作者 陈志颖

chore:使用https

@@ -81,7 +81,7 @@ spec: @@ -81,7 +81,7 @@ spec:
81 - name: ABILITY_SERVICE_HOST 81 - name: ABILITY_SERVICE_HOST
82 value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com" 82 value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"
83 - name: MMM_OPEN_API_SERVICE_HOST 83 - name: MMM_OPEN_API_SERVICE_HOST
84 - value: "http://mmm-open-api-dev.fjmaimaimai.com" 84 + value: "https://mmm-open-api-dev.fjmaimaimai.com"
85 - name: UCENTER_SERVICE_HOST 85 - name: UCENTER_SERVICE_HOST
86 value: "https://suplus-ucenter-dev.fjmaimaimai.com" 86 value: "https://suplus-ucenter-dev.fjmaimaimai.com"
87 - name: BUSINESS_ADMIN_SERVICE_HOST 87 - name: BUSINESS_ADMIN_SERVICE_HOST
@@ -81,7 +81,7 @@ spec: @@ -81,7 +81,7 @@ spec:
81 - name: ABILITY_SERVICE_HOST 81 - name: ABILITY_SERVICE_HOST
82 value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com" 82 value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"
83 - name: MMM_OPEN_API_SERVICE_HOST 83 - name: MMM_OPEN_API_SERVICE_HOST
84 - value: "http://mmm-open-api-dev.fjmaimaimai.com" 84 + value: "https://mmm-open-api-dev.fjmaimaimai.com"
85 - name: UCENTER_SERVICE_HOST 85 - name: UCENTER_SERVICE_HOST
86 value: "https://suplus-ucenter-test.fjmaimaimai.com" 86 value: "https://suplus-ucenter-test.fjmaimaimai.com"
87 - name: BUSINESS_ADMIN_SERVICE_HOST 87 - name: BUSINESS_ADMIN_SERVICE_HOST
@@ -4,14 +4,24 @@ go 1.14 @@ -4,14 +4,24 @@ go 1.14
4 4
5 require ( 5 require (
6 github.com/Shopify/sarama v1.26.4 6 github.com/Shopify/sarama v1.26.4
  7 + github.com/ajg/form v1.5.1 // indirect
7 github.com/astaxie/beego v1.12.1 8 github.com/astaxie/beego v1.12.1
8 github.com/dgrijalva/jwt-go v3.2.0+incompatible 9 github.com/dgrijalva/jwt-go v3.2.0+incompatible
  10 + github.com/gavv/httpexpect v2.0.0+incompatible
9 github.com/gin-gonic/gin v1.5.0 11 github.com/gin-gonic/gin v1.5.0
10 github.com/go-pg/pg/v10 v10.0.0-beta.2 12 github.com/go-pg/pg/v10 v10.0.0-beta.2
  13 + github.com/imkira/go-interpol v1.1.0 // indirect
11 github.com/linmadan/egglib-go v0.0.0-20191217144343-ca4539f95bf9 14 github.com/linmadan/egglib-go v0.0.0-20191217144343-ca4539f95bf9
  15 + github.com/moul/http2curl v1.0.0 // indirect
12 github.com/onsi/ginkgo v1.15.0 16 github.com/onsi/ginkgo v1.15.0
13 github.com/onsi/gomega v1.10.5 17 github.com/onsi/gomega v1.10.5
  18 + github.com/sergi/go-diff v1.1.0 // indirect
14 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect 19 github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
15 github.com/shopspring/decimal v1.2.0 20 github.com/shopspring/decimal v1.2.0
16 github.com/tiptok/gocomm v1.0.5 21 github.com/tiptok/gocomm v1.0.5
  22 + github.com/valyala/fasthttp v1.19.0 // indirect
  23 + github.com/xeipuuv/gojsonschema v1.2.0 // indirect
  24 + github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
  25 + github.com/yudai/gojsondiff v1.0.0 // indirect
  26 + github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
17 ) 27 )
@@ -15,7 +15,7 @@ var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897" @@ -15,7 +15,7 @@ var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897"
15 var UCENTER_SERVICE_HOST = "https://suplus-ucenter-test.fjmaimaimai.com" 15 var UCENTER_SERVICE_HOST = "https://suplus-ucenter-test.fjmaimaimai.com"
16 var UCENTER_APP_KEY = "0c2c2a23dfc64ae230f5c54ab243ab52" 16 var UCENTER_APP_KEY = "0c2c2a23dfc64ae230f5c54ab243ab52"
17 17
18 -var BUSINESS_ADMIN_SERVICE_HOST = "http://suplus-business-admin-test.fjmaimaimai.com" 18 +var BUSINESS_ADMIN_SERVICE_HOST = "https://suplus-business-admin-test.fjmaimaimai.com"
19 var BUSINESS_ADMIN_PLATFORM_ID = "25" //合伙人模块 19 var BUSINESS_ADMIN_PLATFORM_ID = "25" //合伙人模块
20 20
21 var DEFAULT_GUEST_COMPANY int = 358 21 var DEFAULT_GUEST_COMPANY int = 358
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  8 +
  9 +import (
  10 + "github.com/gavv/httpexpect"
  11 + "github.com/go-pg/pg/v10"
  12 + . "github.com/onsi/ginkgo"
  13 + . "github.com/onsi/gomega"
  14 + pG "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
  15 + "net/http"
  16 +)
  17 +
  18 +var _ = Describe("返回员工", func() {
  19 + var employeeId int64
  20 + BeforeEach(func() {
  21 + _, err := pG.DB.QueryOne(
  22 + pg.Scan(&employeeId),
  23 + "INSERT INTO partner (id, company_id, uid, employee_name, employee_account, employee_avatar_url, su_money, status, permissions) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id",
  24 + 1, 101, 2499036607974745088, "employee_name", "employee_account", "employee_avatar_url", 1000.00, 1, pg.Array([]int{1, 3}))
  25 + Expect(err).NotTo(HaveOccurred())
  26 + })
  27 + Describe("根据employeeId参数返回员工", func() {
  28 + Context("传入有效的employeeId", func() {
  29 + It("返回员工数据", func() {
  30 + httpExpect := httpexpect.New(GinkgoT(), server.URL)
  31 + httpExpect.GET("/employees/2499036607974745088").
  32 + Expect().
  33 + Status(http.StatusOK).
  34 + JSON().
  35 + Object().
  36 + ContainsKey("code").ValueEqual("code", 0).
  37 + ContainsKey("msg").ValueEqual("msg", "ok").
  38 + ContainsKey("data").Value("data").Object()
  39 + })
  40 + })
  41 + })
  42 + AfterEach(func() {
  43 + _, err := pG.DB.Exec("DELETE FROM employees WHERE true")
  44 + Expect(err).NotTo(HaveOccurred())
  45 + })
  46 +})
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package auth
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package company
  8 +
  9 +import (
  10 + "github.com/astaxie/beego"
  11 + "github.com/onsi/ginkgo"
  12 + "github.com/onsi/gomega"
  13 + "net/http"
  14 + "net/http/httptest"
  15 + "testing"
  16 +
  17 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
  18 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr"
  19 +)
  20 +
  21 +func TestConfig(t *testing.T) {
  22 + gomega.RegisterFailHandler(ginkgo.Fail)
  23 + ginkgo.RunSpecs(t, "Beego Port Company Correlations Test Case Suite")
  24 +}
  25 +
  26 +var handler http.Handler
  27 +var server *httptest.Server
  28 +
  29 +var _ = ginkgo.BeforeSuite(func() {
  30 + handler = beego.BeeApp.Handlers
  31 + server = httptest.NewServer(handler)
  32 +})
  33 +
  34 +var _ = ginkgo.AfterSuite(func() {
  35 + server.Close()
  36 +})
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package dividend
  8 +
  9 +import (
  10 + "github.com/astaxie/beego"
  11 + "github.com/onsi/ginkgo"
  12 + "github.com/onsi/gomega"
  13 + "net/http"
  14 + "net/http/httptest"
  15 + "testing"
  16 +
  17 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
  18 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr"
  19 +)
  20 +
  21 +func TestConfig(t *testing.T) {
  22 + gomega.RegisterFailHandler(ginkgo.Fail)
  23 + ginkgo.RunSpecs(t, "Beego Port Dividend Correlations Test Case Suite")
  24 +}
  25 +
  26 +var handler http.Handler
  27 +var server *httptest.Server
  28 +
  29 +var _ = ginkgo.BeforeSuite(func() {
  30 + handler = beego.BeeApp.Handlers
  31 + server = httptest.NewServer(handler)
  32 +})
  33 +
  34 +var _ = ginkgo.AfterSuite(func() {
  35 + server.Close()
  36 +})
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package order
  8 +
  9 +import (
  10 + "github.com/astaxie/beego"
  11 + "github.com/onsi/ginkgo"
  12 + "github.com/onsi/gomega"
  13 + "net/http"
  14 + "net/http/httptest"
  15 + "testing"
  16 +
  17 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
  18 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr"
  19 +)
  20 +
  21 +func TestConfig(t *testing.T) {
  22 + gomega.RegisterFailHandler(ginkgo.Fail)
  23 + ginkgo.RunSpecs(t, "Beego Port Order Correlations Test Case Suite")
  24 +}
  25 +
  26 +var handler http.Handler
  27 +var server *httptest.Server
  28 +
  29 +var _ = ginkgo.BeforeSuite(func() {
  30 + handler = beego.BeeApp.Handlers
  31 + server = httptest.NewServer(handler)
  32 +})
  33 +
  34 +var _ = ginkgo.AfterSuite(func() {
  35 + server.Close()
  36 +})
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package partner
  8 +
  9 +import (
  10 + "github.com/astaxie/beego"
  11 + "github.com/onsi/ginkgo"
  12 + "github.com/onsi/gomega"
  13 + "net/http"
  14 + "net/http/httptest"
  15 + "testing"
  16 +
  17 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
  18 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr"
  19 +)
  20 +
  21 +func TestConfig(t *testing.T) {
  22 + gomega.RegisterFailHandler(ginkgo.Fail)
  23 + ginkgo.RunSpecs(t, "Beego Port Partner Correlations Test Case Suite")
  24 +}
  25 +
  26 +var handler http.Handler
  27 +var server *httptest.Server
  28 +
  29 +var _ = ginkgo.BeforeSuite(func() {
  30 + handler = beego.BeeApp.Handlers
  31 + server = httptest.NewServer(handler)
  32 +})
  33 +
  34 +var _ = ginkgo.AfterSuite(func() {
  35 + server.Close()
  36 +})
  1 +/**
  2 + @author: stevechan
  3 + @date: 2021/2/7
  4 + @note:
  5 +**/
  6 +
  7 +package user
  8 +
  9 +import (
  10 + "github.com/astaxie/beego"
  11 + "github.com/onsi/ginkgo"
  12 + "github.com/onsi/gomega"
  13 + "net/http"
  14 + "net/http/httptest"
  15 + "testing"
  16 +
  17 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
  18 + _ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr"
  19 +)
  20 +
  21 +func TestConfig(t *testing.T) {
  22 + gomega.RegisterFailHandler(ginkgo.Fail)
  23 + ginkgo.RunSpecs(t, "Beego Port User Correlations Test Case Suite")
  24 +}
  25 +
  26 +var handler http.Handler
  27 +var server *httptest.Server
  28 +
  29 +var _ = ginkgo.BeforeSuite(func() {
  30 + handler = beego.BeeApp.Handlers
  31 + server = httptest.NewServer(handler)
  32 +})
  33 +
  34 +var _ = ginkgo.AfterSuite(func() {
  35 + server.Close()
  36 +})