dengxiangcun 11 months ago
commit
6cd45cec02
100 changed files with 26134 additions and 0 deletions
  1. 9 0
      Dockerfile
  2. 21 0
      Makefile
  3. 9 0
      README.md
  4. 5 0
      client/client.go
  5. 40 0
      client/finstore.go
  6. 50 0
      client/go_retry.go
  7. 79 0
      client/license.go
  8. 103 0
      client/mop-audit-manage-svr.go
  9. 59 0
      client/mop_device_security.go
  10. 32 0
      client/mop_fast_trial_manager.go
  11. 133 0
      client/mop_verify_code_gateway.go
  12. 76 0
      client/order_right.go
  13. 42 0
      client/zk_http.go
  14. 65 0
      common/account_code.go
  15. 27 0
      common/bson_object.go
  16. 20 0
      common/common.go
  17. 146 0
      common/des.go
  18. 261 0
      common/error.go
  19. 44 0
      common/log.go
  20. 13 0
      common/md5.go
  21. 51 0
      common/mem_cache.go
  22. 12 0
      common/struct.go
  23. 27 0
      common/time.go
  24. 196 0
      config/config.go
  25. 200 0
      consul/consul.go
  26. 2 0
      docs/doc.md
  27. 991 0
      docs/operate.go
  28. 831 0
      docs/organ.go
  29. 40 0
      go.mod
  30. 468 0
      go.sum
  31. 104 0
      grpc/grpc.go
  32. 81 0
      handler/external/common.go
  33. 434 0
      handler/external/external_oper.go
  34. 130 0
      handler/external/external_organ.go
  35. 75 0
      handler/oper_role/oper_auth.go
  36. 426 0
      handler/oper_role/oper_role.go
  37. 545 0
      handler/operation/limit.go
  38. 114 0
      handler/operation/login.go
  39. 555 0
      handler/operation/organ.go
  40. 82 0
      handler/operation/personal.go
  41. 438 0
      handler/operation/review.go
  42. 50 0
      handler/operation/role.go
  43. 123 0
      handler/operation/statistics.go
  44. 134 0
      handler/operation/test.go
  45. 1669 0
      handler/operation/worker.go
  46. 1251 0
      handler/organ/account.go
  47. 442 0
      handler/organ/business.go
  48. 60 0
      handler/organ/business_grpc.go
  49. 867 0
      handler/organ/platform_member.go
  50. 62 0
      handler/organ/role.go
  51. 306 0
      handler/organ/verifycode.go
  52. 161 0
      handler/organ_role/organ_auth.go
  53. 388 0
      handler/organ_role/organ_role.go
  54. 240 0
      handler/utils/jwt.go
  55. 158 0
      handler/utils/kafka.go
  56. 337 0
      handler/utils/redis.go
  57. 57 0
      handler/utils/redis_cluster.go
  58. 322 0
      handler/utils/redis_go_init.go
  59. 406 0
      handler/utils/redis_init.go
  60. 61 0
      main.go
  61. 63 0
      model/common_db/pwd_limit.go
  62. 217 0
      model/common_db/verify_code.go
  63. 33 0
      model/mgo_init.go
  64. 119 0
      model/mysql/mysql.go
  65. 34 0
      model/mysql/operation_db/init.go
  66. 280 0
      model/mysql/operation_db/oper_limit.go
  67. 425 0
      model/mysql/operation_db/oper_organ.go
  68. 249 0
      model/mysql/operation_db/oper_review.go
  69. 128 0
      model/mysql/operation_db/oper_role.go
  70. 367 0
      model/mysql/operation_db/oper_worker.go
  71. 504 0
      model/mysql/organ_db/account.go
  72. 192 0
      model/mysql/organ_db/business.go
  73. 22 0
      model/mysql/organ_db/init.go
  74. 114 0
      model/mysql/organ_db/role.go
  75. 245 0
      model/operation_db/change.go
  76. 279 0
      model/operation_db/oper_limit.go
  77. 506 0
      model/operation_db/oper_organ.go
  78. 318 0
      model/operation_db/oper_review.go
  79. 178 0
      model/operation_db/oper_role.go
  80. 650 0
      model/operation_db/oper_worker.go
  81. 804 0
      model/organ_db/account.go
  82. 314 0
      model/organ_db/business.go
  83. 142 0
      model/organ_db/change.go
  84. 144 0
      model/organ_db/role.go
  85. 47 0
      model/repo/mongo/handler/oper_role/auth_dealer.go
  86. 394 0
      model/repo/mongo/handler/oper_role/role_bingding_dealer.go
  87. 161 0
      model/repo/mongo/handler/oper_role/role_dealer.go
  88. 48 0
      model/repo/mongo/handler/organ_role/auth_dealer.go
  89. 417 0
      model/repo/mongo/handler/organ_role/role_bingding_dealer.go
  90. 197 0
      model/repo/mongo/handler/organ_role/role_dealer.go
  91. 1004 0
      model/repo/mongo/implements/oper_role/auth_db.go
  92. 134 0
      model/repo/mongo/implements/oper_role/change.go
  93. 281 0
      model/repo/mongo/implements/oper_role/role_bingding_db.go
  94. 334 0
      model/repo/mongo/implements/oper_role/role_db.go
  95. 1162 0
      model/repo/mongo/implements/organ_role/auth_db.go
  96. 138 0
      model/repo/mongo/implements/organ_role/change.go
  97. 297 0
      model/repo/mongo/implements/organ_role/role_bingding_db.go
  98. 235 0
      model/repo/mongo/implements/organ_role/role_db.go
  99. 828 0
      model/repo/mongo/mysql_implements/oper_role/auth_db.go
  100. 0 0
      model/repo/mongo/mysql_implements/oper_role/init.go

+ 9 - 0
Dockerfile

@@ -0,0 +1,9 @@
+FROM docker.finogeeks.club/mop/alpine
+
+RUN ls
+
+RUN set -ex && apk add --no-cache ca-certificates
+
+COPY mop-account-system /opt/mop-account-system
+
+ENTRYPOINT /opt/mop-account-system

+ 21 - 0
Makefile

@@ -0,0 +1,21 @@
+# mop-account-system Makefile
+
+export GOPROXY=https://goproxy.io
+MOD_NAME=mop-account-system
+BINARY_NAME=mop-account-system
+GOMODE_FILE=go.mod
+
+install:
+ifneq ($(GOMODE_FILE), $(wildcard $(GOMODE_FILE)))
+	@go mod init $(MOD_NAME)
+endif
+	@go build -o $(BINARY_NAME) -v main.go
+	@go mod vendor
+
+.PHONY:clean
+
+clean:
+	- rm $(BINARY_NAME)
+	- rm go.mod
+	- rm go.sum
+	- rm -rf vendor

+ 9 - 0
README.md

@@ -0,0 +1,9 @@
+*go 微服务开发脚手架*
+* router:存放路由信息
+* handler:存放具体服务
+* commen:存放公用的数据结果、常量值等
+* config:存放获取配置信息,全部从环境变量里面取
+* docs:存放文档信息
+* model:存放数据库ORM
+
+### test

+ 5 - 0
client/client.go

@@ -0,0 +1,5 @@
+package client
+
+import "mop-account-system/config"
+
+var cfg = config.GetConfig()

+ 40 - 0
client/finstore.go

@@ -0,0 +1,40 @@
+package client
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"mop-account-system/common"
+)
+
+type NotifyFinstoreAccountInfoUpReq struct {
+	TraceId string                 `json:"traceId"`
+	SubId   string                 `json:"subId"`
+	Type    string                 `json:"type"`
+	Data    map[string]interface{} `json:"data"`
+}
+
+func NotifyFinstoreAccountInfoUp(ctx context.Context, organId string, m map[string]interface{}) error {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	req := NotifyFinstoreAccountInfoUpReq{}
+	req.Type = "upOrganInfo"
+	req.TraceId = organId
+	req.Data = m
+	body, _ := json.Marshal(req)
+	url := cfg.NotifyFinstoreInfoUpUrl
+
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(body).Patch(url)
+	if err != nil {
+		common.GinLog.Error("NotifyFinstoreAccountInfoUp err:" + err.Error())
+		return err
+	}
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Error("NotifyFinstoreAccountInfoUp status err:" + rsp.String())
+		return errors.New("status err")
+	}
+
+	return nil
+}

+ 50 - 0
client/go_retry.go

@@ -0,0 +1,50 @@
+package client
+
+import (
+	"context"
+	"git.finogeeks.club/base/apm"
+	"net"
+	"net/http"
+	"time"
+
+	"github.com/go-resty/resty/v2"
+)
+
+var restyClient = resty.NewWithClient(&http.Client{
+	Transport: createTransport(nil),
+})
+
+func Request(ctx context.Context) *resty.Request {
+	return restyClient.R().SetContext(ctx)
+}
+
+func createTransport(localAddr net.Addr) http.RoundTripper {
+	dialer := &net.Dialer{
+		Timeout:   30 * time.Second,
+		KeepAlive: 30 * time.Second,
+	}
+	if localAddr != nil {
+		dialer.LocalAddr = localAddr
+	}
+	return &apmRetryTransport{&http.Transport{
+		Proxy:                 http.ProxyFromEnvironment,
+		DialContext:           dialer.DialContext,
+		MaxIdleConns:          200,
+		IdleConnTimeout:       90 * time.Second,
+		TLSHandshakeTimeout:   10 * time.Second,
+		ExpectContinueTimeout: 1 * time.Second,
+		MaxIdleConnsPerHost:   200,
+	}}
+}
+
+type apmRetryTransport struct {
+	*http.Transport
+}
+
+func (transport *apmRetryTransport) RoundTrip(request *http.Request) (*http.Response, error) {
+	eSpan := apm.ApmClient().CreateHttpExitSpan(request.Context(), request, request.URL.Host, request.URL.Path)
+	defer eSpan.End()
+
+	resp, err := transport.Transport.RoundTrip(request)
+	return resp, err
+}

+ 79 - 0
client/license.go

@@ -0,0 +1,79 @@
+package client
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"mop-account-system/common"
+)
+
+type CommonConfigData struct {
+	Error   string `json:"error"`
+	Errcode string `json:"errcode"`
+	Data    struct {
+		OrganName string `json:"organName"`
+	} `json:"data"`
+}
+
+var commonConfig CommonConfigData
+
+func getCommonConfig(ctx context.Context) error {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+
+	url := "http://mop-private-init-server:8080/api/v1/mop/mop-private-init-server/common/config"
+	rsp, err := Request(ctx).SetHeaders(headers).Get(url)
+	if err != nil || rsp.StatusCode() != 200 {
+		return errors.New("mop-private-init-server err")
+	}
+
+	json.Unmarshal(rsp.Body(), &commonConfig)
+
+	return nil
+}
+
+type LicenseData struct {
+	OrganName                   string `json:"organName"`                   //企业名称
+	AppCount                    int    `json:"appCount"`                    //可创建的小程序数量上限
+	CooAppCount                 int    `json:"cooAppCount"`                 //应用的数量
+	ReviewOrganCount            int    `json:"reviewOrganCount"`            //可认证通过的企业数量
+	ExpireTime                  int64  `json:"expireTime"`                  //服务有效期
+	CreateOperAdminByInitServer bool   `json:"createOperAdminByInitServer"` //init服务是否创建运营端管理账号
+	OrganStatusNeverExpire      bool   `json:"organStatusNeverExpire"`      //企业状态是否永不过期
+	AppGrayCount                int    `json:"appGrayCount"`                //灰度数量
+}
+
+type GetLicenseRsp struct {
+	Data    LicenseData `json:"data"`
+	Errcode string      `json:"errcode"`
+	Errmsg  string      `json:"error"`
+}
+
+func GetLicense(ctx context.Context) (*LicenseData, error) {
+	if commonConfig.Data.OrganName == "" {
+		getCommonConfig(ctx)
+	}
+
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+		"Organ-Name":   commonConfig.Data.OrganName, //私有化部署的时候,需要修改机构名称
+	}
+
+	url := "http://mop-license-checker:8080/api/v1/mop/mop-license-checker/license"
+	rsp, _ := Request(ctx).SetHeaders(headers).Get(url)
+	if rsp.StatusCode() != 200 {
+		return nil, errors.New("status code error")
+	}
+
+	var licenseInfo GetLicenseRsp
+	err := json.Unmarshal(rsp.Body(), &licenseInfo)
+	if err != nil {
+		common.GinLog.Errorf("GetLicense json err:%s", err.Error())
+		return nil, err
+	}
+	common.GinLog.Infof("GetLicense info:%+v", licenseInfo)
+	return &licenseInfo.Data, nil
+}

+ 103 - 0
client/mop-audit-manage-svr.go

@@ -0,0 +1,103 @@
+package client
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"mop-account-system/common"
+	"mop-account-system/config"
+)
+
+//获取审核配置的roleId列表
+type GetAuditRolesRspData struct {
+	UpdatorId   string `json:"updatorId"`
+	UpdatorName string `json:"updatorName"`
+	UpdateTime  int64  `json:"updateTime"`
+	RoleInfos   []struct {
+		RoleId   string `json:"roleId"`
+		RoleName string `json:"roleName"`
+	} `json:"roleInfos"`
+}
+type GetAuditRolesRsp struct {
+	Errcode string               `json:"errcode"`
+	Error   string               `json:"error"`
+	Data    GetAuditRolesRspData `json:"data"`
+}
+
+func GetAuditRoles(ctx context.Context) (*GetAuditRolesRspData, error) {
+	url := config.Cfg.AuditManageHost + "/api/v1/mop/mop-audit-manage-svr/operation/audit-roles"
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	rsp, err := Request(ctx).SetHeaders(headers).Get(url)
+	if err != nil {
+		common.GinLog.Errorln("GetAuditRoles status err:" + err.Error())
+		return nil, err
+	}
+
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Errorln("GetAuditRoles status err:" + rsp.String())
+		return nil, errors.New("status err")
+	}
+
+	var rspInfo GetAuditRolesRsp
+	err = json.Unmarshal(rsp.Body(), &rspInfo)
+	if err != nil {
+		common.GinLog.Errorln("json.Unmarshal err:" + err.Error())
+		return nil, err
+	}
+	common.GinLog.Infof("GetAuditRoles rsp:%+v", rspInfo)
+	return &rspInfo.Data, nil
+}
+
+//根据成员列表查询未处理的代办
+type GetAccountTodosRspData struct {
+	Total int `json:"total"`
+	List  []struct {
+		TodoType        string `json:"todoType"`
+		OrganizatioName string `json:"organizatioName"`
+		AppId           string `json:"appId"`
+		Sequence        int    `json:"sequence"`
+		AppName         string `json:"appName"`
+		ApplicationTime int64  `json:"applicationTime"`
+		AuditorName     string `json:"auditorName"`
+		Status          string `json:"status"`
+	} `json:"list"`
+}
+type GetAccountTodosRsp struct {
+	Errcode string                 `json:"errcode"`
+	Error   string                 `json:"error"`
+	Data    GetAccountTodosRspData `json:"data"`
+}
+
+func GetAccountTodos(ctx context.Context, list []string) (*GetAccountTodosRspData, error) {
+	url := config.Cfg.AuditManageHost + "/api/v1/mop/mop-audit-manage-svr/operation/todos" + "?pageNo=0&pageSize=10"
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	type ReqData struct {
+		UserIds []string `json:"userIds"`
+	}
+	req := ReqData{UserIds: list}
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(req).Post(url)
+	if err != nil {
+		common.GinLog.Errorln("GetAccountTodos status err:" + err.Error())
+		return nil, err
+	}
+
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Errorln("GetAccountTodos status err:" + rsp.String())
+		return nil, errors.New("status err")
+	}
+
+	var rspInfo GetAccountTodosRsp
+	err = json.Unmarshal(rsp.Body(), &rspInfo)
+	if err != nil {
+		common.GinLog.Errorln("json.Unmarshal err:" + err.Error())
+		return nil, err
+	}
+	common.GinLog.Infof("GetAccountTodos rsp:%+v", rspInfo)
+	return &rspInfo.Data, nil
+}

+ 59 - 0
client/mop_device_security.go

@@ -0,0 +1,59 @@
+package client
+
+import (
+	"encoding/json"
+	"errors"
+	"git.finogeeks.club/base/apm"
+	"mop-account-system/common"
+
+	"github.com/gin-gonic/gin"
+)
+
+type GetTokenInfoRsp struct {
+	Errcode string `json:"errcode"`
+	Error   string `json:"error"`
+	Data    struct {
+		JwtToken     string `json:"jwtToken"`
+		UserId       string `json:"userId"`
+		ExpireTime   int    `json:"expireTime"`
+		RefreshToken string `json:"refreshToken"`
+	} `json:"data"`
+}
+
+func GetTokenInfo(c *gin.Context, userId string) (*GetTokenInfoRsp, error) {
+	traceCtx := apm.ApmClient().TraceContextFromGin(c)
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+
+	type GetTokenReq struct {
+		UserId string `json:"userId"`
+	}
+
+	var req GetTokenReq
+	req.UserId = userId
+	body, _ := json.Marshal(req)
+
+	url := cfg.DeviceSecurityUrlPrefix + "/api/v1/mop/applets-ecol-device-security/login"
+
+	rsp, err := Request(traceCtx).SetHeaders(headers).SetBody(body).Post(url)
+	if err != nil {
+		common.GinLog.Errorln("DeviceActive status err:" + err.Error())
+		return nil, err
+	}
+
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Errorln("DeviceActive status err:" + rsp.String())
+		return nil, errors.New("status err")
+	}
+
+	var tokensRsp GetTokenInfoRsp
+	err = json.Unmarshal(rsp.Body(), &tokensRsp)
+	if err != nil {
+		common.GinLog.Errorln("json.Unmarshal err:" + err.Error())
+		return nil, err
+	}
+
+	return &tokensRsp, nil
+}

+ 32 - 0
client/mop_fast_trial_manager.go

@@ -0,0 +1,32 @@
+package client
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"mop-account-system/common"
+)
+
+func SetLoginFirst(ctx context.Context, accountId string) error {
+	fmt.Println("SetLoginFirst")
+	var headers = map[string]string{
+		"Accept":               "application/json, text/plain, */*",
+		"Content-Type":         "application/json",
+		"X-Consumer-Custom-ID": accountId,
+	}
+
+	url := cfg.SetLoginFirstServerHost + "/api/v1/mop/mop-fast-trial-manager/login/first?query=0"
+	rsp, err := Request(ctx).SetHeaders(headers).Get(url)
+	if err != nil {
+		common.GinLog.Error("SetLoginFirst err:" + err.Error())
+		return err
+	}
+
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Error("SetLoginFirst status err:" + rsp.String())
+		return errors.New("status err")
+	}
+
+	fmt.Println("SetLoginFirst success")
+	return nil
+}

+ 133 - 0
client/mop_verify_code_gateway.go

@@ -0,0 +1,133 @@
+package client
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"mop-account-system/common"
+)
+
+const (
+	PHONE_MSG_TEMPLATE_ID_1 = 1
+	EMAIL_MSG_TEMPLATE_ID_1 = 1
+)
+
+type PhoneVerifyCodeReq struct {
+	Type      string `json:"type"`
+	Phone     string `json:"phone"`
+	Length    int    `json:"length"`
+	Gap       int    `json:"gap"`
+	ValidTime int    `json:"validTime"`
+}
+
+type VerifyCodeRsp struct {
+	Errcode string                 `json:"errcode"`
+	Error   string                 `json:"error"`
+	Data    map[string]interface{} `json:"data"`
+}
+
+func PhoneVerifyCode(ctx context.Context, length, gap, validTime int, codeType, phone string) (string, error) {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	var req PhoneVerifyCodeReq
+	req.Type = codeType
+	req.Length = length
+	req.Gap = gap
+	req.ValidTime = validTime
+	req.Phone = phone
+	body, _ := json.Marshal(req)
+
+	url := cfg.VerifyCodeUrlPrefix + "/api/v1/mop/verifycode-server/phone/verifyCode"
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(body).Post(url)
+	if err != nil {
+		common.GinLog.Error("PhoneVerifyCode err:" + err.Error())
+		return "", err
+	}
+
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Error("PhoneVerifyCode status err:" + rsp.String())
+		return "", errors.New("status err")
+	}
+
+	var verifyCodeRsp VerifyCodeRsp
+	err = json.Unmarshal(rsp.Body(), &verifyCodeRsp)
+	if err != nil {
+		common.GinLog.Error("json.Unmarshal error:" + err.Error())
+		return "", err
+	}
+	common.GinLog.Debugf("PhoneVerifyCode rsp:%+v", rsp.String())
+	return verifyCodeRsp.Data["verifyCode"].(string), nil
+}
+
+type EmailVerifyCodeReq struct {
+	Type      string `json:"type"`
+	Email     string `json:"email"`
+	Length    int    `json:"length"`
+	Gap       int    `json:"gap"`
+	ValidTime int    `json:"validTime"`
+}
+
+func EmailVerifyCode(ctx context.Context, length, gap, validTime int, codeType, email string) (string, error) {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	var req EmailVerifyCodeReq
+	req.Type = codeType
+	req.Length = length
+	req.Gap = gap
+	req.ValidTime = validTime
+	req.Email = email
+	body, _ := json.Marshal(req)
+
+	url := cfg.VerifyCodeUrlPrefix + "/api/v1/mop/verifycode-server/email/verifyCode"
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(body).Post(url)
+	if err != nil {
+		common.GinLog.Error("EmailVerifyCode err:" + err.Error())
+		return "", err
+	}
+
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Error("EmailVerifyCode status err:" + rsp.String())
+		return "", errors.New("status err")
+	}
+
+	var verifyCodeRsp VerifyCodeRsp
+	err = json.Unmarshal(rsp.Body(), &verifyCodeRsp)
+	if err != nil {
+		common.GinLog.Error("json.Unmarshal error:" + err.Error())
+		return "", err
+	}
+
+	return verifyCodeRsp.Data["verifyCode"].(string), nil
+}
+
+type DelPhoneCodeLimitReq struct {
+	Phone string `json:"phone"`
+}
+
+func DelPhoneCodeLimit(ctx context.Context, phone string) error {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	req := DelPhoneCodeLimitReq{}
+	req.Phone = phone
+	body, _ := json.Marshal(req)
+
+	url := cfg.VerifyCodeServerHost + cfg.DelPhoneLimitUrl
+	common.GinLog.Debugf("DelPhoneCodeLimit url:%s", url)
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(body).Delete(url)
+	if err != nil {
+		common.GinLog.Error("DelPhoneCodeLimit err:" + err.Error())
+		return err
+	}
+	if rsp.StatusCode() != 200 {
+		common.GinLog.Error("DelPhoneCodeLimit status err:" + rsp.String())
+		return errors.New("status err")
+	}
+	common.GinLog.Debugf("DelPhoneCodeLimit rsp:%s", rsp.String())
+	return nil
+}

+ 76 - 0
client/order_right.go

@@ -0,0 +1,76 @@
+package client
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"mop-account-system/common"
+)
+
+const (
+	OrderRightsModifyOverLimitErr = "MOP_RIGHT_MAKE_COUNT_ERR"
+)
+
+type MakeDefaultRightReq struct {
+	AccountId string `json:"accountId"`
+}
+
+func MakeDefaultRight(ctx context.Context, accountId string) error {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	var req MakeDefaultRightReq
+	req.AccountId = accountId
+	body, _ := json.Marshal(req)
+
+	url := cfg.RightUrlPrefix + "/api/v1/mop/mop-purchasing-rights-manager/rights/default"
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(body).Post(url)
+	if err != nil {
+		common.GinLog.Error("MakeDefaultRight err:" + err.Error())
+		return err
+	} else if rsp.StatusCode() != 200 {
+		common.GinLog.Error("MakeDefaultRight status err:" + rsp.String())
+		return errors.New("status err")
+	}
+
+	common.GinLog.Info("MakeDefaultRight success")
+
+	return nil
+}
+
+type OrderRightsModifyReq struct {
+	Type      int    `json:"type"`
+	Count     int    `json:"count"`
+	OrganId   string `json:"organId"`
+	OrganName string `json:"organName"`
+	Operator  string `json:"operator"`
+}
+
+type OrderRightsModifyRsp struct {
+	Error   string                 `json:"error"`
+	Errcode string                 `json:"errcode"`
+	Data    map[string]interface{} `json:"data"`
+}
+
+func OrderRightsModify(ctx context.Context, req OrderRightsModifyReq) (*OrderRightsModifyRsp, error) {
+	var headers = map[string]string{
+		"Accept":       "application/json, text/plain, */*",
+		"Content-Type": "application/json",
+	}
+	url := cfg.OrderRightsModifyURL
+	common.GinLog.Infof("OrderRightsModify url:%s", url)
+	rsp, err := Request(ctx).SetHeaders(headers).SetBody(req).Post(url)
+	if err != nil {
+		common.GinLog.Errorf("OrderRightsModify err:%s", err.Error())
+		return nil, err
+	}
+	rspInfo := OrderRightsModifyRsp{}
+	if err := json.Unmarshal(rsp.Body(), &rspInfo); err != nil {
+		common.GinLog.Errorf("OrderRightsModify json unmarshal err:%s,rsp:%+v", err.Error(), rsp.String())
+		return nil, err
+	}
+	common.GinLog.Info("OrderRightsModify rsp:%+v", rsp.String())
+
+	return &rspInfo, nil
+}

+ 42 - 0
client/zk_http.go

@@ -0,0 +1,42 @@
+package client
+
+import (
+	"git.finogeeks.club/base/apm"
+	"github.com/gin-gonic/gin"
+	"github.com/go-resty/resty/v2"
+)
+
+/*c,需要在业务层传递*/
+func SendByGoRetry(c *gin.Context, url, method string, headers map[string]string, body []byte) (*resty.Response, error) {
+	traceCtx := apm.ApmClient().TraceContextFromGin(c)
+	traceSpanId, exists := c.Get("zipkin_span_id")
+	if exists {
+		value, exists := c.Get("zipkin_trace_span_id_" + traceSpanId.(string))
+		if exists && value != nil {
+			headers["Zipkin-Span-Context"] = value.(string)
+		}
+	}
+
+	var rsp *resty.Response
+	var err error
+
+	switch method {
+	case "GET":
+		rsp, err = Request(traceCtx).SetHeaders(headers).SetBody(body).Get(url)
+		break
+	case "POST":
+		rsp, err = Request(traceCtx).SetHeaders(headers).SetBody(body).Post(url)
+		break
+	case "PUT":
+		rsp, err = Request(traceCtx).SetHeaders(headers).SetBody(body).Put(url)
+		break
+	case "DELETE":
+		rsp, err = Request(traceCtx).SetHeaders(headers).SetBody(body).Delete(url)
+		break
+	case "PATCH":
+		rsp, err = Request(traceCtx).SetHeaders(headers).SetBody(body).Patch(url)
+		break
+	}
+
+	return rsp, err
+}

+ 65 - 0
common/account_code.go

@@ -0,0 +1,65 @@
+package common
+
+import (
+	"strings"
+)
+
+const (
+	OPER_CODE_PREFIX     = "OPER_"
+	ORGAN_CODE_PREFIX    = "ORGAN_"
+	OPER_CODE_PREFIX_LEN = len(OPER_CODE_PREFIX)
+)
+
+func EncodeOperAccount(account string) string {
+	return OPER_CODE_PREFIX + account
+}
+
+func EncodeOrganAccount(account string) string {
+	return ORGAN_CODE_PREFIX + account
+}
+
+func DecodeOperAccount(account string) string {
+	return account[OPER_CODE_PREFIX_LEN:]
+}
+
+func GetAccountPrefix(account string) string {
+	i := strings.IndexAny(account, "_")
+	if i == -1 {
+		return ""
+	}
+	return account[0 : i+1]
+}
+
+func DecodeAccount(account string) string {
+	i := strings.IndexAny(account, "_")
+	if i == -1 {
+		return ""
+	}
+	return account[i+1:]
+}
+
+//4-22字符,只允许小写字母、数字、下划线,且首位须为字母
+func CheckAccountFormat(account string) bool {
+	len := strings.Count(account, "") - 1
+	if len < 4 || len > 22 {
+		return false
+	}
+
+	for i, _ := range account {
+		if i == 0 {
+			if !(account[0:1] >= "a" && account[0:1] <= "z") {
+				return false
+			}
+		} else {
+			if (account[i:i+1] >= "0" && account[i:i+1] <= "9") ||
+				(account[i:i+1] >= "a" && account[i:i+1] <= "z") ||
+				account[i:i+1] == "_" {
+				continue
+			} else {
+				return false
+			}
+		}
+	}
+
+	return true
+}

+ 27 - 0
common/bson_object.go

@@ -0,0 +1,27 @@
+package common
+
+import (
+	"encoding/hex"
+
+	"gopkg.in/mgo.v2/bson"
+)
+
+func ObjectIdHex(s string) bson.ObjectId { //bson.ObjectIdHex会panic,所以重新一个
+	d, err := hex.DecodeString(s)
+	if err != nil || len(d) != 12 {
+		GinLog.Error("invalid input to ObjectIdHex=" + s)
+		var b bson.ObjectId
+		b = ""
+		return b
+	}
+	return bson.ObjectId(d)
+}
+
+func InArray(s string, list []string) bool {
+	for _, v := range list {
+		if v == s {
+			return true
+		}
+	}
+	return false
+}

+ 20 - 0
common/common.go

@@ -0,0 +1,20 @@
+package common
+
+const (
+	PUB_ENV_UAT       = "mop-uat"
+	PUB_ENV_PRIVATE   = "mop-private"
+	PUB_ENV_COMMUNITY = "mop-community"
+)
+
+func TransferArr2Str(arr []string, splitStr string) string {
+	result := ""
+	for _, v := range arr {
+		if result == "" {
+			result = v
+		} else {
+			result = result + splitStr + v
+		}
+	}
+
+	return result
+}

+ 146 - 0
common/des.go

@@ -0,0 +1,146 @@
+package common
+
+import (
+	"bytes"
+	"crypto/cipher"
+	"crypto/des"
+	"encoding/hex"
+	"fmt"
+)
+const (
+	DES_CRYPT_KEY = "w$D5%8x@"
+	DES_CRYPT_IV  = "34RHn876"
+)
+
+type DES_CBC struct {
+}
+
+// 分组填充--填充对应长度的相同数字(1, 22, 333....)
+//data: 待分组数据, blockSize: 每组的长度
+func (d DES_CBC) PKCS7Padding(date []byte, blockSize int) (PaddingResult []byte) {
+	// 获取数据长度
+	length := len(date)
+	// 获取待填充数据长度
+	count := length % blockSize
+	PaddingCount := blockSize - count
+	// 在数据后填充数据
+	PaddingDate := bytes.Repeat([]byte{byte(PaddingCount)}, PaddingCount)
+	PaddingResult = append(date, PaddingDate...)
+	return
+}
+
+//  分组移除
+func (d DES_CBC) PKCS7Unpadding(date []byte, blockSize int) (UnpaddingResult []byte) {
+	length := len(date)
+	temp := int(date[length-1])
+	UnpaddingResult = date[:length-temp]
+	return
+}
+
+//src:           --明文/密文,需要分组填充,每组8byte
+//key:           --秘钥   8byte
+//iv:            --初始化向量  8byte  长度必须与key相同
+//加密
+func (d DES_CBC) DesCBCEncrypt(src []byte, key []byte, iv []byte) []byte {
+	// 创建并返回一个使用DES算法的cipher.Block接口
+	block, err := des.NewCipher(key)
+	// 判断是否创建成功
+	if err != nil {
+		panic(err)
+	}
+	// 明文组数据填充
+	paddingText := d.PKCS7Padding(src, block.BlockSize())
+	// 创建一个密码分组为链接模式的, 底层使用DES加密的BlockMode接口
+	blockMode := cipher.NewCBCEncrypter(block, iv)
+	// 加密
+	dst := make([]byte, len(paddingText))
+	blockMode.CryptBlocks(dst, paddingText)
+	return dst
+}
+
+// 解密:
+func (d DES_CBC) DesCBCDecrypt(src []byte, key []byte, iv []byte) []byte {
+	// 创建并返回一个使用DES算法的cipher.Block接口
+	block, err := des.NewCipher(key)
+	if err != nil {
+		panic(err)
+	}
+	// 创建一个密码分组为链接模式的, 底层使用DES解密的BlockMode接口
+	blockMode := cipher.NewCBCDecrypter(block, iv)
+	// 解密
+	dst := make([]byte, len(src))
+	blockMode.CryptBlocks(dst, src)
+	// 分组移除
+	dst = d.PKCS7Unpadding(dst, block.BlockSize())
+	return dst
+}
+
+type DES_ECB struct {
+}
+
+//ECB加密
+func (d DES_ECB) EncryptDES_ECB(src, key string) string {
+	data := []byte(src)
+	keyByte := []byte(key)
+	block, err := des.NewCipher(keyByte)
+	if err != nil {
+		panic(err)
+	}
+	bs := block.BlockSize()
+	//对明文数据进行补码
+	data = d.PKCS5Padding(data, bs)
+	if len(data)%bs != 0 {
+		panic("Need a multiple of the blocksize")
+	}
+	out := make([]byte, len(data))
+	dst := out
+	for len(data) > 0 {
+		//对明文按照blocksize进行分块加密
+		//必要时可以使用go关键字进行并行加密
+		block.Encrypt(dst, data[:bs])
+		data = data[bs:]
+		dst = dst[bs:]
+	}
+	return fmt.Sprintf("%x", out)
+}
+
+//ECB解密
+func (d DES_ECB) DecryptDES_ECB(src, key string) string {
+	data, err := hex.DecodeString(src)
+	if err != nil {
+		//fmt.Println(err)
+		panic(err)
+	}
+	keyByte := []byte(key)
+	block, err := des.NewCipher(keyByte)
+	if err != nil {
+		panic(err)
+	}
+	bs := block.BlockSize()
+	if len(data)%bs != 0 {
+		panic("crypto/cipher: input not full blocks")
+	}
+	out := make([]byte, len(data))
+	dst := out
+	for len(data) > 0 {
+		block.Decrypt(dst, data[:bs])
+		data = data[bs:]
+		dst = dst[bs:]
+	}
+	out = d.PKCS5UnPadding(out)
+	return string(out)
+}
+
+//明文补码算法
+func (d DES_ECB) PKCS5Padding(ciphertext []byte, blockSize int) []byte {
+	padding := blockSize - len(ciphertext)%blockSize
+	padtext := bytes.Repeat([]byte{byte(padding)}, padding)
+	return append(ciphertext, padtext...)
+}
+
+//明文减码算法
+func (d DES_ECB) PKCS5UnPadding(origData []byte) []byte {
+	length := len(origData)
+	unpadding := int(origData[length-1])
+	return origData[:(length - unpadding)]
+}

+ 261 - 0
common/error.go

@@ -0,0 +1,261 @@
+package common
+
+import (
+	pb "mop-account-system/protobuf/golang"
+
+	"github.com/gin-gonic/gin"
+)
+
+const (
+	OK                                       = "OK"
+	FC_ORGAN_BIND_ERROR                      = "FC_ORGAN_BIND_ERROR"
+	FC_ORGAN_REGISTER_ERROR                  = "FC_ORGAN_REGISTER_ERROR"
+	FC_ORGAN_VERIFIY_CODE_ERROR              = "FC_ORGAN_VERIFIY_CODE_ERROR"
+	FC_ORGAN_PHONE_ERROR                     = "FC_ORGAN_PHONE_ERROR"
+	FC_ORGAN_PHONE_GET_VERIFY_CODE_ERROR     = "FC_ORGAN_PHONE_GET_VERIFY_CODE_ERROR"
+	FC_ORGAN_PHONE_GET_VERIFY_CODE_TOO_MANY  = "FC_ORGAN_PHONE_GET_VERIFY_CODE_TOO_MANY"
+	FC_ORGAN_PHONE_DUPLICATE                 = "FC_ORGAN_PHONE_DUPLICATE"
+	FC_ORGAN_IDENTITY_DUPLICATE              = "FC_ORGAN_IDENTITY_DUPLICATE"
+	FC_ORGAN_ACCOUNT_DUPLICATE               = "FC_ORGAN_ACCOUNT_DUPLICATE"
+	FC_ORGAN_TRACE_ID_ERROR                  = "FC_ORGAN_TRACE_ID_ERROR"
+	FC_ORGAN_GET_BY_TRACE_ID_ERROR           = "FC_ORGAN_GET_BY_TRACE_ID_ERROR"
+	FC_ORGAN_BUSINESS_APPLY_ERROR            = "FC_ORGAN_BUSINESS_APPLY_ERROR"
+	FC_ORGAN_ACCOUNT_OR_PWD_EMPTY            = "FC_ORGAN_ACCOUNT_OR_PWD_EMPTY"
+	FC_ORGAN_ACCOUNT_NOT_EXIST               = "FC_ORGAN_ACCOUNT_NOT_EXIST"
+	FC_ORGAN_ACCOUNT_OR_PWD_ERROR            = "FC_ORGAN_ACCOUNT_OR_PWD_ERROR"
+	FC_ORGAN_ACCOUNT_PASSWORD_ERROR          = "FC_ORGAN_ACCOUNT_PASSWORD_ERROR"
+	FC_ORGAN_ACCOUNT_EMPTY                   = "FC_ORGAN_ACCOUNT_EMPTY"
+	FC_ORGAN_FORBID                          = "FC_ORGAN_FORBID"
+	FC_ORGAN_BUSINESS_NOT_EXIST              = "FC_ORGAN_BUSINESS_NOT_EXIST"
+	FC_ORGAN_PARAM_ERROR                     = "FC_ORGAN_PARAM_ERROR"
+	FC_ORGAN_MODIFY_PHONE_ERROR              = "FC_ORGAN_MODIFY_PHONE_ERROR"
+	FC_ORGAN_MODIFY_BUSINESS_ADMIN_ERROR     = "FC_ORGAN_MODIFY_BUSINESS_ADMIN_ERROR"
+	FC_ORGAN_GEN_VERIFY_CODE_TYPE_ERROR      = "FC_ORGAN_GEN_VERIFY_CODE_TYPE_ERROR"
+	FC_ORGAN_POWER_CHECK_ERROR               = "FC_ORGAN_POWER_CHECK_ERROR"
+	FC_ORGAN_POWER_CHECK_REVIEWING_ERROR     = "FC_ORGAN_POWER_CHECK_REVIEWING_ERROR"
+	FC_ORGAN_POWER_CHECK_UNCERTIFIED_ERROR   = "FC_ORGAN_POWER_CHECK_UNCERTIFIED_ERROR"
+	FC_ORGAN_POWER_CHECK_EXPIRED_ERROR       = "FC_ORGAN_POWER_CHECK_EXPIRED_ERROR"
+	FC_ORGAN_POWER_CHECK_FROZEN_ERROR        = "FC_ORGAN_POWER_CHECK_FROZEN_ERROR"
+	FC_ORGAN_PLATFORM_ACCOUNT_MODIFY_ERROR   = "FC_ORGAN_PLATFORM_ACCOUNT_MODIFY_ERROR"
+	FC_ORGAN_PLATFORM_ACCOUNT_DEL_ERROR      = "FC_ORGAN_PLATFORM_ACCOUNT_DEL_ERROR"
+	FC_ORGAN_ACCOUNT_OR_PHONE_DUPLICATE      = "FC_ORGAN_ACCOUNT_OR_PHONE_DUPLICATE"
+	FC_ORGAN_SOCIAL_CREDIT_CODE_DUPLICATE    = "FC_ORGAN_SOCIAL_CREDIT_CODE_DUPLICATE"
+	FC_ORGAN_MEMBER_ROLE_ERROR               = "FC_ORGAN_MEMBER_ROLE_ERROR"
+	FC_ORGAN_PHONE_NOT_REGISTER              = "FC_ORGAN_PHONE_NOT_REGISTER"
+	FC_ORGAN_PHONE_NOT_EQUAL                 = "FC_ORGAN_PHONE_NOT_EQUAL"
+	FC_ORGAN_EMAIL_GET_VERIFY_CODE_ERROR     = "FC_ORGAN_EMAIL_GET_VERIFY_CODE_ERROR"
+	FC_ORGAN_EMAIL_DUPLICATE                 = "FC_ORGAN_EMAIL_DUPLICATE"
+	FC_ORGAN_REGISTER_TOO_MANY               = "FC_ORGAN_REGISTER_TOO_MANY"
+	FC_ORGAN_SERVER_ERROR                    = "FC_ORGAN_SERVER_ERROR"
+	FC_ORGAN_EMAIL_NOT_EQUAL                 = "FC_ORGAN_EMAIL_NOT_EQUAL"
+	FC_ORGAN_PERSON_APPLY_ERROR              = "FC_ORGAN_PERSON_APPLY_ERROR"
+	FC_ORGAN_EMAIL_VERIFY_CODE_TOO_MANY      = "FC_ORGAN_EMAIL_VERIFY_CODE_TOO_MANY"
+	FC_ORGAN_OPERATE_TOO_MANY                = "FC_ORGAN_OPERATE_TOO_MANY"
+	FC_ORGAN_VERIFY_CODE_ERROR               = "FC_ORGAN_VERIFY_CODE_ERROR"
+	FC_ORGAN_VERIFY_CODE_NOT_EXIST           = "FC_ORGAN_VERIFY_CODE_NOT_EXIST"
+	FC_ORGAN_NOT_PERSON                      = "FC_ORGAN_NOT_PERSON"
+	FC_ORGAN_PERSON_ADD_MEMBER_MAX           = "FC_ORGAN_PERSON_ADD_MEMBER_MAX"
+	FC_ORGAN_BUSINESS_ADD_MEMBER_MAX         = "FC_ORGAN_BUSINESS_ADD_MEMBER_MAX"
+	FC_ORGAN_FINSTORE_PERSON_ADD_APP_MAX     = "FC_ORGAN_FINSTORE_PERSON_ADD_APP_MAX"
+	FC_ORGAN_FINSTORE_ADD_APP_MAX            = "FC_ORGAN_FINSTORE_ADD_APP_MAX"
+	FC_ORGAN_FINSTORE_PERSON_ADD_COO_APP_MAX = "FC_ORGAN_FINSTORE_PERSON_ADD_COO_APP_MAX"
+	FC_ORGAN_FINSTORE_ADD_COO_APP_MAX        = "FC_ORGAN_FINSTORE_ADD_COO_APP_MAX"
+
+	FC_OPERA_BIND_ERROR                 = "FC_OPERA_BIND_ERROR"
+	FC_OPERA_ACCOUNT_ERROR              = "FC_OPERA_ACCOUNT_ERROR"
+	FC_OPERA_PASSWORD_ERROR             = "FC_OPERA_PASSWORD_ERROR"
+	FC_OPERA_SERVER_ERROR               = "FC_OPERA_SERVER_ERROR"
+	FC_OPERA_PAGE_ERROR                 = "FC_OPERA_PAGE_ERROR"
+	FC_OPERA_NUM_ERROR                  = "FC_OPERA_NUM_ERROR"
+	FC_OPERA_ACCOUNT_EXITED             = "FC_OPERA_ACCOUNT_EXITED"
+	FC_OPERA_PHONE_EXITED               = "FC_OPERA_PHONE_EXITED"
+	FC_OPERA_EMAIL_EXITED               = "FC_OPERA_EMAIL_EXITED"
+	FC_OPERA_IDCARD_EXITED              = "FC_OPERA_IDCARD_EXITED"
+	FC_OPERS_ACCOUNT_NOT                = "FC_OPERS_ACCOUNT_NOT"
+	FC_OPERA_JWT_ERROR                  = "FC_OPERA_JWT_ERROR"
+	FC_OPERA_STATUS_ERROR               = "FC_OPERA_STATUS_ERROR"
+	FC_OPERA_NO_REASON                  = "FC_OPERA_NO_REASON"
+	FC_OPERA_PARAM_COMPLETE             = "FC_OPERA_PARAM_COMPLETE"
+	FC_OPERA_NO_AUTH                    = "FC_OPERA_NO_AUTH"
+	FC_OPERA_ACCOUNT_HAS_ICE            = "FC_OPERA_ACCOUNT_HAS_ICE"
+	FC_OPERA_OLD_PWD_ERROR              = "FC_OPERA_OLD_PWD_ERROR"
+	FC_OPERA_INVAILD_ACCOUNT            = "FC_OPERA_INVAILD_ACCOUNT"
+	FC_OPERA_VERIFY_CODE_ERROR          = "FC_OPERA_VERIFY_CODE_ERROR"
+	FC_OPERA_PHONE_NO_EXITE             = "FC_OPERA_PHONE_NO_EXITE"
+	FC_OPERA_PARAM_ERROR                = "FC_OPERA_PARAM_ERROR"
+	FC_OPERA_GEN_VERIFY_CODE_TYPE_ERROR = "FC_OPERA_GEN_VERIFY_CODE_ERROR"
+	FC_OPERA_GEN_VERIFY_CODE_TOO_MANY   = "FC_OPERA_GEN_VERIFY_CODE_TOO_MANY"
+	FC_OPERA_GET_VERIFY_CODE_SMS_ERROR  = "FC_OPERA_GET_VERIFY_CODE_SMS_ERROR"
+	FC_OPERA_RETRY_GEN_VERIFY_CODE      = "FC_OPERA_RETRY_GEN_VERIFY_CODE"
+	FC_OPERA_FORBID_ERROR               = "FC_OPERA_FORBID_ERROR"
+	FC_OPERA_UP_ORGAN_APPINUM_TOO_SMALL = "FC_OPERA_UP_ORGAN_APPINUM_TOO_SMALL"
+	FC_OPERA_APPID_EXCEED_LIMIT         = "FC_OPERA_APPID_EXCEED_LIMIT"
+	FC_OPERA_VERIFY_CODE_PHONE_ERROR    = "FC_OPERA_VERIFY_CODE_PHONE_ERROR"
+	FC_ORGAN_ACCOUNT_LOGIN_ERROR        = "FC_ORGAN_ACCOUNT_LOGIN_ERROR"
+	FC_ORGAN_RETRY_REVIEW_ERROR         = "FC_ORGAN_RETRY_REVIEW_ERROR"
+	FC_ORGAN_DELETE_WORKER_LACK_ERROR   = "FC_ORGAN_DELETE_WORKER_LACK_ERROR"
+	FC_ORGAN_PHONE_ACCOUNT_NO_MATCH     = "FC_ORGAN_PHONE_ACCOUNT_NO_MATCH"
+	FC_ORGAN_PWD_RETRY_OVER_LIMIT       = "FC_ORGAN_PWD_RETRY_OVER_LIMIT"
+	FC_OPERA_PWD_ERROR_POINT            = "FC_OPERA_PWD_ERROR_POINT"
+	FC_OPERA_DEAL_REASON_EMPTY          = "FC_OPERA_DEAL_REASON_EMPTY"
+	FC_OPERA_NEED_HAS_CERT              = "FC_OPERA_NEED_HAS_CERT"
+	FC_OPERA_NEED_HAS_FREE              = "FC_OPERA_NEED_HAS_CERT"
+	FC_OPERA_GEN_VERIFYCODE_RETRY       = "FC_OPERA_GEN_VERIFYCODE_RETRY"
+	FC_OPERA_GET_LICE_ERROR             = "FC_OPERA_GET_LICE_ERROR"
+	FC_OPERA_APPID_COUNT_OVER           = "FC_OPERA_APPID_COUNT_OVER"
+	FC_OPERA_ORGAN_COUNT_OVER           = "FC_OPERA_ORGAN_COUNT_OVER"
+	FC_OPERA_LIMIT_NUM_FEW              = "FC_OPERA_LIMIT_NUM_FEW"
+	FC_OPERA_LIMIT_TYPE_ERROR           = "FC_OPERA_LIMIT_TYPE_ERROR"
+	FC_OPERA_LIMIT_APPID_OVER_ERROR     = "FC_OPERA_LIMIT_APPID_OVER_ERROR"
+	FC_OPERA_LIMIT_BIND_OVER_ERROR      = "FC_OPERA_LIMIT_BIND_OVER_ERROR"
+	FC_OPERA_LIMIT_MEMBER_OVER_ERROR    = "FC_OPERA_LIMIT_MEMBER_OVER_ERROR"
+
+	//角色相关错误代码
+	FC_OPER_ROLE_REPEAT_ERR         = "FC_OPER_ROLE_REPEAT_ERR"
+	FC_OPER_ROLE_NOT_FUND_ERR       = "FC_OPER_ROLE_NOT_FUND_ERR"
+	FC_ROLE_DELETE_ERR              = "FC_ROLE_DELETE_ERR"
+	FC_ROLE_DELETE_ACCOUNT_ERR      = "FC_ROLE_DELETE_ACCOUNT_ERR"
+	FC_ROLE_DEFAULT_DELETE_ERR      = "FC_ROLE_DEFAULT_DELETE_ERR"
+	FC_DEL_ACCOUNT_ERR              = "FC_DEL_ACCOUNT_ERR"
+	FC_DEL_ACCOUNT_CONFLICT_ERR     = "FC_DEL_ACCOUNT_CONFLICT_ERR"
+	FC_DEL_ACCOUNT_TODOS_NOZERO_ERR = "FC_DEL_ACCOUNT_TODOS_NOZERO_ERR"
+)
+
+var errorText = map[string]string{
+	"OK":                                       "",
+	"FC_ORGAN_BIND_ERROR":                      "http body请求参数解析失败",
+	"FC_ORGAN_REGISTER_ERROR":                  "管理员账号注册失败",
+	"FC_ORGAN_VERIFIY_CODE_ERROR":              "验证码错误",
+	"FC_ORGAN_PHONE_ERROR":                     "手机号错误",
+	"FC_ORGAN_PHONE_GET_VERIFY_CODE_ERROR":     "获取验证码失败",
+	"FC_ORGAN_PHONE_GET_VERIFY_CODE_TOO_MANY":  "请稍后再重新获取验证码",
+	"FC_ORGAN_PHONE_DUPLICATE":                 "该手机号已注册,请重新输入",
+	"FC_ORGAN_IDENTITY_DUPLICATE":              "该身份证已注册,请重新输入",
+	"FC_ORGAN_ACCOUNT_DUPLICATE":               "用户名已存在,请重新输入",
+	"FC_ORGAN_TRACE_ID_ERROR":                  "traceId错误",
+	"FC_ORGAN_GET_BY_TRACE_ID_ERROR":           "查询账号信息失败",
+	"FC_ORGAN_BUSINESS_APPLY_ERROR":            "企业信息提交申请失败",
+	"FC_ORGAN_ACCOUNT_OR_PWD_EMPTY":            "账号或者密码为空",
+	"FC_ORGAN_ACCOUNT_NOT_EXIST":               "不存在该账号信息",
+	"FC_ORGAN_ACCOUNT_OR_PWD_ERROR":            "帐号或密码错误",
+	"FC_ORGAN_ACCOUNT_PASSWORD_ERROR":          "密码错误",
+	"FC_ORGAN_ACCOUNT_EMPTY":                   "账号为空",
+	"FC_ORGAN_FORBID":                          "无权限操作",
+	"FC_ORGAN_BUSINESS_NOT_EXIST":              "企业信息为空",
+	"FC_ORGAN_PARAM_ERROR":                     "请求参数错误",
+	"FC_ORGAN_MODIFY_PHONE_ERROR":              "修改手机号失败",
+	"FC_ORGAN_MODIFY_BUSINESS_ADMIN_ERROR":     "修改管理员信息失败",
+	"FC_ORGAN_GEN_VERIFY_CODE_TYPE_ERROR":      "获取验证码类型错误",
+	"FC_ORGAN_POWER_CHECK_ERROR":               "当前企业尚未通过认证,无法使用该功能",
+	"FC_ORGAN_POWER_CHECK_REVIEWING_ERROR":     "当前企业状态为审核中状态,无法使用该功能",
+	"FC_ORGAN_POWER_CHECK_UNCERTIFIED_ERROR":   "当前企业状态为未认证状态,无法使用该功能",
+	"FC_ORGAN_POWER_CHECK_EXPIRED_ERROR":       "当前企业状态为已过期状态,无法使用该功能",
+	"FC_ORGAN_POWER_CHECK_FROZEN_ERROR":        "当前企业状态为已冻结状态,无法使用该功能",
+	"FC_ORGAN_PLATFORM_ACCOUNT_MODIFY_ERROR":   "编辑平台成员失败",
+	"FC_ORGAN_PLATFORM_ACCOUNT_DEL_ERROR":      "删除失败,请重新获取列表后操作",
+	"FC_ORGAN_ACCOUNT_OR_PHONE_DUPLICATE":      "账号或者手机号已经注册,请重新修改",
+	"FC_ORGAN_SOCIAL_CREDIT_CODE_DUPLICATE":    "社会信用代码已经注册,请重新修改",
+	"FC_ORGAN_MEMBER_ROLE_ERROR":               "账号类型错误",
+	"FC_ORGAN_ACCOUNT_LOGIN_ERROR":             "账号登录失败,请稍后再试",
+	"FC_ORGAN_PHONE_NOT_REGISTER":              "该手机号未注册",
+	"FC_ORGAN_PHONE_NOT_EQUAL":                 "登录手机号错误",
+	"FC_ORGAN_EMAIL_GET_VERIFY_CODE_ERROR":     "获取邮箱验证码失败",
+	"FC_ORGAN_EMAIL_DUPLICATE":                 "该邮箱已注册,请重新输入",
+	"FC_ORGAN_REGISTER_TOO_MANY":               "注册太频繁,请稍后再重新注册",
+	"FC_ORGAN_SERVER_ERROR":                    "服务异常,请稍后重试",
+	"FC_ORGAN_EMAIL_NOT_EQUAL":                 "登录邮箱错误",
+	"FC_ORGAN_PERSON_APPLY_ERROR":              "个人信息申请失败",
+	"FC_ORGAN_EMAIL_VERIFY_CODE_TOO_MANY":      "获取验证码太频繁,请稍后重新获取验证码",
+	"FC_ORGAN_OPERATE_TOO_MANY":                "请求过于频繁,请稍后再重试",
+	"FC_ORGAN_VERIFY_CODE_ERROR":               "验证码错误,请重新输入",
+	"FC_ORGAN_VERIFY_CODE_NOT_EXIST":           "验证码已过期,请重新获取",
+	"FC_ORGAN_NOT_PERSON":                      "非个人账号,不能升级为企业账号",
+	"FC_ORGAN_PERSON_ADD_MEMBER_MAX":           "成员数量已达上限,如需新增成员,请联系平台运营方",
+	"FC_ORGAN_BUSINESS_ADD_MEMBER_MAX":         "成员数量已达上限,如需新增成员,请联系平台运营方",
+	"FC_ORGAN_FINSTORE_PERSON_ADD_APP_MAX":     "可创建的小程序个数已达上限,如需创建新的小程序,请联系平台运营方",
+	"FC_ORGAN_FINSTORE_ADD_APP_MAX":            "可创建的小程序个数已达上限,如需创建新的小程序,请联系平台运营方",
+	"FC_ORGAN_FINSTORE_PERSON_ADD_COO_APP_MAX": "可合作应用个数已达上限,如需新增合作应用,请联系平台运营方",
+	"FC_ORGAN_FINSTORE_ADD_COO_APP_MAX":        "可合作应用个数已达上限,如需新增合作应用,请联系平台运营方",
+
+	"FC_OPERA_BIND_ERROR":                 "http body请求参数解析失败",
+	"FC_OPERA_ACCOUNT_ERROR":              "账号错误",
+	"FC_OPERA_PASSWORD_ERROR":             "密码错误",
+	"FC_OPERA_SERVER_ERROR":               "服务端错误,请重试",
+	"FC_OPERA_PAGE_ERROR":                 "参数page错误",
+	"FC_OPERA_NUM_ERROR":                  "参数num需大于0小于等于100",
+	"FC_OPERA_ACCOUNT_EXITED":             "该用户名已存在,请重新输入",
+	"FC_OPERA_PHONE_EXITED":               "该手机号已注册,请重新输入",
+	"FC_OPERA_EMAIL_EXITED":               "该邮箱已注册,请重新输入",
+	"FC_OPERA_IDCARD_EXITED":              "该身份证已注册,请重新输入",
+	"FC_OPERS_ACCOUNT_NOT":                "该账户不存在",
+	"FC_OPERA_JWT_ERROR":                  "jwt错误",
+	"FC_OPERA_STATUS_ERROR":               "设置状态非法",
+	"FC_OPERA_NO_REASON":                  "驳回原因不能为空",
+	"FC_OPERA_PARAM_COMPLETE":             "必填项不可为空",
+	"FC_OPERA_NO_AUTH":                    "无权限进行此操作",
+	"FC_OPERA_ACCOUNT_HAS_ICE":            "账号已经被冻结",
+	"FC_OPERA_OLD_PWD_ERROR":              "旧密码不正确",
+	"FC_OPERA_INVAILD_ACCOUNT":            "非法账户",
+	"FC_OPERA_VERIFY_CODE_ERROR":          "验证码错误",
+	"FC_OPERA_PHONE_NO_EXITE":             "该手机号不存在",
+	"FC_OPERA_GEN_VERIFY_CODE_ERROR":      "获取验证码类型错误",
+	"FC_OPERA_PARAM_ERROR":                "参数错误",
+	"FC_OPERA_GEN_VERIFY_CODE_TOO_MANY":   "请稍后再重新获取验证码",
+	"FC_OPERA_GET_VERIFY_CODE_SMS_ERROR":  "获取验证码失败",
+	"FC_OPERA_RETRY_GEN_VERIFY_CODE":      "重复申请验证码",
+	"FC_OPERA_FORBID_ERROR":               "无权限",
+	"FC_OPERA_UP_ORGAN_APPINUM_TOO_SMALL": "更新数量小于已使用数量",
+	"FC_OPERA_APPID_EXCEED_LIMIT":         "appid数量超出上限",
+	"FC_OPERA_VERIFY_CODE_PHONE_ERROR":    "获取验证码手机号不是该账户手机号",
+	"FC_ORGAN_RETRY_REVIEW_ERROR":         "该条信息已经被审核",
+	"FC_ORGAN_DELETE_WORKER_LACK_ERROR":   "删除失败,请重新获取列表后操作",
+	"FC_ORGAN_PHONE_ACCOUNT_NO_MATCH":     "获取验证码手机号与账号拥有手机号不匹配",
+	"FC_ORGAN_PWD_RETRY_OVER_LIMIT":       "密码尝试次数太多,请24小时后再尝试。",
+	"FC_OPERA_DEAL_REASON_EMPTY":          "拒绝原因不能为空",
+	"FC_OPERA_NEED_HAS_CERT":              "企业未通过认证,不可冻结",
+	"FC_OPERA_NEED_HAS_FREE":              "企业不是冻结状态,不可解冻",
+	"FC_OPERA_GEN_VERIFYCODE_RETRY":       "请稍后再获取验证码",
+	"FC_OPERA_GET_LICE_ERROR":             "获取license失败",
+	"FC_OPERA_APPID_COUNT_OVER":           "appid数量超过签发证书允许数量",
+	"FC_OPERA_ORGAN_COUNT_OVER":           "审核通过企业数量超过签发证书允许数量",
+	"FC_OPERA_LIMIT_NUM_FEW":              "修改数量小于已使用数量",
+	"FC_OPERA_LIMIT_TYPE_ERROR":           "类型错误",
+	"FC_OPERA_LIMIT_APPID_OVER_ERROR":     "小程序数量已达上限,如需新增小程序,请联系平台运营方",
+	"FC_OPERA_LIMIT_BIND_OVER_ERROR":      "应用数量已达上限,如需新增应用,请联系平台运营方",
+	"FC_OPERA_LIMIT_MEMBER_OVER_ERROR":    "成员数量已达上限,如需新增成员,请联系平台运营方",
+
+	//角色管理相关错误信息
+	"FC_OPER_ROLE_REPEAT_ERR":         "角色名称已存在",
+	"FC_OPER_ROLE_NOT_FUND_ERR":       "未查询到角色",
+	"FC_ROLE_DELETE_ERR":              "删除失败,当前角色下还有成员。",
+	"FC_ROLE_DELETE_ACCOUNT_ERR":      "成员的角色不能为空,每个成员至少要有一个角色",
+	"FC_ROLE_DEFAULT_DELETE_ERR":      "管理员为系统默认角色,不可删除。",
+	"FC_DEL_ACCOUNT_ERR":              "无法删除自己的账号!",
+	"FC_DEL_ACCOUNT_TODOS_NOZERO_ERR": "删除的成员中还有尚未处理的待办,请处理后再删除。",
+}
+
+func MakeRsp(c *gin.Context, httpStatus int, errCode string, data interface{}) {
+	c.JSON(httpStatus, gin.H{
+		"error":   errorText[errCode],
+		"errcode": errCode,
+		"data":    data,
+	})
+}
+func MakeRspNoLoc(c *gin.Context, httpStatus int, errCode, errMsg string, data interface{}) {
+	c.JSON(httpStatus, gin.H{
+		"error":   errMsg,
+		"errcode": errCode,
+		"data":    data,
+	})
+}
+
+func GetErrMsg(errCode string) string {
+	return errorText[errCode]
+}
+
+func MakeGrpcCommonResult(httpStatus int, errCode string, result **pb.CommonResult) {
+	*result = &pb.CommonResult{}
+	(*result).Error = errorText[errCode]
+	(*result).Errcode = errCode
+	(*result).Httpcode = int32(httpStatus)
+}

+ 44 - 0
common/log.go

@@ -0,0 +1,44 @@
+package common
+
+import (
+	"mop-account-system/config"
+	"os"
+
+	"github.com/sirupsen/logrus"
+)
+
+var GinLog *logrus.Logger
+
+func init() {
+	GinLog = GetDefaultGinLog()
+}
+
+func GetDefaultGinLog() *logrus.Logger {
+	l := logrus.New()
+	l.Formatter = &logrus.JSONFormatter{
+		TimestampFormat:  "2006-01-02T15:04:05",
+		DisableTimestamp: false,
+		FieldMap:         nil,
+		CallerPrettyfier: nil,
+		PrettyPrint:      false,
+	}
+	l.Out = os.Stdout
+	l.ReportCaller = true
+	l.Level = getModeByStr(config.Cfg.Mode)
+	return l
+}
+
+func getModeByStr(s string) logrus.Level {
+	switch s {
+	case "debug":
+		return logrus.DebugLevel
+	case "info":
+		return logrus.InfoLevel
+	case "warn":
+		return logrus.WarnLevel
+	case "error":
+		return logrus.ErrorLevel
+	default:
+		return logrus.DebugLevel
+	}
+}

+ 13 - 0
common/md5.go

@@ -0,0 +1,13 @@
+package common
+
+import (
+	"crypto/md5"
+	"encoding/hex"
+)
+
+//生成md5值
+func GenMd5(str string) string  {
+	h := md5.New()
+	h.Write([]byte(str))
+	return hex.EncodeToString(h.Sum(nil))
+}

+ 51 - 0
common/mem_cache.go

@@ -0,0 +1,51 @@
+package common
+
+import (
+	"errors"
+	"time"
+
+	"github.com/patrickmn/go-cache"
+)
+
+var memCache *cache.Cache
+var licenseCache *cache.Cache
+
+func init() {
+	memCache = cache.New(30*time.Second, 3*time.Second) //30秒钟超时,每3秒检查是否有需要超时清除
+	licenseCache = cache.New(10*time.Minute, 1*time.Minute)
+}
+
+func SetMemCache(key string, value interface{}) {
+	memCache.Set(key, value, cache.DefaultExpiration)
+}
+
+func GetMemCache(key string) (interface{}, error) {
+	value, found := memCache.Get(key)
+	if found {
+		return value, nil
+	}
+
+	return nil, errors.New("Not Fount, key=" + key)
+}
+
+func GetMemCacheWithDelete(key string) (interface{}, error) {
+	value, found := memCache.Get(key)
+	if found {
+		go memCache.Delete(key)
+		return value, nil
+	}
+
+	return nil, errors.New("Not Fount, key=" + key)
+}
+
+func SetRspCode(url string, httpStatusCode int) {
+	licenseCache.SetDefault(url, httpStatusCode)
+}
+
+func GetRspCode(url string) (int, bool) {
+	if v, ok := licenseCache.Get(url); !ok {
+		return 0, false
+	} else {
+		return v.(int), true
+	}
+}

+ 12 - 0
common/struct.go

@@ -0,0 +1,12 @@
+package common
+
+import "encoding/json"
+
+func InterfaceToJsonString(obj interface{}) string {
+	jsonBytes, err := json.Marshal(obj)
+	if err == nil {
+		return string(jsonBytes)
+	}
+
+	return ""
+}

+ 27 - 0
common/time.go

@@ -0,0 +1,27 @@
+package common
+
+import (
+	"strconv"
+	"time"
+)
+
+func TimeFormat1(t time.Time) string {
+	s := ""
+	year, month, day := t.Date()
+
+	yearStr := strconv.Itoa(year)
+
+	monthStr := strconv.Itoa(int(month))
+	if month < 10 {
+		monthStr = "0" + monthStr
+	}
+
+	dayStr := strconv.Itoa(day)
+	if day < 10 {
+		dayStr = "0" + dayStr
+	}
+
+	s = yearStr + "-" + monthStr + "-" + dayStr + " "
+
+	return s
+}

+ 196 - 0
config/config.go

@@ -0,0 +1,196 @@
+package config
+
+import (
+	"encoding/json"
+	"fmt"
+	"git.finogeeks.club/base/apm"
+
+	"github.com/caarlos0/env/v6"
+)
+
+// 例子
+type Config struct {
+	HttpPort                string `env:"HTTP_PORT" envDefault:"8080"`
+	GrpcPort                string `env:"GRPC_PORT" envDefault:"9090"`
+	ConsulAddr              string `env:"" envDefault:""`
+	ConsulHttpIp            string `env:"CONSUL_HTTP_IP" envDefault:""`
+	ConsulPort              string `env:"CONSUL_PORT" envDefault:"8500"`
+	ConsulTag               string `env:"CONSUL_TAG" envDefault:"mop-finstore"` //consul tag
+	Mode                    string `env:"MODE" envDefault:""`
+	MongoURL                string `env:"MONGO_URL" envDefault:"mongodb://localhost:27017"` //mongo地址
+	DBName                  string `env:"DB_NAME" envDefault:"mop-account-system"`
+	LogMode                 string `env:"LOG_MODE" envDefault:"debug"`
+	HttpMode                string `env:"HTTP_MODE" envDefault:"debug"`
+	KongMode                string `env:"KONG_MODE" envDefault:"use_db"`
+	KongUrlPrefix           string `env:"KONG_URL_PREFIX" envDefault:"http://gateway.gateway:8001"`
+	CommonVerifyCode        string `env:"COMMON_VERIFY_CODE" envDefault:"185890"`
+	OrganExpiredM           string `env:"ORGAN_EXPIRED_MONTH" envDefault:"12"` //企业过期时间 单位:month
+	RedisAddr               string `env:"REDIS_ADDR" envDefault:"redis://redis:6379/11"`
+	RedisPassword           string `env:"REDIS_PASSWORD" envDefault:""`
+	RedisMode               string `env:"REDIS_MODE" envDefault:"single"`
+	ResetPassword           string `env:"RESET_PASSWORD" envDefault:"123Abc"`
+	OperAdminName           string `env:"OPER_ADMIN_NAME" envDefault:"admin"`
+	OperAdminAccount        string `env:"OPER_ADMIN_ACCOUNT" envDefault:"admin"`
+	OperAdminPhone          string `env:"OPER_ADMIN_PHONE" envDefault:""`
+	OperAdminPwd            string `env:"OPER_ADMIN_PASSWORD" envDefault:"123Abc"`
+	DeviceSecurityUrlPrefix string `env:"DEVICE_SECURITY_URL_PREFIX" envDefault:"http://mop-device-security:8080"`
+	TokenExpireTime         int    `env:"TOKEN_EXPIRE_TIME" envDefault:"1036800"`
+	MaxRedisClientNum       int    `env:"MAX_REDIS_CLIENT_NUM" envDefault:"100"`
+	OperAdminEmail          string `env:"OPER_ADMIN_EMAIL" envDefault:"admin@open.com"`
+	KafkaAddr               string `env:"KAFKA_ADDR" envDefault:"kafka-service.kafka:9093"`
+	KafkaVersion            string `env:"KAFKA_VERSION" envDefault:"2.3.0"`
+	DevelopLevel            string `env:"DEVELOP_LEVEL" envDefault:"release"`
+	VerifyCodeUrlPrefix     string `env:"VERIFY_CODE_SERVER_HOST" envDefault:"http://mop-verify-code-gateway:8080"`
+	VerifyCodeServerHost    string `env:"VERIFY_CODE_URL_PREFIX" envDefault:"http://mop-verify-code-server:8080"`
+	SetLoginFirstServerHost string `env:"SET_LOGIN_FIRST_HOST" envDefault:"http://mop-fast-trial-manager:8080"`
+
+	DelPhoneLimitUrl   string `env:"DEL_PHONE_CODE_LIMIT_URL" envDefault:"/api/v1/mop/finogeeks-verify-code-server/phone-limit"`
+	OperateLogTopic    string `env:"OPERATE_LOG_TOPIC" envDefault:"mop_operation_log"`
+	NotifyDataTopic    string `env:"NOTIFY_DATA_TOPIC" envDefault:"mop_notify_data_topic"`
+	CompanyUpdateTopic string `env:"COMPANY_UPDATE_TOPIC" envDefault:"mop_purchasing_rights_manager_topic"`
+
+	ZipKinUrl               string `env:"ZIPKIN_URL" envDefault:""`
+	ServerName              string `env:"SERVER_NAME" envDefault:"mop-account-system"`
+	PwdErrCountLimit        int    `env:"PWD_ERR_COUNT_LIMITE" envDefault:"5"`
+	PwdErrTimeLimit         int    `env:"PWD_ERR_TIME_LIMIT" envDefault:"86400"` //密码错误,账号封禁时间 单位:秒
+	VerifyCodeType          string `env:"VERIFY_CODE_TYPE" envDefault:"mop"`
+	PerAccountExpireMon     int    `env:"PER_ACCOUNT_EXPIRE_MON" envDefault:"12"`
+	NotifyFinstoreInfoUpUrl string `env:"FINSTORE_NOTIFY_INFO_URL" envDefault:"http://mop-app-manage-svr:8080/api/v1/mop/finstore/notify"`
+	//数量限制
+	AllowApplyIdNum  int    `env:"ALLOW_APPLY_ID_NUM" envDefault:"10"`
+	AllowBindNum     int    `env:"ALLOW_BIND_NUM" envDefault:"10"`
+	AllowMemNum      int    `env:"ALLOW_MEM_NUM" envDefault:"99"`
+	PerAllowAppIdNum int    `env:"PER_ALLOW_APPID_NUM" envDefault:"2"`
+	PerAllowBindNum  int    `env:"PER_ALLOW_BIND_NUM" envDefault:"1"`
+	PerAllowMemNum   int    `env:"PER_ALLOW_MEM_NUM" envDefault:"0"`
+	Env              string `env:"ENV" envDefault:"mop-uat"` //mop-uat、mop-fdep、mop-private、mop-community
+	//redis
+	RedisSentinelAddr     string `env:"REDIS_SENTINEL_ADDR" envDefault:"redis://redis-cluster-redis-cluster-sentinel.redis-cluster:26379/"`
+	RedisMasterName       string `env:"REDIS_MASTER_NAME" envDefault:"mymaster"`
+	RedisDatabase         int    `env:"REDIS_INDEX" envDefault:"11"`
+	RedisSentinelPassword string `env:"REDIS_SENTINEL_PASSWORD" envDefault:""`
+
+	RightUrlPrefix       string `env:"RIGHT_UTL_PREFIX" envDefault:"http://mop-purchasing-rights-manager.mop-finstore:8080"`
+	OrderRightsModifyURL string `env:"ORDER_RIGHTS_MODIFY_URL" envDefault:"http://mop-purchasing-rights-manager:8080/api/v1/mop/mop-purchasing-rights-manager/rights/modify"`
+	MysqlUserName        string `env:"MYSQL_USER_NAME" envDefault:"root"`
+	MysqlPassword        string `env:"MYSQL_PASSWORD" envDefault:""`
+	MysqlURL             string `env:"MYSQL_URL" envDefault:"localhost"`
+	MysqlPort            int    `env:"MYSQL_PORT" envDefault:"3306"`
+	DBMode               string `env:"DB_MODE" envDefault:"mongo"`
+	MysqlAddr            string `env:"MYSQL_ADDR" envDefault:""`
+
+	SkyWalkingUrl        string `env:"SKYWALKING_URL" envDefault:"127.0.0.1:11800"`
+	SkyWalkingEnable     bool   `env:"SKYWALKING_ENABLE" envDefault:"false"`
+	SkyWalkingPartitions uint32 `env:"SKYWALKING_PARTITIONS" envDefault:"1"`
+
+	AuditManageHost string `env:"AUDIT_MANAGE_HOST" envDefault:"http://mop-audit-manage-svr:8080"`
+}
+
+var Cfg *Config
+
+func init() {
+	//Cfg = getConfig()
+	Cfg = new(Config)
+	if err := env.Parse(Cfg); err != nil {
+		fmt.Printf("%+v\n", err)
+		panic(err)
+	}
+	if Cfg.ConsulHttpIp != "" {
+		Cfg.ConsulAddr = Cfg.ConsulHttpIp + ":" + Cfg.ConsulPort
+	} else {
+		Cfg.ConsulAddr = ""
+	}
+	b, _ := json.MarshalIndent(Cfg, "", "  ")
+	fmt.Println("config:", string(b))
+
+	apm.BuildApmClient(apm.CreateBuild(Cfg.SkyWalkingUrl, Cfg.ServerName, Cfg.SkyWalkingPartitions, Cfg.SkyWalkingEnable))
+
+}
+
+func GetConfig() *Config {
+	return Cfg
+}
+
+//func getConfig() (cfg *Config) {
+//	config := &Config{}
+//	config.HttpPort = getEnv("HTTP_PORT", "8080") //服务端口
+//	config.GrpcPort = getEnv("GRPC_PORT", "9090") //grpc服务端口
+//	config.ConsulHttpIp = getEnv("CONSUL_HTTP_IP", "")
+//	config.ConsulPort = getEnv("CONSUL_PORT", "8500")
+//	if config.ConsulHttpIp != "" {
+//		config.ConsulAddr = config.ConsulHttpIp + ":" + config.ConsulPort
+//	} else {
+//		config.ConsulAddr = ""
+//	}
+//	config.ConsulTag = getEnv("CONSUL_TAG", "mop-finstore")            //consul tag
+//	config.Mode = getEnv("MODE", "")                                   //路由模式
+//	config.MongoURL = getEnv("MONGO_URL", "mongodb://localhost:27017") //mongo地址
+//	config.DBName = getEnv("DB_NAME", "mop-applets-ecol-account")      //db名字
+//	config.LogMode = getEnv("LOG_MODE", "debug")                       //日志级别
+//	config.HttpMode = getEnv("HTTP_MODE", "debug")                     //http的mode 分"debug" "test" "release"
+//	config.KongUrlPrefix = getEnv("KONG_URL_PREFIX", "http://gateway.gateway:8001")
+//	config.OrganExpiredM = getEnv("ORGAN_EXPIRED_MONTH", "12")       //企业过期时间
+//	config.CommonVerifyCode = getEnv("COMMON_VERIFY_CODE", "185890") //万能验证码,为空的时候不能使用该验证码
+//	config.RedisAddr = getEnv("REDIS_URL", "redis://redis:6379/11")
+//	config.RedisPassword = getEnv("REDIS_PASSWORD", "")
+//	config.RedisMode = getEnv("REDIS_MODE", "single")               //singel:单点模式,sentinel:哨兵模式
+//	config.ResetPassword = getEnv("RESET_PASSWORD", "123Abc")       //重置成员密码
+//	config.OperAdminName = getEnv("OPER_ADMIN_NAME", "admin")       //运营方管理员姓名
+//	config.OperAdminAccount = getEnv("OPER_ADMIN_ACCOUNT", "admin") //运营方管理员账号
+//	config.OperAdminPhone = getEnv("OPER_ADMIN_PHONE", "")          //运营方管理员电话
+//	config.OperAdminPwd = getEnv("OPER_ADMIN_PASSWORD", "123Abc")   //运营方管理员密码
+//	config.DeviceSecurityUrlPrefix = getEnv("DEVICE_SECURITY_URL_PREFIX", "http://mop-device-security:8080")
+//	config.TokenExpireTime = getEnvNum("TOKEN_EXPIRE_TIME", 86400*14)
+//	config.MaxRedisClientNum = getEnvNum("MAX_REDIS_CLIENT_NUM", 100)
+//	config.OperAdminEmail = getEnv("OPER_ADMIN_EMAIL", "admin@open.com")
+//	config.KafkaAddr = getEnv("KAFKA_ADDR", "kafka-service.kafka:9093")
+//	config.DevelopLevel = getEnv("DEVELOP_LEVEL", "release")
+//	config.VerifyCodeServerHost = getEnv("VERIFY_CODE_SERVER_HOST", "http://mop-verify-code-server:8080")
+//	config.VerifyCodeUrlPrefix = getEnv("VERIFY_CODE_URL_PREFIX", "http://mop-verify-code-gateway:8080")
+//	config.DelPhoneLimitUrl = getEnv("DEL_PHONE_CODE_LIMIT_URL", "/api/v1/mop/finogeeks-verify-code-server/phone-limit")
+//	config.OperateLogTopic = getEnv("OPERATE_LOG_TOPIC", "mop_operation_log")
+//	config.NotifyDataTopic = getEnv("NOTIFY_DATA_TOPIC", "mop_notify_data_topic")
+//	config.ZipKinUrl = getEnv("ZIPKIN_URL", "")
+//	config.ServerName = getEnv("SERVER_NAME", "mop-account-system")
+//	config.PwdErrCountLimit = getEnvNum("PWD_ERR_COUNT_LIMITE", 5)
+//	config.PwdErrTimeLimit = getEnvNum("PWD_ERR_TIME_LIMIT", 24*60*60)
+//	config.VerifyCodeType = getEnv("VERIFY_CODE_TYPE", "mop")
+//	config.PerAccountExpireMon = getEnvNum("PER_ACCOUNT_EXPIRE_MON", 12)
+//
+//	config.NotifyFinstoreInfoUpUrl = getEnv("FINSTORE_NOTIFY_INFO_URL", "http://mop-app-manage-svr:8080/api/v1/mop/finstore/notify")
+//	//私有化版本以license为准、saas版以环境变量为准
+//	config.AllowApplyIdNum = getEnvNum("ALLOW_APPLY_ID_NUM", 10)  //初始允许企业创建的最大appid数量
+//	config.AllowBindNum = getEnvNum("ALLOW_BIND_NUM", 10)         //初始允许企业创建的最大应用数量
+//	config.AllowMemNum = getEnvNum("ALLOW_MEM_NUM", 99)           //初始允许企业创建的最大成员数量
+//	config.PerAllowAppIdNum = getEnvNum("PER_ALLOW_APPID_NUM", 2) //初始个人mock企业创建的最大appid数量
+//	config.PerAllowBindNum = getEnvNum("PER_ALLOW_BIND_NUM", 1)   //初始个人mock企业创建的最大应用数量
+//	config.PerAllowMemNum = getEnvNum("PER_ALLOW_MEM_NUM", 0)     //初始个人mocke企业申请的最大成员数量
+//
+//	config.RedisSentinelAddr = getEnv("REDIS_SENTINEL_ADDR", "redis://redis-cluster-redis-cluster-sentinel.redis-cluster:26379/")
+//	config.RedisMasterName = getEnv("REDIS_MASTER_NAME", "mymaster")
+//	config.RedisDatabase = getEnvNum("REDIS_INDEX", 11)
+//	config.RedisSentinelPassword = getEnv("REDIS_SENTINEL_PASSWORD", "")
+//
+//	config.Env = getEnv("ENV", "mop-uat") //mop-uat、mop-fdep、mop-private
+//	config.RightUrlPrefix = getEnv("RIGHT_UTL_PREFIX", "http://mop-purchasing-rights-manager.mop-finstore:8080")
+//	fmt.Printf("config:%+v\n", config)
+//	return config
+//}
+//
+//func getEnv(key, fallback string) string {
+//	if value, ok := os.LookupEnv(key); ok {
+//		return value
+//	}
+//	return fallback
+//}
+//
+//func getEnvNum(key string, fallback int) int {
+//	if value, ok := os.LookupEnv(key); ok {
+//		num, err := strconv.Atoi(value)
+//		if err != nil {
+//			panic("env param is not int")
+//		}
+//		return num
+//	}
+//	return fallback
+//}

+ 200 - 0
consul/consul.go

@@ -0,0 +1,200 @@
+package consul
+
+import (
+	"encoding/json"
+	"fmt"
+	"mop-account-system/common"
+	"mop-account-system/config"
+	"net"
+	"net/http"
+	"strconv"
+	"time"
+
+	consulapi "github.com/hashicorp/consul/api"
+	"github.com/hashicorp/consul/api/watch"
+	uuid "github.com/satori/go.uuid"
+)
+
+var (
+	mopConsul *MopConsul
+)
+
+type MopConsul struct {
+	CheckPort    string
+	NodeId       string
+	ConsulClient *consulapi.Client
+	IsRegSucc    bool
+}
+
+func InitConsul() {
+	mopConsul = NewMopConsul()
+	mopConsul.Init()
+}
+
+func NewMopConsul() *MopConsul {
+	var m MopConsul
+
+	m.CheckPort = "9091"
+	m.NodeId = uuid.NewV4().String()
+	m.IsRegSucc = false
+
+	var err error
+	cfg := consulapi.DefaultConfig()
+	cfg.Address = config.GetConfig().ConsulAddr
+	m.ConsulClient, err = consulapi.NewClient(cfg)
+	if err != nil {
+		panic(err)
+	}
+
+	return &m
+}
+
+func (m *MopConsul) Init() {
+	m.InitCheck() //初始化check接口
+
+	time.Sleep(1 * time.Second)
+	m.RegisterServer()  //注册服务
+	go m.WatchService() //服务是否发生change
+	go m.SyncServiceHealth(60)	//主动拉取健康状态
+}
+
+func (m *MopConsul) InitCheck() {
+	http.HandleFunc("/"+m.NodeId+"/check", func(w http.ResponseWriter, r *http.Request) {
+		w.Write([]byte("success"))
+	})
+
+	go http.ListenAndServe(":"+m.CheckPort, nil)
+}
+
+func (m *MopConsul) GetLocalIP() string {
+	addrs, err := net.InterfaceAddrs()
+	if err != nil {
+		return ""
+	}
+	for _, address := range addrs {
+		if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
+			if ipnet.IP.To4() != nil {
+				return ipnet.IP.String()
+			}
+		}
+	}
+	return ""
+}
+
+func (m *MopConsul) RegisterServer() {
+	registration := new(consulapi.AgentServiceRegistration)
+	registration.ID = m.NodeId
+	registration.Name = config.GetConfig().ServerName
+	registration.Port, _ = strconv.Atoi(config.GetConfig().GrpcPort)
+	registration.Tags = []string{config.GetConfig().ConsulTag}
+	registration.Address = m.GetLocalIP()
+	fmt.Println("localIP=" + registration.Address)
+	registration.Check = &consulapi.AgentServiceCheck{
+		CheckID:                        m.NodeId,
+		HTTP:                           "http://" + registration.Address + ":" + m.CheckPort + "/" + m.NodeId + "/check",
+		Timeout:                        "5s",
+		Interval:                       "30s",
+		DeregisterCriticalServiceAfter: "35s", //check失败后35秒删除本服务
+	}
+
+	err := m.ConsulClient.Agent().ServiceRegister(registration)
+	if err != nil {
+		fmt.Errorf("ServiceRegister err:" + err.Error())
+		if m.IsRegSucc == false {
+			panic(err)
+		}
+	}
+
+	m.IsRegSucc = true
+	fmt.Println("Consul RegisterServer success")
+}
+
+func (m *MopConsul) WatchService() {
+	var notifyCh = make(chan struct{})
+
+	watchContent := `{"type":"service", "service":"` + config.GetConfig().ServerName + `", "tag":"` + config.GetConfig().ConsulTag + `"}`
+	plan := m.WatchParse(watchContent)
+	plan.Handler = func(idx uint64, raw interface{}) {
+		fmt.Println("service change...")
+		if raw == nil {
+			return // ignore
+		}
+		fmt.Println("do something...")
+		notifyCh <- struct{}{}
+	}
+
+	go func() {
+		if err := plan.Run(config.GetConfig().ConsulAddr); err != nil {
+			panic(err)
+		}
+	}()
+	defer plan.Stop()
+
+	for {
+		select {
+		case <-notifyCh:
+			m.RegisterAgain()
+		}
+	}
+}
+
+func (m *MopConsul) SyncServiceHealth(gap int) {
+	for {
+		time.Sleep(time.Duration(gap) * time.Second)
+		isHealth := false
+		services, _, err := m.ConsulClient.Health().Service(config.GetConfig().ServerName, config.GetConfig().ConsulTag, true, &consulapi.QueryOptions{WaitIndex: 0})
+		if err != nil {
+			fmt.Errorf("error retrieving instances from Consul: %s", err.Error())
+		}
+
+		for _, s := range services {
+			if s.Service.ID == m.NodeId {
+				isHealth = true
+				break
+			}
+		}
+
+		if !isHealth {
+			m.RegisterServer()
+		}
+	}
+}
+
+func (m *MopConsul) WatchParse(q string) *watch.Plan {
+	var params map[string]interface{}
+	if err := json.Unmarshal([]byte(q), &params); err != nil {
+		fmt.Errorf("Unmarshal err:" + err.Error())
+		return nil
+	}
+
+	plan, err := watch.Parse(params)
+	if err != nil {
+		panic(err)
+	}
+
+	return plan
+}
+
+func (m *MopConsul) RegisterAgain() {
+	if !m.CheckServiceIsOK() {
+		m.RegisterServer()
+	}
+}
+
+func (m *MopConsul) CheckServiceIsOK() bool {
+	services, _ := m.ConsulClient.Agent().Services()
+
+	isOK := false
+	if len(services) > 0 {
+		if value, ok := services[m.NodeId]; ok {
+			fmt.Println("service=" + common.InterfaceToJsonString(value))
+			if value.Service == config.GetConfig().ServerName {
+				if value.Weights.Passing == 1 {
+					isOK = true
+				}
+			}
+		}
+	}
+
+	return isOK
+}

+ 2 - 0
docs/doc.md

@@ -0,0 +1,2 @@
+### mop-account-system document
+

+ 991 - 0
docs/operate.go

@@ -0,0 +1,991 @@
+package docs
+
+/**
+ * @api {POST} /api/v1/mop/applets-ecol-account/operation/login  [C/S]运营方登陆接口
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	account						用户名
+ * @apiParam  (RequestBody) {string}				   	password					登录密码(md5 32位加密)
+ * @apiParam  (RequestBody) {bool}				   		isWeb					是否在web端登陆
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"account": "abc123456",
+ *		"password": "5cff6f7c4357ee0001c96fab",
+ *		"isWeb":true
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *			"traceId":"jaigjoajgiajg",//唯一id
+ *			"role":"admin",		 //角色
+ *			"phone":"jaogjaojgi",//电话
+ *			"jwtToken":"Jiajgoajgi",
+ *			"refreshToken":"5cff6f7c4357ee0001c96fac......",
+ *			"jwtTokenExpireTime":7200,	//jwtToken有效时长,单位是秒
+ *			"env":"mop-fdep"
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/reviewlist  					[C/S]运营方获取审核列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	findData					公司账号或者公司名称
+ * @apiParam   {int}                   	status						审核状态(0-全部 1-审核 2-未审核)
+ * @apiParam   {int}                   	page						第几页
+ * @apiParam   {int}					   	num							每页数量
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"status":1,
+ *		"findData":"mingcheng",
+ *		"page": 2,
+ *		"num": 15,
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *			"total":2,
+ *			"totalInfo": {
+ *          	"allTotal": 2,
+ *          	"hasReviewedNum": 2,	//已经审核数量
+ *         		"noReviewNum": 0		//未审核数量
+ *      	},
+ *			"list":[
+ *					{
+ *						"name":"企业名称",
+ *						"account":"企业账号",
+ *						"applyTime":1573813430,					//申请时间
+ *						"status":1,								//审核状态 1-已审核 2-未审核
+ *						"Reviewer":"wangkang",					//审核人 未审核时为空
+ *						"result":1,								//审核结果 1-通过认证 2-驳回
+ *						"refuseReason":"test",					//驳回原因
+ *						"createTime":1573813430,				//创建时间
+ *						"updateTime":1573813430,				//更新时间
+ *						"organId":"jaiojgiajg",					//企业唯一id,根据该id可获取企业详情
+ *						"socialCreditCode":"123232424",			//社会统一信用代码
+ *						"licenseNetdiskId":"afgagag",			//资格证书
+ *						"authorizationNetdiskId":"agagag",		//授权书
+ *						"adminInfo":{							//管理员信息
+ *							"name":"xingming",
+ *							"idCard":"610829382983984",
+ *							"phone":"jaogjaogjiajgiagji",
+ *						},
+ * 				}
+ *		]
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/review/detail/:traceId  					[C/S]运营方获取审核信息详情
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {String}					   	traceId							审核信息的Id
+ * @apiParamExample {CURL} Request-Example:
+ *	/api/v1/mop/applets-ecol-account/operation/review/detail/eiwaohoejojowjoajoeig
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *				"name":"企业名称",
+ *				"account":"企业账号",
+ *				"applyTime":1573813430,					//申请时间
+ *				"status":1,								//审核状态 1-已审核 2-未审核
+ *				"Reviewer":"wangkang",					//审核人 未审核时为空
+ *				"result":1,								//审核结果 1-通过认证 2-驳回
+ *				"refuseReason":"test",					//驳回原因
+ *				"createTime":1573813430,				//创建时间
+ *				"updateTime":1573813430,				//更新时间
+ *				"organId":"jaiojgiajg",					//企业唯一id,根据该id可获取企业详情
+ *				"socialCreditCode":"123232424",			//社会统一信用代码
+ *				"licenseNetdiskId":"afgagag",			//资格证书
+ *				"authorizationNetdiskId":"agagag",		//授权书
+ *				"adminInfo":{							//管理员信息
+ *					"name":"xingming",
+ *					"idCard":"610829382983984",
+ *					"phone":"jaogjaogjiajgiagji",
+ *				}
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/organ/:traceId  	[C/S]运营方获取企业账户详情
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  	{string}                   	traceId						对应ID
+ * @apiParamExample {json} Request-Example:
+ * /api/v1/mop/applets-ecol-account/operation/organ/jiajgoajgoaijgigj
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *			"info":{
+ *				"name":"finogeeks",
+ *				"account":"finogeeks123",
+ *				"accountStatus":1,
+ *				"socialCreditCode":"jaijgoajgoajg",
+ *				"licenseNetdiskId":"jaogaoijgoajg",
+ *				"authorizationNetdiskId":"jaojaij",
+ *				"createTime":,
+ *				"updateTime":,
+ *				"adminInfo":{
+ *					"name":"wangkang",
+ *					"idCard":"6108765566",
+ *					"phone":"123234567"
+ *				}
+ * 		}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/organlist  [C/S]运营方获取企业列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	type						拉取类型 appid管理为"appidManage" organ管理为"organManage"
+ * @apiParam   {string}                   	findData					公司账号或者公司名称
+ * @apiParam   {int}                   		accountStatus				企业状态(0-全部 1-审核中 2-未认证 3-已认证 4-已过期 5-已冻结)
+ * @apiParam   {int}                   		page						第几页
+ * @apiParam   {int}					   	num							每页数量
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"status":1,
+ *		"findData":"mingcheng",
+ *		"page": 2,
+ *		"num": 15,
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *			"total":15,
+ *			"totalInfo":{
+ *				"allTotal":15,		//总数
+ *				"reviewingNum":1,	//审核中
+ *				"noApporeNum":2,	//未认证
+ *				"hasApporeNum":3,	//已认证
+ *				"expiredNum":4,		//已过期
+ *				"hasFreeNum":5		//已冻结
+ *			},
+ *			"list":[
+ *					{
+ *						"name":"企业名称",
+ *						"account":"企业账号",
+ *						"accountStatus":2,						//企业状态 1-审核中 2-未认证 3-已认证 4-已过期 5-已冻结
+ *						"socialCreditCode":"123456788", 		//社会统一信用代码
+ *						"authorizationNetdiskId":"1234567jigj",	//资格证书
+ *						"LicenseNetdiskId":"jjajigjaogji",		//企业营业执照网盘ID
+ *						"refuseReason":"test",					//驳回原因
+ *						"expireDate":1573813430,				//过期时间
+ *						"createTime":1573813430,				//创建时间
+ *						"updateTime":1573813430,				//更新时间
+ *						"adminInfo":{							//企业管理员信息
+ *							"name":"xiangcun",
+ *							"idCard":"666671786283768657",
+ *							"phone":"178273648264"
+ *						},
+ *						"appidInfo":{
+ *							"allowApplyIdNum":10,			//允许申请的appid数量上限
+ *							"hasApplyIdNum"3,				//已经申请的appid数量
+ *							"upNumOper":"wangkang",			//更新申请数量的工作人员
+ *							"upNumTime":15902923095			//更新申请数量的时间(时间戳)
+ *						}
+ * 				}
+ *		]
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {post} /api/v1/mop/applets-ecol-account/operation/organ/update  	[C/S]运营方修改企业信息
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  	(RequestBody){string}                   	traceId						企业id
+ * @apiParam  	(RequestBody){array}                   		upData						更新的信息
+ * @apiParamExample {json} Request-Example:
+ * {
+ *		"traceId":"",
+ *		"upData":[
+ *			{"key":"allowApplyIdNum","value":1},	//更新appid上限的时候填这个就可以了
+ *			{"key":"hasApplyIdNum","value":2}
+ *		]
+ * }
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *
+ * 		}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {POST} /api/v1/mop/applets-ecol-account/operation/organ/add-appid-num  	[C/S]运营方增加企业已经使用的appid数量
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  	(RequestBody){string}                   	traceId						企业id
+ * @apiParam  	(RequestBody){int}                   		num						添加的数量
+ * @apiParamExample {json} Request-Example:
+ * {
+ *		"traceId":"agagahahjaojgiagj",
+ *		"num":1,
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *
+ * 		}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {POST} /api/v1/mop/applets-ecol-account/operation/review        [C/S]运营方认证企业
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	traceId						成员id
+ * @apiParam  (RequestBody) {int}                   	status					    1-通过认证 2-驳回
+ * @apiParam  (RequestBody) {string}                   	reason					    驳回原因
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"traceId": "abc123456",
+ *      "status":2,
+ *		"reason":"图片模糊",
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/deal/organ        				[C/S]运营方冻结/解冻企业账号
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	traceId						id
+ * @apiParam  (RequestBody) {int}                   	status						冻结-1 解冻-2
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"id": "abc123456",
+ *      "status":1
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/workerlist  [C/S]运营方获取工作人员列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	findData					电话号/姓名(支持模糊查询)
+ * @apiParam   {int}                   	page						第几页
+ * @apiParam   {int}				   		num							每页数量
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"name":"wangkang",
+ *		"phone":"1234567",
+ *		"page": 2,
+ *		"num": 15
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+			"total":2,
+			"list":[
+				{
+					"phone":"111111111",
+					"account":"zhangsan123",
+					"createTime":"2019-09-09 18:02:01"
+				},
+				{
+					"phone":"111111111",
+					"account":"zhangsan123",
+					"createTime":"2019-09-09 18:02:01"
+				}
+			],
+			"exp":""
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+*/
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/worker/detail/:workerId  [C/S]运营方获取工作人员详情
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  {string}				   		workerId							人员id
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+			"info":
+				{
+					"name":"zhnagsan",
+					"phone":"111111111",
+					"account":"zhangsan123",
+					"email":"www@jaojgia.com",
+					"idCard":"jaojiajgiaojgigi",
+				}
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+*/
+
+/**
+ * @api {POST} /api/v1/mop/applets-ecol-account/operation/worker/add  [C/S]运营方增加运营成员
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}				   	account					    账号
+ * @apiParam  (RequestBody) {string}				   	password					登录密码(md5 32位加密)
+ * @apiParam  (RequestBody) {string}				   	phone					    电话号
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"account":"lisi123",
+ *		"password": "5cff6f7c4357ee0001c96fab",
+ *		"phone":"12344556777"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {delete} /api/v1/mop/applets-ecol-account/operation/worker        [C/S]运营方删除运营成员
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	list						成员id列表
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"list": ["abc123456","bsc98765"]
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/worker      [C/S]运营方修改运营成员
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	traceId							成员id
+ * @apiParam  (RequestBody) {string}				   	account					    	账号
+ * @apiParam  (RequestBody) {string}				   	phone					    	电话号(加密)
+ * @apiParam  (RequestBody) {string}				   	verifyCode					    旧的验证码
+ * @apiParam  (RequestBody) {string}				   	newVerifyCode					新的验证码
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"id":"joajgoajgiaojgoaijg",
+ *		"account":"lisi123",
+ *		"phone":"12344556777",
+ *		"verifyCode":"850822",
+ *		"newVerifyCode":"850822"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/worker/deal        [C/S]运营方冻结/解冻运营成员
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	traceId						成员id
+ * @apiParam  (RequestBody) {int}                   	status					冻结-1 解冻-2
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"id": "abc123456",
+ *      "status":1
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/worker/reset/password      [C/S]运营方重置运营成员密码
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	traceId							成员id
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"traceId":"joajgoajgiaojgoaijg",
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/worker/phone/verify-code    [C/S]运营方获取验证码
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	traceId						    忘记密码时为空
+ * @apiParam   {string}                   	type							忘记密码时填"forget",确认修改成员信息时填"submit_modify"
+ * @apiParam   {string}                   	phone							加密之后的phone
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"traceId":"",
+ *		"type":"forget",
+ *		"phone":"joajgoiajgoijoajiogjiagj"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/worker/phone/check-code    [C/S]运营方校验验证码
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	type						    校验类型("modify":确认修改身份)
+ * @apiParam   {string}                   	phone						    电话
+ * @apiParam   {string}                   	verifyCode						验证码
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"type":"modify",
+ *		"phone":"oajgoajgiajgoajigoijgaoi",
+ *		"verifyCode":"12346",
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/worker/forgot/password      [C/S]运营方忘记密码修改密码
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	phone							电话(加密)
+ * @apiParam  (RequestBody) {string}                   	newPassword						新密码(加密)
+ * @apiParam  (RequestBody) {string}                   	verifyCode						验证码
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"phone":"oajgioajgoajgioagj",
+ *		"newPassword":"jaogjioajgiogj",
+ *		"verifyCode":"77879"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/worker/owner/up-phone     [C/S]运营方登陆人员修改手机号
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	verifyCode							验证码
+ * @apiParam  (RequestBody) {string}                   	oldPhone							旧电话
+ * @apiParam  (RequestBody) {string}				   	newPhone				    		新电话
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"verifyCode":"123123",
+ *		"oldPhoen": "12344556777",
+ *		"newPhone":"12344556777"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/worker/update/password     		[C/S]运营方修改账号密码
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	type								类型("admin" 与 "owner")
+ * @apiParam  (RequestBody) {string}                   	traceId								类型为"owner"为""
+ * @apiParam  (RequestBody) {string}                   	oldPassword							旧密码
+ * @apiParam  (RequestBody) {string}                   	newPassword							新密码
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"type":"owner",
+ *		"traceId":"",
+ *		"oldPassword": "12344556777",
+ *		"newPassword":" 12344556777"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/digital    [C/S]获取企业统计数据
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	pullType			拉取类型,用逗号分割
+ * @apiParam   {int64}                   	pullTime			拉取时间
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		//accCertCom-认证企业,accReviewCom-审核企业,accExpirCom-过期企业,accFreeCom-冻结企业,accHasCertCom-已认证、accNoCertCom未认证、accInReviewCom-审核中
+ *		"pullType":"accCertCom,accReviewCom,accExpirCom,accFreeCom",
+ *		"pullTime":"forget"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *			"accCertCom":12,
+ *			"accReviewCom":10,
+ *			"accExpirCom":1",
+ *			"accFreeCom":1
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/auth/check  					[C/S]运营方权限校验
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	account						没有前缀的账号
+ * @apiParam   {string}                   	auth						权限
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"account":"wangkang",
+ *		"auth":"addWorker"
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+ *			"hasAuth":true	//bool true-有权限 false-无权限
+ * 		}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/ftHelper/test-url  					[C/S]凡泰助手添加url时测试url是否可用接口
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParamExample {json} Request-Example:
+ *	{}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {
+ *       "result": "OK"
+ *   },
+ *   "errcode": "OK",
+ *   "error": ""
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/ftHelper/test-jwt-valid  					[C/S]凡泰助手测试jwt是否失效接口
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {Header}               Authorization						jwt(参数形式:Bearer+空格+jwt)
+ * @apiParamExample {TXT} Request-Example:
+ * /api/v1/mop/applets-ecol-account/operation/ftHelper/testJwtVaild
+ * req.Header.Add("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nz...")
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {
+ *       "result": "OK"
+ *   },
+ *   "errcode": "OK",
+ *   "error": ""
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 = 401 jwt缺失
+ * HTTP/1.1 = 403 jwt失效
+ */
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/limit  					[C/S]数量限制修改接口
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   (RequestBody){String="appId","binding","member"}    type 	修改类型 appId:appid数量 binding:应用数量 member:工作成员
+ * @apiParam   (RequestBody){Bool}    needNotify=false 	是否通知机构端
+ * @apiParam   (RequestBody){String}    organId 	机构Id
+ * @apiParam   (RequestBody){Number}    upNum 		修改的数量
+ * @apiParamExample {JSON} Request-Example:
+ * {
+ *	"type":"bind",
+ *  "needNotify":true,
+ *	"organId":"5e4bdb7e7af379000120f7e6",
+ *	"upNum":13
+ * }
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {},
+ *   "errcode": "OK",
+ *   "error": ""
+ *}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 != 200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/limit/appId    [C/S]获取小程序数量限制列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	searchTxt						查找条件-匹配企业名称
+ * @apiParam   {Number}                   	pageNo=1						页数(从1开始)
+ * @apiParam   {Number}                   	pageSize=50						每页数量
+ * @apiParamExample {CURL} Request-Example:
+ *	/api/v1/mop/applets-ecol-account/operation/limit/appId?serarchTxt=test&pageNo=1&pageSize=10
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {
+ *       "total": 9,
+ *       "list": [
+ *           {
+ *               "organId": "5e45f039a63c7c00019adc01",
+ *               "organName": "验证码错误",
+ *               "limitNum": 10,
+ *               "hasUseNum": 0,
+ *               "upMember": "",
+ *               "upTimestamp": 1581641785
+ *           }
+ *       ]
+ *   },
+ *   "errcode": "OK",
+ *   "error": ""
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/limit/binding    [C/S]获取应用限制列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                   	searchTxt						查找条件-匹配企业名称
+ * @apiParam   {Number}                   	pageNo=1						页数(从1开始)
+ * @apiParam   {Number}                   	pageSize=50						每页数量
+ * @apiParamExample {CURL} Request-Example:
+ *	/api/v1/mop/applets-ecol-account/operation/limit/binding?serarchTxt=test&pageNo=1&pageSize=10
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {
+ *       "total": 9,
+ *       "list": [
+ *           {
+ *               "organId": "5e45f039a63c7c00019adc01",
+ *               "organName": "验证码错误",
+ *               "limitNum": 10,
+ *               "hasUseNum": 0,
+ *               "upMember": "",
+ *               "upTimestamp": 1581641785
+ *           }
+ *       ]
+ *   },
+ *   "errcode": "OK",
+ *   "error": ""
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/limit/add-check  					[C/S]数量限制修改校验
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string="appId","binding","member"}    type 	修改类型 appId:appid数量 binding:应用数量 member:工作成员
+ * @apiParam   {string}    organId 	机构Id
+ * @apiParam   {Number}    addNum 		增加的数量
+ * @apiParamExample {CURL} Request-Example:
+ *  /api/v1/mop/applets-ecol-account/operation/limit/addCheck?type=appId&organId=jiajgoagji&addNum=1
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {},
+ *   "errcode": "OK",
+ *   "error": ""
+ *}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 != 200 服务端异常
+ * appId超出限制错误码:	FC_OPERA_LIMIT_APPID_OVER_ERROR,
+ * binding超出限制错误码:	FC_OPERA_LIMIT_BIND_OVER_ERROR,
+ * member超出限制错误码:	FC_OPERA_LIMIT_MEMBER_OVER_ERROR
+ */
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/personal/list  [C/S]获取个人账户列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam   {string}                 searchTxt					电话号/邮箱(精确查找)
+ * @apiParam   {int}                   	pageNo						第几页
+ * @apiParam   {int}				   	pageSize					每页数量
+ * @apiParamExample {CURL} Request-Example:
+ * /api/v1/mop/applets-ecol-account/operation/personal/list?searchTxt=&pageNo=1&pageSize=10
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *		"errcode": "OK",
+ *		"error": "",
+ *		"data": {
+			"total":2,
+			"list":[
+				{
+					"email":"zhnagsan@qq.com",
+					"phone":"111111111",
+					"registTime":1582109643,
+					"expireTime":1582109643
+				},
+				{
+					"email":"zhnagsan@qq.com",
+					"phone":"111111111",
+					"registTime":1582109643,
+					"expireTime":1582109643
+				}
+			],
+ *		}
+ * }
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+*/
+
+
+/**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/role/list [C/S][运营端]查询角色列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParamExample {json} Request-Example:
+ *	{
+	 	data : [
+			{
+				"id":"1231233123"
+				"name":"管理员"
+				"peopleNumber" 3
+			}
+	 	]
+ 	} 
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+ /**
+ * @api {POST} /api/v1/mop/applets-ecol-account/operation/role/add [C/S][运营端]新增角色
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  {string} 				name
+ * @apiParam  {[]string} 			authList 权限列表
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {},
+ *   "errcode": "OK",
+ *   "error": ""
+ *}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+ 
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/role/edit [C/S][运营端]配置角色权限
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  {string} 				id
+ * @apiParam  {[]string} 			authList 权限列表
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {},
+ *   "errcode": "OK",
+ *   "error": ""
+ *}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+ /**
+ * @api {DELETE} /api/v1/mop/applets-ecol-account/operation/role/delete [C/S][运营端]删除角色
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  {string} 				id
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {},
+ *   "errcode": "OK",
+ *   "error": ""
+ *}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+  /**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/operation/role/manage-account [C/S][运营端]角色中管理账号
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  {string} 				roleId
+ * @apiParam  {[]string} 			accountList 账号列表
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {
+ *   "data": {},
+ *   "errcode": "OK",
+ *   "error": ""
+ *}
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */
+
+
+ /**
+ * @api {GET} /api/v1/mop/applets-ecol-account/operation/auth/list [C/S][运营端]查询权限列表
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  {string} 				roleId
+ * @apiParamExample {json} Request-Example:
+ *	{
+	 	data : [
+			{
+				"id":"1231233123"
+				"name":"SDK管理"
+				"nameEn":"SSCCSDK"
+				"status" : 1
+				"childrens" : [
+					{
+						"id":"555555"
+						"name":"新增SDK"
+						"nameEn":"addSDK"
+						"status" : 1
+					},
+					{
+						"id":"66666"
+						"name":"SDK管理"
+						"nameEn":"ManageSDK"
+						"status" : 1
+					}
+				]
+			}
+	 	]
+ 	} 
+ * @apiErrorExample Error Status:
+ * HTTP/1.1 !=200 服务端异常
+ */

+ 831 - 0
docs/organ.go

@@ -0,0 +1,831 @@
+package docs
+
+/**
+ * @api {PUT} /api/v1/mop/applets-ecol-account/organ/register  [C/S]企业方账号注册
+ * @apiGroup Applets Ecol Account
+ * @apiVersion __API_VERSION__
+ * @apiParam  (RequestBody) {string}                   	phone			手机号
+ * @apiParam  (RequestBody) {string}				   	password		登录密码,需要通过md5加密
+ * @apiParam  (RequestBody) {string}				   	verifyCode		验证码
+ * @apiParam  (RequestBody) {bool}				   		isApp		true:代表移动端
+ * @apiParamExample {json} Request-Example:
+ *	{
+ *		"phone": "18589095302",
+ *		"password": "5cff6f7c4357ee0001c96fab",
+ *		"verifyCode":"123456",
+ *		"isApp":true
+ *	}
+ * @apiSuccessExample {json} Success Status:
+ * HTTP/1.1 200 OK
+ * {