瀏覽代碼

Merge branch 'feature/v4.7.55' of ssh://192.168.3.207:10022/qmx/jy into feature/v4.7.55

wangchuanjin 2 年之前
父節點
當前提交
6da89f1df8

+ 1 - 0
src/go.mod

@@ -122,3 +122,4 @@ require (
 	sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
 	sigs.k8s.io/yaml v1.2.0 // indirect
 )
+

+ 1 - 1
src/go.sum

@@ -1897,4 +1897,4 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
 sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
 sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
 xorm.io/builder v0.3.6/go.mod h1:LEFAPISnRzG+zxaxj2vPicRwz67BdhFreKg8yv8/TgU=
-xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM=
+xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM=

File diff suppressed because it is too large
+ 4 - 5
src/jfw/modules/bigmember/src/config.json


+ 8 - 2
src/jfw/modules/publicapply/src/attachmentdow/service/service.go

@@ -31,11 +31,14 @@ func (u *Dow) SupplyInfoFileDownload() {
 	}
 	r := func() Result {
 		userid := qu.ObjToString(u.GetSession("userId"))
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
 
-		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		BaseMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 		vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userid)
 		isPower := false
 		//大会员下载权限判断
@@ -116,11 +119,14 @@ func (u *Dow) Subdow() {
 	}
 	r := func() Result {
 		userid := qu.ObjToString(u.GetSession("userId"))
+		baseUserId := qu.Int64All(u.GetSession("base_user_id"))
+		entId := qu.Int64All(u.GetSession("entId"))
+		accountId := qu.Int64All(u.GetSession("accountId"))
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
 
-		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		BaseMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 		vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userid)
 
 		var (

+ 7 - 7
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -4,7 +4,6 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
-	"jy/src/jfw/modules/publicapply/src/grpc"
 	"log"
 	"strconv"
 	"strings"
@@ -436,22 +435,23 @@ func Power(userid string, baseUserId, entId, accountId int64) (bool, map[string]
 	isVip, isMember, isEnt, privatedata := false, false, false, false
 	vipstatus := 0
 	//isVip, isMember, isEnt, privatedata
-	resp := grpc.PowerCheck.Check("10000", userid, baseUserId, accountId, entId)
+	//resp := grpc.PowerCheck.Check("10000", userid, baseUserId, accountId, entId)
+	resp := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 	if resp != nil {
-		if resp.Vip.Status > 1 {
+		if resp.VipStatus > 1 {
 			vipstatus = 1
 			isVip = true
 		}
-		if resp.Vip.Upgrade > 0 && isVip {
+		if resp.Vip_BuySet.Upgrade > 0 && isVip {
 			vipstatus = 2
 		}
-		if resp.Member.Status > 0 {
+		if resp.Status > 0 {
 			isMember = true
 		}
-		if resp.Entniche.PowerSource != 1 && resp.Entniche.Status == 1 {
+		if resp.EntnicheStatus > 0 {
 			isEnt = true
 		}
-		privatedata = resp.Ent.PrivateGD
+		privatedata = resp.PrivateGD
 	}
 	return isVip || isEnt || isMember, map[string]interface{}{
 		"vip":         vipstatus,

+ 58 - 53
src/jfw/modules/publicapply/src/config.json

@@ -1,57 +1,62 @@
 {
-	"webPort": "828",
-    "mail": [
-        {
-            "addr": "smtp.exmail.qq.com",
-            "port": 465,
-            "pwd": "ue9Rg9Sf4CVtdm5a",
-            "user": "public03@topnet.net.cn"
-        },
-        {
-            "addr": "smtp.exmail.qq.com",
-            "port": 465,
-            "pwd": "ue9Rg9Sf4CVtdm5a",
-            "user": "public03@topnet.net.cn"
-        }
-    ],
-    "industry": "分类综合测试",
-    "frequency":"周-3",
-    "hotWords":["微信"],
-    "defaultEntList": [
-        "744fb1d7cc3561e11c639fcc2ad955c0",
-        "d47dc00fc4453115d4562ab7ce3144c2",
-        "eb1998800775782e1e80e55a325a42ca",
-        "118b315754f688151b1b2b82c2fb7511",
-        "dd049424278d809c5f5ebc1980c254bf",
-        "5e79625afc8952e7123459e9826ed3c1",
-        "372fd29ec10178affd656996ced9480f",
-        "11c4fe5273ab36ee4ee1a5b1a779d543",
-        "66264174942f9e958ee65b98bcd63f1b",
-        "bf2d5bb853e7935d9e8714a34b53cae1",
-        "8945af2c1a25e9138cb64774cf66fa4b",
-        "971ee9b68eb80fc001258d6bd0bbc57a",
-        "8426311c8e40dc50e5583ce686d4d5bc",
-        "434ab2c08bd8b8c84f2946dc9bae3630",
-        "899ba5bb52a17a92bb9b1868fe30cf08",
-        "c882c88dcb108f2445773b0aad030edc",
-        "ddb4a8abeebd2702a64d0aa4e9172e4a",
-        "ea5547e5826dac4253c00901019a31c5",
-        "9ae1bcd5e1c5c24631515a1193073fa5",
-        "4c9a591604f1a3eb74857fc9de35e9ff",
-        "3613232bc702d011232ed57f0027af1c"
-
-    ],
-    "bidSearchOldUserLimit": 1626105600,
-    "attachmentRPC":"192.168.3.206:10082",
-    "followPushRpc": "127.0.0.1:8759",
-    "file_number": 10,
-    "smsServiceRpc":"127.0.0.1:932",
-    "fileSignBool":true,
-    "followCustomer": {
-      "customerNumb": 10,
-      "enterpriseNumb": 500
+  "webPort": "828",
+  "mail": [
+    {
+      "addr": "smtp.exmail.qq.com",
+      "port": 465,
+      "pwd": "ue9Rg9Sf4CVtdm5a",
+      "user": "public03@topnet.net.cn"
     },
-    "tipInfo":{
-    	"box_moving":1670774400
+    {
+      "addr": "smtp.exmail.qq.com",
+      "port": 465,
+      "pwd": "ue9Rg9Sf4CVtdm5a",
+      "user": "public03@topnet.net.cn"
     }
+  ],
+  "industry": "分类综合测试",
+  "frequency": "周-3",
+  "hotWords": [
+    "微信"
+  ],
+  "defaultEntList": [
+    "744fb1d7cc3561e11c639fcc2ad955c0",
+    "d47dc00fc4453115d4562ab7ce3144c2",
+    "eb1998800775782e1e80e55a325a42ca",
+    "118b315754f688151b1b2b82c2fb7511",
+    "dd049424278d809c5f5ebc1980c254bf",
+    "5e79625afc8952e7123459e9826ed3c1",
+    "372fd29ec10178affd656996ced9480f",
+    "11c4fe5273ab36ee4ee1a5b1a779d543",
+    "66264174942f9e958ee65b98bcd63f1b",
+    "bf2d5bb853e7935d9e8714a34b53cae1",
+    "8945af2c1a25e9138cb64774cf66fa4b",
+    "971ee9b68eb80fc001258d6bd0bbc57a",
+    "8426311c8e40dc50e5583ce686d4d5bc",
+    "434ab2c08bd8b8c84f2946dc9bae3630",
+    "899ba5bb52a17a92bb9b1868fe30cf08",
+    "c882c88dcb108f2445773b0aad030edc",
+    "ddb4a8abeebd2702a64d0aa4e9172e4a",
+    "ea5547e5826dac4253c00901019a31c5",
+    "9ae1bcd5e1c5c24631515a1193073fa5",
+    "4c9a591604f1a3eb74857fc9de35e9ff",
+    "3613232bc702d011232ed57f0027af1c"
+  ],
+  "bidSearchOldUserLimit": 1626105600,
+  "attachmentRPC": "192.168.3.206:10082",
+  "followPushRpc": "127.0.0.1:8759",
+  "file_number": 10,
+  "smsServiceRpc": "127.0.0.1:932",
+  "fileSignBool": true,
+  "followCustomer": {
+    "customerNumb": 10,
+    "enterpriseNumb": 500
+  },
+  "tipInfo": {
+    "box_moving": 1670774400
+  },
+  "etcd": {
+    "hosts": "192.168.3.206:27080",
+    "key": "powercheck.rpc"
+  }
 }

+ 0 - 5
src/jfw/modules/publicapply/src/config.yaml

@@ -1,5 +0,0 @@
-etcd:
-  hosts:
-  - 192.168.3.206:2379
-powercheckKey: "powercheck.rpc" #权限校验中台rpc
-userCenterKey: "usercenter.rpc" #用户中台rpc

+ 4 - 0
src/jfw/modules/publicapply/src/config/config.go

@@ -31,6 +31,10 @@ type config struct {
 	}
 	ExhibitionLog string
 	TipInfo       map[string]int64
+	Etcd          struct {
+		Hosts string `json:"hosts"`
+		Key   string `json:"key"`
+	} `json:"etcd"`
 }
 type BidColl struct {
 	PayUserCollLimit      int    //付费用户收藏数量最大限制

+ 10 - 8
src/jfw/modules/publicapply/src/customer/entity/entiy.go

@@ -16,12 +16,14 @@ import (
 )
 
 type CustomerOperation struct {
-	UserId   string `json:"userId"`
-	EntId    int    `json:"entId"`
-	Name     string `json:"name"`
-	Province string `json:"province"`
-	City     string `json:"city"`
-	B        bool   `json:"b"` //true 取关;默认 false 关注。
+	UserId     string `json:"userId"`
+	EntId      int    `json:"entId"`
+	Name       string `json:"name"`
+	Province   string `json:"province"`
+	City       string `json:"city"`
+	B          bool   `json:"b"` //true 取关;默认 false 关注。
+	BaseUserId int64
+	AccountId  int64
 }
 
 func NewCustomerOperation() CustomerOperation {
@@ -94,7 +96,7 @@ func (this *CustomerOperation) CList(pageSize, pageNo, entUserId int, keyword, i
 	}
 
 	//大会员客户关注上限
-	BigMsg := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
+	BigMsg := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, qu.Int64All(this.EntId), config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 	entVip := jy.GetEntnicheState(this.UserId, db.Mysql, db.Mgo)
 	customerMap := map[string]interface{}{}
 	if entVip.EntnicheStatus > 0 {
@@ -175,7 +177,7 @@ func (this *CustomerOperation) CheckPower() string {
 		msg = "登录异常"
 	} else {
 		//查询是否是大会员
-		if userPower := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo); userPower.Status > 0 {
+		if userPower := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, qu.Int64All(this.EntId), config.Config.Etcd.Hosts, config.Config.Etcd.Key); userPower.Status > 0 {
 			count := redis.GetInt(redisName, fmt.Sprintf(redisCountKey, this.UserId))
 			if count < 1 {
 				query := map[string]interface{}{

+ 13 - 2
src/jfw/modules/publicapply/src/customer/service/service.go

@@ -57,6 +57,9 @@ func (this *ServiceStruct) Exclude() {
 // 关注客户列表
 func (this *ServiceStruct) CstList() {
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+	entId := qu.IntAll(this.GetSession("entId"))
+	accountId := qu.Int64All(this.GetSession("accountId"))
 	defer qu.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
@@ -64,6 +67,9 @@ func (this *ServiceStruct) CstList() {
 		}
 		cotion := entity.NewCustomerOperation()
 		cotion.UserId = userId
+		cotion.AccountId = accountId
+		cotion.BaseUserId = baseUserId
+		cotion.EntId = entId
 		entUserId := qu.IntAll(this.GetSession("entUserId")) //获取企业id
 		pageSize, _ := this.GetInteger("pagesize")
 		pageNo, _ := this.GetInteger("pageno")
@@ -86,6 +92,9 @@ func (this *ServiceStruct) CstList() {
 // 关注or取关客户
 func (this *ServiceStruct) CstAtt() {
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+	entId := qu.IntAll(this.GetSession("entId"))
+	accountId := qu.Int64All(this.GetSession("accountId"))
 	defer qu.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
@@ -101,8 +110,10 @@ func (this *ServiceStruct) CstAtt() {
 			return Result{Data: nil, Error_msg: Error_msg_1003}
 		}
 		cotion.UserId = userId
-		cotion.EntId = qu.IntAll(this.GetSession("entId"))
-
+		cotion.EntId = entId
+		cotion.UserId = userId
+		cotion.AccountId = accountId
+		cotion.BaseUserId = baseUserId
 		msg := cotion.CheckPower()
 		if !cotion.B && msg != "" {
 			return Result{Data: false, Error_msg: msg}

+ 5 - 2
src/jfw/modules/publicapply/src/enterpriseSearch/service/search.go

@@ -1,7 +1,7 @@
 package service
 
 import (
-	"jy/src/jfw/modules/publicapply/src/db"
+	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/enterpriseSearch/entity"
 	"log"
 
@@ -19,6 +19,9 @@ type EnterpriseSearchAction struct {
 // DoEntSearch 企业搜索
 func (esa *EnterpriseSearchAction) DoEntSearch() {
 	userId, _ := esa.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(esa.GetSession("base_user_id"))
+	entId := qutil.Int64All(esa.GetSession("entId"))
+	accountId := qutil.Int64All(esa.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entSearch, err := (&entity.EnterpriseSearch{
 			Match:       esa.GetString("match"),
@@ -39,7 +42,7 @@ func (esa *EnterpriseSearchAction) DoEntSearch() {
 			return nil, err
 		}
 		//查询是否是会员
-		if vipData := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo); vipData.Status > 0 || vipData.VipStatus > 0 {
+		if vipData := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key); vipData.Status > 0 || vipData.VipStatus > 0 {
 			entSearch.IsVip = true
 		}
 		//查询

+ 18 - 19
src/jfw/modules/publicapply/src/go.mod

@@ -3,20 +3,18 @@ module jy/src/jfw/modules/publicapply/src
 go 1.18
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20230109053435-fe962d69e751
-	app.yhyue.com/moapp/jypkg v0.0.0-20230109081446-6622f5a8b068
-	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4
-	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979
+	app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170
+	app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
-	github.com/gogf/gf/v2 v2.2.6
-	github.com/zeromicro/go-zero v1.4.3
+	github.com/gogf/gf/v2 v2.0.6
 	go.mongodb.org/mongo-driver v1.11.1
 )
 
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
-	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
-	github.com/BurntSushi/toml v1.1.0 // indirect
+	app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c // indirect
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4 // indirect
+	github.com/BurntSushi/toml v0.4.1 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
 	github.com/cespare/xxhash/v2 v2.1.2 // indirect
@@ -28,7 +26,7 @@ require (
 	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
 	github.com/fatih/color v1.13.0 // indirect
 	github.com/felixge/fgprof v0.9.3 // indirect
-	github.com/fsnotify/fsnotify v1.5.4 // indirect
+	github.com/fsnotify/fsnotify v1.5.1 // indirect
 	github.com/garyburd/redigo v1.6.2 // indirect
 	github.com/go-logr/logr v1.2.3 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
@@ -52,7 +50,7 @@ require (
 	github.com/jinzhu/now v1.1.1 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
-	github.com/magiconair/properties v1.8.6 // indirect
+	github.com/longbridgeapp/sqlparser v0.3.1 // indirect
 	github.com/mattn/go-colorable v0.1.9 // indirect
 	github.com/mattn/go-isatty v0.0.14 // indirect
 	github.com/mattn/go-runewidth v0.0.13 // indirect
@@ -78,17 +76,18 @@ require (
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
+	github.com/zeromicro/go-zero v1.4.3 // indirect
 	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
 	go.etcd.io/etcd/client/v3 v3.5.5 // indirect
-	go.opentelemetry.io/otel v1.11.0 // indirect
-	go.opentelemetry.io/otel/exporters/jaeger v1.11.0 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 // indirect
-	go.opentelemetry.io/otel/exporters/zipkin v1.11.0 // indirect
-	go.opentelemetry.io/otel/sdk v1.11.0 // indirect
-	go.opentelemetry.io/otel/trace v1.11.0 // indirect
+	go.opentelemetry.io/otel v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/jaeger v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/zipkin v1.10.0 // indirect
+	go.opentelemetry.io/otel/sdk v1.10.0 // indirect
+	go.opentelemetry.io/otel/trace v1.10.0 // indirect
 	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/automaxprocs v1.5.1 // indirect
@@ -98,7 +97,7 @@ require (
 	golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
 	golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
 	golang.org/x/sync v0.1.0 // indirect
-	golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
+	golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
 	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
 	golang.org/x/text v0.4.0 // indirect
 	golang.org/x/time v0.3.0 // indirect

+ 20 - 130
src/jfw/modules/publicapply/src/go.sum

@@ -1,38 +1,15 @@
 app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d h1:WPsYuuptAd3UEgN+jPzpnsDe/OvcshDUUtOTZPYGSJ8=
 app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d/go.mod h1:91/lSD/hS+ckMVP3WdidRzDhC60lLMdyce9QHy0cSMA=
-app.yhyue.com/moapp/jyInfo v1.0.0/go.mod h1:+RjyGNvk7PT1P8cglkVlaj1lLlBXuPB+f5LipoOtgPs=
 app.yhyue.com/moapp/jyPoints v1.1.1/go.mod h1:SvP8p5L3jGrejHiH2LXfgCg/NPlFiKBC5Yd0gsI12FU=
-app.yhyue.com/moapp/jybase v0.0.0-20220415064050-37ce64b3e2d4/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
-app.yhyue.com/moapp/jybase v0.0.0-20220418104200-46c3fff161c7/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
-app.yhyue.com/moapp/jybase v0.0.0-20220419023055-f406279ff7e3/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
-app.yhyue.com/moapp/jybase v0.0.0-20220420032112-668025915ee4/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
-app.yhyue.com/moapp/jybase v0.0.0-20220421060131-a1001013ba46/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
 app.yhyue.com/moapp/jybase v0.0.0-20220427020729-974c1a148186/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
-app.yhyue.com/moapp/jybase v0.0.0-20220719064915-2fef79005dfa/go.mod h1:FjBF25AYoBrPhVKTXGXWcmEAbBT0ATTK6KJMOA+I80Q=
-app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tcD9TcKb/HOP2BLbzppyDz2kpQSFhPMQTUgbQ=
-app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jybase v0.0.0-20230109053435-fe962d69e751 h1:Z3Ye/xauzer3FymqIElv9/iEIfDOUkQBfnQPcKthoSc=
-app.yhyue.com/moapp/jybase v0.0.0-20230109053435-fe962d69e751/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230109081446-6622f5a8b068 h1:+sZ9yGrMPsetT8DTdRiHTkK+wnFgNClvPzNdkPewdBw=
-app.yhyue.com/moapp/jypkg v0.0.0-20230109081446-6622f5a8b068/go.mod h1:n2XBXZGvxUuc4AZMeMYUZuK7ayrwDQ7UdrZd6AJkUVM=
-app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
-app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
-bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
-bp.jydev.jianyu360.cn/BaseService/gateway v0.0.0-20220419090715-88ddb32961be/go.mod h1:Yj4oabIGItuMoF0BXYLz2XAnF581kxgXBrvlUtIJrkI=
-bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4/go.mod h1:BMLd/5wb3BIEGhnEgF9y1sJN9P5/Dw9kYsoiE9V8I9g=
+app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170 h1:gjx6+x7P1Vp/++OyfuEdR3Bcjj4/HrgIaRnE1cMTP3k=
+app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170/go.mod h1:efAeRPDpJ13JuNODuqtfLlKQSQgCbnUcwGPzhFU5krY=
+app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c h1:3tmWsZPTkhmkPJ1fbDLqrklgnooC1DRNwsjxEoMYbwg=
+app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c/go.mod h1:7D6zNxrg+Tma3VC43TLu7XPczubl4uJavua89kaFS1Q=
+app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c h1:CrcvbsXZ4aQkNikBi7FUUQZNnY8hKsNo2LLe/SqeXs8=
+app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4 h1:Xv1D9avDKeaM5kQTisF/pIt8y7B7yQ/hAxuWEg75LMs=
 bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4/go.mod h1:5nimT8GJh46AyfeeDeyRlDQygMlO7TRM8Pwm41Gxemc=
-bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220418005748-8ba5d936dd53/go.mod h1:E5lcDI3k4FESLxiAetCfWQTq8qfpy9cv0yN1oKoEO34=
-bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220419023723-0b32d4a41751/go.mod h1:6KL5LMEku83uRbre0W/bj5kXG2I6pJGBFtktmtp51yM=
-bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220419063004-233fc7ce006c/go.mod h1:6KL5LMEku83uRbre0W/bj5kXG2I6pJGBFtktmtp51yM=
-bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220420075831-0b59892e9982/go.mod h1:wsHNO91h37H+xE4ZNny0yd7mtpODeDJxbVYhIRMR+qw=
-bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.3/go.mod h1:Z353aucNO5hH4ZYjeKST3kE1PN3W8/uPc4J8s0Upz40=
-bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4/go.mod h1:rRiGzKG4F/fmkNxXQCxrkxNWc8yf1SmW8qWCKfGIQSM=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220418072311-2062bed1e700/go.mod h1:KjcrxTzM96tBc6G4B8tlLBn1lrVy5UJYF8+eTdP4xAE=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220421015128-4a36f3eac5c5/go.mod h1:GT0QC4aaKDuXxAvaU4G02XjCc31TU1ctqBGqxQYOfC4=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220905055615-8540037e1b06/go.mod h1:LS21iwbgP8i3ZHJ1n4yNpLXQ/nzEudUOk0klC6VM2dQ=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979 h1:hC97JNmBonTAsnDH4XMWLXVqWdo85tCo0ge04cy0e4E=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
@@ -397,24 +374,17 @@ cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vf
 cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA=
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
-github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw=
 github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA=
-github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
-github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A=
 github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
 github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
-github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
 github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
-github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
 github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
 github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
 github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
-github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I=
-github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
-github.com/ClickHouse/clickhouse-go v1.5.1/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
 github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
 github.com/ClickHouse/clickhouse-go/v2 v2.0.14/go.mod h1:iq2DUGgpA4BBki2CVwrF8x43zqBjdgHtbexkFkh5a6M=
 github.com/ClickHouse/clickhouse-go/v2 v2.2.0/go.mod h1:8f2XZUi7XoeU+uPIytSi1cvx8fmJxi7vIgqpvYTF1+o=
@@ -422,7 +392,6 @@ github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q
 github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
-github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
 github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67 h1:x98/gnpyNAiuvg/gX3KgdfKxnZj3t9pIl3BCVJg3qwg=
@@ -440,12 +409,9 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/miniredis/v2 v2.14.1/go.mod h1:uS970Sw5Gs9/iK3yBg0l9Uj9s25wXxSpQUE9EaJ/Blg=
-github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I=
 github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
 github.com/alicebob/miniredis/v2 v2.23.1 h1:jR6wZggBxwWygeXcdNyguCOCIjPsZyNUNlAkTx2fu0U=
 github.com/alicebob/miniredis/v2 v2.23.1/go.mod h1:84TWKZlxYkfgMucPBf5SOQBYJceZeQRFIaQgNMiCX6Q=
-github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
-github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
 github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y=
@@ -454,7 +420,6 @@ github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb
 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
 github.com/aws/aws-sdk-go v1.35.20/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
-github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
 github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
 github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -505,11 +470,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
 github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f h1:q/DpyjJjZs94bziQ7YkBmIlpqbVP7yw179rnzoNVX1M=
 github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f/go.mod h1:QGrK8vMWWHQYQ3QU9bw9Y9OPNfxccGzfb41qjvVeXtY=
 github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM=
-github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
-github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
 github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4/go.mod h1:L7S4x0R7vv3xoOhGuyAJyCO2MYzWOpccM4Isn8jIUgY=
 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
@@ -531,12 +494,9 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m
 github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
 github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
-github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
 github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
-github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
 github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
 github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
 github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
@@ -549,14 +509,11 @@ github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03D
 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
 github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
-github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
-github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
-github.com/fullstorydev/grpcurl v1.8.6/go.mod h1:WhP7fRQdhxz2TkL97u+TCb505sxfH78W1usyoB3tepw=
 github.com/fullstorydev/grpcurl v1.8.7/go.mod h1:pVtM4qe3CMoLaIzYS8uvTuDj2jVYmXqMUkZeijnXp/E=
 github.com/garyburd/redigo v1.6.2 h1:yE/pwKCrbLpLpQICzYTeZ7JsTA/C53wFTJHaEtRqniM=
 github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
-github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
@@ -571,7 +528,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V
 github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
 github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
 github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
-github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
 github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
 github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
 github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -583,12 +539,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
 github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
 github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
 github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
-github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
 github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
 github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
-github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
-github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
 github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
 github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w=
@@ -602,6 +554,7 @@ github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ
 github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
+github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M=
 github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
 github.com/go-xorm/builder v0.3.4/go.mod h1:KxkQkNN1DpPKTedxXyTQcmH+rXfvk4LZ9SOOBoZBAxw=
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
@@ -633,20 +586,17 @@ github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY9
 github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
 github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
+github.com/gogf/gf/v2 v2.0.6 h1:2etb4FMpbQKWIJO+UjtIWrZUp01HUsFb6Po8pgizAWk=
 github.com/gogf/gf/v2 v2.0.6/go.mod h1:8uYzw7qNzuq8vrhVlWke1b1925FFqOJIgmyYW1sr/0M=
-github.com/gogf/gf/v2 v2.2.6 h1:KS8sPTiHzOfIqQNmdXmfEA9F2KWlBEPHKlM7wTDKlF0=
-github.com/gogf/gf/v2 v2.2.6/go.mod h1:thvkyb43RWUu/m05sRm4CbH9r7t7/FrW2M56L9Ystwk=
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
 github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
 github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
 github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
 github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU=
 github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
-github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
 github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
@@ -752,12 +702,10 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99
 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
 github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
 github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
-github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
 github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU=
 github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw=
 github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA=
 github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
-github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
 github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
 github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
 github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
@@ -805,14 +753,11 @@ github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJk
 github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI=
 github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI=
 github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ=
-github.com/jhump/protoreflect v1.10.3/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg=
 github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E=
 github.com/jhump/protoreflect v1.12.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI=
 github.com/jhump/protoreflect v1.14.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI=
-github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
 github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
-github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E=
 github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
@@ -853,20 +798,16 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn
 github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
 github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
-github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
-github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
+github.com/longbridgeapp/sqlparser v0.3.1 h1:iWOZWGIFgQrJRgobLXUNJdvqGRpbVXkyKUKUA5CNJBE=
 github.com/longbridgeapp/sqlparser v0.3.1/go.mod h1:GIHaUq8zvYyHLCLMJJykx1CdM6LHtkUih/QaJXySSx4=
-github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
-github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
@@ -877,7 +818,6 @@ github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kN
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
 github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
 github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
 github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
 github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
@@ -893,7 +833,6 @@ github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4
 github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
 github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
-github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
@@ -915,7 +854,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW
 github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
 github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
-github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso=
 github.com/nsqio/go-nsq v1.1.0 h1:PQg+xxiUjA7V+TLdXw7nVrJ5Jbl3sN86EhGCQj4+FYE=
 github.com/nsqio/go-nsq v1.1.0/go.mod h1:vKq36oyeVXgsS5Q8YEO7WghqidAVXQlcFxzQbQTuDEY=
 github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
@@ -931,7 +869,6 @@ github.com/olivere/elastic/v7 v7.0.22/go.mod h1:VDexNy9NjmtAkrjNoI7tImv7FR4tf5zU
 github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
 github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
@@ -941,7 +878,6 @@ github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3
 github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
 github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
 github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
@@ -950,7 +886,6 @@ github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
 github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
-github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
 github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw=
 github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
 github.com/paulmach/orb v0.5.0/go.mod h1:FWRlTgl88VI1RBx/MkrwWDRhQ96ctqMCh8boXhmqB/A=
@@ -996,7 +931,6 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
-github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
 github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
 github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
 github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
@@ -1023,7 +957,6 @@ github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
 github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
 github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
 github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
@@ -1053,7 +986,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
 github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
 github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -1103,34 +1035,27 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
-github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ=
 github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
 github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
-github.com/zeromicro/go-zero v1.3.2/go.mod h1:DEj3Fwj1Ui1ltsgf6YqwTL9nD4+tYzIRX0c1pWtQo1E=
 github.com/zeromicro/go-zero v1.3.5/go.mod h1:wh4o794b7Ul3W0k35Pw9nc3iB4O0OpaQTMQz/PJc1bc=
-github.com/zeromicro/go-zero v1.4.0/go.mod h1:1amLn98K7c6FLntb9f8hdmq26ajtolOg4DTFWnRt54o=
 github.com/zeromicro/go-zero v1.4.3 h1:sTQ++6fxQHJnpGCN7h2CUrhWmbvhBqEgE75cJl635SM=
 github.com/zeromicro/go-zero v1.4.3/go.mod h1:UmDjuW7LHd9j7+nnnPBcXF0HLNmjJw6OjHPTlSp7X7Y=
 github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
 go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
 go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM=
-go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
 go.etcd.io/etcd/api/v3 v3.5.5 h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0=
 go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8=
-go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
 go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
 go.etcd.io/etcd/client/pkg/v3 v3.5.5 h1:9S0JUVvmrVl7wCF39iTQthdaaNIiAaQbmK75ogO6GU8=
 go.etcd.io/etcd/client/pkg/v3 v3.5.5/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ=
-go.etcd.io/etcd/client/v3 v3.5.2/go.mod h1:kOOaWFFgHygyT0WlSmL8TJiXmMysO/nNUlEsSsN6W4o=
 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
 go.etcd.io/etcd/client/v3 v3.5.5 h1:q++2WTJbUgpQu4B6hCuT7VkdwaTP7Qz6Daak3WzbrlI=
 go.etcd.io/etcd/client/v3 v3.5.5/go.mod h1:aApjR4WGlSumpnJ2kloS75h6aHUmAyaPLjHMxpc7E7c=
 go.mongodb.org/mongo-driver v1.5.0/go.mod h1:boiGPFqyBs5R0R5qf2ErokGRekMfwn+MqKaUyHs7wy0=
 go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
-go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
 go.mongodb.org/mongo-driver v1.11.1 h1:QP0znIRTuL0jf1oBQoAoM0C6ZJfBK4kx0Uumtv1A7w8=
 go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8=
 go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
@@ -1145,47 +1070,31 @@ go.opentelemetry.io/otel v1.0.0/go.mod h1:AjRVh9A5/5DE7S+mZtTR6t8vpKKryam+0lREnf
 go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs=
 go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
 go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM=
-go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo=
+go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
 go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
-go.opentelemetry.io/otel v1.11.0 h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk=
-go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk=
-go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc=
 go.opentelemetry.io/otel/exporters/jaeger v1.8.0/go.mod h1:GbWg+ng88rDtx+id26C34QLqw2erqJeAjsCx9AFeHfE=
-go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs=
+go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw=
 go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA=
-go.opentelemetry.io/otel/exporters/jaeger v1.11.0 h1:Sv2valcFfMlfu6g8USSS+ZUN5vwbuGj1aY/CFtMG33w=
-go.opentelemetry.io/otel/exporters/jaeger v1.11.0/go.mod h1:nRgyJbgJ0hmaUdHwyDpTTfBYz61cTTeeGhVzfQc+FsI=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
 go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 h1:0dly5et1i/6Th3WHn0M6kYiJfFNzhhxanrJ0bOfnjEo=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0/go.mod h1:+Lq4/WkdCkjbGcBMVHHg2apTbv8oMBf29QCnyCCJjNQ=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 h1:eyJ6njZmH16h9dOKCi7lMswAnGsSOwgTqWzfxqcuNr8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0/go.mod h1:FnDp7XemjN3oZ3xGunnfOUTVwd2XcvLbtRAuOSU3oc8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 h1:j2RFV0Qdt38XQ2Jvi4WIsQ56w8T7eSirYbMw19VXRDg=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0/go.mod h1:pILgiTEtrqvZpoiuGdblDgS5dbIaTgDrkIuKfEFkt+A=
-go.opentelemetry.io/otel/exporters/zipkin v1.3.0/go.mod h1:LxGGfHIYbvsFnrJtBcazb0yG24xHdDGrT/H6RB9r3+8=
 go.opentelemetry.io/otel/exporters/zipkin v1.8.0/go.mod h1:0uYAyCuGT67MFV9Z/Mmx93wGuugHw0FbxMc74fs3LNo=
-go.opentelemetry.io/otel/exporters/zipkin v1.9.0/go.mod h1:HyIvYIu37wV4Wx5azd7e05x9k/dOz9KB4x0plw2QNvs=
+go.opentelemetry.io/otel/exporters/zipkin v1.10.0 h1:HcPAFsFpEBKF+G5NIOA+gBsxifd3Ej+wb+KsdBLa15E=
 go.opentelemetry.io/otel/exporters/zipkin v1.10.0/go.mod h1:HdfvgwcOoCB0+zzrTHycW6btjK0zNpkz2oTGO815SCI=
-go.opentelemetry.io/otel/exporters/zipkin v1.11.0 h1:v/Abo5REOWrCj4zcEIUHFZtXpsCVjrwZj28iyX2rHXE=
-go.opentelemetry.io/otel/exporters/zipkin v1.11.0/go.mod h1:unWnsLCMYfINP8ue0aXVrB/GYHoXNn/lbTnupvLekGQ=
 go.opentelemetry.io/otel/sdk v1.0.0/go.mod h1:PCrDHlSy5x1kjezSdL37PhbFUMjrsLRshJ2zCzeXwbM=
 go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs=
-go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU=
 go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c=
-go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4=
+go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
 go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE=
-go.opentelemetry.io/otel/sdk v1.11.0 h1:ZnKIL9V9Ztaq+ME43IUi/eo22mNsb6a7tGfzaOWB5fo=
-go.opentelemetry.io/otel/sdk v1.11.0/go.mod h1:REusa8RsyKaq0OlyangWXaw97t2VogoO4SSEeKkSTAk=
 go.opentelemetry.io/otel/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs=
 go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk=
 go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
 go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4=
-go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo=
+go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
 go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
-go.opentelemetry.io/otel/trace v1.11.0 h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI=
-go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U=
 go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
 go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
 go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
@@ -1216,10 +1125,8 @@ golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACk
 golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
 golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -1266,7 +1173,6 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1392,7 +1298,6 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1425,7 +1330,6 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1469,9 +1373,8 @@ golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg=
 golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
-golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -1494,9 +1397,7 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
 golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -1517,7 +1418,6 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn
 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@@ -1547,10 +1447,8 @@ golang.org/x/tools v0.0.0-20200410132612-ae9902aceb98/go.mod h1:EkVYQZoAsY45+roY
 golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
@@ -1799,7 +1697,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
@@ -1856,25 +1753,19 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-k8s.io/api v0.20.12/go.mod h1:A2brwyEkVLM3wQGNnzoAa5JsQRzHK0uoOQ+bsnv7V68=
 k8s.io/api v0.22.9 h1:PidjRtgd0zDa6SvyooBLH/SP62uOhEBY0kx0UYRGr1o=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
-k8s.io/apimachinery v0.20.12/go.mod h1:uM7hCI0NyBymUwgshMgZyte475lxhr+QH6h3cvdnzEc=
 k8s.io/apimachinery v0.22.9 h1:5qjnpBk6eC9me0SAzokCUMI0KVF2PENK1PnykF8/Gjo=
 k8s.io/apimachinery v0.22.9/go.mod h1:ZvVLP5iLhwVFg2Yx9Gh5W0um0DUauExbRhe+2Z8I1EU=
-k8s.io/client-go v0.20.12/go.mod h1:NBJj6Evp73Xy/4v/O/RDRaH0+3JoxNfjRxkyRgrdbsA=
 k8s.io/client-go v0.22.9 h1:5p2R2LsoBfaE6QnXfWFmyyvxrFXtfegUGRMZSpTI+Q8=
 k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k=
 k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
 k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
-k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
 k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
 k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
 k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
 k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM=
 k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
-k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20220706174534-f6158b442e7c/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJOIfnislxYlqTj8=
@@ -1883,7 +1774,6 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
 sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
-sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
 sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y=
 sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4=
 sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

+ 0 - 40
src/jfw/modules/publicapply/src/grpc/powerCheckCenter.go

@@ -1,40 +0,0 @@
-package grpc
-
-import (
-	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
-	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
-	"context"
-	"github.com/gogf/gf/v2/frame/g"
-	"github.com/gogf/gf/v2/os/gctx"
-	"github.com/zeromicro/go-zero/core/discov"
-	"github.com/zeromicro/go-zero/zrpc"
-	"log"
-)
-
-var PowerCheck = &powerCheck{}
-
-type powerCheck struct {
-}
-
-func (p *powerCheck) Check(appid, userId string, baseUserId, accountId, entId int64) *pb.CheckResp {
-	var ctx = gctx.New()
-	client, err := zrpc.NewClient(zrpc.RpcClientConf{
-		Etcd: discov.EtcdConf{
-			Hosts: g.Cfg().MustGet(ctx, "etcd.hosts").Strings(),
-			Key:   g.Cfg().MustGet(ctx, "powercheckKey").String(),
-		},
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	defer client.Conn().Close()
-	resp, err := powercheck.NewPowerCheck(client).Check(context.Background(), &pb.CheckReq{
-		Appid:      appid,
-		Userid:     userId,
-		BaseUserId: baseUserId,
-		AccountId:  accountId,
-		EntId:      entId,
-	})
-	return resp
-}

+ 939 - 934
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -1,1010 +1,1015 @@
 package entity
 
 import (
-        qutil "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-        "fmt"
-        "jy/src/jfw/modules/publicapply/src/db"
-        "jy/src/jfw/modules/publicapply/src/util"
-        "strconv"
-        "strings"
-        "time"
-
-        "go.mongodb.org/mongo-driver/bson"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/config"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"jy/src/jfw/modules/publicapply/src/util"
+	"strconv"
+	"strings"
+	"time"
+
+	"go.mongodb.org/mongo-driver/bson"
 )
 
 type KeyWordsSet struct {
-        ClassifyIndex string   //分类索引
-        ClassifyName  string   //分类名称
-        KeyWordIndex  string   //关键词索引
-        KeyWordName   string   //关键词名称
-        ActionType    string   //操作类型 SK:保存/修改关键词; DK:删除关键词; SC:保存/修改分类  DC:删除分类
-        AppendKeyWord []string //附加词
-        NotKeyWord    []string //排除词
-        MatchWay      int      // 单个关键词匹配方事 0:精准匹配 1:模糊匹配
-        KeyWordsCount string   //是否是首次添加关键词
-        Type          string   // 大会员/超级订阅
-        UserId        string   //用户id
-        DeleteKey     string   //删除的关键词 json字符串{"0":"1,2","2":"0,3"} key:分类名称索引  value:分类名称下的关键词索引
-        Power         int
-        EntId         int
-        EntUserId     int
+	ClassifyIndex string   //分类索引
+	ClassifyName  string   //分类名称
+	KeyWordIndex  string   //关键词索引
+	KeyWordName   string   //关键词名称
+	ActionType    string   //操作类型 SK:保存/修改关键词; DK:删除关键词; SC:保存/修改分类  DC:删除分类
+	AppendKeyWord []string //附加词
+	NotKeyWord    []string //排除词
+	MatchWay      int      // 单个关键词匹配方事 0:精准匹配 1:模糊匹配
+	KeyWordsCount string   //是否是首次添加关键词
+	Type          string   // 大会员/超级订阅
+	UserId        string   //用户id
+	DeleteKey     string   //删除的关键词 json字符串{"0":"1,2","2":"0,3"} key:分类名称索引  value:分类名称下的关键词索引
+	Power         int
+	EntId         int
+	EntUserId     int
+	BaseUserId    int64
+	AccountId     int64
 }
 
 func (this *KeyWordsSet) UpdateKeyWords() map[string]interface{} {
-        power := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
-        if this.Type == "m" && power.Status < 0 {
-                return map[string]interface{}{"flag": false, "msg": "暂无权限"}
-        }
-        types := "o_jy"
-        if this.Type == "m" {
-                types = "o_member_jy"
-        } else if this.Type == "v" {
-                types = "o_vipjy"
-        }
-        //付费用户
-        if this.Type != "f" && (power.Status > 0 || power.VipStatus > 0) {
-                switch this.ActionType {
-                case "SK": //保存/修改关键词
-                        return AddKeyWords(types, this.UserId, this.ClassifyIndex, this.ClassifyName, this.KeyWordIndex, this.KeyWordName, this.KeyWordsCount, this.NotKeyWord, this.AppendKeyWord, this.MatchWay, this.Power, this.EntUserId, this.EntId)
-                case "DK": //删除关键词
-                        return DeleteKeyWords(types, this.DeleteKey, this.UserId, this.Power, this.EntUserId, this.EntId)
-                case "SC": //保存/修改分类
-                        return AddClass(types, this.ClassifyIndex, this.ClassifyName, this.UserId, this.Power, this.EntUserId, this.EntId)
-                case "DC": //删除分类
-                        return DeleteClass(types, this.ClassifyIndex, this.UserId, this.Power, this.EntUserId, this.EntId)
-                case "directSubKWS": //搜索列表直接订阅关键词
-                        return directSubKWS(types, this.KeyWordName, this.UserId, this.Power, this.EntUserId, this.EntId)
-                }
-        } else {
-                this.ClassifyIndex = "0"
-                this.ClassifyName = "未分类"
-                switch this.ActionType {
-                case "SK": //保存/修改关键词
-                        return AddKeyWordsFree(types, this.UserId, this.ClassifyIndex, this.ClassifyName, this.KeyWordIndex, this.KeyWordName, this.KeyWordsCount, this.NotKeyWord, this.AppendKeyWord, this.MatchWay)
-                case "DK": //删除关键词
-                        return DeleteKeyWordsFree(types, this.DeleteKey, this.UserId)
-                case "directSubKWS": //搜索列表直接订阅关键词
-                        return directSubKWSFree(types, this.KeyWordName, this.UserId)
-                }
-        }
-        return map[string]interface{}{"flag": true, "msg": ""}
+	power := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, qutil.Int64All(this.EntId), config.Config.Etcd.Hosts, config.Config.Etcd.Key)
+	if this.Type == "m" && power.Status < 0 {
+		return map[string]interface{}{"flag": false, "msg": "暂无权限"}
+	}
+	types := "o_jy"
+	if this.Type == "m" {
+		types = "o_member_jy"
+	} else if this.Type == "v" {
+		types = "o_vipjy"
+	}
+	//付费用户
+	if this.Type != "f" && (power.Status > 0 || power.VipStatus > 0) {
+		switch this.ActionType {
+		case "SK": //保存/修改关键词
+			return AddKeyWords(types, this.UserId, this.ClassifyIndex, this.ClassifyName, this.KeyWordIndex, this.KeyWordName, this.KeyWordsCount, this.NotKeyWord, this.AppendKeyWord, this.MatchWay, this.Power, this.EntUserId, this.EntId)
+		case "DK": //删除关键词
+			return DeleteKeyWords(types, this.DeleteKey, this.UserId, this.Power, this.EntUserId, this.EntId)
+		case "SC": //保存/修改分类
+			return AddClass(types, this.ClassifyIndex, this.ClassifyName, this.UserId, this.Power, this.EntUserId, this.EntId)
+		case "DC": //删除分类
+			return DeleteClass(types, this.ClassifyIndex, this.UserId, this.Power, this.EntUserId, this.EntId)
+		case "directSubKWS": //搜索列表直接订阅关键词
+			return directSubKWS(types, this.KeyWordName, this.UserId, this.Power, this.EntUserId, this.EntId)
+		}
+	} else {
+		this.ClassifyIndex = "0"
+		this.ClassifyName = "未分类"
+		switch this.ActionType {
+		case "SK": //保存/修改关键词
+			return AddKeyWordsFree(types, this.UserId, this.ClassifyIndex, this.ClassifyName, this.KeyWordIndex, this.KeyWordName, this.KeyWordsCount, this.NotKeyWord, this.AppendKeyWord, this.MatchWay)
+		case "DK": //删除关键词
+			return DeleteKeyWordsFree(types, this.DeleteKey, this.UserId)
+		case "directSubKWS": //搜索列表直接订阅关键词
+			return directSubKWSFree(types, this.KeyWordName, this.UserId)
+		}
+	}
+	return map[string]interface{}{"flag": true, "msg": ""}
 }
 
 //
 func directSubKWSFree(updateItems string, keys string, userId string) map[string]interface{} {
-        data, ok := db.Mgo.FindById("user", userId, fmt.Sprintf(`{"%s":1}`, updateItems))
-        var repleat = false
-        var kwsCount = 0
-        if len([]rune(keys)) > 20 {
-                keys = qutil.SubString(keys, 0, 20)
-        }
-        flag := "n"
-        if ok && data != nil && len(*data) > 0 && keys != "" {
-                updateObj, _ := (*data)[updateItems].(map[string]interface{})
-                if updateObj["a_key"] != nil && len(qutil.ObjArrToMapArr(updateObj["a_key"].([]interface{}))) > 0 {
-                        a_key := updateObj["a_key"].([]interface{})
-                        for _, n := range a_key {
-                                ntmp := qutil.ObjToMap(n.(interface{}))
-                                nkey := qutil.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
-                                if strings.Join(nkey, " ") == keys {
-                                        repleat = true
-                                        break
-                                }
-                        }
-                } else {
-                        //无关键词 直接添加
-                        if ok := db.Mgo.UpdateById("user", userId, bson.M{"$set": bson.M{
-                                fmt.Sprintf("%s.a_key", updateItems): bson.A{
-                                        bson.M{
-                                                "key":        bson.A{keys},
-                                                "appendkey":  bson.A{},
-                                                "notkey":     bson.A{},
-                                                "updatetime": time.Now().Unix(),
-                                        },
-                                },
-                                updateItems + ".l_modifydate": time.Now().Unix(),
-                                // updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
-                        },
-                        }); ok {
-                                flag = "y"
-                        }
-                        return map[string]interface{}{"flag": flag}
-                }
-                if repleat {
-                        flag = "o"
-                } else if kwsCount >= 10 {
-                        flag = "m"
-                } else {
-                        var _key = make(map[string]interface{})
-                        var a_key = make([]map[string]interface{}, 1)
-                        classify_name := "未分类"
-                        _key["key"] = strings.Split(strings.ReplaceAll(keys, " ", ""), " ")
-                        _key["appendkey"] = []string{}
-                        _key["notkey"] = []string{}
-                        _key["updatetime"] = time.Now().Unix()
-                        a_key[0] = _key
-                        if len(a_key) > 0 {
-                                ok := db.Mgo.UpdateById("user", userId, bson.M{
-                                        "$push": bson.M{
-                                                updateItems + ".a_key": bson.M{
-                                                        "$each": a_key,
-                                                },
-                                        },
-                                        "$set": bson.M{
-                                                updateItems + ".l_modifydate": time.Now().Unix(),
-                                                updateItems + ".s_item":       classify_name,
-                                                // updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
-                                        },
-                                })
-                                if ok {
-                                        flag = "y"
-                                }
-                        }
-                }
-        }
-        if flag == "y" {
-                //清楚缓存
-                jy.ClearBigVipUserPower(userId)
-        }
-        return map[string]interface{}{"flag": flag}
+	data, ok := db.Mgo.FindById("user", userId, fmt.Sprintf(`{"%s":1}`, updateItems))
+	var repleat = false
+	var kwsCount = 0
+	if len([]rune(keys)) > 20 {
+		keys = qutil.SubString(keys, 0, 20)
+	}
+	flag := "n"
+	if ok && data != nil && len(*data) > 0 && keys != "" {
+		updateObj, _ := (*data)[updateItems].(map[string]interface{})
+		if updateObj["a_key"] != nil && len(qutil.ObjArrToMapArr(updateObj["a_key"].([]interface{}))) > 0 {
+			a_key := updateObj["a_key"].([]interface{})
+			for _, n := range a_key {
+				ntmp := qutil.ObjToMap(n.(interface{}))
+				nkey := qutil.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
+				if strings.Join(nkey, " ") == keys {
+					repleat = true
+					break
+				}
+			}
+		} else {
+			//无关键词 直接添加
+			if ok := db.Mgo.UpdateById("user", userId, bson.M{"$set": bson.M{
+				fmt.Sprintf("%s.a_key", updateItems): bson.A{
+					bson.M{
+						"key":        bson.A{keys},
+						"appendkey":  bson.A{},
+						"notkey":     bson.A{},
+						"updatetime": time.Now().Unix(),
+					},
+				},
+				updateItems + ".l_modifydate": time.Now().Unix(),
+				// updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
+			},
+			}); ok {
+				flag = "y"
+			}
+			return map[string]interface{}{"flag": flag}
+		}
+		if repleat {
+			flag = "o"
+		} else if kwsCount >= 10 {
+			flag = "m"
+		} else {
+			var _key = make(map[string]interface{})
+			var a_key = make([]map[string]interface{}, 1)
+			classify_name := "未分类"
+			_key["key"] = strings.Split(strings.ReplaceAll(keys, " ", ""), " ")
+			_key["appendkey"] = []string{}
+			_key["notkey"] = []string{}
+			_key["updatetime"] = time.Now().Unix()
+			a_key[0] = _key
+			if len(a_key) > 0 {
+				ok := db.Mgo.UpdateById("user", userId, bson.M{
+					"$push": bson.M{
+						updateItems + ".a_key": bson.M{
+							"$each": a_key,
+						},
+					},
+					"$set": bson.M{
+						updateItems + ".l_modifydate": time.Now().Unix(),
+						updateItems + ".s_item":       classify_name,
+						// updateItems + ".i_newfree":    1, //老免费用户=>新订阅设置页面 20211122
+					},
+				})
+				if ok {
+					flag = "y"
+				}
+			}
+		}
+	}
+	if flag == "y" {
+		//清楚缓存
+		jy.ClearBigVipUserPower(userId)
+	}
+	return map[string]interface{}{"flag": flag}
 }
 
 //免费用户删除关键词
 func DeleteKeyWordsFree(types, deletekey, userId string) map[string]interface{} {
-        //免费用户只有一个分类
-        var index = "0"
-        dMap, err := util.JsonToMap(deletekey)
-        newMap, saveData := []interface{}{}, map[string]interface{}{}
-        if err == nil && len(dMap) > 0 {
-                data, ok := db.Mgo.FindById("user", userId, `{"`+types+`":1}`)
-                if data != nil && ok && len(*data) > 0 {
-                        ojy, _ := (*data)[types].(map[string]interface{})
-                        a_key, _ := ojy["a_key"].([]interface{})
-                        if dMap[index] != nil {
-                                keyarrs := qutil.ObjArrToMapArr(a_key)
-                                for kk, vk := range keyarrs {
-                                        if util.IsContain(strings.Split(dMap[index].(string), ","), strconv.Itoa(kk)) {
-                                                continue
-                                        }
-                                        newMap = append(newMap, vk)
-                                }
-                                saveData[types+".a_key"] = newMap
-                        }
-                }
-        }
-        flag := true
-        if len(saveData) > 0 {
-                flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                        "$set": saveData,
-                })
-                SetLog(userId, types, 0, 0, 0)
-        }
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	//免费用户只有一个分类
+	var index = "0"
+	dMap, err := util.JsonToMap(deletekey)
+	newMap, saveData := []interface{}{}, map[string]interface{}{}
+	if err == nil && len(dMap) > 0 {
+		data, ok := db.Mgo.FindById("user", userId, `{"`+types+`":1}`)
+		if data != nil && ok && len(*data) > 0 {
+			ojy, _ := (*data)[types].(map[string]interface{})
+			a_key, _ := ojy["a_key"].([]interface{})
+			if dMap[index] != nil {
+				keyarrs := qutil.ObjArrToMapArr(a_key)
+				for kk, vk := range keyarrs {
+					if util.IsContain(strings.Split(dMap[index].(string), ","), strconv.Itoa(kk)) {
+						continue
+					}
+					newMap = append(newMap, vk)
+				}
+				saveData[types+".a_key"] = newMap
+			}
+		}
+	}
+	flag := true
+	if len(saveData) > 0 {
+		flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+			"$set": saveData,
+		})
+		SetLog(userId, types, 0, 0, 0)
+	}
+	return map[string]interface{}{"flag": flag, "msg": ""}
 }
 
 //免费用户修改 保存关键词
 func AddKeyWordsFree(types, userId, classIndex, className, keywordsIndex, keywordName, keywordCount string, notKeyword, appendKeyword []string, matchWay int) map[string]interface{} {
-        flag := true
-        data, ok := db.Mgo.FindById("user", userId, `{"`+types+`":1}`)
-        saveData := map[string]interface{}{}
-        if ok && data != nil && len(*data) > 0 {
-                a_items := make([]interface{}, 0)
-                ojy, _ := (*data)[types].(map[string]interface{})
-                a_key, errs := ojy["a_key"].([]interface{})
-                if !errs {
-                        db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                "$set": map[string]interface{}{
-                                        types + ".a_key": []map[string]interface{}{},
-                                        // types + ".i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
-                                },
-                        })
-                }
-                if ki, _ := strconv.Atoi(keywordsIndex); ki > len(a_key) {
-                        keywordsIndex = strconv.Itoa(len(a_key))
-                } else if ki == 0 {
-                        keywordsIndex = strconv.Itoa(ki)
-                }
-                a_items = append(a_items, ojy)
-                //排除词处理 词过长或者为空的情况
-                if len(notKeyword) > 0 {
-                        for i, notval := range notKeyword {
-                                if len([]rune(notval)) > 20 {
-                                        notval = qutil.SubString(notval, 0, 20)
-                                }
-                                if notval == "" {
-                                        notKeyword = append(notKeyword[:i], notKeyword[i+1:]...)
-                                }
-                        }
-                }
-                var _kws []string //关键词
-                for _, kn := range strings.Split(keywordName, " ") {
-                        if kn != "" {
-                                _kws = append(_kws, kn)
-                        }
-                }
-                var _key = make(map[string]interface{})
-                newKws := []string{_kws[0]} //第一个关键词在key中 后边的存入appendkey
-                _key["key"] = newKws
-                _key["appendkey"] = append(appendKeyword, _kws[1:]...)
-                _key["notkey"] = notKeyword
-                _key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
-                if KeyWordsRepeat(_key, a_items) {
-                        return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
-                } else {
-                        //修改关键词
-                        saveData[types+".s_item"] = className
-                        // saveData[types+".i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
-                        saveData[types+".a_key."+keywordsIndex+".key"] = newKws
-                        saveData[types+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
-                        saveData[types+".a_key."+keywordsIndex+".notkey"] = notKeyword
-                        saveData[types+".a_key."+keywordsIndex+".matchway"] = matchWay
-                        saveData[types+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
-                }
-        }
-        if len(saveData) > 0 {
-                if db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                        "$set": saveData,
-                }) {
-                        flag = true
-                        //清楚缓存
-                        jy.ClearBigVipUserPower(userId)
-                }
-                SetLog(userId, types, 0, 0, 0)
-        }
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	flag := true
+	data, ok := db.Mgo.FindById("user", userId, `{"`+types+`":1}`)
+	saveData := map[string]interface{}{}
+	if ok && data != nil && len(*data) > 0 {
+		a_items := make([]interface{}, 0)
+		ojy, _ := (*data)[types].(map[string]interface{})
+		a_key, errs := ojy["a_key"].([]interface{})
+		if !errs {
+			db.Mgo.UpdateById("user", userId, map[string]interface{}{
+				"$set": map[string]interface{}{
+					types + ".a_key": []map[string]interface{}{},
+					// types + ".i_newfree": 1, //老免费用户=>新订阅设置页面 20211122
+				},
+			})
+		}
+		if ki, _ := strconv.Atoi(keywordsIndex); ki > len(a_key) {
+			keywordsIndex = strconv.Itoa(len(a_key))
+		} else if ki == 0 {
+			keywordsIndex = strconv.Itoa(ki)
+		}
+		a_items = append(a_items, ojy)
+		//排除词处理 词过长或者为空的情况
+		if len(notKeyword) > 0 {
+			for i, notval := range notKeyword {
+				if len([]rune(notval)) > 20 {
+					notval = qutil.SubString(notval, 0, 20)
+				}
+				if notval == "" {
+					notKeyword = append(notKeyword[:i], notKeyword[i+1:]...)
+				}
+			}
+		}
+		var _kws []string //关键词
+		for _, kn := range strings.Split(keywordName, " ") {
+			if kn != "" {
+				_kws = append(_kws, kn)
+			}
+		}
+		var _key = make(map[string]interface{})
+		newKws := []string{_kws[0]} //第一个关键词在key中 后边的存入appendkey
+		_key["key"] = newKws
+		_key["appendkey"] = append(appendKeyword, _kws[1:]...)
+		_key["notkey"] = notKeyword
+		_key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
+		if KeyWordsRepeat(_key, a_items) {
+			return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
+		} else {
+			//修改关键词
+			saveData[types+".s_item"] = className
+			// saveData[types+".i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
+			saveData[types+".a_key."+keywordsIndex+".key"] = newKws
+			saveData[types+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
+			saveData[types+".a_key."+keywordsIndex+".notkey"] = notKeyword
+			saveData[types+".a_key."+keywordsIndex+".matchway"] = matchWay
+			saveData[types+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
+		}
+	}
+	if len(saveData) > 0 {
+		if db.Mgo.UpdateById("user", userId, map[string]interface{}{
+			"$set": saveData,
+		}) {
+			flag = true
+			//清楚缓存
+			jy.ClearBigVipUserPower(userId)
+		}
+		SetLog(userId, types, 0, 0, 0)
+	}
+	return map[string]interface{}{"flag": flag, "msg": ""}
 }
 
 //保存/修改关键词
 func AddKeyWords(types, userId, classIndex, className, keywordsIndex, keywordName, keywordCount string, notKeyword, appendKeyword []string, matchWay int, power, entUserId, entId int) map[string]interface{} {
-        flag := true
-        if power != 1 {
-                //个人版
-                data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
-                saveData := map[string]interface{}{}
-                if ok && data != nil && len(*data) > 0 {
-                        ojy, _ := (*data)[types].(map[string]interface{})
-                        a_items, errs := ojy["a_items"].([]interface{})
-                        if !errs {
-                                db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                        "$set": map[string]interface{}{
-                                                types + ".a_items": []map[string]interface{}{},
-                                        },
-                                })
-                        }
-                        //附加词处理
-                        if len(appendKeyword) > 0 {
-                                for i, addval := range appendKeyword {
-                                        if len([]rune(addval)) > 20 {
-                                                addval = qutil.SubString(addval, 0, 20)
-                                        }
-                                        if addval == "" {
-                                                appendKeyword = append(appendKeyword[:i], appendKeyword[i+1:]...)
-                                        }
-                                }
-                        }
-                        //排除词处理 词过长或者为空的情况
-                        if len(notKeyword) > 0 {
-                                for i, notval := range notKeyword {
-                                        if len([]rune(notval)) > 20 {
-                                                notval = qutil.SubString(notval, 0, 20)
-                                        }
-                                        if notval == "" {
-                                                notKeyword = append(notKeyword[:i], notKeyword[i+1:]...)
-                                        }
-                                }
-                        }
-                        var _kws []string //关键词
-                        for _, kn := range strings.Split(keywordName, " ") {
-                                if kn != "" {
-                                        _kws = append(_kws, kn)
-                                }
-                        }
-                        var _key = make(map[string]interface{})
-                        newKws := []string{_kws[0]} //第一个关键词在key中 后边的存入appendkey
-                        _key["key"] = newKws
-                        _key["appendkey"] = append(appendKeyword, _kws[1:]...)
-                        _key["notkey"] = notKeyword
-                        _key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
-                        if KeyWordsRepeat(_key, a_items) {
-                                return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
-                        } else {
-                                //修改关键词
-                                saveData[types+".a_items."+classIndex+".s_item"] = className
-                                saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".key"] = newKws
-                                saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
-                                saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".notkey"] = notKeyword
-                                saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".matchway"] = matchWay
-                                saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
-                        }
-                }
-
-                if len(saveData) > 0 {
-                        flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                "$set": saveData,
-                        })
-                        SetLog(userId, types, power, entUserId, entId)
-                }
-        } else {
-                //企业个人版
-                //先查看有没有关键词
-                types := "o_entniche"
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                data, ok := db.Mgo.Find("entniche_rule", query, `{"`+types+`.a_items":1}`, nil, false, -1, -1)
-                saveData := map[string]interface{}{}
-                if !ok || data == nil || len(*data) == 0 {
-                        db.Mgo.Update("entniche_rule", query, map[string]interface{}{
-                                "$set": map[string]interface{}{
-                                        "o_entniche.a_items": []map[string]interface{}{},
-                                        "l_updatetime":       time.Now().Unix(),
-                                }}, true, false)
-                }
-                //entniche_rule有数据
-                ojy, _ := (*data)[0][types].(map[string]interface{})
-                a_items, errs := ojy["a_items"].([]interface{})
-                if !errs {
-                        db.Mgo.Update("entniche_rule", query, map[string]interface{}{
-                                "$set": map[string]interface{}{
-                                        "o_entniche.a_items": []map[string]interface{}{},
-                                }}, true, false)
-                }
-                //附加词处理
-                if len(appendKeyword) > 0 {
-                        for i, addval := range appendKeyword {
-                                if len([]rune(addval)) > 20 {
-                                        addval = qutil.SubString(addval, 0, 20)
-                                }
-                                if addval == "" {
-                                        appendKeyword = append(appendKeyword[:i], appendKeyword[i+1:]...)
-                                }
-                        }
-                }
-                //排除词处理 词过长或者为空的情况
-                if len(notKeyword) > 0 {
-                        for i, notval := range notKeyword {
-                                if len([]rune(notval)) > 20 {
-                                        notval = qutil.SubString(notval, 0, 20)
-                                }
-                                if notval == "" {
-                                        notKeyword = append(notKeyword[:i], notKeyword[i+1:]...)
-                                }
-                        }
-                }
-                var _kws []string //关键词
-                for _, kn := range strings.Split(keywordName, " ") {
-                        if kn != "" {
-                                _kws = append(_kws, kn)
-                        }
-                }
-                var _key = make(map[string]interface{})
-                newKws := []string{_kws[0]} //第一个关键词在key中 后边的存入appendkey
-                _key["key"] = newKws
-                _key["appendkey"] = append(appendKeyword, _kws[1:]...)
-                _key["notkey"] = notKeyword
-                _key["updatetime"] = time.Now().Unix()
-                _key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
-                if KeyWordsRepeat(_key, a_items) {
-                        return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
-                } else {
-                        //修改关键词
-                        saveData[types+".a_items."+classIndex+".s_item"] = className
-                        saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".key"] = newKws
-                        saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
-                        saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".notkey"] = notKeyword
-                        saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".matchway"] = matchWay
-                        saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
-                }
-
-                saveData["l_updatetime"] = time.Now().Unix()
-                flag = db.Mgo.Update("entniche_rule", query, map[string]interface{}{
-                        "$set": saveData,
-                }, true, false)
-                SetLog(userId, types, power, entUserId, entId)
-        }
-
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	flag := true
+	if power != 1 {
+		//个人版
+		data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
+		saveData := map[string]interface{}{}
+		if ok && data != nil && len(*data) > 0 {
+			ojy, _ := (*data)[types].(map[string]interface{})
+			a_items, errs := ojy["a_items"].([]interface{})
+			if !errs {
+				db.Mgo.UpdateById("user", userId, map[string]interface{}{
+					"$set": map[string]interface{}{
+						types + ".a_items": []map[string]interface{}{},
+					},
+				})
+			}
+			//附加词处理
+			if len(appendKeyword) > 0 {
+				for i, addval := range appendKeyword {
+					if len([]rune(addval)) > 20 {
+						addval = qutil.SubString(addval, 0, 20)
+					}
+					if addval == "" {
+						appendKeyword = append(appendKeyword[:i], appendKeyword[i+1:]...)
+					}
+				}
+			}
+			//排除词处理 词过长或者为空的情况
+			if len(notKeyword) > 0 {
+				for i, notval := range notKeyword {
+					if len([]rune(notval)) > 20 {
+						notval = qutil.SubString(notval, 0, 20)
+					}
+					if notval == "" {
+						notKeyword = append(notKeyword[:i], notKeyword[i+1:]...)
+					}
+				}
+			}
+			var _kws []string //关键词
+			for _, kn := range strings.Split(keywordName, " ") {
+				if kn != "" {
+					_kws = append(_kws, kn)
+				}
+			}
+			var _key = make(map[string]interface{})
+			newKws := []string{_kws[0]} //第一个关键词在key中 后边的存入appendkey
+			_key["key"] = newKws
+			_key["appendkey"] = append(appendKeyword, _kws[1:]...)
+			_key["notkey"] = notKeyword
+			_key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
+			if KeyWordsRepeat(_key, a_items) {
+				return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
+			} else {
+				//修改关键词
+				saveData[types+".a_items."+classIndex+".s_item"] = className
+				saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".key"] = newKws
+				saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
+				saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".notkey"] = notKeyword
+				saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".matchway"] = matchWay
+				saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
+			}
+		}
+
+		if len(saveData) > 0 {
+			flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+				"$set": saveData,
+			})
+			SetLog(userId, types, power, entUserId, entId)
+		}
+	} else {
+		//企业个人版
+		//先查看有没有关键词
+		types := "o_entniche"
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		data, ok := db.Mgo.Find("entniche_rule", query, `{"`+types+`.a_items":1}`, nil, false, -1, -1)
+		saveData := map[string]interface{}{}
+		if !ok || data == nil || len(*data) == 0 {
+			db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"o_entniche.a_items": []map[string]interface{}{},
+					"l_updatetime":       time.Now().Unix(),
+				}}, true, false)
+		}
+		//entniche_rule有数据
+		ojy, _ := (*data)[0][types].(map[string]interface{})
+		a_items, errs := ojy["a_items"].([]interface{})
+		if !errs {
+			db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"o_entniche.a_items": []map[string]interface{}{},
+				}}, true, false)
+		}
+		//附加词处理
+		if len(appendKeyword) > 0 {
+			for i, addval := range appendKeyword {
+				if len([]rune(addval)) > 20 {
+					addval = qutil.SubString(addval, 0, 20)
+				}
+				if addval == "" {
+					appendKeyword = append(appendKeyword[:i], appendKeyword[i+1:]...)
+				}
+			}
+		}
+		//排除词处理 词过长或者为空的情况
+		if len(notKeyword) > 0 {
+			for i, notval := range notKeyword {
+				if len([]rune(notval)) > 20 {
+					notval = qutil.SubString(notval, 0, 20)
+				}
+				if notval == "" {
+					notKeyword = append(notKeyword[:i], notKeyword[i+1:]...)
+				}
+			}
+		}
+		var _kws []string //关键词
+		for _, kn := range strings.Split(keywordName, " ") {
+			if kn != "" {
+				_kws = append(_kws, kn)
+			}
+		}
+		var _key = make(map[string]interface{})
+		newKws := []string{_kws[0]} //第一个关键词在key中 后边的存入appendkey
+		_key["key"] = newKws
+		_key["appendkey"] = append(appendKeyword, _kws[1:]...)
+		_key["notkey"] = notKeyword
+		_key["updatetime"] = time.Now().Unix()
+		_key["matchway"] = matchWay //matchway 0:精准匹配 1:模糊匹配
+		if KeyWordsRepeat(_key, a_items) {
+			return map[string]interface{}{"flag": false, "msg": "关键词已存在"}
+		} else {
+			//修改关键词
+			saveData[types+".a_items."+classIndex+".s_item"] = className
+			saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".key"] = newKws
+			saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".appendkey"] = append(appendKeyword, _kws[1:]...)
+			saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".notkey"] = notKeyword
+			saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".matchway"] = matchWay
+			saveData[types+".a_items."+classIndex+".a_key."+keywordsIndex+".updatetime"] = time.Now().Unix()
+		}
+
+		saveData["l_updatetime"] = time.Now().Unix()
+		flag = db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+			"$set": saveData,
+		}, true, false)
+		SetLog(userId, types, power, entUserId, entId)
+	}
+
+	return map[string]interface{}{"flag": flag, "msg": ""}
 }
 
 //删除关键词可以批量
 func DeleteKeyWords(types, deletekey, userId string, power, entUserId, entId int) map[string]interface{} {
-        flag := true
-        if power != 1 {
-                dMap, err := util.JsonToMap(deletekey)
-                newMap, saveData := []interface{}{}, map[string]interface{}{}
-                if err == nil && len(dMap) > 0 {
-                        data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
-                        if data != nil && ok && len(*data) > 0 {
-                                ojy, _ := (*data)[types].(map[string]interface{})
-                                a_items, _ := ojy["a_items"].([]interface{})
-                                for k, v := range a_items {
-                                        newItems := map[string]interface{}{}
-                                        if dMap[strconv.Itoa(k)] != nil {
-                                                if items, ok := v.(map[string]interface{}); ok && len(items) > 0 {
-                                                        for kk, vv := range items {
-                                                                new_vv := vv
-                                                                new_m := []map[string]interface{}{}
-                                                                if kk == "a_key" {
-                                                                        keyarrs := qutil.ObjArrToMapArr(vv.([]interface{}))
-                                                                        for kk, vk := range keyarrs {
-                                                                                if util.IsContain(strings.Split(dMap[strconv.Itoa(k)].(string), ","), strconv.Itoa(kk)) {
-                                                                                        continue
-                                                                                }
-                                                                                new_m = append(new_m, vk)
-                                                                        }
-                                                                        new_vv = new_m
-                                                                }
-                                                                newItems[kk] = new_vv
-                                                        }
-                                                }
-                                                newMap = append(newMap, newItems)
-                                        } else {
-                                                newMap = append(newMap, v)
-                                        }
-                                }
-                        }
-                        saveData[types+".a_items"] = newMap
-                }
-                if len(saveData) > 0 {
-                        flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                "$set": saveData,
-                        })
-                        SetLog(userId, types, 0, 0, 0)
-                }
-        } else {
-                types := "o_entniche"
-                dMap, err := util.JsonToMap(deletekey)
-                newMap := []interface{}{}
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                if err == nil && len(dMap) > 0 {
-                        data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
-                        if data == nil || !ok || len(*data) == 0 {
-                                return map[string]interface{}{"flag": flag, "msg": ""}
-                        }
-                        ojy, _ := (*data)[0][types].(map[string]interface{})
-                        a_items, _ := ojy["a_items"].([]interface{})
-                        for k, v := range a_items {
-                                newItems := map[string]interface{}{}
-                                if dMap[strconv.Itoa(k)] != nil {
-                                        if items, ok := v.(map[string]interface{}); ok && len(items) > 0 {
-                                                for kk, vv := range items {
-                                                        new_vv := vv
-                                                        new_m := []map[string]interface{}{}
-                                                        if kk == "a_key" {
-                                                                keyarrs := qutil.ObjArrToMapArr(vv.([]interface{}))
-                                                                for kk, vk := range keyarrs {
-                                                                        if util.IsContain(strings.Split(dMap[strconv.Itoa(k)].(string), ","), strconv.Itoa(kk)) {
-                                                                                continue
-                                                                        }
-                                                                        new_m = append(new_m, vk)
-                                                                }
-                                                                new_vv = new_m
-                                                        }
-                                                        newItems[kk] = new_vv
-                                                }
-                                        }
-                                        newMap = append(newMap, newItems)
-                                } else {
-                                        newMap = append(newMap, v)
-                                }
-                        }
-                }
-
-                if len(newMap) > 0 {
-                        flag = db.Mgo.Update("entniche_rule", query, bson.M{"$set": bson.M{
-                                "l_updatetime":       time.Now().Unix(),
-                                "o_entniche.a_items": newMap,
-                        }}, true, false)
-                        SetLog(userId, types, power, entUserId, entId)
-                }
-
-        }
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	flag := true
+	if power != 1 {
+		dMap, err := util.JsonToMap(deletekey)
+		newMap, saveData := []interface{}{}, map[string]interface{}{}
+		if err == nil && len(dMap) > 0 {
+			data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
+			if data != nil && ok && len(*data) > 0 {
+				ojy, _ := (*data)[types].(map[string]interface{})
+				a_items, _ := ojy["a_items"].([]interface{})
+				for k, v := range a_items {
+					newItems := map[string]interface{}{}
+					if dMap[strconv.Itoa(k)] != nil {
+						if items, ok := v.(map[string]interface{}); ok && len(items) > 0 {
+							for kk, vv := range items {
+								new_vv := vv
+								new_m := []map[string]interface{}{}
+								if kk == "a_key" {
+									keyarrs := qutil.ObjArrToMapArr(vv.([]interface{}))
+									for kk, vk := range keyarrs {
+										if util.IsContain(strings.Split(dMap[strconv.Itoa(k)].(string), ","), strconv.Itoa(kk)) {
+											continue
+										}
+										new_m = append(new_m, vk)
+									}
+									new_vv = new_m
+								}
+								newItems[kk] = new_vv
+							}
+						}
+						newMap = append(newMap, newItems)
+					} else {
+						newMap = append(newMap, v)
+					}
+				}
+			}
+			saveData[types+".a_items"] = newMap
+		}
+		if len(saveData) > 0 {
+			flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+				"$set": saveData,
+			})
+			SetLog(userId, types, 0, 0, 0)
+		}
+	} else {
+		types := "o_entniche"
+		dMap, err := util.JsonToMap(deletekey)
+		newMap := []interface{}{}
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		if err == nil && len(dMap) > 0 {
+			data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
+			if data == nil || !ok || len(*data) == 0 {
+				return map[string]interface{}{"flag": flag, "msg": ""}
+			}
+			ojy, _ := (*data)[0][types].(map[string]interface{})
+			a_items, _ := ojy["a_items"].([]interface{})
+			for k, v := range a_items {
+				newItems := map[string]interface{}{}
+				if dMap[strconv.Itoa(k)] != nil {
+					if items, ok := v.(map[string]interface{}); ok && len(items) > 0 {
+						for kk, vv := range items {
+							new_vv := vv
+							new_m := []map[string]interface{}{}
+							if kk == "a_key" {
+								keyarrs := qutil.ObjArrToMapArr(vv.([]interface{}))
+								for kk, vk := range keyarrs {
+									if util.IsContain(strings.Split(dMap[strconv.Itoa(k)].(string), ","), strconv.Itoa(kk)) {
+										continue
+									}
+									new_m = append(new_m, vk)
+								}
+								new_vv = new_m
+							}
+							newItems[kk] = new_vv
+						}
+					}
+					newMap = append(newMap, newItems)
+				} else {
+					newMap = append(newMap, v)
+				}
+			}
+		}
+
+		if len(newMap) > 0 {
+			flag = db.Mgo.Update("entniche_rule", query, bson.M{"$set": bson.M{
+				"l_updatetime":       time.Now().Unix(),
+				"o_entniche.a_items": newMap,
+			}}, true, false)
+			SetLog(userId, types, power, entUserId, entId)
+		}
+
+	}
+	return map[string]interface{}{"flag": flag, "msg": ""}
 }
 
 //删除分类【可以批量删除】
 func DeleteClass(types, classIndex, userId string, power, entUserId, entId int) map[string]interface{} {
-        flag := true
-        if power != 1 {
-                items, saveData := []interface{}{}, map[string]interface{}{}
-                m := map[string]bool{}
-                for _, v := range strings.Split(classIndex, ",") {
-                        m[v] = true
-                }
-                data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
-                if data != nil && ok && len(*data) > 0 {
-                        ojy, _ := (*data)[types].(map[string]interface{})
-                        a_items, _ := ojy["a_items"].([]interface{})
-                        for k, v := range a_items {
-                                if !m[strconv.Itoa(k)] {
-                                        items = append(items, v)
-                                }
-                        }
-                }
-                saveData[types+".a_items"] = items
-
-                if len(saveData) > 0 {
-                        flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                "$set": saveData,
-                        })
-                        SetLog(userId, types, 0, 0, 0)
-                }
-        } else {
-                types := "o_entniche"
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                items := []interface{}{}
-                m := map[string]bool{}
-                for _, v := range strings.Split(classIndex, ",") {
-                        m[v] = true
-                }
-                data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
-                if data == nil || !ok || len(*data) == 0 {
-                        return map[string]interface{}{"flag": flag, "msg": ""}
-                }
-                ojy, _ := (*data)[0][types].(map[string]interface{})
-                a_items, _ := ojy["a_items"].([]interface{})
-                for k, v := range a_items {
-                        if !m[strconv.Itoa(k)] {
-                                items = append(items, v)
-                        }
-                }
-
-                if len(items) > 0 {
-                        flag = db.Mgo.Update("entniche_rule", query, bson.M{"$set": bson.M{
-                                "l_updatetime":       time.Now().Unix(),
-                                "o_entniche.a_items": items,
-                        }}, true, false)
-                        SetLog(userId, types, power, entUserId, entId)
-                }
-        }
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	flag := true
+	if power != 1 {
+		items, saveData := []interface{}{}, map[string]interface{}{}
+		m := map[string]bool{}
+		for _, v := range strings.Split(classIndex, ",") {
+			m[v] = true
+		}
+		data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
+		if data != nil && ok && len(*data) > 0 {
+			ojy, _ := (*data)[types].(map[string]interface{})
+			a_items, _ := ojy["a_items"].([]interface{})
+			for k, v := range a_items {
+				if !m[strconv.Itoa(k)] {
+					items = append(items, v)
+				}
+			}
+		}
+		saveData[types+".a_items"] = items
+
+		if len(saveData) > 0 {
+			flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+				"$set": saveData,
+			})
+			SetLog(userId, types, 0, 0, 0)
+		}
+	} else {
+		types := "o_entniche"
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		items := []interface{}{}
+		m := map[string]bool{}
+		for _, v := range strings.Split(classIndex, ",") {
+			m[v] = true
+		}
+		data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
+		if data == nil || !ok || len(*data) == 0 {
+			return map[string]interface{}{"flag": flag, "msg": ""}
+		}
+		ojy, _ := (*data)[0][types].(map[string]interface{})
+		a_items, _ := ojy["a_items"].([]interface{})
+		for k, v := range a_items {
+			if !m[strconv.Itoa(k)] {
+				items = append(items, v)
+			}
+		}
+
+		if len(items) > 0 {
+			flag = db.Mgo.Update("entniche_rule", query, bson.M{"$set": bson.M{
+				"l_updatetime":       time.Now().Unix(),
+				"o_entniche.a_items": items,
+			}}, true, false)
+			SetLog(userId, types, power, entUserId, entId)
+		}
+	}
+	return map[string]interface{}{"flag": flag, "msg": ""}
 }
 
 //创建分类名
 func AddClass(types, classIndex, className, userId string, power, entUserId, entId int) map[string]interface{} {
-        flag := true
-        if power != 1 {
-                saveData := map[string]interface{}{}
-                data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
-                if data != nil && ok && len(*data) > 0 {
-                        ojy, _ := (*data)[types].(map[string]interface{})
-                        a_items, errs := ojy["a_items"].([]interface{})
-                        //没有该字段创建
-                        if !errs {
-                                db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                        "$set": map[string]interface{}{
-                                                "" + types + ".a_items": []map[string]interface{}{},
-                                        },
-                                })
-                        }
-                        sitemsArr := []string{} //分类名称数组
-                        for _, av := range a_items {
-                                _av := qutil.ObjToMap(av)
-                                sitemsArr = append(sitemsArr, qutil.ObjToString((*_av)["s_item"]))
-                        }
-                        if util.IsRepeat(append(sitemsArr, className)) {
-                                return map[string]interface{}{"flag": false, "msg": "分类名称重复"}
-                        }
-                        c_lens := strconv.Itoa(len(a_items))
-                        if ci, _ := strconv.Atoi(classIndex); ci < len(a_items)+1 {
-                                if classIndex == "" || c_lens == classIndex { //新增
-                                        classIndex = strconv.Itoa(len(a_items)) //索引
-                                        saveData[types+".a_items."+classIndex+".a_key"] = []map[string]interface{}{}
-                                }
-                                saveData[types+".a_items."+classIndex+".s_item"] = className
-                                saveData[types+".a_items."+classIndex+".updatetime"] = time.Now().Unix()
-                        }
-                }
-
-                if len(saveData) > 0 {
-                        flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
-                                "$set": saveData,
-                        })
-                        SetLog(userId, types, 0, 0, 0)
-                }
-        } else {
-                types := "o_entniche"
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                saveData := map[string]interface{}{}
-                data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
-                a_items:=[]interface{}{}
-                if data == nil || !ok || len(*data) == 0 {
-                        db.Mgo.Update("entniche_rule", query, map[string]interface{}{
-                                "$set": map[string]interface{}{
-                                        "o_entniche.a_items": []map[string]interface{}{},
-                                        "l_updatetime":       time.Now().Unix(),
-                                }}, true, false)
-
-                }else{
-                        ojy, _ := (*data)[0][types].(map[string]interface{})
-                        a_items, _ = ojy["a_items"].([]interface{})
-                }
-
-                sitemsArr := []string{} //分类名称数组
-                for _, av := range a_items {
-                        _av := qutil.ObjToMap(av)
-                        sitemsArr = append(sitemsArr, qutil.ObjToString((*_av)["s_item"]))
-                }
-                if util.IsRepeat(append(sitemsArr, className)) {
-                        return map[string]interface{}{"flag": false, "msg": "分类名称重复"}
-                }
-                c_lens := strconv.Itoa(len(a_items))
-                if ci, _ := strconv.Atoi(classIndex); ci < len(a_items)+1 {
-                        if classIndex == "" || c_lens == classIndex { //新增
-                                classIndex = strconv.Itoa(len(a_items)) //索引
-                                saveData[types+".a_items."+classIndex+".a_key"] = []map[string]interface{}{}
-                        }
-                        saveData[types+".a_items."+classIndex+".s_item"] = className
-                        saveData[types+".a_items."+classIndex+".updatetime"] = time.Now().Unix()
-
-                }
-                saveData["l_updatetime"] =  time.Now().Unix()
-                if len(saveData) > 0 {
-                        flag = db.Mgo.Update("entniche_rule", query, map[string]interface{}{
-                                "$set": saveData,
-                        }, true, false)
-                        SetLog(userId, types, power, entUserId, entId)
-                }
-        }
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	flag := true
+	if power != 1 {
+		saveData := map[string]interface{}{}
+		data, ok := db.Mgo.FindById("user", userId, `{"`+types+`.a_items":1}`)
+		if data != nil && ok && len(*data) > 0 {
+			ojy, _ := (*data)[types].(map[string]interface{})
+			a_items, errs := ojy["a_items"].([]interface{})
+			//没有该字段创建
+			if !errs {
+				db.Mgo.UpdateById("user", userId, map[string]interface{}{
+					"$set": map[string]interface{}{
+						"" + types + ".a_items": []map[string]interface{}{},
+					},
+				})
+			}
+			sitemsArr := []string{} //分类名称数组
+			for _, av := range a_items {
+				_av := qutil.ObjToMap(av)
+				sitemsArr = append(sitemsArr, qutil.ObjToString((*_av)["s_item"]))
+			}
+			if util.IsRepeat(append(sitemsArr, className)) {
+				return map[string]interface{}{"flag": false, "msg": "分类名称重复"}
+			}
+			c_lens := strconv.Itoa(len(a_items))
+			if ci, _ := strconv.Atoi(classIndex); ci < len(a_items)+1 {
+				if classIndex == "" || c_lens == classIndex { //新增
+					classIndex = strconv.Itoa(len(a_items)) //索引
+					saveData[types+".a_items."+classIndex+".a_key"] = []map[string]interface{}{}
+				}
+				saveData[types+".a_items."+classIndex+".s_item"] = className
+				saveData[types+".a_items."+classIndex+".updatetime"] = time.Now().Unix()
+			}
+		}
+
+		if len(saveData) > 0 {
+			flag = db.Mgo.UpdateById("user", userId, map[string]interface{}{
+				"$set": saveData,
+			})
+			SetLog(userId, types, 0, 0, 0)
+		}
+	} else {
+		types := "o_entniche"
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		saveData := map[string]interface{}{}
+		data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
+		a_items := []interface{}{}
+		if data == nil || !ok || len(*data) == 0 {
+			db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+				"$set": map[string]interface{}{
+					"o_entniche.a_items": []map[string]interface{}{},
+					"l_updatetime":       time.Now().Unix(),
+				}}, true, false)
+
+		} else {
+			ojy, _ := (*data)[0][types].(map[string]interface{})
+			a_items, _ = ojy["a_items"].([]interface{})
+		}
+
+		sitemsArr := []string{} //分类名称数组
+		for _, av := range a_items {
+			_av := qutil.ObjToMap(av)
+			sitemsArr = append(sitemsArr, qutil.ObjToString((*_av)["s_item"]))
+		}
+		if util.IsRepeat(append(sitemsArr, className)) {
+			return map[string]interface{}{"flag": false, "msg": "分类名称重复"}
+		}
+		c_lens := strconv.Itoa(len(a_items))
+		if ci, _ := strconv.Atoi(classIndex); ci < len(a_items)+1 {
+			if classIndex == "" || c_lens == classIndex { //新增
+				classIndex = strconv.Itoa(len(a_items)) //索引
+				saveData[types+".a_items."+classIndex+".a_key"] = []map[string]interface{}{}
+			}
+			saveData[types+".a_items."+classIndex+".s_item"] = className
+			saveData[types+".a_items."+classIndex+".updatetime"] = time.Now().Unix()
+
+		}
+		saveData["l_updatetime"] = time.Now().Unix()
+		if len(saveData) > 0 {
+			flag = db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+				"$set": saveData,
+			}, true, false)
+			SetLog(userId, types, power, entUserId, entId)
+		}
+	}
+	return map[string]interface{}{"flag": flag, "msg": ""}
 
 }
 
 //关键词判重
 func KeyWordsRepeat(obj map[string]interface{}, aitems []interface{}) bool {
-        // 录入的关键词
-        key, _ := obj["key"].([]string)
-        notkey, _ := obj["notkey"].([]string)
-        matchway, _ := obj["matchway"].(int) //matchway 0:精准匹配 1:模糊匹配
-        appendkey, _ := obj["appendkey"].([]string)
-        if util.IsRepeat(key) || util.IsRepeat(appendkey) {
-                return true
-        }
-        // 录入的关键词
-        for _, v := range aitems {
-                if items, ok := v.(map[string]interface{}); ok && len(items) > 0 {
-                        for kk, vv := range items {
-                                if kk == "a_key" {
-                                        for _, n := range qutil.ObjArrToMapArr(vv.([]interface{})) {
-                                                db_not := []string{}
-                                                db_key := []string{}
-                                                db_append := []string{}
-                                                if n["key"] != nil {
-                                                        db_key = qutil.ObjArrToStringArr(n["key"].([]interface{}))
-                                                }
-                                                if n["notkey"] != nil {
-                                                        db_not = qutil.ObjArrToStringArr(n["notkey"].([]interface{}))
-                                                }
-                                                if n["appendkey"] != nil {
-                                                        db_append = qutil.ObjArrToStringArr(n["appendkey"].([]interface{}))
-                                                }
-                                                if util.StringArrEqual(key, db_key) && util.StringArrEqual(notkey, db_not) && qutil.IntAllDef(n["matchway"], 0) == matchway && util.StringArrEqual(appendkey, db_append) {
-                                                        return true
-                                                }
-                                        }
-                                }
-                        }
-                }
-        }
-        return false
+	// 录入的关键词
+	key, _ := obj["key"].([]string)
+	notkey, _ := obj["notkey"].([]string)
+	matchway, _ := obj["matchway"].(int) //matchway 0:精准匹配 1:模糊匹配
+	appendkey, _ := obj["appendkey"].([]string)
+	if util.IsRepeat(key) || util.IsRepeat(appendkey) {
+		return true
+	}
+	// 录入的关键词
+	for _, v := range aitems {
+		if items, ok := v.(map[string]interface{}); ok && len(items) > 0 {
+			for kk, vv := range items {
+				if kk == "a_key" {
+					for _, n := range qutil.ObjArrToMapArr(vv.([]interface{})) {
+						db_not := []string{}
+						db_key := []string{}
+						db_append := []string{}
+						if n["key"] != nil {
+							db_key = qutil.ObjArrToStringArr(n["key"].([]interface{}))
+						}
+						if n["notkey"] != nil {
+							db_not = qutil.ObjArrToStringArr(n["notkey"].([]interface{}))
+						}
+						if n["appendkey"] != nil {
+							db_append = qutil.ObjArrToStringArr(n["appendkey"].([]interface{}))
+						}
+						if util.StringArrEqual(key, db_key) && util.StringArrEqual(notkey, db_not) && qutil.IntAllDef(n["matchway"], 0) == matchway && util.StringArrEqual(appendkey, db_append) {
+							return true
+						}
+					}
+				}
+			}
+		}
+	}
+	return false
 }
 
 type UpdateOther struct {
-        PageType        string //projectMatch项目匹配  saveSeniorset关键词匹配方式  infoType信息类型
-        Pmindex         int    //1项目匹配开启 0项目匹配关闭
-        InfoTypeArr     string //信息类型
-        Matchtype       int    //1标题匹配 2项目匹配
-        UserId          string
-        Type            string
-        OtherBuyerclass int //其它采购单位
-        Power           int
-        EntId           int
-        EntUserId       int
+	PageType        string //projectMatch项目匹配  saveSeniorset关键词匹配方式  infoType信息类型
+	Pmindex         int    //1项目匹配开启 0项目匹配关闭
+	InfoTypeArr     string //信息类型
+	Matchtype       int    //1标题匹配 2项目匹配
+	UserId          string
+	Type            string
+	OtherBuyerclass int //其它采购单位
+	Power           int
+	EntId           int
+	EntUserId       int
+	BaseUserId      int64
+	AccountId       int64
 }
 
 func (this *UpdateOther) UpdateOther() map[string]interface{} {
-        power := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
-        if this.Type == "m" && power.Status < 0 {
-                return map[string]interface{}{"flag": false, "msg": "暂无权限"}
-        }
-        types := "o_jy"
-        if this.Type == "m" {
-                types = "o_member_jy"
-        } else if this.Type == "v" {
-                types = "o_vipjy"
-        }
-        if this.Power == 1 {
-                types = "o_entniche"
-        }
-        setMap := func() map[string]interface{} {
-                switch this.PageType {
-                case "projectMatch": //项目匹配
-                        return UpdateProjectMatch(types, this.Pmindex)
-                case "saveSeniorset": //关键词匹配方式
-                        return UpdateSaveSeniorset(types, this.Matchtype)
-                case "infoType": //信息类型
-                        return UpdateInfoType(types, this.InfoTypeArr)
-                case "other_buyerclass":
-                        return UpdateOtherBuyerClass(types, this.OtherBuyerclass)
-                case "keytip": //关键词升级弹窗提示(一个用户只提示一次)
-                        return UpdateKeyTip(types)
-                }
-                return nil
-        }()
-        flag := true
-        if types == "o_jy" {
-                // setMap["o_jy.i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
-        }
-        if setMap != nil {
-                if this.Power == 1 {
-                        query := map[string]interface{}{
-                                "i_userid": this.EntUserId,
-                                "i_entid":  this.EntId,
-                                "i_type":   1,
-                        }
-                        if db.Mgo.Update("entniche_rule", query, map[string]interface{}{
-                                "$set": setMap,
-                        }, true, false) {
-                                flag = true
-                                //清楚缓存
-                                jy.ClearBigVipUserPower(this.UserId)
-                        }
-                        SetLog(this.UserId, types, this.Power, this.EntUserId, this.EntId)
-                } else {
-                        query := map[string]interface{}{
-                                "i_userid": this.EntUserId,
-                                "i_entid":  this.EntId,
-                        }
-                        setMap["l_updatetime"] = time.Now().Unix()
-                        flag = db.Mgo.Update("entniche_rule", query, bson.M{"$set": setMap}, true, false)
-                        if flag {
-                                flag = true
-                                //清楚缓存
-                                jy.ClearBigVipUserPower(this.UserId)
-                        }
-                        SetLog(this.UserId, types, this.Power, this.EntUserId, this.EntId)
-
-                }
-
-        }
-        return map[string]interface{}{"flag": flag, "msg": ""}
+	power := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, qutil.Int64All(this.EntId), config.Config.Etcd.Hosts, config.Config.Etcd.Key)
+	if this.Type == "m" && power.Status < 0 {
+		return map[string]interface{}{"flag": false, "msg": "暂无权限"}
+	}
+	types := "o_jy"
+	if this.Type == "m" {
+		types = "o_member_jy"
+	} else if this.Type == "v" {
+		types = "o_vipjy"
+	}
+	if this.Power == 1 {
+		types = "o_entniche"
+	}
+	setMap := func() map[string]interface{} {
+		switch this.PageType {
+		case "projectMatch": //项目匹配
+			return UpdateProjectMatch(types, this.Pmindex)
+		case "saveSeniorset": //关键词匹配方式
+			return UpdateSaveSeniorset(types, this.Matchtype)
+		case "infoType": //信息类型
+			return UpdateInfoType(types, this.InfoTypeArr)
+		case "other_buyerclass":
+			return UpdateOtherBuyerClass(types, this.OtherBuyerclass)
+		case "keytip": //关键词升级弹窗提示(一个用户只提示一次)
+			return UpdateKeyTip(types)
+		}
+		return nil
+	}()
+	flag := true
+	if types == "o_jy" {
+		// setMap["o_jy.i_newfree"] = 1 //老免费用户=>新订阅设置页面 20211122
+	}
+	if setMap != nil {
+		if this.Power == 1 {
+			query := map[string]interface{}{
+				"i_userid": this.EntUserId,
+				"i_entid":  this.EntId,
+				"i_type":   1,
+			}
+			if db.Mgo.Update("entniche_rule", query, map[string]interface{}{
+				"$set": setMap,
+			}, true, false) {
+				flag = true
+				//清楚缓存
+				jy.ClearBigVipUserPower(this.UserId)
+			}
+			SetLog(this.UserId, types, this.Power, this.EntUserId, this.EntId)
+		} else {
+			query := map[string]interface{}{
+				"i_userid": this.EntUserId,
+				"i_entid":  this.EntId,
+			}
+			setMap["l_updatetime"] = time.Now().Unix()
+			flag = db.Mgo.Update("entniche_rule", query, bson.M{"$set": setMap}, true, false)
+			if flag {
+				flag = true
+				//清楚缓存
+				jy.ClearBigVipUserPower(this.UserId)
+			}
+			SetLog(this.UserId, types, this.Power, this.EntUserId, this.EntId)
+
+		}
+
+	}
+	return map[string]interface{}{"flag": flag, "msg": ""}
 }
 
 //
 func UpdateProjectMatch(types string, pmindex int) map[string]interface{} {
-        return map[string]interface{}{
-                types + ".i_projectmatch": pmindex,
-        }
+	return map[string]interface{}{
+		types + ".i_projectmatch": pmindex,
+	}
 }
 
 //
 func UpdateSaveSeniorset(types string, matchtype int) map[string]interface{} {
-        return map[string]interface{}{
-                types + ".i_matchway": matchtype,
-        }
+	return map[string]interface{}{
+		types + ".i_matchway": matchtype,
+	}
 }
 
 //
 func UpdateInfoType(types string, infotype string) map[string]interface{} {
-        if infotype != "" {
-                return map[string]interface{}{
-                        types + ".a_infotype": strings.Split(infotype, ","),
-                }
-        } else {
-                return map[string]interface{}{
-                        types + ".a_infotype": []string{},
-                }
-        }
+	if infotype != "" {
+		return map[string]interface{}{
+			types + ".a_infotype": strings.Split(infotype, ","),
+		}
+	} else {
+		return map[string]interface{}{
+			types + ".a_infotype": []string{},
+		}
+	}
 }
 
 //
 func UpdateOtherBuyerClass(types string, other int) map[string]interface{} {
-        return map[string]interface{}{
-                types + ".i_matchbuyerclass_other": other,
-        }
+	return map[string]interface{}{
+		types + ".i_matchbuyerclass_other": other,
+	}
 }
 
 //UpdateKeyTip 关键词升级提示
 func UpdateKeyTip(types string) map[string]interface{} {
-        return map[string]interface{}{
-                types + ".b_keytip": true,
-        }
+	return map[string]interface{}{
+		types + ".b_keytip": true,
+	}
 }
 
 func directSubKWS(updateItems string, keys string, userId string, power, entUserId, entId int) map[string]interface{} {
-        flag := "n"
-        if power != 1 {
-                data, ok := db.Mgo.FindById("user", userId, fmt.Sprintf(`{"%s":1}`, updateItems))
-                var repleat = false
-                var classify_index = -1
-                var kwsCount = 0
-                if len([]rune(keys)) > 20 {
-                        keys = qutil.SubString(keys, 0, 20)
-                }
-                if ok && data != nil && len(*data) > 0 && keys != "" {
-                        updateObj, _ := (*data)[updateItems].(map[string]interface{})
-                        if updateObj["a_items"] != nil {
-                                a_items := updateObj["a_items"].([]interface{})
-                                for k, v := range a_items {
-                                        tmp := qutil.ObjToMap(v.(map[string]interface{}))
-                                        a_key := (*tmp)["a_key"].([]interface{})
-                                        kwsCount = kwsCount + len(a_key)
-                                        if (*tmp)["s_item"] == "未分类" {
-                                                classify_index = k
-                                        }
-                                        for _, n := range a_key {
-                                                ntmp := qutil.ObjToMap(n.(interface{}))
-                                                nkey := qutil.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
-                                                if strings.Join(nkey, " ") == keys {
-                                                        repleat = true
-                                                        break
-                                                }
-                                        }
-                                        if repleat {
-                                                break
-                                        }
-                                }
-                                if classify_index == -1 {
-                                        classify_index = len(a_items)
-                                }
-                        } else {
-                                //无关键词 直接添加
-                                if ok := db.Mgo.UpdateById("user", userId, bson.M{"$set": bson.M{fmt.Sprintf("%s.a_items", updateItems): bson.A{bson.M{"s_item": "未分类",
-                                        "a_key":        bson.A{bson.M{"key": bson.A{keys}}},
-                                        "l_modifydate": time.Now().Unix()}}}}); ok {
-                                        flag = "y"
-                                }
-                                return map[string]interface{}{"flag": flag}
-                        }
-                        if repleat {
-                                flag = "o"
-                        } else if kwsCount >= 300 {
-                                flag = "m"
-                        } else {
-                                var _key = make(map[string]interface{})
-                                var a_key = make([]map[string]interface{}, 1)
-                                classify_name := "未分类"
-                                _key["key"] = strings.Split(keys, " ")
-                                a_key[0] = _key
-                                if len(a_key) > 0 {
-                                        ok := db.Mgo.UpdateById("user", userId, bson.M{
-                                                "$push": bson.M{
-                                                        updateItems + ".a_items." + strconv.Itoa(classify_index) + ".a_key": bson.M{
-                                                                "$each": a_key,
-                                                        },
-                                                },
-                                                "$set": bson.M{
-                                                        updateItems + ".l_modifydate":                                        time.Now().Unix(),
-                                                        updateItems + ".a_items." + strconv.Itoa(classify_index) + ".s_item": classify_name,
-                                                },
-                                        })
-                                        if ok {
-                                                flag = "y"
-                                        }
-                                }
-                        }
-                }
-        } else {
-                updateItems = "o_entniche"
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
-                var repleat = false
-                var classify_index = -1
-                var kwsCount = 0
-                if len([]rune(keys)) > 20 {
-                        keys = qutil.SubString(keys, 0, 20)
-                }
-                if ok && data != nil && len(*data) > 0 && keys != "" {
-                        updateObj, _ := (*data)[0]["o_entniche"].(map[string]interface{})
-                        if updateObj["a_items"] != nil {
-                                a_items := updateObj["a_items"].([]interface{})
-                                for k, v := range a_items {
-                                        tmp := qutil.ObjToMap(v.(map[string]interface{}))
-                                        a_key := (*tmp)["a_key"].([]interface{})
-                                        kwsCount = kwsCount + len(a_key)
-                                        if (*tmp)["s_item"] == "未分类" {
-                                                classify_index = k
-                                        }
-                                        for _, n := range a_key {
-                                                ntmp := qutil.ObjToMap(n.(interface{}))
-                                                nkey := qutil.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
-                                                if strings.Join(nkey, " ") == keys {
-                                                        repleat = true
-                                                        break
-                                                }
-                                        }
-                                        if repleat {
-                                                break
-                                        }
-                                }
-                                if classify_index == -1 {
-                                        classify_index = len(a_items)
-                                }
-                        } else {
-                                //无关键词 直接添加
-                                if ok := db.Mgo.Update("entniche_rule", query, bson.M{"$set": bson.M{"o_entniche.a_items": bson.A{bson.M{"s_item": "未分类",
-                                        "a_key":      bson.A{bson.M{"key": bson.A{keys}}},
-                                        "updatetime": time.Now().Unix()}},
-                                        "l_updatetime": time.Now().Unix(),
-                                }}, true, false); ok {
-                                        flag = "y"
-                                }
-                                return map[string]interface{}{"flag": flag}
-                        }
-                        if repleat {
-                                flag = "o"
-                        } else if kwsCount >= 300 {
-                                flag = "m"
-                        } else {
-                                var _key = make(map[string]interface{})
-                                var a_key = make([]map[string]interface{}, 1)
-                                classify_name := "未分类"
-                                _key["key"] = strings.Split(keys, " ")
-                                a_key[0] = _key
-                                if len(a_key) > 0 {
-                                        ok := db.Mgo.Update("entniche_rule", query, bson.M{
-
-                                                "$push": bson.M{
-                                                        updateItems + ".a_items." + strconv.Itoa(classify_index) + ".a_key": bson.M{
-                                                                "$each": a_key,
-                                                        },
-                                                },
-                                                "$set": bson.M{
-                                                        "l_updatetime": time.Now().Unix(),
-                                                        updateItems + ".a_items." + strconv.Itoa(classify_index) + ".s_item":     classify_name,
-                                                        updateItems + ".a_items." + strconv.Itoa(classify_index) + ".updatetime": time.Now().Unix(),
-                                                },
-                                        }, true, false)
-                                        if ok {
-                                                flag = "y"
-                                        }
-                                }
-                        }
-                }
-        }
-        return map[string]interface{}{"flag": flag}
+	flag := "n"
+	if power != 1 {
+		data, ok := db.Mgo.FindById("user", userId, fmt.Sprintf(`{"%s":1}`, updateItems))
+		var repleat = false
+		var classify_index = -1
+		var kwsCount = 0
+		if len([]rune(keys)) > 20 {
+			keys = qutil.SubString(keys, 0, 20)
+		}
+		if ok && data != nil && len(*data) > 0 && keys != "" {
+			updateObj, _ := (*data)[updateItems].(map[string]interface{})
+			if updateObj["a_items"] != nil {
+				a_items := updateObj["a_items"].([]interface{})
+				for k, v := range a_items {
+					tmp := qutil.ObjToMap(v.(map[string]interface{}))
+					a_key := (*tmp)["a_key"].([]interface{})
+					kwsCount = kwsCount + len(a_key)
+					if (*tmp)["s_item"] == "未分类" {
+						classify_index = k
+					}
+					for _, n := range a_key {
+						ntmp := qutil.ObjToMap(n.(interface{}))
+						nkey := qutil.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
+						if strings.Join(nkey, " ") == keys {
+							repleat = true
+							break
+						}
+					}
+					if repleat {
+						break
+					}
+				}
+				if classify_index == -1 {
+					classify_index = len(a_items)
+				}
+			} else {
+				//无关键词 直接添加
+				if ok := db.Mgo.UpdateById("user", userId, bson.M{"$set": bson.M{fmt.Sprintf("%s.a_items", updateItems): bson.A{bson.M{"s_item": "未分类",
+					"a_key":        bson.A{bson.M{"key": bson.A{keys}}},
+					"l_modifydate": time.Now().Unix()}}}}); ok {
+					flag = "y"
+				}
+				return map[string]interface{}{"flag": flag}
+			}
+			if repleat {
+				flag = "o"
+			} else if kwsCount >= 300 {
+				flag = "m"
+			} else {
+				var _key = make(map[string]interface{})
+				var a_key = make([]map[string]interface{}, 1)
+				classify_name := "未分类"
+				_key["key"] = strings.Split(keys, " ")
+				a_key[0] = _key
+				if len(a_key) > 0 {
+					ok := db.Mgo.UpdateById("user", userId, bson.M{
+						"$push": bson.M{
+							updateItems + ".a_items." + strconv.Itoa(classify_index) + ".a_key": bson.M{
+								"$each": a_key,
+							},
+						},
+						"$set": bson.M{
+							updateItems + ".l_modifydate":                                        time.Now().Unix(),
+							updateItems + ".a_items." + strconv.Itoa(classify_index) + ".s_item": classify_name,
+						},
+					})
+					if ok {
+						flag = "y"
+					}
+				}
+			}
+		}
+	} else {
+		updateItems = "o_entniche"
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		data, ok := db.Mgo.Find("entniche_rule", query, `{"o_entniche.a_items":1}`, nil, false, -1, -1)
+		var repleat = false
+		var classify_index = -1
+		var kwsCount = 0
+		if len([]rune(keys)) > 20 {
+			keys = qutil.SubString(keys, 0, 20)
+		}
+		if ok && data != nil && len(*data) > 0 && keys != "" {
+			updateObj, _ := (*data)[0]["o_entniche"].(map[string]interface{})
+			if updateObj["a_items"] != nil {
+				a_items := updateObj["a_items"].([]interface{})
+				for k, v := range a_items {
+					tmp := qutil.ObjToMap(v.(map[string]interface{}))
+					a_key := (*tmp)["a_key"].([]interface{})
+					kwsCount = kwsCount + len(a_key)
+					if (*tmp)["s_item"] == "未分类" {
+						classify_index = k
+					}
+					for _, n := range a_key {
+						ntmp := qutil.ObjToMap(n.(interface{}))
+						nkey := qutil.ObjArrToStringArr((*ntmp)["key"].([]interface{}))
+						if strings.Join(nkey, " ") == keys {
+							repleat = true
+							break
+						}
+					}
+					if repleat {
+						break
+					}
+				}
+				if classify_index == -1 {
+					classify_index = len(a_items)
+				}
+			} else {
+				//无关键词 直接添加
+				if ok := db.Mgo.Update("entniche_rule", query, bson.M{"$set": bson.M{"o_entniche.a_items": bson.A{bson.M{"s_item": "未分类",
+					"a_key":      bson.A{bson.M{"key": bson.A{keys}}},
+					"updatetime": time.Now().Unix()}},
+					"l_updatetime": time.Now().Unix(),
+				}}, true, false); ok {
+					flag = "y"
+				}
+				return map[string]interface{}{"flag": flag}
+			}
+			if repleat {
+				flag = "o"
+			} else if kwsCount >= 300 {
+				flag = "m"
+			} else {
+				var _key = make(map[string]interface{})
+				var a_key = make([]map[string]interface{}, 1)
+				classify_name := "未分类"
+				_key["key"] = strings.Split(keys, " ")
+				a_key[0] = _key
+				if len(a_key) > 0 {
+					ok := db.Mgo.Update("entniche_rule", query, bson.M{
+
+						"$push": bson.M{
+							updateItems + ".a_items." + strconv.Itoa(classify_index) + ".a_key": bson.M{
+								"$each": a_key,
+							},
+						},
+						"$set": bson.M{
+							"l_updatetime": time.Now().Unix(),
+							updateItems + ".a_items." + strconv.Itoa(classify_index) + ".s_item":     classify_name,
+							updateItems + ".a_items." + strconv.Itoa(classify_index) + ".updatetime": time.Now().Unix(),
+						},
+					}, true, false)
+					if ok {
+						flag = "y"
+					}
+				}
+			}
+		}
+	}
+	return map[string]interface{}{"flag": flag}
 }
 
 //订阅设置记录
 func SetLog(userid, types string, power, entUserId, entId int) {
-        if power == 1 {
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                res, _ := db.Mgo.FindOne("entniche_rule", query)
-                if res != nil && len(*res) > 0 {
-                        (*res)["userid"] = userid
-                        (*res)["type"] = types
-                        (*res)["createtime"] = time.Now().Unix()
-                        db.Mgo_Log.Save("ovipjy_log", res)
-                }
-        } else {
-                if data, ok := db.Mgo.FindById("user", userid, `{"o_vipjy":1,"o_member_jy":1,"o_jy":1}`); len(*data) > 0 && ok && data != nil {
-                        (*data)["userid"] = userid
-                        (*data)["type"] = types
-                        (*data)["createtime"] = time.Now().Unix()
-                        db.Mgo_Log.Save("ovipjy_log", data)
-                }
-        }
+	if power == 1 {
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		res, _ := db.Mgo.FindOne("entniche_rule", query)
+		if res != nil && len(*res) > 0 {
+			(*res)["userid"] = userid
+			(*res)["type"] = types
+			(*res)["createtime"] = time.Now().Unix()
+			db.Mgo_Log.Save("ovipjy_log", res)
+		}
+	} else {
+		if data, ok := db.Mgo.FindById("user", userid, `{"o_vipjy":1,"o_member_jy":1,"o_jy":1}`); len(*data) > 0 && ok && data != nil {
+			(*data)["userid"] = userid
+			(*data)["type"] = types
+			(*data)["createtime"] = time.Now().Unix()
+			db.Mgo_Log.Save("ovipjy_log", data)
+		}
+	}
 }

+ 532 - 529
src/jfw/modules/publicapply/src/subscribePush/entity/setting.go

@@ -1,608 +1,611 @@
 package entity
 
 import (
-        "app.yhyue.com/moapp/jybase/redis"
-        "jy/src/jfw/modules/publicapply/src/db"
-        "errors"
-        "fmt"
-        "log"
-        qutil "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-        "sort"
-        "strings"
-        "time"
-        "jy/src/jfw/modules/publicapply/src/util"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"errors"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/config"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"jy/src/jfw/modules/publicapply/src/util"
+	"log"
+	"sort"
+	"strings"
+	"time"
 )
 
 //订阅设置设置修改
 type SubscribeSet struct {
-        Area      map[string]interface{} //地区
-        Industry  []string               //行业
-        UserId    string                 //用户id
-        Type      string                 //类型
-        EntId     int
-        EntUserId int
+	Area       map[string]interface{} //地区
+	Industry   []string               //行业
+	UserId     string                 //用户id
+	Type       string                 //类型
+	EntId      int
+	EntUserId  int
+	BaseUserId int64
+	AccountId  int64
 }
 
 func (this *SubscribeSet) SetAreaAndIndustry() *FuncResult {
-        area := this.Area
-        industry := this.Industry
-        userId := this.UserId
-        typ := this.Type
-        power := 0
-        if typ == "m" {
-                infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%大会员%' ", this.EntId)
-                if infoCount > 0 {
-                        power = 1
-                }
-                return memberSet(area, industry, userId, power, this.EntUserId, this.EntId)
-        } else if typ == "v" {
-                infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%VIP订阅%' ", this.EntId)
-                if infoCount > 0 {
-                        power = 1
-                }
-                return vipSet(area, industry, userId, power, this.EntUserId, this.EntId)
-        } else {
-                return freeSet(area, industry, userId)
-        }
+	area := this.Area
+	industry := this.Industry
+	userId := this.UserId
+	typ := this.Type
+	power := 0
+	if typ == "m" {
+		infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%大会员%' ", this.EntId)
+		if infoCount > 0 {
+			power = 1
+		}
+		return memberSet(area, industry, userId, power, this.EntUserId, this.EntId)
+	} else if typ == "v" {
+		infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%VIP订阅%' ", this.EntId)
+		if infoCount > 0 {
+			power = 1
+		}
+		return vipSet(area, industry, userId, power, this.EntUserId, this.EntId)
+	} else {
+		return freeSet(area, industry, userId)
+	}
 }
 
 //
 func freeSet(area map[string]interface{}, industry []string, userId string) *FuncResult {
-        //isfirst:是否第一次设置地区;ppb:是否购买省级订阅包; areacount:省份订阅包购买的省份数量-1:全国 无限制调整
-        isfirst, ppb, areacount := IsCanSet(userId, area)
-        //购买省份订阅包 已调整地区次数
-        ppnum := 0
-        //免费用户购买省份订阅包 按月算
-        ym := fmt.Sprint(time.Now().Year()) + "-" + fmt.Sprint(time.Now().Month())
-        if ppb {
-                ppnum = redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, ym))
-        } else if len(area) == 0 {
-                return &FuncResult{false, errors.New("地区参数异常"), nil}
-        }
-        //免费用户未购买省份订阅包 按年算
-        year := fmt.Sprint(time.Now().Year())
-        //免费用户 已调整地区次数
-        fpnum := redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, year))
-        // log.Println(len(area), "fpnum:", fpnum, "ppnum:", ppnum)
-        //第一次设置地区 || 购买全国  不扣次数
-        var issetredis = areacount > -1 && !isfirst
-        if issetredis {
-                //地区范围判断
-                if areacount+jy.BaseAreaNum < len(area) {
-                        return &FuncResult{false, errors.New("超出地区可设置范围"), nil}
-                }
-                //地区调整次数判断
-                if areacount+jy.BaseAreaNum <= ppnum { //+fpnum
-                        return &FuncResult{false, errors.New(fmt.Sprintf("订阅地区调整次数(%d)已用完", areacount+jy.BaseAreaNum)), nil}
-                }
-        }
-        //清楚缓存
-        jy.ClearBigVipUserPower(userId)
-        if !FreeSubChange(userId, &area, industry, ppb, isfirst) {
-                return &FuncResult{false, errors.New("保存修改出错"), nil}
-        } else if issetredis { //更新调整次数 非全国(第一次 不消耗次数)
-                //优先使用省份订阅包次数
-                // log.Println(areacount, "---", ppnum)
-                // log.Println(jy.BaseAreaNum, "---", fpnum)
-                if ppb {
-                        if areacount+jy.BaseAreaNum > ppnum {
-                                redis.Put(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, ym), ppnum+1, 31*24*60*60)
-                        } else {
-                                log.Println(fmt.Sprintf("免费用户购买省份订阅包设置地区 扣除次数异常  userId:%s", userId))
-                        }
-                } else if jy.BaseAreaNum > fpnum {
-                        redis.Put(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, year), fpnum+1, 365*24*60*60)
-                } else {
-                        log.Println(fmt.Sprintf("免费用户设置地区 扣除次数异常  userId:%s", userId))
-                }
-        }
-        SetLog(userId, "o_jy", 0, 0, 0)
-        return &FuncResult{true, nil, map[string]interface{}{
-                "doSuccess": true,
-        }}
+	//isfirst:是否第一次设置地区;ppb:是否购买省级订阅包; areacount:省份订阅包购买的省份数量-1:全国 无限制调整
+	isfirst, ppb, areacount := IsCanSet(userId, area)
+	//购买省份订阅包 已调整地区次数
+	ppnum := 0
+	//免费用户购买省份订阅包 按月算
+	ym := fmt.Sprint(time.Now().Year()) + "-" + fmt.Sprint(time.Now().Month())
+	if ppb {
+		ppnum = redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, ym))
+	} else if len(area) == 0 {
+		return &FuncResult{false, errors.New("地区参数异常"), nil}
+	}
+	//免费用户未购买省份订阅包 按年算
+	year := fmt.Sprint(time.Now().Year())
+	//免费用户 已调整地区次数
+	fpnum := redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, year))
+	// log.Println(len(area), "fpnum:", fpnum, "ppnum:", ppnum)
+	//第一次设置地区 || 购买全国  不扣次数
+	var issetredis = areacount > -1 && !isfirst
+	if issetredis {
+		//地区范围判断
+		if areacount+jy.BaseAreaNum < len(area) {
+			return &FuncResult{false, errors.New("超出地区可设置范围"), nil}
+		}
+		//地区调整次数判断
+		if areacount+jy.BaseAreaNum <= ppnum { //+fpnum
+			return &FuncResult{false, errors.New(fmt.Sprintf("订阅地区调整次数(%d)已用完", areacount+jy.BaseAreaNum)), nil}
+		}
+	}
+	//清楚缓存
+	jy.ClearBigVipUserPower(userId)
+	if !FreeSubChange(userId, &area, industry, ppb, isfirst) {
+		return &FuncResult{false, errors.New("保存修改出错"), nil}
+	} else if issetredis { //更新调整次数 非全国(第一次 不消耗次数)
+		//优先使用省份订阅包次数
+		// log.Println(areacount, "---", ppnum)
+		// log.Println(jy.BaseAreaNum, "---", fpnum)
+		if ppb {
+			if areacount+jy.BaseAreaNum > ppnum {
+				redis.Put(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, ym), ppnum+1, 31*24*60*60)
+			} else {
+				log.Println(fmt.Sprintf("免费用户购买省份订阅包设置地区 扣除次数异常  userId:%s", userId))
+			}
+		} else if jy.BaseAreaNum > fpnum {
+			redis.Put(jy.PowerCacheDb, fmt.Sprintf(jy.UserUpdateAreaKey, userId, year), fpnum+1, 365*24*60*60)
+		} else {
+			log.Println(fmt.Sprintf("免费用户设置地区 扣除次数异常  userId:%s", userId))
+		}
+	}
+	SetLog(userId, "o_jy", 0, 0, 0)
+	return &FuncResult{true, nil, map[string]interface{}{
+		"doSuccess": true,
+	}}
 }
 
 //免费用户地区调整
 func FreeSubChange(userId string, area *map[string]interface{}, industry []string, ppb, isfirst bool) bool {
-        setMap := map[string]interface{}{"$set": map[string]interface{}{
-                "o_jy.o_area":    area, //设置地区
-                "o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
-        }}
-        if ppb {
-                setMap = map[string]interface{}{"$set": map[string]interface{}{
-                        "o_jy.o_area_p":  area, //设置地区
-                        "o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
-                }}
-        }
-        updateOk := db.Mgo.UpdateById("user", userId, setMap)
-        if !updateOk {
-                return false
-        }
-        return true
+	setMap := map[string]interface{}{"$set": map[string]interface{}{
+		"o_jy.o_area":    area, //设置地区
+		"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
+	}}
+	if ppb {
+		setMap = map[string]interface{}{"$set": map[string]interface{}{
+			"o_jy.o_area_p":  area, //设置地区
+			"o_jy.i_newfree": 1,    //老免费用户=>新订阅设置页面 20211122
+		}}
+	}
+	updateOk := db.Mgo.UpdateById("user", userId, setMap)
+	if !updateOk {
+		return false
+	}
+	return true
 }
 
 //是否可进行地区调整
 func IsCanSet(userId string, areamap map[string]interface{}) (bool, bool, int) {
-        areacount := 0
-        myarea := []string{}
-        setarea := []string{}
-        myareamap := map[string]interface{}{}
-        mData, ok := db.Mgo.FindById("user", userId, `{"o_jy":1}`)
-        if !ok || len(*mData) == 0 || mData == nil {
-                return false, false, areacount
-        }
-        o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
-        //地区是否完全一致
-        if o_jy["o_area"] != nil {
-                myareamap = *qutil.ObjToMap(o_jy["o_area"])
+	areacount := 0
+	myarea := []string{}
+	setarea := []string{}
+	myareamap := map[string]interface{}{}
+	mData, ok := db.Mgo.FindById("user", userId, `{"o_jy":1}`)
+	if !ok || len(*mData) == 0 || mData == nil {
+		return false, false, areacount
+	}
+	o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
+	//地区是否完全一致
+	if o_jy["o_area"] != nil {
+		myareamap = *qutil.ObjToMap(o_jy["o_area"])
 
-        }
-        //是否购买省份订阅包
-        if o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > 0 {
-                o_buyset_p, _ := o_jy["o_buyset_p"].(map[string]interface{})
-                areacount = qutil.IntAll(o_buyset_p["areacount"]) //-1 全国无限制
-                myareamap = *qutil.ObjToMap(o_jy["o_area_p"])
-        }
-        myareabool := map[string]bool{}
-        areasize := 0
-        //库中地区
-        for oak, _ := range myareamap {
-                myareabool[oak] = true
-                myarea = append(myarea, oak)
-        }
-        //参数地区
-        for sak, _ := range areamap {
-                if myareabool[sak] {
-                        areasize += 1
-                }
-                setarea = append(setarea, sak)
-        }
-        if areaSort(setarea) == areaSort(myarea) || areasize == len(setarea) {
-                log.Println(setarea, "-地区选择前后一致或地区调整在已选择地区范围内-", myarea)
-                return true, qutil.IntAll(o_jy["i_ppstatus"]) > 0, areacount
-        }
-        // log.Println(areaSort(setarea) == areaSort(myarea), "---areacount:", areacount)
-        return o_jy["o_area"] == nil, qutil.IntAll(o_jy["i_ppstatus"]) > 0, areacount
+	}
+	//是否购买省份订阅包
+	if o_jy["i_ppstatus"] != nil && qutil.IntAll(o_jy["i_ppstatus"]) > 0 {
+		o_buyset_p, _ := o_jy["o_buyset_p"].(map[string]interface{})
+		areacount = qutil.IntAll(o_buyset_p["areacount"]) //-1 全国无限制
+		myareamap = *qutil.ObjToMap(o_jy["o_area_p"])
+	}
+	myareabool := map[string]bool{}
+	areasize := 0
+	//库中地区
+	for oak, _ := range myareamap {
+		myareabool[oak] = true
+		myarea = append(myarea, oak)
+	}
+	//参数地区
+	for sak, _ := range areamap {
+		if myareabool[sak] {
+			areasize += 1
+		}
+		setarea = append(setarea, sak)
+	}
+	if areaSort(setarea) == areaSort(myarea) || areasize == len(setarea) {
+		log.Println(setarea, "-地区选择前后一致或地区调整在已选择地区范围内-", myarea)
+		return true, qutil.IntAll(o_jy["i_ppstatus"]) > 0, areacount
+	}
+	// log.Println(areaSort(setarea) == areaSort(myarea), "---areacount:", areacount)
+	return o_jy["o_area"] == nil, qutil.IntAll(o_jy["i_ppstatus"]) > 0, areacount
 }
 
 //
 func areaSort(area []string) string {
-        sort.Slice(area, func(i, j int) bool {
-                return area[i] < area[j]
-        })
-        return strings.Join(area, ",")
+	sort.Slice(area, func(i, j int) bool {
+		return area[i] < area[j]
+	})
+	return strings.Join(area, ",")
 }
 
 //
 func vipSet(area map[string]interface{}, industry []string, userId string, power, entUserId, entId int) *FuncResult {
-        if len(industry) == 1 && industry[0] == "" {
-                industry = []string{}
-        }
-        rData, oldBuyset, isVip := GetVipDetail(userId)
-        if !isVip {
-                return &FuncResult{false, errors.New("请求异常,非vip状态"), nil}
-        }
-        if power == 1 {
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                res, _ := db.Mgo.FindOne("entniche_rule", query)
-                if res != nil && len(*res) > 0 {
-                        rData = qutil.ObjToMap((*res))
-                }
-        }
-        if rData == nil || len(*rData) == 0 {
-                return &FuncResult{false, errors.New("获取信息失败"), nil}
-        }
-        newBuyset := NewBuySet(&area, industry, oldBuyset.Upgrade == 1)
+	if len(industry) == 1 && industry[0] == "" {
+		industry = []string{}
+	}
+	rData, oldBuyset, isVip := GetVipDetail(userId)
+	if !isVip {
+		return &FuncResult{false, errors.New("请求异常,非vip状态"), nil}
+	}
+	if power == 1 {
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		res, _ := db.Mgo.FindOne("entniche_rule", query)
+		if res != nil && len(*res) > 0 {
+			rData = qutil.ObjToMap((*res))
+		}
+	}
+	if rData == nil || len(*rData) == 0 {
+		return &FuncResult{false, errors.New("获取信息失败"), nil}
+	}
+	newBuyset := NewBuySet(&area, industry, oldBuyset.Upgrade == 1)
 
-        if needUpgrade := needUpgrade(newBuyset, oldBuyset); needUpgrade {
-                log.Printf("%s 订阅内容超出套餐 %+v area:%v industry:%v", userId, oldBuyset, area, industry)
-                return &FuncResult{false, errors.New("订阅内容超出套餐"), nil}
-        }
-        if power == 1 {
-                if !VipSubChange(userId, qutil.ObjToMap((*rData)["o_entniche"]), &area, industry, power, entUserId, entId) {
-                        return &FuncResult{false, errors.New("保存修改出错"), nil}
-                }
-        } else {
-                if !VipSubChange(userId, qutil.ObjToMap((*rData)["o_vipjy"]), &area, industry, power, entUserId, entId) {
-                        return &FuncResult{false, errors.New("保存修改出错"), nil}
-                }
-        }
+	if needUpgrade := needUpgrade(newBuyset, oldBuyset); needUpgrade {
+		log.Printf("%s 订阅内容超出套餐 %+v area:%v industry:%v", userId, oldBuyset, area, industry)
+		return &FuncResult{false, errors.New("订阅内容超出套餐"), nil}
+	}
+	if power == 1 {
+		if !VipSubChange(userId, qutil.ObjToMap((*rData)["o_entniche"]), &area, industry, power, entUserId, entId) {
+			return &FuncResult{false, errors.New("保存修改出错"), nil}
+		}
+	} else {
+		if !VipSubChange(userId, qutil.ObjToMap((*rData)["o_vipjy"]), &area, industry, power, entUserId, entId) {
+			return &FuncResult{false, errors.New("保存修改出错"), nil}
+		}
+	}
 
-        SetLog(userId, "o_vipjy", power, entUserId, entId)
-        return &FuncResult{true, nil, map[string]interface{}{
-                "doSuccess": true,
-        }}
+	SetLog(userId, "o_vipjy", power, entUserId, entId)
+	return &FuncResult{true, nil, map[string]interface{}{
+		"doSuccess": true,
+	}}
 }
 
 //大会员订阅设置
-func memberSet(area map[string]interface{}, industry []string, userId string, power, entUserId, entId int) *FuncResult {
-        if data := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo); data.Status <= 0 {
-                return &FuncResult{false, errors.New("请求异常,非大会员状态"), nil}
-        }
-        if len(industry) == 1 && industry[0] == "" {
-                industry = []string{}
-        }
-        if !MemberSubChange(userId, &area, industry, power, entUserId, entId) {
-                return &FuncResult{false, errors.New("保存修改出错"), nil}
-        }
-        SetLog(userId, "o_member_jy", power, entUserId, entId)
-        return &FuncResult{true, nil, map[string]interface{}{
-                "doSuccess": true,
-        }}
+func memberSet(area map[string]interface{}, industry []string, userId string, power, entUserId, entId, baseUserId, accountId int) *FuncResult {
+	if data := jy.GetBigVipUserBaseMsg("10000", userId, qutil.Int64All(baseUserId), qutil.Int64All(accountId), qutil.Int64All(entId), config.Config.Etcd.Key, config.Config.Etcd.Key); data.Status <= 0 {
+		return &FuncResult{false, errors.New("请求异常,非大会员状态"), nil}
+	}
+	if len(industry) == 1 && industry[0] == "" {
+		industry = []string{}
+	}
+	if !MemberSubChange(userId, &area, industry, power, entUserId, entId) {
+		return &FuncResult{false, errors.New("保存修改出错"), nil}
+	}
+	SetLog(userId, "o_member_jy", power, entUserId, entId)
+	return &FuncResult{true, nil, map[string]interface{}{
+		"doSuccess": true,
+	}}
 }
 
 //购买内容
 type SubvipBuySet struct {
-        Upgrade         int   `json:"upgrade"`         //是否是升级版;1是 其他不是
-        AreaCount       int   `json:"areacount"`       //-1 全国  >0 省份数量
-        NewCitys        []int `json:"newcitys"`        //城市数量(新)
-        BuyerclassCount int   `json:"buyerclasscount"` //行业数
+	Upgrade         int   `json:"upgrade"`         //是否是升级版;1是 其他不是
+	AreaCount       int   `json:"areacount"`       //-1 全国  >0 省份数量
+	NewCitys        []int `json:"newcitys"`        //城市数量(新)
+	BuyerclassCount int   `json:"buyerclasscount"` //行业数
 }
 
 //获取省份,城市,行业购买内容
 //[省份,城市,行业]
 func GetVipDetail(userId string) (*map[string]interface{}, *SubvipBuySet, bool) {
-        mData, ok := db.Mgo.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1,"l_vip_endtime":1,"l_vip_starttime":1,"isread":1}`)
-        if !ok || len(*mData) == 0 || mData == nil {
-                return nil, nil, false
-        }
-        //是否处于vip状态
-        vipStatus := qutil.IntAll((*mData)["i_vip_status"])
-        tmp := qutil.ObjToMap((*qutil.ObjToMap((*mData)["o_vipjy"]))["o_buyset"])
+	mData, ok := db.Mgo.FindById("user", userId, `{"o_vipjy":1,"i_vip_status":1,"l_vip_endtime":1,"l_vip_starttime":1,"isread":1}`)
+	if !ok || len(*mData) == 0 || mData == nil {
+		return nil, nil, false
+	}
+	//是否处于vip状态
+	vipStatus := qutil.IntAll((*mData)["i_vip_status"])
+	tmp := qutil.ObjToMap((*qutil.ObjToMap((*mData)["o_vipjy"]))["o_buyset"])
 
-        newCity, ok := (*tmp)["newcitys"].([]interface{})
+	newCity, ok := (*tmp)["newcitys"].([]interface{})
 
-        return mData, &SubvipBuySet{
-                qutil.IntAll((*tmp)["upgrade"]),
-                qutil.IntAll((*tmp)["areacount"]),
-                util.ConfirmIntArr(newCity),
-                qutil.IntAll((*tmp)["buyerclasscount"]),
-        }, vipStatus > 0
+	return mData, &SubvipBuySet{
+		qutil.IntAll((*tmp)["upgrade"]),
+		qutil.IntAll((*tmp)["areacount"]),
+		util.ConfirmIntArr(newCity),
+		qutil.IntAll((*tmp)["buyerclasscount"]),
+	}, vipStatus > 0
 }
 
 var SubVipPrice subVipPrice
 
 func init() {
-        qutil.ReadConfig("./subvip_price.json", &SubVipPrice)
+	qutil.ReadConfig("./subvip_price.json", &SubVipPrice)
 }
 
 //价格表
 type subVipPrice struct {
-        Old struct {
-                Month struct {
-                        OneCity_oneBuyerClass     int `json:"oneCity_oneBuyerClass"`     //一个城市一个行业
-                        OneCity_allBuyerClass     int `json:"oneCity_allBuyerClass"`     //一个城市全部行业
-                        OneProvince_oneBuyerClass int `json:"oneProvince_oneBuyerClass"` //一个省份一个行业
-                        OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
-                        AllProvince_oneBuyerClass int `json:"allProvince_oneBuyerClass"` //全国一个行业
-                        AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
-                } `json:"month"`
-                Year struct {
-                        OneCity_oneBuyerClass     int `json:"oneCity_oneBuyerClass"`     //一个城市一个行业
-                        OneCity_allBuyerClass     int `json:"oneCity_allBuyerClass"`     //一个城市全部行业
-                        OneProvince_oneBuyerClass int `json:"oneProvince_oneBuyerClass"` //一个省份一个行业
-                        OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
-                        AllProvince_oneBuyerClass int `json:"allProvince_oneBuyerClass"` //全国一个行业
-                        AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
-                } `json:"year"`
-                CityPrice          int `json:"cityPrice"`          //单个城市价格
-                ProvincePrice      int `json:"provincePrice"`      //单个省份价格
-                BuyerClassPrice    int `json:"buyerClassPrice"`    //单个行业价格
-                CityMaxCount       int `json:"cityMaxCount"`       //单个省份城市可计价最大数量
-                ProvinceMaxCount   int `json:"provinceMaxCount"`   //所有地区中省份可计价最大数量
-                BuyerClassMaxCount int `json:"buyerClassMaxCount"` //行业价格可计价最大数量
-                MonthMaxCount      int `json:"monthMaxCount"`      //月份可计价最大数量
-        } `json:"old"`
-        New struct {
-                Month struct {
-                        OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
-                        AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
-                } `json:"month"`
-                Quarter struct {
-                        OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
-                        AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
-                } `json:"quarter"`
-                Year struct {
-                        OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
-                        AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
-                } `json:"year"`
-                ProvincePrice    int `json:"provincePrice"`    //单个省份价格
-                ProvinceMaxCount int `json:"provinceMaxCount"` //所有地区中省份可计价最大数量
-                MonthMaxCount    int `json:"monthMaxCount"`    //月份可计价最大数量
-        } `json:"new"`
-        Discount float64 `json:"discount"` //折扣(测试使用)
+	Old struct {
+		Month struct {
+			OneCity_oneBuyerClass     int `json:"oneCity_oneBuyerClass"`     //一个城市一个行业
+			OneCity_allBuyerClass     int `json:"oneCity_allBuyerClass"`     //一个城市全部行业
+			OneProvince_oneBuyerClass int `json:"oneProvince_oneBuyerClass"` //一个省份一个行业
+			OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+			AllProvince_oneBuyerClass int `json:"allProvince_oneBuyerClass"` //全国一个行业
+			AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+		} `json:"month"`
+		Year struct {
+			OneCity_oneBuyerClass     int `json:"oneCity_oneBuyerClass"`     //一个城市一个行业
+			OneCity_allBuyerClass     int `json:"oneCity_allBuyerClass"`     //一个城市全部行业
+			OneProvince_oneBuyerClass int `json:"oneProvince_oneBuyerClass"` //一个省份一个行业
+			OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+			AllProvince_oneBuyerClass int `json:"allProvince_oneBuyerClass"` //全国一个行业
+			AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+		} `json:"year"`
+		CityPrice          int `json:"cityPrice"`          //单个城市价格
+		ProvincePrice      int `json:"provincePrice"`      //单个省份价格
+		BuyerClassPrice    int `json:"buyerClassPrice"`    //单个行业价格
+		CityMaxCount       int `json:"cityMaxCount"`       //单个省份城市可计价最大数量
+		ProvinceMaxCount   int `json:"provinceMaxCount"`   //所有地区中省份可计价最大数量
+		BuyerClassMaxCount int `json:"buyerClassMaxCount"` //行业价格可计价最大数量
+		MonthMaxCount      int `json:"monthMaxCount"`      //月份可计价最大数量
+	} `json:"old"`
+	New struct {
+		Month struct {
+			OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+			AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+		} `json:"month"`
+		Quarter struct {
+			OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+			AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+		} `json:"quarter"`
+		Year struct {
+			OneProvince_allBuyerClass int `json:"oneProvince_allBuyerClass"` //一个省份全部行业
+			AllProvince_allBuyerClass int `json:"allProvince_allBuyerClass"` //全国全行业
+		} `json:"year"`
+		ProvincePrice    int `json:"provincePrice"`    //单个省份价格
+		ProvinceMaxCount int `json:"provinceMaxCount"` //所有地区中省份可计价最大数量
+		MonthMaxCount    int `json:"monthMaxCount"`    //月份可计价最大数量
+	} `json:"new"`
+	Discount float64 `json:"discount"` //折扣(测试使用)
 }
 
 //超级订阅获取购买项
 func NewBuySet(area *map[string]interface{}, industry []string, isUpgrade bool) *SubvipBuySet {
-        pCount := -1
-        citys := []int{}
-        if area != nil {
-                if (*area)["全国"] != nil {
-                        area = &map[string]interface{}{}
-                } else if pCount_tmp := qutil.IntAll((*area)["areacount"]); pCount_tmp > 0 {
-                        pCount = pCount_tmp
-                }
-        }
-        buyset := SubvipBuySet{}
-        if !isUpgrade {
-                buyset.Upgrade = 0 //升级版超级订阅标识
-                if len(*area) > 0 {
-                        pCount = 0
-                        for _, v := range *area {
-                                tmp := v.([]interface{})
-                                if len(tmp) == 0 || len(tmp) > SubVipPrice.Old.CityMaxCount { //省份
-                                        pCount++
-                                } else { //城市
-                                        citys = append(citys, len(tmp))
-                                }
-                        }
-                        //省份数量自动转换全国
-                        if pCount > SubVipPrice.Old.ProvinceMaxCount {
-                                pCount = -1
-                                citys = []int{}
-                        }
-                }
-                buyset.NewCitys = citys
-                buyset.AreaCount = pCount //地区
-                //行业数量自动转换全行业
-                buyset.BuyerclassCount = len(industry)
-                if len(industry) > SubVipPrice.Old.BuyerClassMaxCount || len(industry) == 0 {
-                        buyset.BuyerclassCount = -1
-                }
-        } else {
-                buyset.Upgrade = 1 //升级版超级订阅标识
-                if len(*area) > 0 {
-                        pCount = len(*area)
-                        //省份数量自动转换全国
-                        if pCount > SubVipPrice.New.ProvinceMaxCount {
-                                pCount = -1
-                        }
-                } else {
-                        buyset.AreaCount = -1 //全国
-                }
-                buyset.AreaCount = pCount   //地区
-                buyset.NewCitys = citys     //城市,4.4改版不支持购买城市
-                buyset.BuyerclassCount = -1 //行业,4.4改版只能购买全行业
-        }
-        return &buyset
+	pCount := -1
+	citys := []int{}
+	if area != nil {
+		if (*area)["全国"] != nil {
+			area = &map[string]interface{}{}
+		} else if pCount_tmp := qutil.IntAll((*area)["areacount"]); pCount_tmp > 0 {
+			pCount = pCount_tmp
+		}
+	}
+	buyset := SubvipBuySet{}
+	if !isUpgrade {
+		buyset.Upgrade = 0 //升级版超级订阅标识
+		if len(*area) > 0 {
+			pCount = 0
+			for _, v := range *area {
+				tmp := v.([]interface{})
+				if len(tmp) == 0 || len(tmp) > SubVipPrice.Old.CityMaxCount { //省份
+					pCount++
+				} else { //城市
+					citys = append(citys, len(tmp))
+				}
+			}
+			//省份数量自动转换全国
+			if pCount > SubVipPrice.Old.ProvinceMaxCount {
+				pCount = -1
+				citys = []int{}
+			}
+		}
+		buyset.NewCitys = citys
+		buyset.AreaCount = pCount //地区
+		//行业数量自动转换全行业
+		buyset.BuyerclassCount = len(industry)
+		if len(industry) > SubVipPrice.Old.BuyerClassMaxCount || len(industry) == 0 {
+			buyset.BuyerclassCount = -1
+		}
+	} else {
+		buyset.Upgrade = 1 //升级版超级订阅标识
+		if len(*area) > 0 {
+			pCount = len(*area)
+			//省份数量自动转换全国
+			if pCount > SubVipPrice.New.ProvinceMaxCount {
+				pCount = -1
+			}
+		} else {
+			buyset.AreaCount = -1 //全国
+		}
+		buyset.AreaCount = pCount   //地区
+		buyset.NewCitys = citys     //城市,4.4改版不支持购买城市
+		buyset.BuyerclassCount = -1 //行业,4.4改版只能购买全行业
+	}
+	return &buyset
 }
 
 //是否需要升级
 func needUpgrade(newBuySet, oldBuySet *SubvipBuySet) bool {
-        if newBuySet.Upgrade != 1 { //旧版本订阅是否需要升级校验
-                BuyerclassUpgrade, AreaNeedUpgrade := false, false
-                UpgradeBuyset := &SubvipBuySet{
-                        oldBuySet.Upgrade,
-                        oldBuySet.AreaCount,
-                        oldBuySet.NewCitys,
-                        oldBuySet.BuyerclassCount,
-                }
-                //比较行业
-                if oldBuySet.BuyerclassCount != -1 {
-                        //若当前买的不是全行业,并且当前行业数量小于新行业数量时
-                        if oldBuySet.BuyerclassCount < newBuySet.BuyerclassCount || newBuySet.BuyerclassCount == -1 {
-                                BuyerclassUpgrade = true
-                                //计算升级后的buySet
-                                UpgradeBuyset.BuyerclassCount = newBuySet.BuyerclassCount
-                        }
-                }
-                //比较地区
-                if oldBuySet.AreaCount != -1 {
-                        if newBuySet.AreaCount == -1 { //升级为全国
-                                UpgradeBuyset.AreaCount = newBuySet.AreaCount
-                                UpgradeBuyset.NewCitys = newBuySet.NewCitys
-                                AreaNeedUpgrade = true
-                        } else {
-                                oldCitysBuyOne, oldCitysBuyTwo := 0, 0
-                                newCitysBuyOne, newCitysBuyTwo := 0, 0
-                                oldCopy := []int{} //复制(防止影响原数组)
-                                for _, v := range oldBuySet.NewCitys {
-                                        if v == 1 {
-                                                oldCitysBuyOne++
-                                        } else {
-                                                oldCitysBuyTwo++
-                                        }
-                                        oldCopy = append(oldCopy, v)
-                                }
-                                UpgradeBuyset.NewCitys = oldCopy
-                                for _, v := range newBuySet.NewCitys {
-                                        if v == 1 {
-                                                newCitysBuyOne++
-                                        } else {
-                                                newCitysBuyTwo++
-                                        }
-                                }
+	if newBuySet.Upgrade != 1 { //旧版本订阅是否需要升级校验
+		BuyerclassUpgrade, AreaNeedUpgrade := false, false
+		UpgradeBuyset := &SubvipBuySet{
+			oldBuySet.Upgrade,
+			oldBuySet.AreaCount,
+			oldBuySet.NewCitys,
+			oldBuySet.BuyerclassCount,
+		}
+		//比较行业
+		if oldBuySet.BuyerclassCount != -1 {
+			//若当前买的不是全行业,并且当前行业数量小于新行业数量时
+			if oldBuySet.BuyerclassCount < newBuySet.BuyerclassCount || newBuySet.BuyerclassCount == -1 {
+				BuyerclassUpgrade = true
+				//计算升级后的buySet
+				UpgradeBuyset.BuyerclassCount = newBuySet.BuyerclassCount
+			}
+		}
+		//比较地区
+		if oldBuySet.AreaCount != -1 {
+			if newBuySet.AreaCount == -1 { //升级为全国
+				UpgradeBuyset.AreaCount = newBuySet.AreaCount
+				UpgradeBuyset.NewCitys = newBuySet.NewCitys
+				AreaNeedUpgrade = true
+			} else {
+				oldCitysBuyOne, oldCitysBuyTwo := 0, 0
+				newCitysBuyOne, newCitysBuyTwo := 0, 0
+				oldCopy := []int{} //复制(防止影响原数组)
+				for _, v := range oldBuySet.NewCitys {
+					if v == 1 {
+						oldCitysBuyOne++
+					} else {
+						oldCitysBuyTwo++
+					}
+					oldCopy = append(oldCopy, v)
+				}
+				UpgradeBuyset.NewCitys = oldCopy
+				for _, v := range newBuySet.NewCitys {
+					if v == 1 {
+						newCitysBuyOne++
+					} else {
+						newCitysBuyTwo++
+					}
+				}
 
-                                p_Diff := newBuySet.AreaCount - oldBuySet.AreaCount
-                                c_1_diff := newCitysBuyOne - oldCitysBuyOne
-                                c_2_diff := newCitysBuyTwo - oldCitysBuyTwo
+				p_Diff := newBuySet.AreaCount - oldBuySet.AreaCount
+				c_1_diff := newCitysBuyOne - oldCitysBuyOne
+				c_2_diff := newCitysBuyTwo - oldCitysBuyTwo
 
-                                if p_Diff > 0 {
-                                        UpgradeBuyset.AreaCount = newBuySet.AreaCount
-                                }
+				if p_Diff > 0 {
+					UpgradeBuyset.AreaCount = newBuySet.AreaCount
+				}
 
-                                if p_Diff > 0 || p_Diff+c_2_diff > 0 || p_Diff+c_2_diff+c_1_diff > 0 {
-                                        //有多余未使用名额保留
-                                        if p_Diff+c_2_diff+c_1_diff < 0 {
-                                                if c_1_diff < 0 && p_Diff+c_2_diff >= 0 {
-                                                        c_1_diff = -(p_Diff + c_2_diff)
-                                                }
-                                                if c_2_diff < 0 && p_Diff+c_1_diff >= 0 {
-                                                        c_2_diff = -(p_Diff + c_1_diff)
-                                                }
-                                        }
+				if p_Diff > 0 || p_Diff+c_2_diff > 0 || p_Diff+c_2_diff+c_1_diff > 0 {
+					//有多余未使用名额保留
+					if p_Diff+c_2_diff+c_1_diff < 0 {
+						if c_1_diff < 0 && p_Diff+c_2_diff >= 0 {
+							c_1_diff = -(p_Diff + c_2_diff)
+						}
+						if c_2_diff < 0 && p_Diff+c_1_diff >= 0 {
+							c_2_diff = -(p_Diff + c_1_diff)
+						}
+					}
 
-                                        //需要升级
-                                        AreaNeedUpgrade = true
-                                        //计算升级后的buySet
-                                        if p_Diff < 0 { //有剩余省份未使用
-                                                if c_2_diff > 0 {
-                                                        c_2_diff += p_Diff //转移给两个市使用
-                                                } else {
-                                                        c_1_diff += p_Diff //转移给一个市使用
-                                                }
-                                        } else { //省份数量增加
-                                                UpgradeBuyset.AreaCount = newBuySet.AreaCount
-                                        }
-                                        del_2_flag, del_1_flag := 0, 0 //被占用
-                                        if c_2_diff < 0 {              //有两个城市的名额未使用完
-                                                if p_Diff > 0 {
-                                                        //转移给一个省使用
-                                                        if c_2_diff+p_Diff > 0 {
-                                                                del_2_flag += -c_2_diff
-                                                                c_2_diff = 0
-                                                                //p_Diff -= -c_2_diff;
-                                                        } else {
-                                                                c_2_diff += p_Diff
-                                                                del_2_flag += p_Diff
-                                                                //p_Diff = 0
-                                                        }
-                                                }
-                                                if c_1_diff > 0 && c_2_diff < 0 { //转移给一个市使用
-                                                        c_1_diff += c_2_diff
-                                                }
-                                        }
-                                        if c_1_diff < 0 { //有一个城市的名额未使用完
-                                                if p_Diff > 0 {
-                                                        if c_1_diff+p_Diff > 0 {
-                                                                del_1_flag += -c_1_diff
-                                                                c_1_diff = 0
-                                                                //p_Diff -= -c_1_diff
-                                                        } else {
-                                                                c_1_diff += p_Diff
-                                                                del_1_flag += p_Diff
-                                                                //p_Diff = 0
-                                                        }
-                                                }
-                                                if c_2_diff > 0 && c_1_diff < 0 {
-                                                        if c_1_diff+c_2_diff > 0 {
-                                                                del_1_flag += -c_1_diff
-                                                                c_1_diff = 0
-                                                                //c_2_diff -= -c_1_diff;
-                                                        } else {
-                                                                c_1_diff += c_2_diff
-                                                                del_1_flag += c_2_diff
-                                                                //c_2_diff = 0
-                                                        }
-                                                }
-                                        }
-                                        //删除顶替
-                                        log.Println("start", UpgradeBuyset.NewCitys, del_2_flag, del_1_flag)
-                                        index_flag := 0
-                                        for del_2_flag > 0 || del_1_flag > 0 {
-                                                valueFlag := UpgradeBuyset.NewCitys[index_flag]
-                                                if del_2_flag > 0 && valueFlag == 2 {
-                                                        UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys[:index_flag], UpgradeBuyset.NewCitys[index_flag+1:]...)
-                                                        del_2_flag--
-                                                        continue
-                                                } else if del_1_flag > 0 && valueFlag == 1 {
-                                                        UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys[:index_flag], UpgradeBuyset.NewCitys[index_flag+1:]...)
-                                                        del_1_flag--
-                                                        continue
-                                                }
-                                                index_flag++
-                                        }
-                                        log.Println("end", UpgradeBuyset.NewCitys, c_2_diff, c_1_diff)
-                                        //增加新增
-                                        for i := c_2_diff; i > 0; i-- { //添加购买两个市数量
-                                                UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys, 2)
-                                        }
+					//需要升级
+					AreaNeedUpgrade = true
+					//计算升级后的buySet
+					if p_Diff < 0 { //有剩余省份未使用
+						if c_2_diff > 0 {
+							c_2_diff += p_Diff //转移给两个市使用
+						} else {
+							c_1_diff += p_Diff //转移给一个市使用
+						}
+					} else { //省份数量增加
+						UpgradeBuyset.AreaCount = newBuySet.AreaCount
+					}
+					del_2_flag, del_1_flag := 0, 0 //被占用
+					if c_2_diff < 0 {              //有两个城市的名额未使用完
+						if p_Diff > 0 {
+							//转移给一个省使用
+							if c_2_diff+p_Diff > 0 {
+								del_2_flag += -c_2_diff
+								c_2_diff = 0
+								//p_Diff -= -c_2_diff;
+							} else {
+								c_2_diff += p_Diff
+								del_2_flag += p_Diff
+								//p_Diff = 0
+							}
+						}
+						if c_1_diff > 0 && c_2_diff < 0 { //转移给一个市使用
+							c_1_diff += c_2_diff
+						}
+					}
+					if c_1_diff < 0 { //有一个城市的名额未使用完
+						if p_Diff > 0 {
+							if c_1_diff+p_Diff > 0 {
+								del_1_flag += -c_1_diff
+								c_1_diff = 0
+								//p_Diff -= -c_1_diff
+							} else {
+								c_1_diff += p_Diff
+								del_1_flag += p_Diff
+								//p_Diff = 0
+							}
+						}
+						if c_2_diff > 0 && c_1_diff < 0 {
+							if c_1_diff+c_2_diff > 0 {
+								del_1_flag += -c_1_diff
+								c_1_diff = 0
+								//c_2_diff -= -c_1_diff;
+							} else {
+								c_1_diff += c_2_diff
+								del_1_flag += c_2_diff
+								//c_2_diff = 0
+							}
+						}
+					}
+					//删除顶替
+					log.Println("start", UpgradeBuyset.NewCitys, del_2_flag, del_1_flag)
+					index_flag := 0
+					for del_2_flag > 0 || del_1_flag > 0 {
+						valueFlag := UpgradeBuyset.NewCitys[index_flag]
+						if del_2_flag > 0 && valueFlag == 2 {
+							UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys[:index_flag], UpgradeBuyset.NewCitys[index_flag+1:]...)
+							del_2_flag--
+							continue
+						} else if del_1_flag > 0 && valueFlag == 1 {
+							UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys[:index_flag], UpgradeBuyset.NewCitys[index_flag+1:]...)
+							del_1_flag--
+							continue
+						}
+						index_flag++
+					}
+					log.Println("end", UpgradeBuyset.NewCitys, c_2_diff, c_1_diff)
+					//增加新增
+					for i := c_2_diff; i > 0; i-- { //添加购买两个市数量
+						UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys, 2)
+					}
 
-                                        for i := c_1_diff; i > 0; i-- { //添加购买一个市数量
-                                                UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys, 1)
-                                        }
-                                } else {
-                                        //不需要升级
-                                        AreaNeedUpgrade = false
-                                }
-                        }
-                }
-                if BuyerclassUpgrade || AreaNeedUpgrade {
-                        return true
-                } else {
-                        return false
-                }
-        } else {
-                //return newBuySet.AreaCount == -1 || newBuySet.AreaCount > oldBuySet.AreaCount
-                if oldBuySet.AreaCount != -1 {
-                        return newBuySet.AreaCount == -1 || newBuySet.AreaCount > oldBuySet.AreaCount
-                } else {
-                        return false
-                }
-        }
+					for i := c_1_diff; i > 0; i-- { //添加购买一个市数量
+						UpgradeBuyset.NewCitys = append(UpgradeBuyset.NewCitys, 1)
+					}
+				} else {
+					//不需要升级
+					AreaNeedUpgrade = false
+				}
+			}
+		}
+		if BuyerclassUpgrade || AreaNeedUpgrade {
+			return true
+		} else {
+			return false
+		}
+	} else {
+		//return newBuySet.AreaCount == -1 || newBuySet.AreaCount > oldBuySet.AreaCount
+		if oldBuySet.AreaCount != -1 {
+			return newBuySet.AreaCount == -1 || newBuySet.AreaCount > oldBuySet.AreaCount
+		} else {
+			return false
+		}
+	}
 }
 
 //超级订阅 订阅修改
 func VipSubChange(userId string, oldVip, areaNew *map[string]interface{}, industryNew []string, power, entUserId, entId int) bool {
-        updateOk := false
-        if power == 1 {
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                updateOk = db.Mgo.Update("entniche_rule", query,
-                        map[string]interface{}{"$set": map[string]interface{}{
-                                "o_entniche.o_area":       areaNew,     //设置地区
-                                "o_entniche.a_buyerclass": industryNew, //设置行业
-                                "l_updatetime":            time.Now().Unix(),
-                        }}, true, false)
-        } else {
-                updateOk = db.Mgo.UpdateById("user", userId,
-                        map[string]interface{}{"$set": map[string]interface{}{
-                                "o_vipjy.o_area":       areaNew,     //设置地区
-                                "o_vipjy.a_buyerclass": industryNew, //设置行业
-                        }})
-        }
-        if !updateOk {
-                return false
-        } else {
-                //保存修改日志
-                go func() {
-                        db.Mgo_Log.Save("subvip_edit_log", map[string]interface{}{
-                                "s_userid":         userId,
-                                "o_area_old":       (*oldVip)["o_area"],
-                                "a_buyerclass_old": (*oldVip)["a_buyerclass"],
-                                "o_area":           areaNew,
-                                "a_buyerclass":     industryNew,
-                                "l_changeTime":     time.Now().Unix(),
-                        })
-                }()
-        }
-        return true
+	updateOk := false
+	if power == 1 {
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		updateOk = db.Mgo.Update("entniche_rule", query,
+			map[string]interface{}{"$set": map[string]interface{}{
+				"o_entniche.o_area":       areaNew,     //设置地区
+				"o_entniche.a_buyerclass": industryNew, //设置行业
+				"l_updatetime":            time.Now().Unix(),
+			}}, true, false)
+	} else {
+		updateOk = db.Mgo.UpdateById("user", userId,
+			map[string]interface{}{"$set": map[string]interface{}{
+				"o_vipjy.o_area":       areaNew,     //设置地区
+				"o_vipjy.a_buyerclass": industryNew, //设置行业
+			}})
+	}
+	if !updateOk {
+		return false
+	} else {
+		//保存修改日志
+		go func() {
+			db.Mgo_Log.Save("subvip_edit_log", map[string]interface{}{
+				"s_userid":         userId,
+				"o_area_old":       (*oldVip)["o_area"],
+				"a_buyerclass_old": (*oldVip)["a_buyerclass"],
+				"o_area":           areaNew,
+				"a_buyerclass":     industryNew,
+				"l_changeTime":     time.Now().Unix(),
+			})
+		}()
+	}
+	return true
 }
 
 //超级订阅 订阅修改
 func MemberSubChange(userId string, areaNew *map[string]interface{}, industryNew []string, power, entUserId, entId int) bool {
-        if power == 1 {
-                query := map[string]interface{}{
-                        "i_userid": entUserId,
-                        "i_entid":  entId,
-                        "i_type":   1,
-                }
-                if updateOk := db.Mgo.Update("entniche_rule", query,
-                        map[string]interface{}{"$set": map[string]interface{}{
-                                "o_entniche.o_area":       areaNew,     //设置地区
-                                "o_entniche.a_buyerclass": industryNew, //设置行业
-                                "l_updatetime":            time.Now().Unix(),
-                        }}, true, false); !updateOk {
-                        return false
-                }
-        } else {
-                if updateOk := db.Mgo.UpdateById("user", userId,
-                        map[string]interface{}{"$set": map[string]interface{}{
-                                "o_member_jy.o_area":       areaNew,     //设置地区
-                                "o_member_jy.a_buyerclass": industryNew, //设置行业
-                        }}); !updateOk {
-                        return false
-                }
-        }
+	if power == 1 {
+		query := map[string]interface{}{
+			"i_userid": entUserId,
+			"i_entid":  entId,
+			"i_type":   1,
+		}
+		if updateOk := db.Mgo.Update("entniche_rule", query,
+			map[string]interface{}{"$set": map[string]interface{}{
+				"o_entniche.o_area":       areaNew,     //设置地区
+				"o_entniche.a_buyerclass": industryNew, //设置行业
+				"l_updatetime":            time.Now().Unix(),
+			}}, true, false); !updateOk {
+			return false
+		}
+	} else {
+		if updateOk := db.Mgo.UpdateById("user", userId,
+			map[string]interface{}{"$set": map[string]interface{}{
+				"o_member_jy.o_area":       areaNew,     //设置地区
+				"o_member_jy.a_buyerclass": industryNew, //设置行业
+			}}); !updateOk {
+			return false
+		}
+	}
 
-        return true
+	return true
 }

+ 5 - 2
src/jfw/modules/publicapply/src/subscribePush/service/pushList.go

@@ -38,19 +38,22 @@ func (sp *SubscribePush) VipSwitch() {
 		if userId == "" {
 			return nil, fmt.Errorf("未登录")
 		}
+		baseUserId := util.Int64All(sp.GetSession("base_user_id"))
+		entId := util.Int64All(sp.GetSession("entId"))
+		accountId := util.Int64All(sp.GetSession("accountId"))
 		switchOk := false
 		vt := sp.GetString("vt")
 		if vt == "" {
 			vt = jy.SwitchService.GetEntniche(sp.Session(), db.Mgo, db.Mysql)
 		} else if vt == jy.SubVipFlag {
-			vipMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+			vipMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 			if vipMsg.VipStatus <= 0 {
 				return nil, fmt.Errorf("未购买超级订阅")
 			}
 			sp.SetSession(jy.SwitchService.SessionKey, jy.SwitchService.Vip)
 			switchOk = true
 		} else if vt == jy.MemberFlag {
-			vipMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+			vipMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 			if vipMsg.Status <= 0 {
 				return nil, fmt.Errorf("未购买大会员")
 			}

+ 103 - 93
src/jfw/modules/publicapply/src/subscribePush/service/subscribe.go

@@ -1,108 +1,118 @@
 package service
 
 import (
-        qutil "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jybase/go-xweb/xweb"
-        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-        "jy/src/jfw/modules/publicapply/src/db"
-        "jy/src/jfw/modules/publicapply/src/subscribePush/entity"
-        "log"
-        "strings"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"jy/src/jfw/modules/publicapply/src/subscribePush/entity"
+	"log"
+	"strings"
 )
 
 type Subscribe struct {
-        *xweb.Action
-        update      xweb.Mapper `xweb:"/subscribe/update"`      //订阅修改
-        setUserInfo xweb.Mapper `xweb:"/subscribe/setUserInfo"` //各种修改【关键词、关键词匹配方式、信息类型、项目匹配】
+	*xweb.Action
+	update      xweb.Mapper `xweb:"/subscribe/update"`      //订阅修改
+	setUserInfo xweb.Mapper `xweb:"/subscribe/setUserInfo"` //各种修改【关键词、关键词匹配方式、信息类型、项目匹配】
 }
 
 // 大会员、超级订阅订阅修改
 func (s *Subscribe) Update() {
-        userId := qutil.ObjToString(s.GetSession("userId"))
-        ent_id := qutil.IntAll(s.GetSession("entId"))
-        entUserId := qutil.IntAll(s.GetSession("entUserId"))
-        vSwitch := s.GetString("vSwitch")
-        if vSwitch == "" {
-                vSwitch = jy.SwitchService.Get(s.Session(), db.Mgo) //v:vip m:member
-        }
-        sub := &entity.SubscribeSet{
-                Area:      *qutil.ObjToMap(s.GetString("area")),
-                Industry:  strings.Split(s.GetString("industry"), ","),
-                UserId:    userId,
-                Type:      vSwitch,
-                EntId:     ent_id,
-                EntUserId: entUserId,
-        }
-        r := sub.SetAreaAndIndustry()
-        if r.Err != nil {
-                log.Printf("%s SaveChange err:%v\n", userId, r.Err.Error())
-        }
-        s.ServeJson(r.Format())
+	userId := qutil.ObjToString(s.GetSession("userId"))
+	ent_id := qutil.IntAll(s.GetSession("entId"))
+	entUserId := qutil.IntAll(s.GetSession("entUserId"))
+	baseUserId := qutil.Int64All(s.GetSession("base_user_id"))
+	accountId := qutil.Int64All(s.GetSession("accountId"))
+	vSwitch := s.GetString("vSwitch")
+	if vSwitch == "" {
+		vSwitch = jy.SwitchService.Get(s.Session(), db.Mgo) //v:vip m:member
+	}
+	sub := &entity.SubscribeSet{
+		Area:       *qutil.ObjToMap(s.GetString("area")),
+		Industry:   strings.Split(s.GetString("industry"), ","),
+		UserId:     userId,
+		Type:       vSwitch,
+		EntId:      ent_id,
+		EntUserId:  entUserId,
+		AccountId:  accountId,
+		BaseUserId: baseUserId,
+	}
+	r := sub.SetAreaAndIndustry()
+	if r.Err != nil {
+		log.Printf("%s SaveChange err:%v\n", userId, r.Err.Error())
+	}
+	s.ServeJson(r.Format())
 }
 
 //关键词、关键词匹配方式、信息类型、项目匹配
 func (s *Subscribe) SetUserInfo() {
-        r := map[string]interface{}{}
-        userId := qutil.ObjToString(s.GetSession("userId"))
-        entId := qutil.IntAll(s.GetSession("entId"))
-        entUserId := qutil.IntAll(s.GetSession("entUserId"))
-        vSwitch := s.GetString("vSwitch")
-        if vSwitch == "" {
-                vSwitch = jy.SwitchService.Get(s.Session(), db.Mgo) //v:vip m:member "":free
-        }
-        //判断是否有权限
-        power := 0
-        if entId > 0 {
-                if vSwitch == "v" {
-                        infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%VIP订阅%' ", entId)
-                        if infoCount > 0 {
-                                power = 1
-                        }
-                } else if vSwitch == "m" {
-                        infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%大会员%' ", entId)
-                        if infoCount > 0 {
-                                power = 1
-                        }
-                }
-        }
-        if pageType := s.GetString("pageType"); pageType == "keyWords" {
-                //
-                match_way, _ := s.GetInteger("match_way")
-                sub := &entity.KeyWordsSet{
-                        ClassifyIndex: s.GetString("classify_index"),
-                        ClassifyName:  strings.Trim(s.GetString("classify_name"), ""),
-                        KeyWordIndex:  s.GetString("kws_index"),
-                        KeyWordName:   strings.Trim(s.GetString("kws_name"), ""),
-                        ActionType:    s.GetString("actionType"),
-                        AppendKeyWord: s.GetSlice("addition_kws"),
-                        NotKeyWord:    s.GetSlice("not_kws"),
-                        MatchWay:      match_way,
-                        KeyWordsCount: s.GetString("kwscount"),
-                        Type:          vSwitch,
-                        UserId:        userId,
-                        DeleteKey:     s.GetString("delete_key"),
-                        Power:         power,
-                        EntUserId:     entUserId,
-                        EntId:         entId,
-                }
-                r = sub.UpdateKeyWords()
-        } else {
-                pmindex, _ := s.GetInteger("pmindex")
-                matchtype, _ := s.GetInteger("matchtype")
-                other, _ := s.GetInteger("other")
-                uo := &entity.UpdateOther{
-                        PageType:        s.GetString("pageType"),
-                        Pmindex:         pmindex,
-                        InfoTypeArr:     s.GetString("infoTypeArr"),
-                        Matchtype:       matchtype,
-                        UserId:          userId,
-                        Type:            vSwitch,
-                        OtherBuyerclass: other,
-                        Power:           power,
-                        EntUserId:       entUserId,
-                        EntId:           entId,
-                }
-                r = uo.UpdateOther()
-        }
-        s.ServeJson(r)
+	r := map[string]interface{}{}
+	userId := qutil.ObjToString(s.GetSession("userId"))
+	entId := qutil.IntAll(s.GetSession("entId"))
+	entUserId := qutil.IntAll(s.GetSession("entUserId"))
+	baseUserId := qutil.Int64All(s.GetSession("base_user_id"))
+	accountId := qutil.Int64All(s.GetSession("accountId"))
+	vSwitch := s.GetString("vSwitch")
+	if vSwitch == "" {
+		vSwitch = jy.SwitchService.Get(s.Session(), db.Mgo) //v:vip m:member "":free
+	}
+	//判断是否有权限
+	power := 0
+	if entId > 0 {
+		if vSwitch == "v" {
+			infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%VIP订阅%' ", entId)
+			if infoCount > 0 {
+				power = 1
+			}
+		} else if vSwitch == "m" {
+			infoCount := db.Mysql.CountBySql("select  count(id) from  entniche_wait_empower where  ent_id=? and  end_time>NOW() and  product_type like '%大会员%' ", entId)
+			if infoCount > 0 {
+				power = 1
+			}
+		}
+	}
+	if pageType := s.GetString("pageType"); pageType == "keyWords" {
+		//
+		match_way, _ := s.GetInteger("match_way")
+		sub := &entity.KeyWordsSet{
+			ClassifyIndex: s.GetString("classify_index"),
+			ClassifyName:  strings.Trim(s.GetString("classify_name"), ""),
+			KeyWordIndex:  s.GetString("kws_index"),
+			KeyWordName:   strings.Trim(s.GetString("kws_name"), ""),
+			ActionType:    s.GetString("actionType"),
+			AppendKeyWord: s.GetSlice("addition_kws"),
+			NotKeyWord:    s.GetSlice("not_kws"),
+			MatchWay:      match_way,
+			KeyWordsCount: s.GetString("kwscount"),
+			Type:          vSwitch,
+			UserId:        userId,
+			DeleteKey:     s.GetString("delete_key"),
+			Power:         power,
+			EntUserId:     entUserId,
+			EntId:         entId,
+			AccountId:     accountId,
+			BaseUserId:    baseUserId,
+		}
+		r = sub.UpdateKeyWords()
+	} else {
+		pmindex, _ := s.GetInteger("pmindex")
+		matchtype, _ := s.GetInteger("matchtype")
+		other, _ := s.GetInteger("other")
+		uo := &entity.UpdateOther{
+			PageType:        s.GetString("pageType"),
+			Pmindex:         pmindex,
+			InfoTypeArr:     s.GetString("infoTypeArr"),
+			Matchtype:       matchtype,
+			UserId:          userId,
+			Type:            vSwitch,
+			OtherBuyerclass: other,
+			Power:           power,
+			EntUserId:       entUserId,
+			EntId:           entId,
+			AccountId:       accountId,
+			BaseUserId:      baseUserId,
+		}
+		r = uo.UpdateOther()
+	}
+	s.ServeJson(r)
 }

+ 20 - 14
src/jfw/modules/publicapply/src/userbase/entity/entity.go

@@ -18,9 +18,12 @@ import (
 )
 
 type UserInfo struct {
-	UserId   string //用户id
-	Platform string //平台 PC WX APP
-	Names    string //功能名称
+	UserId     string //用户id
+	Platform   string //平台 PC WX APP
+	Names      string //功能名称
+	BaseUserId int64
+	AccountId  int64
+	EntId      int64
 }
 
 type FuncNames struct {
@@ -29,11 +32,11 @@ type FuncNames struct {
 	Img  string `json:"img"`
 }
 
-func NewUserInfo(userId, platform, names string) *UserInfo {
+func NewUserInfo(userId, platform, names string, baseUserId, accountId, entId int64) *UserInfo {
 	if platform == "" {
 		platform = "PC"
 	}
-	return &UserInfo{userId, platform, names}
+	return &UserInfo{userId, platform, names, baseUserId, accountId, entId}
 }
 
 //保存
@@ -45,7 +48,7 @@ func (this *UserInfo) SaveNameByUserId() bool {
 	var namesarr = []string{}
 	if this.Names != "" {
 		for _, v := range strings.Split(this.Names, ",") {
-			if !ChargeMap[v] || IsPower(v, this.UserId) {
+			if !ChargeMap[v] || IsPower(v, this.UserId, this.BaseUserId, this.AccountId, this.EntId) {
 				namesarr = append(namesarr, v)
 			}
 		}
@@ -91,7 +94,7 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 	} else {
 		for _, v := range BaseFuncInfo.CommonFunctions {
 			if v.Isbase {
-				if v.Name == "订阅管理" && !IsPower(v.Name, this.UserId) {
+				if v.Name == "订阅管理" && !IsPower(v.Name, this.UserId, this.BaseUserId, this.AccountId, this.EntId) {
 					continue
 				}
 				fns = append(fns, &FuncNames{
@@ -114,7 +117,7 @@ var ChargeMap = map[string]bool{}
 func (this *UserInfo) AllNames() (fns []*FuncNames) {
 	for _, v := range BaseFuncInfo.CommonFunctions {
 		ChargeMap[v.Name] = v.Charge
-		if !v.Charge || IsPower(v.Name, this.UserId) {
+		if !v.Charge || IsPower(v.Name, this.UserId, this.BaseUserId, this.AccountId, this.EntId) {
 			fns = append(fns, &FuncNames{
 				Name: v.Name,
 				Url:  thisByPlat(this.Platform, "url", &v),
@@ -154,8 +157,8 @@ func thisByPlat(platform, name string, bcv *initjson.BaseFunc) (res string) {
 }
 
 //查看是否有使用此功能的权限
-func IsPower(name, userId string) (b bool) {
-	BigPower := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+func IsPower(name, userId string, baseUserId, accountId, entId int64) (b bool) {
+	BigPower := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 	if BigPower.Status > 0 {
 		switch name {
 		case "企业情报监控":
@@ -266,9 +269,12 @@ func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[stri
 
 //用户一次性弹窗信息集合
 type TipInfoStruct struct {
-	UserId  string
-	DoType  string
-	TipName string
+	UserId     string
+	DoType     string
+	TipName    string
+	BaseUserId int64
+	AccountId  int64
+	EntId      int64
 }
 
 //
@@ -295,7 +301,7 @@ func (this *TipInfoStruct) GetTipInfo() (flag bool) {
 	} else { //查询是否提示弹框
 		//判断是否严重用户注册时间
 		if config.Config.TipInfo[this.TipName] > 0 {
-			userBase := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
+			userBase := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, util.Int64All(this.EntId), config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 			//此时间点后注册的新用户
 			if userBase.Registedate > config.Config.TipInfo[this.TipName] {
 				return true

+ 7 - 4
src/jfw/modules/publicapply/src/userbase/entity/menu.go

@@ -5,11 +5,14 @@ import (
 )
 
 type MenuInfoStruct struct {
-	UserId string `json:"userId"`
+	UserId     string `json:"userId"`
+	BaseUserId int64  `json:"baseUserId"`
+	EntId      int64  `json:"entId"`
+	AccountId  int64  `json:"accountId"`
 }
 
-func NewMenuInfo(userId string) *MenuInfoStruct {
-	return &MenuInfoStruct{userId}
+func NewMenuInfo(userId string, baseUserId, accountId, entId int64) *MenuInfoStruct {
+	return &MenuInfoStruct{userId, baseUserId, accountId, entId}
 }
 
 //大会员菜单
@@ -25,7 +28,7 @@ func (this *MenuInfoStruct) GetMenuInfo() (menus []*initjson.MenuLevel) {
 				Isusable: mv.Isusable,
 			}
 			if !msll.Isusable {
-				if IsPower(msll.Name, this.UserId) {
+				if IsPower(msll.Name, this.UserId, this.BaseUserId, this.AccountId, this.EntId) {
 					msll.Isusable = true
 				} else {
 					//子账号 隐藏订阅管理

+ 26 - 8
src/jfw/modules/publicapply/src/userbase/service/service.go

@@ -11,15 +11,18 @@ import (
 //大会员菜单
 func (this *ServiceStruct) BigmemberMenu() {
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+	entId := qu.Int64All(this.GetSession("entId"))
+	accountId := qu.Int64All(this.GetSession("accountId"))
 	defer qu.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
-		if !entity.IsPower("", userId) {
+		if !entity.IsPower("", userId, baseUserId, accountId, entId) {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
-		newMenu := entity.NewMenuInfo(userId)
+		newMenu := entity.NewMenuInfo(userId, baseUserId, accountId, entId)
 		return Result{Data: newMenu.GetMenuInfo()}
 	}()
 	this.ServeJson(r)
@@ -30,13 +33,16 @@ func (this *ServiceStruct) AllFunctions() {
 	userId, _ := this.GetSession("userId").(string)
 	defer qu.Catch()
 	r := func() Result {
+		baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+		entId := qu.Int64All(this.GetSession("entId"))
+		accountId := qu.Int64All(this.GetSession("accountId"))
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
-		if !entity.IsPower("", userId) {
+		if !entity.IsPower("", userId, baseUserId, accountId, entId) {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
-		newFN := entity.NewUserInfo(userId, "", "")
+		newFN := entity.NewUserInfo(userId, "", "", baseUserId, accountId, entId)
 		return Result{Data: newFN.AllNames()}
 	}()
 	this.ServeJson(r)
@@ -47,15 +53,18 @@ func (this *ServiceStruct) SaveFunctions() {
 	userId, _ := this.GetSession("userId").(string)
 	defer qu.Catch()
 	r := func() Result {
+		baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+		entId := qu.Int64All(this.GetSession("entId"))
+		accountId := qu.Int64All(this.GetSession("accountId"))
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
 		names := this.GetString("names")
-		if !entity.IsPower("", userId) {
+		if !entity.IsPower("", userId, baseUserId, accountId, entId) {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
 		platform := this.GetString("platform")
-		newFN := entity.NewUserInfo(userId, platform, names)
+		newFN := entity.NewUserInfo(userId, platform, names, baseUserId, accountId, entId)
 		return Result{Data: newFN.SaveNameByUserId()}
 	}()
 	this.ServeJson(r)
@@ -66,14 +75,17 @@ func (this *ServiceStruct) UbFunctions() {
 	userId, _ := this.GetSession("userId").(string)
 	defer qu.Catch()
 	r := func() Result {
+		baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+		entId := qu.Int64All(this.GetSession("entId"))
+		accountId := qu.Int64All(this.GetSession("accountId"))
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
-		if !entity.IsPower("", userId) {
+		if !entity.IsPower("", userId, baseUserId, accountId, entId) {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
 		platform := this.GetString("platform")
-		newFN := entity.NewUserInfo(userId, platform, "")
+		newFN := entity.NewUserInfo(userId, platform, "", baseUserId, accountId, entId)
 		return Result{Data: newFN.GetNameByUserId()}
 	}()
 	this.ServeJson(r)
@@ -108,6 +120,9 @@ func (this *ServiceStruct) TipInfo() {
 	userId, _ := this.GetSession("userId").(string)
 	defer qu.Catch()
 	r := func() Result {
+		baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+		entId := qu.Int64All(this.GetSession("entId"))
+		accountId := qu.Int64All(this.GetSession("accountId"))
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
@@ -115,6 +130,9 @@ func (this *ServiceStruct) TipInfo() {
 		if tipInfo.TipName == "" {
 			return Result{Data: nil, Error_msg: Error_msg_1002}
 		}
+		tipInfo.EntId = entId
+		tipInfo.AccountId = accountId
+		tipInfo.BaseUserId = baseUserId
 		return Result{Data: tipInfo.GetTipInfo()}
 	}()
 	this.ServeJson(r)

Some files were not shown because too many files changed in this diff