zhangxinlei1996 před 3 roky
rodič
revize
639f63df1f
39 změnil soubory, kde provedl 1939 přidání a 201 odebrání
  1. 2 1
      api/etc/goodscenter.yaml
  2. 157 0
      api/goodsCenter.api
  3. 28 0
      api/internal/handler/functiondefineaddhandler.go
  4. 28 0
      api/internal/handler/goodsaddhandler.go
  5. 28 0
      api/internal/handler/goodsdelhandler.go
  6. 28 0
      api/internal/handler/goodsgethandler.go
  7. 28 0
      api/internal/handler/goodsspecaddhandler.go
  8. 28 0
      api/internal/handler/goodsspecdelhandler.go
  9. 28 0
      api/internal/handler/goodsspecgethandler.go
  10. 28 0
      api/internal/handler/goodsspecpoweraddhandler.go
  11. 28 0
      api/internal/handler/goodsspecupdhandler.go
  12. 28 0
      api/internal/handler/goodsupdhandler.go
  13. 50 0
      api/internal/handler/routes.go
  14. 50 0
      api/internal/logic/functiondefineaddlogic.go
  15. 65 0
      api/internal/logic/goodsaddlogic.go
  16. 48 0
      api/internal/logic/goodsdellogic.go
  17. 67 0
      api/internal/logic/goodsgetlogic.go
  18. 81 0
      api/internal/logic/goodsspecaddlogic.go
  19. 48 0
      api/internal/logic/goodsspecdellogic.go
  20. 59 0
      api/internal/logic/goodsspecgetlogic.go
  21. 63 0
      api/internal/logic/goodsspecpoweraddlogic.go
  22. 59 0
      api/internal/logic/goodsspecupdlogic.go
  23. 66 0
      api/internal/logic/goodsupdlogic.go
  24. 116 0
      api/internal/types/types.go
  25. 27 19
      public/entity/base_goods.go
  26. 3 3
      public/entity/base_goods_function_define.go
  27. 21 16
      public/entity/base_goods_spec.go
  28. 67 0
      public/entity/base_goods_spec_power.go
  29. 1 1
      public/entity/util.go
  30. 1 0
      public/service/base_goods.go
  31. 7 0
      public/service/base_goods_stand_classify.go
  32. 26 0
      rpc/goodsCenter.proto
  33. 24 15
      rpc/goodscenter/goodscenter.go
  34. 1 0
      rpc/internal/logic/goodsspecgetlogic.go
  35. 60 0
      rpc/internal/logic/goodsspecpoweraddlogic.go
  36. 6 0
      rpc/internal/server/goodscenterserver.go
  37. 408 136
      rpc/pb/goodsCenter.pb.go
  38. 38 0
      rpc/pb/goodsCenter_grpc.pb.go
  39. 38 10
      rpc/test/goods_test.go

+ 2 - 1
api/etc/goodscenter.yaml

@@ -10,4 +10,5 @@ Logx:
   Mode: console #console|file|volume
   Path: logs
   Level: info #info|error|severe
-  KeepDays: 100
+  KeepDays: 100
+Timeout:  5000

+ 157 - 0
api/goodsCenter.api

@@ -10,10 +10,167 @@ type (
 		Error_msg  string      `json:"error_msg"`
 		Data       interface{} `json:"data"`
 	}
+
+	GoodsAddReq {
+		AppId                  string `header:"appId,default=10000"`
+		Name                   string `json:"name"`                   //商品名称
+		Code                   string `json:"code"`                   //商品代码
+		Stand_classify_code    string `json:"stand_classify_code"`    //标准分类代码
+		Business_classify_code string `json:"business_classify_code"` //商户分类代码
+		Business_id            string `json:"business_id"`            //商家id
+		Pc_landpage            string `json:"pc_landpage"`            //pc端落地页
+		Wx_landpage            string `json:"wx_landpage"`            //wx端落地页
+		App_landpage           string `json:"app_landpage"`           //app端落地页
+		Logo                   string `json:"logo"`                   //产品logo
+		Introduce_img_1        string `json:"introduce_img_1"`        //产品介绍图1
+		Introduce_img_2        string `json:"introduce_img_2"`        //产品介绍图2
+		Introduce_img_3        string `json:"introduce_img_3"`        //产品介绍图3
+		Detail                 string `json:"detail"`                 //详情
+		Status                 string `json:"status"`                 //0下架  1上架
+		Create_persion         string `json:"create_persion"`         //创建人
+		Update_person          string `json:"update_person"`          //更新人
+		Describe               string `json:"describe"`               //描述
+		Label                  string `json:"label"`                  //标签
+		Attributes             string `json:"attributes"`             //商品属性  //1:资源包类型 2:权益类型
+		Id                     int64  `json:"id,optional"`
+	}
+
+	GoodsIdReq {
+		Id    int64  `json:"id"`
+		AppId string `header:"appId,default=10000"`
+	}
+
+	GoodsUpdReq {
+		AppId                  string `header:"appId,default=10000"`
+		Name                   string `json:"name,optional"`                   //商品名称
+		Stand_classify_code    string `json:"stand_classify_code,optional"`    //标准分类代码
+		Business_classify_code string `json:"business_classify_code,optional"` //商户分类代码
+		Business_id            string `json:"business_id,optional"`            //商家id
+		Pc_landpage            string `json:"pc_landpage,optional"`            //pc端落地页
+		Wx_landpage            string `json:"wx_landpage,optional"`            //wx端落地页
+		App_landpage           string `json:"app_landpage,optional"`           //app端落地页
+		Logo                   string `json:"logo,optional"`                   //产品logo
+		Introduce_img_1        string `json:"introduce_img_1,optional"`        //产品介绍图1
+		Introduce_img_2        string `json:"introduce_img_2,optional"`        //产品介绍图2
+		Introduce_img_3        string `json:"introduce_img_3,optional"`        //产品介绍图3
+		Detail                 string `json:"detail,optional"`                 //详情
+		Status                 string `json:"status,optional"`                 //0下架  1上架
+		Create_persion         string `json:"create_persion,optional"`         //创建人
+		Update_person          string `json:"update_person,optional"`          //更新人
+		Describe               string `json:"describe,optional"`               //描述
+		Label                  string `json:"label,optional"`                  //标签
+		Attributes             string `json:"attributes,optional"`             //商品属性  //1:资源包类型 2:权益类型
+		Id                     int64  `json:"id"`
+	}
+
+	FunctionDefineReq {
+		AppId             string   `header:"appId,default=10000"`
+		Goods_code        string   `json:"goods_code"`
+		Function_code_arr []string `json:"function_code_arr"`
+		Name              string   `json:"name"`
+	}
+
+	GoodsSpec {
+		AppId               string       `json:"appId,default=10000"`
+		Name                string       `json:"name"`                //规格名称
+		Goods_code          string       `json:"goods_code"`          //商品代码
+		Origin_price        int64        `json:"origin_price"`        //原价
+		Sku_max             int64        `json:"sku_max"`             //sku最大值
+		Calculation_formula string       `json:"calculation_formula"` //价格的计算公式
+		Calculation_mode    int64        `json:"calculation_mode"`    //1:一口价 2:公式计价 3:阶梯计价
+		Calculation_type    int64        `json:"calculation_type"`    //1:按量 2:sku(个人默认授权,企业手动需要授权)
+		Tag                 string       `json:"tag"`                 //自定义值,用于分组
+		Remark              string       `json:"remark"`              //备注
+		Actual_price        int64        `json:"actual_price"`        //实际价格
+		Goods_spec_child    []*GoodsSpec `json:"goods_spec_child,optional"`
+		Id                  int64        `json:"id,optional"`
+	}
+
+	GoodSpecIdReq {
+		Spec_id int64  `json:"spec_id"`
+		AppId   string `header:"appId,default=10000"`
+	}
+
+	GoodsSpecUpdReq {
+		AppId               string `json:"appId,default=10000"`
+		Name                string `json:"name,optional"`                //规格名称
+		Goods_code          string `json:"goods_code,optional"`          //商品代码
+		Origin_price        int64  `json:"origin_price,optional"`        //原价
+		Sku_max             int64  `json:"sku_max,optional"`             //sku最大值
+		Calculation_formula string `json:"calculation_formula,optional"` //价格的计算公式
+		Calculation_mode    int64  `json:"calculation_mode,optional"`    //1:一口价 2:公式计价 3:阶梯计价
+		Calculation_type    int64  `json:"calculation_type,optional"`    //1:按量 2:sku(个人默认授权,企业手动需要授权)
+		Tag                 string `json:"tag,optional"`                 //自定义值,用于分组
+		Remark              string `json:"remark,optional"`              //备注
+		Actual_price        int64  `json:"actual_price,,optional"`       //实际价格
+		Id                  int64  `json:"id"`
+	}
+
+	GoodsSpecPowerAddReq {
+		Id                     int64  `json:"id,optional"`
+		Appid                  string `json:"appId,default=10000"`
+		Goods_function_id      int64  `json:"goods_function_id"`      //商品功能id
+		Goods_code             string `json:"goods_code"`             //商品代码
+		Spec_id                int64  `json:"spec_id"`                //规格id
+		Function_code          string `json:"function_code"`          //功能代码
+		Limit_strategy         string `json:"limit_strategy"`         //限制频率
+		Cycle                  string `json:"cycle"`                  //周期
+		Strategy_count         int64  `json:"strategy_count"`         //频率数量
+		Max_num                int64  `json:"max_num"`                //最大数量 不可修改,从原始表带过来
+		Use_count              int64  `json:"use_count"`              //数量
+		Power_type             int64  `json:"power_type"`             //权益所属类型 1:个人 2:企业
+		Count_type             int64  `json:"count_type"`             //数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+		Power_count            int64  `json:"power_count"`            //授权数量
+		Judge_repeat_mechanism int64  `json:"judge_repeat_mechanism"` //判重机制 0:无 1:通用判重 2:应用判重
+		Judge_repeat_scope     int64  `json:"judge_repeat_scope"`     //判重范围
+		Judge_repeat_flag      string `json:"judge_repeat_flag"`      //判重标识 _id、projectid
+		Judge_repeat_strategy  int64  `json:"judge_repeat_strategy"`  //判重策略 0:无需判重 1:通用判重 2:应用自己判重
+	}
 )
 
 service goodsCenter {
 	@doc "获取标准商品分类树"
 	@handler getBaseGoodsStandClassify
 	post /goodsCenter/getBaseGoodsStandClassify (BaseGoodsClassifyReq) returns (Reply)
+	
+	@doc "添加商品"
+	@handler goodsAdd
+	post /goodsCenter/goodsAdd (GoodsAddReq) returns (Reply)
+	
+	@doc "删除商品"
+	@handler goodsDel
+	post /goodsCenter/goodsDel (GoodsIdReq) returns (Reply)
+	
+	@doc "修改商品"
+	@handler goodsUpd
+	post /goodsCenter/goodsUpd (GoodsUpdReq) returns (Reply)
+	
+	@doc "查看商品"
+	@handler goodsGet
+	post /goodsCenter/goodsGet (GoodsIdReq) returns (Reply)
+	
+	@doc "新增商品功能定义、功能定义明细表"
+	@handler functionDefineAdd
+	post /goodsCenter/functionDefineAdd (FunctionDefineReq) returns (Reply)
+	
+	@doc "新增商品规格"
+	@handler goodsSpecAdd
+	post /goodsCenter/goodsSpecAdd(GoodsSpec) returns (Reply)
+	
+	@doc "删除商品规格"
+	@handler goodsSpecDel
+	post /goodsCenter/goodsSpecDel(GoodSpecIdReq) returns (Reply)
+	
+	@doc "修改商品规格"
+	@handler goodsSpecUpd
+	post /goodsCenter/goodsSpecUpd(GoodsSpecUpdReq) returns (Reply)
+	
+	@doc "查看商品规格"
+	@handler goodsSpecGet
+	post /goodsCenter/goodsSpecGet(GoodSpecIdReq) returns (Reply)
+	
+	@doc "新增商品规格权益"
+	@handler goodsSpecPowerAdd
+	post /goodsCenter/goodsSpecPowerAdd(GoodsSpecPowerAddReq) returns (Reply)
+	
 }

+ 28 - 0
api/internal/handler/functiondefineaddhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func functionDefineAddHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.FunctionDefineReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewFunctionDefineAddLogic(r.Context(), svcCtx)
+		resp, err := l.FunctionDefineAdd(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsaddhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsAddHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsAddReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsAddLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsAdd(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsdelhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsDelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsIdReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsDelLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsDel(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsgethandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsGetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsIdReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsGetLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsGet(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsspecaddhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsSpecAddHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsSpec
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsSpecAddLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsSpecAdd(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsspecdelhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsSpecDelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodSpecIdReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsSpecDelLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsSpecDel(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsspecgethandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsSpecGetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodSpecIdReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsSpecGetLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsSpecGet(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsspecpoweraddhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsSpecPowerAddHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsSpecPowerAddReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsSpecPowerAddLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsSpecPowerAdd(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsspecupdhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsSpecUpdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsSpecUpdReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsSpecUpdLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsSpecUpd(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 28 - 0
api/internal/handler/goodsupdhandler.go

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/logic"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func goodsUpdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.GoodsUpdReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGoodsUpdLogic(r.Context(), svcCtx)
+		resp, err := l.GoodsUpd(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 50 - 0
api/internal/handler/routes.go

@@ -17,6 +17,56 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/goodsCenter/getBaseGoodsStandClassify",
 				Handler: getBaseGoodsStandClassifyHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsAdd",
+				Handler: goodsAddHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsDel",
+				Handler: goodsDelHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsUpd",
+				Handler: goodsUpdHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsGet",
+				Handler: goodsGetHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/functionDefineAdd",
+				Handler: functionDefineAddHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsSpecAdd",
+				Handler: goodsSpecAddHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsSpecDel",
+				Handler: goodsSpecDelHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsSpecUpd",
+				Handler: goodsSpecUpdHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsSpecGet",
+				Handler: goodsSpecGetHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/goodsCenter/goodsSpecPowerAdd",
+				Handler: goodsSpecPowerAddHandler(serverCtx),
+			},
 		},
 	)
 }

+ 50 - 0
api/internal/logic/functiondefineaddlogic.go

@@ -0,0 +1,50 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type FunctionDefineAddLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewFunctionDefineAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FunctionDefineAddLogic {
+	return &FunctionDefineAddLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *FunctionDefineAddLogic) FunctionDefineAdd(req *types.FunctionDefineReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.FunctionDefineAdd(l.ctx, &pb.FunctionDefineReq{
+		GoodsCode:       req.Goods_code,
+		FunctionCodeArr: req.Function_code_arr,
+		Name:            req.Name,
+		Appid:           req.AppId,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 65 - 0
api/internal/logic/goodsaddlogic.go

@@ -0,0 +1,65 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+	. "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsAddLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsAddLogic {
+	return &GoodsAddLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsAddLogic) GoodsAdd(req *types.GoodsAddReq) (resp *types.Reply, err error) {
+	//todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := GoodsCenterRpc.GoodsAdd(l.ctx, &pb.GoodsAddReq{
+		Appid:                req.AppId,
+		Name:                 req.Name,
+		Code:                 req.Code,
+		StandClassifyCode:    req.Stand_classify_code,
+		BusinessClassifyCode: req.Business_classify_code,
+		BusinessId:           req.Business_id,
+		PcLandpage:           req.Pc_landpage,
+		WxLandpage:           req.Wx_landpage,
+		AppLandpage:          req.App_landpage,
+		Logo:                 req.Logo,
+		IntroduceImg_1:       req.Introduce_img_1,
+		IntroduceImg_2:       req.Introduce_img_2,
+		IntroduceImg_3:       req.Introduce_img_3,
+		Detail:               req.Detail,
+		Status:               req.Status,
+		CreatePersion:        req.Create_persion,
+		UpdatePerson:         req.Update_person,
+		Describe:             req.Describe,
+		Label:                req.Label,
+		Attributes:           req.Attributes,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 48 - 0
api/internal/logic/goodsdellogic.go

@@ -0,0 +1,48 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsDelLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsDelLogic {
+	return &GoodsDelLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsDelLogic) GoodsDel(req *types.GoodsIdReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsDel(l.ctx, &pb.GoodsDelReq{
+		Appid: req.AppId,
+		Id:    req.Id,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 67 - 0
api/internal/logic/goodsgetlogic.go

@@ -0,0 +1,67 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsGetLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsGetLogic {
+	return &GoodsGetLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsGetLogic) GoodsGet(req *types.GoodsIdReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsGet(l.ctx, &pb.GoodsGetReq{
+		Appid: req.AppId,
+		Id:    req.Id,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	} else {
+		resp.Data = &types.GoodsAddReq{
+			Name:                   goodsResp.Name,
+			Code:                   goodsResp.Code,
+			Stand_classify_code:    goodsResp.StandClassifyCode,
+			Business_classify_code: goodsResp.BusinessClassifyCode,
+			Business_id:            goodsResp.BusinessId,
+			Pc_landpage:            goodsResp.PcLandpage,
+			Wx_landpage:            goodsResp.WxLandpage,
+			App_landpage:           goodsResp.AppLandpage,
+			Logo:                   goodsResp.Logo,
+			Introduce_img_1:        goodsResp.IntroduceImg_1,
+			Introduce_img_2:        goodsResp.IntroduceImg_2,
+			Introduce_img_3:        goodsResp.IntroduceImg_3,
+			Detail:                 goodsResp.Detail,
+			Status:                 goodsResp.Status,
+			Create_persion:         goodsResp.CreatePersion,
+			Update_person:          goodsResp.UpdatePerson,
+			Describe:               goodsResp.Describes,
+			Label:                  goodsResp.Label,
+			Attributes:             goodsResp.Attributes,
+		}
+	}
+	return
+}

+ 81 - 0
api/internal/logic/goodsspecaddlogic.go

@@ -0,0 +1,81 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsSpecAddLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsSpecAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsSpecAddLogic {
+	return &GoodsSpecAddLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsSpecAddLogic) GoodsSpecAdd(req *types.GoodsSpec) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsSpecAdd(l.ctx, &pb.GoodsSpecAddReq{
+		GoodsSpec: &pb.GoodsSpec{
+			Appid:              req.AppId,
+			Name:               req.Name,
+			GoodsCode:          req.Goods_code,
+			OriginPrice:        req.Origin_price,
+			SkuMax:             req.Sku_max,
+			CalculationType:    req.Calculation_type,
+			CalculationMode:    req.Calculation_mode,
+			CalculationFormula: req.Calculation_formula,
+			Tag:                req.Tag,
+			Remark:             req.Remark,
+			ActualPrice:        req.Actual_price,
+			GoodsSpecChild:     Format(req.Goods_spec_child, []*pb.GoodsSpec{}),
+		},
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}
+
+//格式转化
+func Format(arr []*types.GoodsSpec, child []*pb.GoodsSpec) []*pb.GoodsSpec {
+	for _, v := range arr {
+		child = append(child, &pb.GoodsSpec{
+			Appid:              v.AppId,
+			Name:               v.Name,
+			GoodsCode:          v.Goods_code,
+			OriginPrice:        v.Origin_price,
+			SkuMax:             v.Sku_max,
+			CalculationType:    v.Calculation_type,
+			CalculationMode:    v.Calculation_mode,
+			CalculationFormula: v.Calculation_formula,
+			Tag:                v.Tag,
+			Remark:             v.Remark,
+			ActualPrice:        v.Actual_price,
+			GoodsSpecChild:     Format(v.Goods_spec_child, []*pb.GoodsSpec{}),
+		})
+	}
+	return child
+}

+ 48 - 0
api/internal/logic/goodsspecdellogic.go

@@ -0,0 +1,48 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsSpecDelLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsSpecDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsSpecDelLogic {
+	return &GoodsSpecDelLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsSpecDelLogic) GoodsSpecDel(req *types.GoodSpecIdReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsSpecDel(l.ctx, &pb.GoodsSpecGetReq{
+		Appid:  req.AppId,
+		SpecId: req.Spec_id,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 59 - 0
api/internal/logic/goodsspecgetlogic.go

@@ -0,0 +1,59 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsSpecGetLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsSpecGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsSpecGetLogic {
+	return &GoodsSpecGetLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsSpecGetLogic) GoodsSpecGet(req *types.GoodSpecIdReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsSpecGet(l.ctx, &pb.GoodsSpecGetReq{
+		Appid:  req.AppId,
+		SpecId: req.Spec_id,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	} else {
+		resp.Data = &types.GoodsSpec{
+			AppId:               goodsResp.Appid,
+			Name:                goodsResp.Name,
+			Goods_code:          goodsResp.GoodsCode,
+			Origin_price:        goodsResp.OriginPrice,
+			Sku_max:             goodsResp.SkuMax,
+			Calculation_type:    goodsResp.CalculationType,
+			Calculation_mode:    goodsResp.CalculationMode,
+			Calculation_formula: goodsResp.CalculationFormula,
+			Tag:                 goodsResp.Tag,
+			Remark:              goodsResp.Remark,
+			Actual_price:        goodsResp.ActualPrice,
+		}
+	}
+	return
+}

+ 63 - 0
api/internal/logic/goodsspecpoweraddlogic.go

@@ -0,0 +1,63 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsSpecPowerAddLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsSpecPowerAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsSpecPowerAddLogic {
+	return &GoodsSpecPowerAddLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsSpecPowerAddLogic) GoodsSpecPowerAdd(req *types.GoodsSpecPowerAddReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsSpecPowerAdd(l.ctx, &pb.GoodsSpecPowerAddReq{
+		Appid:                req.Appid,
+		GoodsFunctionId:      req.Goods_function_id,
+		GoodsCode:            req.Goods_code,
+		SpecId:               req.Spec_id,
+		FunctionCode:         req.Function_code,
+		LimitStrategy:        req.Limit_strategy,
+		Cycle:                req.Cycle,
+		StrategyCount:        req.Strategy_count,
+		MaxNum:               req.Max_num,
+		UseCount:             req.Use_count,
+		PowerType:            req.Power_type,
+		CountType:            req.Count_type,
+		PowerCount:           req.Power_count,
+		JudgeRepeatMechanism: req.Judge_repeat_mechanism,
+		JudgeRepeatScope:     req.Judge_repeat_scope,
+		JudgeRepeatFlag:      req.Judge_repeat_flag,
+		JudgeRepeatStrategy:  req.Judge_repeat_strategy,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 59 - 0
api/internal/logic/goodsspecupdlogic.go

@@ -0,0 +1,59 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsSpecUpdLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsSpecUpdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsSpecUpdLogic {
+	return &GoodsSpecUpdLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsSpecUpdLogic) GoodsSpecUpd(req *types.GoodsSpecUpdReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+	goodsResp, err := service.GoodsCenterRpc.GoodsSpecUpd(l.ctx, &pb.GoodsSpecAddReq{
+		GoodsSpec: &pb.GoodsSpec{
+			Id:                 req.Id,
+			Appid:              req.AppId,
+			Name:               req.Name,
+			GoodsCode:          req.Goods_code,
+			OriginPrice:        req.Origin_price,
+			SkuMax:             req.Sku_max,
+			CalculationType:    req.Calculation_type,
+			CalculationMode:    req.Calculation_mode,
+			CalculationFormula: req.Calculation_formula,
+			Tag:                req.Tag,
+			Remark:             req.Remark,
+			ActualPrice:        req.Actual_price,
+		},
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 66 - 0
api/internal/logic/goodsupdlogic.go

@@ -0,0 +1,66 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsUpdLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGoodsUpdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsUpdLogic {
+	return &GoodsUpdLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GoodsUpdLogic) GoodsUpd(req *types.GoodsUpdReq) (resp *types.Reply, err error) {
+	// todo: add your logic here and delete this line
+	resp = &types.Reply{}
+
+	goodsResp, err := service.GoodsCenterRpc.GoodsUpd(l.ctx, &pb.GoodsAddReq{
+		Id:                   req.Id,
+		Appid:                req.AppId,
+		Name:                 req.Name,
+		StandClassifyCode:    req.Stand_classify_code,
+		BusinessClassifyCode: req.Business_classify_code,
+		BusinessId:           req.Business_id,
+		PcLandpage:           req.Pc_landpage,
+		WxLandpage:           req.Wx_landpage,
+		AppLandpage:          req.App_landpage,
+		Logo:                 req.Logo,
+		IntroduceImg_1:       req.Introduce_img_1,
+		IntroduceImg_2:       req.Introduce_img_2,
+		IntroduceImg_3:       req.Introduce_img_3,
+		Detail:               req.Detail,
+		Status:               req.Status,
+		CreatePersion:        req.Create_persion,
+		UpdatePerson:         req.Update_person,
+		Describe:             req.Describe,
+		Label:                req.Label,
+		Attributes:           req.Attributes,
+	})
+	if goodsResp.ErrorMsg != "" {
+		resp.Error_msg = goodsResp.ErrorMsg
+		resp.Error_code = -1
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
+	}
+	resp.Data = map[string]interface{}{
+		"status": goodsResp.Status,
+	}
+	return
+}

+ 116 - 0
api/internal/types/types.go

@@ -10,3 +10,119 @@ type Reply struct {
 	Error_msg  string      `json:"error_msg"`
 	Data       interface{} `json:"data"`
 }
+
+type GoodsAddReq struct {
+	AppId                  string `header:"appId,default=10000"`
+	Name                   string `json:"name"`                   //商品名称
+	Code                   string `json:"code"`                   //商品代码
+	Stand_classify_code    string `json:"stand_classify_code"`    //标准分类代码
+	Business_classify_code string `json:"business_classify_code"` //商户分类代码
+	Business_id            string `json:"business_id"`            //商家id
+	Pc_landpage            string `json:"pc_landpage"`            //pc端落地页
+	Wx_landpage            string `json:"wx_landpage"`            //wx端落地页
+	App_landpage           string `json:"app_landpage"`           //app端落地页
+	Logo                   string `json:"logo"`                   //产品logo
+	Introduce_img_1        string `json:"introduce_img_1"`        //产品介绍图1
+	Introduce_img_2        string `json:"introduce_img_2"`        //产品介绍图2
+	Introduce_img_3        string `json:"introduce_img_3"`        //产品介绍图3
+	Detail                 string `json:"detail"`                 //详情
+	Status                 string `json:"status"`                 //0下架  1上架
+	Create_persion         string `json:"create_persion"`         //创建人
+	Update_person          string `json:"update_person"`          //更新人
+	Describe               string `json:"describe"`               //描述
+	Label                  string `json:"label"`                  //标签
+	Attributes             string `json:"attributes"`             //商品属性  //1:资源包类型 2:权益类型
+	Id                     int64  `json:"id,optional"`
+}
+
+type GoodsIdReq struct {
+	Id    int64  `json:"id"`
+	AppId string `header:"appId,default=10000"`
+}
+
+type GoodsUpdReq struct {
+	AppId                  string `header:"appId,default=10000"`
+	Name                   string `json:"name,optional"`                   //商品名称
+	Stand_classify_code    string `json:"stand_classify_code,optional"`    //标准分类代码
+	Business_classify_code string `json:"business_classify_code,optional"` //商户分类代码
+	Business_id            string `json:"business_id,optional"`            //商家id
+	Pc_landpage            string `json:"pc_landpage,optional"`            //pc端落地页
+	Wx_landpage            string `json:"wx_landpage,optional"`            //wx端落地页
+	App_landpage           string `json:"app_landpage,optional"`           //app端落地页
+	Logo                   string `json:"logo,optional"`                   //产品logo
+	Introduce_img_1        string `json:"introduce_img_1,optional"`        //产品介绍图1
+	Introduce_img_2        string `json:"introduce_img_2,optional"`        //产品介绍图2
+	Introduce_img_3        string `json:"introduce_img_3,optional"`        //产品介绍图3
+	Detail                 string `json:"detail,optional"`                 //详情
+	Status                 string `json:"status,optional"`                 //0下架  1上架
+	Create_persion         string `json:"create_persion,optional"`         //创建人
+	Update_person          string `json:"update_person,optional"`          //更新人
+	Describe               string `json:"describe,optional"`               //描述
+	Label                  string `json:"label,optional"`                  //标签
+	Attributes             string `json:"attributes,optional"`             //商品属性  //1:资源包类型 2:权益类型
+	Id                     int64  `json:"id"`
+}
+
+type FunctionDefineReq struct {
+	AppId             string   `header:"appId,default=10000"`
+	Goods_code        string   `json:"goods_code"`
+	Function_code_arr []string `json:"function_code_arr"`
+	Name              string   `json:"name"`
+}
+
+type GoodsSpec struct {
+	AppId               string       `json:"appId,default=10000"`
+	Name                string       `json:"name"`                //规格名称
+	Goods_code          string       `json:"goods_code"`          //商品代码
+	Origin_price        int64        `json:"origin_price"`        //原价
+	Sku_max             int64        `json:"sku_max"`             //sku最大值
+	Calculation_formula string       `json:"calculation_formula"` //价格的计算公式
+	Calculation_mode    int64        `json:"calculation_mode"`    //1:一口价 2:公式计价 3:阶梯计价
+	Calculation_type    int64        `json:"calculation_type"`    //1:按量 2:sku(个人默认授权,企业手动需要授权)
+	Tag                 string       `json:"tag"`                 //自定义值,用于分组
+	Remark              string       `json:"remark"`              //备注
+	Actual_price        int64        `json:"actual_price"`        //实际价格
+	Goods_spec_child    []*GoodsSpec `json:"goods_spec_child,optional"`
+	Id                  int64        `json:"id,optional"`
+}
+
+type GoodSpecIdReq struct {
+	Spec_id int64  `json:"spec_id"`
+	AppId   string `header:"appId,default=10000"`
+}
+
+type GoodsSpecUpdReq struct {
+	AppId               string `json:"appId,default=10000"`
+	Name                string `json:"name,optional"`                //规格名称
+	Goods_code          string `json:"goods_code,optional"`          //商品代码
+	Origin_price        int64  `json:"origin_price,optional"`        //原价
+	Sku_max             int64  `json:"sku_max,optional"`             //sku最大值
+	Calculation_formula string `json:"calculation_formula,optional"` //价格的计算公式
+	Calculation_mode    int64  `json:"calculation_mode,optional"`    //1:一口价 2:公式计价 3:阶梯计价
+	Calculation_type    int64  `json:"calculation_type,optional"`    //1:按量 2:sku(个人默认授权,企业手动需要授权)
+	Tag                 string `json:"tag,optional"`                 //自定义值,用于分组
+	Remark              string `json:"remark,optional"`              //备注
+	Actual_price        int64  `json:"actual_price,,optional"`       //实际价格
+	Id                  int64  `json:"id"`
+}
+
+type GoodsSpecPowerAddReq struct {
+	Id                     int64  `json:"id,optional"`
+	Appid                  string `json:"appId,default=10000"`
+	Goods_function_id      int64  `json:"goods_function_id"`      //商品功能id
+	Goods_code             string `json:"goods_code"`             //商品代码
+	Spec_id                int64  `json:"spec_id"`                //规格id
+	Function_code          string `json:"function_code"`          //功能代码
+	Limit_strategy         string `json:"limit_strategy"`         //限制频率
+	Cycle                  string `json:"cycle"`                  //周期
+	Strategy_count         int64  `json:"strategy_count"`         //频率数量
+	Max_num                int64  `json:"max_num"`                //最大数量 不可修改,从原始表带过来
+	Use_count              int64  `json:"use_count"`              //数量
+	Power_type             int64  `json:"power_type"`             //权益所属类型 1:个人 2:企业
+	Count_type             int64  `json:"count_type"`             //数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+	Power_count            int64  `json:"power_count"`            //授权数量
+	Judge_repeat_mechanism int64  `json:"judge_repeat_mechanism"` //判重机制 0:无 1:通用判重 2:应用判重
+	Judge_repeat_scope     int64  `json:"judge_repeat_scope"`     //判重范围
+	Judge_repeat_flag      string `json:"judge_repeat_flag"`      //判重标识 _id、projectid
+	Judge_repeat_strategy  int64  `json:"judge_repeat_strategy"`  //判重策略 0:无需判重 1:通用判重 2:应用自己判重
+}

+ 27 - 19
public/entity/base_goods.go

@@ -5,8 +5,6 @@ import (
 	"errors"
 	"strconv"
 
-	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
-
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
 	. "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/db"
@@ -45,7 +43,10 @@ type Base_goods_struct struct {
 //新增商品
 func (b *Base_goods_struct) Add() (int64, error) {
 	if b.Appid == "" || b.Name == "" || b.Code == "" || b.Create_persion == "" {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
+	}
+	if c := Mysql_BaseService.CountBySql("select count(1) from base_goods where code = ?", b.Code); c > 0 {
+		return -1, errors.New("商品代码已存在")
 	}
 	status, _ := strconv.Atoi(b.Status)
 	business_id, _ := strconv.Atoi(b.Business_id)
@@ -94,17 +95,17 @@ func (b *Base_goods_struct) Add() (int64, error) {
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("新增失败")
+	return -1, errors.New("新增失败")
 }
 
 //删除商品
 func (b *Base_goods_struct) Del() (int64, error) {
 	if b.Appid == "" || b.Id == 0 {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
 	}
 	snapshot_data := Mysql_BaseService.SelectBySql(`select * from base_goods where id =? limit 1`, b.Id)
 	if snapshot_data == nil || len(*snapshot_data) == 0 {
-		return 0, errors.New("未查询到商品")
+		return -1, errors.New("未查询到商品")
 	}
 	ok := Mysql_BaseService.ExecTx("删除商品", func(tx *sql.Tx) bool {
 		data := (*snapshot_data)[0]
@@ -121,30 +122,27 @@ func (b *Base_goods_struct) Del() (int64, error) {
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("删除失败")
+	return -1, errors.New("删除失败")
 }
 
 //修改商品
 func (b *Base_goods_struct) Update() (int64, error) {
 	if b.Appid == "" || b.Id == 0 || b.Update_person == "" {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
 	}
 	snapshot_data := Mysql_BaseService.SelectBySql(`select * from base_goods where id =? and appid=? limit 1`, b.Id, b.Appid)
 	if snapshot_data == nil || len(*snapshot_data) == 0 {
-		return 0, errors.New("未查询到商品")
+		return -1, errors.New("未查询到商品")
 	}
 	updateMap := map[string]interface{}{
-		"version":       service.Version(),
+		"version":       Version(),
 		"update_time":   date.NowFormat(date.Date_Full_Layout),
 		"update_person": b.Update_person,
 	}
 	if b.Name != "" {
 		updateMap["name"] = b.Name
 	}
-	//TODO 商品代码是否支持修改? 如果需要修改 需要同步修改 相关 goods_code字段
-	// if b.Code != "" {
-	// 	updateMap["code"] = b.Code
-	// }
+
 	if b.Stand_classify_code != "" {
 		updateMap["stand_classify_code"] = b.Stand_classify_code
 	}
@@ -187,9 +185,6 @@ func (b *Base_goods_struct) Update() (int64, error) {
 		attribute, _ := strconv.Atoi(b.Attribute)
 		updateMap["attribute"] = attribute
 	}
-	if b.Label != "" {
-		updateMap["label"] = b.Label
-	}
 
 	//修改商品
 	ok := Mysql_BaseService.ExecTx("修改商品", func(tx *sql.Tx) bool {
@@ -207,7 +202,7 @@ func (b *Base_goods_struct) Update() (int64, error) {
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("修改失败")
+	return -1, errors.New("修改失败")
 }
 
 //查看商品
@@ -217,11 +212,24 @@ func (b *Base_goods_struct) Get() (*Base_goods_struct, error) {
 		return base_goods_data, errors.New("缺失参数,请检查必要参数")
 	}
 	//TODO 关联其他表查询
-	data := Mysql_BaseService.SelectBySql(`select name,code,stand_classify_code,business_classify_code,pc_landpage,wx_landpage,app_landpage,logo,introduce_img_1,introduce_img_2,introduce_img_3,detail,status,attribute,create_persion,update_person from base_goods where id =? and appid = ?  limit 1`, b.Id, b.Appid)
+	data := Mysql_BaseService.SelectBySql(`select appid,id,name,code,stand_classify_code,business_classify_code,pc_landpage,wx_landpage,app_landpage,logo,introduce_img_1,introduce_img_2,introduce_img_3,detail,status,attribute,create_persion,update_person,describes from base_goods where id =? and appid = ?  limit 1`, b.Id, b.Appid)
 	if data == nil || len(*data) == 0 {
 		return base_goods_data, errors.New("未查询到商品")
 	}
 	r := (*data)[0]
+	//将int类型转为string类型
+	if r["status"] != nil {
+		r["status"] = strconv.Itoa(common.IntAll(r["status"]))
+	}
+	if r["business_id"] != nil {
+		r["business_id"] = strconv.Itoa(common.IntAll(r["business_id"]))
+	}
+	if r["attribute"] != nil {
+		r["attribute"] = strconv.Itoa(common.IntAll(r["attribute"]))
+	}
+	if r["id"] != nil {
+		r["id"] = strconv.Itoa(common.IntAll(r["id"]))
+	}
 	base_goods_data = common.JsonUnmarshal(r, &Base_goods_struct{}).(*Base_goods_struct)
 	return base_goods_data, nil
 }

+ 3 - 3
public/entity/base_goods_function_define.go

@@ -23,10 +23,10 @@ type Base_goods_function_define_struct struct {
 func (b *Base_goods_function_define_struct) Add() (int64, error) {
 	now := date.NowFormat(date.Date_Full_Layout)
 	if b.Appid == "" || b.Name == "" || b.Goods_code == "" {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
 	}
 	if c := Mysql_BaseService.CountBySql(`select count(1) from base_goods where code = ?`, b.Goods_code); c <= 0 {
-		return 0, errors.New("请确认商品代码是否正确")
+		return -1, errors.New("请确认商品代码是否正确")
 	}
 	//商品功能定义明细表需要字段
 	base_goods_function_detail_fields := []string{"appid", "goods_function_define_id", "function_code"}
@@ -54,5 +54,5 @@ func (b *Base_goods_function_define_struct) Add() (int64, error) {
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("新增失败")
+	return -1, errors.New("新增失败")
 }

+ 21 - 16
public/entity/base_goods_spec.go

@@ -3,9 +3,9 @@ package entity
 import (
 	"database/sql"
 	"errors"
+	"log"
 
 	"app.yhyue.com/moapp/jybase/common"
-	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/service"
 	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/goodscenter"
 
 	"app.yhyue.com/moapp/jybase/date"
@@ -37,10 +37,10 @@ type Base_goods_spec_struct struct {
 func (b *Base_goods_spec_struct) Add() (int64, error) {
 	now := date.NowFormat(date.Date_Full_Layout)
 	if b.Appid == "" || b.Name == "" || b.Goods_code == "" {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
 	}
 	if c := Mysql_BaseService.CountBySql(`select count(1) from base_goods where code = ?`, b.Goods_code); c <= 0 {
-		return 0, errors.New("请确认商品代码是否正确")
+		return -1, errors.New("请确认商品代码是否正确")
 	}
 	//新增商品功能定义表、商品功能定义明细表
 	ok := Mysql_BaseService.ExecTx("新增商品功能", func(tx *sql.Tx) bool {
@@ -55,19 +55,20 @@ func (b *Base_goods_spec_struct) Add() (int64, error) {
 			"calculation_type":    b.Calculation_type,
 			"calculation_formula": b.Calculation_formula,
 			"calculation_mode":    b.Calculation_mode,
-			"version":             service.Version(),
+			"version":             Version(),
 			"tag":                 b.Tag,
 			"remark":              b.Remark,
 			"create_time":         now,
-			"updateTime":          now,
+			"update_time":         now,
 		})
+		log.Println("=-===", b.Googds_spec)
 		Recursion(id1, b.Googds_spec)
 		return id1 > 0
 	})
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("新增失败")
+	return -1, errors.New("新增失败")
 }
 
 //递归、生成父子关系
@@ -88,11 +89,11 @@ func Recursion(fid int64, arr []*goodscenter.GoodsSpec) {
 				"calculation_type":    v.CalculationType,
 				"calculation_formula": v.CalculationFormula,
 				"calculation_mode":    v.CalculationMode,
-				"version":             service.Version(),
+				"version":             Version(),
 				"tag":                 v.Tag,
 				"remark":              v.Remark,
 				"create_time":         now,
-				"updateTime":          now,
+				"update_time":         now,
 			})
 			bl := true
 			if fid > 0 {
@@ -126,11 +127,11 @@ func (b *Base_goods_spec_struct) Get() (*Base_goods_spec_struct, error) {
 
 func (b *Base_goods_spec_struct) Del() (int64, error) {
 	if b.Appid == "" || b.Id == 0 {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
 	}
 	data := Mysql_BaseService.SelectBySql(`select * from base_goods_spec where id =? and appid =? limit 1`, b.Id, b.Appid)
 	if data == nil || len(*data) == 0 {
-		return 0, errors.New("未找到该商品规格")
+		return -1, errors.New("未找到该商品规格")
 	}
 
 	rdata := (*data)[0]
@@ -147,22 +148,26 @@ func (b *Base_goods_spec_struct) Del() (int64, error) {
 			"delete_status": 1,
 			"update_time":   now,
 		})
-		return id1 > 0 && bl
+		//删除对应父子关系
+		bl2 := Mysql_BaseService.DeleteByTx(tx, "base_goods_spec_relation", map[string]interface{}{
+			"pid": common.Int64All(rdata["goods_spec_id"]),
+		})
+		return id1 > 0 && bl && bl2
 	})
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("删除失败")
+	return -1, errors.New("删除失败")
 }
 
 //修改
 func (b *Base_goods_spec_struct) Upd() (int64, error) {
 	if b.Appid == "" || b.Id == 0 {
-		return 0, errors.New("缺失参数,请检查必要参数")
+		return -1, errors.New("缺失参数,请检查必要参数")
 	}
 	data := Mysql_BaseService.SelectBySql(`select * from base_goods_spec where id =? and appid =? limit 1`, b.Id, b.Appid)
 	if data == nil || len(*data) == 0 {
-		return 0, errors.New("未找到该商品规格")
+		return -1, errors.New("未找到该商品规格")
 	}
 
 	rdata := (*data)[0]
@@ -170,7 +175,7 @@ func (b *Base_goods_spec_struct) Upd() (int64, error) {
 	delete(rdata, "id")
 	updateMap := map[string]interface{}{
 		"update_time": date.NowFormat(date.Date_Full_Layout),
-		"version":     service.Version(),
+		"version":     Version(),
 	}
 	if b.Name != "" {
 		updateMap["name"] = b.Name
@@ -213,5 +218,5 @@ func (b *Base_goods_spec_struct) Upd() (int64, error) {
 	if ok {
 		return 1, nil
 	}
-	return 0, errors.New("修改失败")
+	return -1, errors.New("修改失败")
 }

+ 67 - 0
public/entity/base_goods_spec_power.go

@@ -0,0 +1,67 @@
+package entity
+
+import (
+	"errors"
+
+	"app.yhyue.com/moapp/jybase/date"
+	. "bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/db"
+)
+
+var Base_goods_spec_power = Base_goods_spec_power_struct{}
+
+//商品规格权益表
+type Base_goods_spec_power_struct struct {
+	Id                     int64 //商品规格权益主键id
+	Appid                  string
+	Goods_function_id      int64  //商品功能id
+	Goods_code             string //商品代码
+	Spec_id                int64  //规格id
+	Function_code          string //功能代码
+	Limit_strategy         string //限制频率
+	Cycle                  string //周期
+	Strategy_count         int64  //频率数量
+	Max_num                int64  //最大数量 不可修改,从原始表带过来
+	Use_count              int64  //数量
+	Power_type             int64  //权益所属类型 1:个人 2:企业
+	Count_type             int64  //数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+	Power_count            int64  //授权数量
+	Judge_repeat_mechanism int64  //判重机制 0:无 1:通用判重 2:应用判重
+	Judge_repeat_scope     int64  //判重范围
+	Judge_repeat_flag      string //判重标识 _id、projectid
+	Judge_repeat_strategy  int64  //判重策略 0:无需判重 1:通用判重 2:应用自己判重
+}
+
+//新增商品规格
+func (b *Base_goods_spec_power_struct) Add() (int64, error) {
+	now := date.NowFormat(date.Date_Full_Layout)
+	if b.Appid == "" || b.Goods_function_id == 0 || b.Goods_code == "" || b.Spec_id == 0 {
+		return -1, errors.New("缺失参数,请检查必要参数")
+	}
+
+	//新增商品功能定义表、商品功能定义明细表
+	//商品规格权益表
+	id1 := Mysql_BaseService.Insert("base_goods_spec_power", map[string]interface{}{
+		"appid":                  b.Appid,
+		"goods_function_id":      b.Goods_function_id,
+		"goods_code":             b.Goods_code,
+		"spec_id":                b.Spec_id,
+		"function_code":          b.Function_code,
+		"cycle":                  b.Cycle,
+		"limit_strategy":         b.Limit_strategy,
+		"strategy_count":         b.Strategy_count,
+		"max_count":              b.Max_num,
+		"use_count":              b.Use_count,
+		"count_type":             b.Count_type,
+		"power_type":             b.Power_type,
+		"power_count":            b.Power_count,
+		"judge_repeat_mechanism": b.Judge_repeat_mechanism,
+		"judge_repeat_scope":     b.Judge_repeat_scope,
+		"judge_repeat_flag":      b.Judge_repeat_flag,
+		"judge_repeat_strategy":  b.Judge_repeat_strategy,
+		"create_time":            now,
+	})
+	if id1 > 0 {
+		return 1, nil
+	}
+	return -1, errors.New("新增失败")
+}

+ 1 - 1
public/service/util.go → public/entity/util.go

@@ -1,4 +1,4 @@
-package service
+package entity
 
 import (
 	"strconv"

+ 1 - 0
public/service/base_goods.go

@@ -0,0 +1 @@
+package service

+ 7 - 0
public/service/base_goods_stand_classify.go

@@ -0,0 +1,7 @@
+package service
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/goodscenter"
+)
+
+var GoodsCenterRpc goodscenter.GoodsCenter

+ 26 - 0
rpc/goodsCenter.proto

@@ -101,6 +101,8 @@ message GoodsGetResp{
 	int64 id= 22;
 	string error_msg = 23;
 	int64 error_code = 24; 
+	string describes=25;
+	string label=26;
 }
 
 //
@@ -154,7 +156,29 @@ message GoodsSpecGetResp{
 	string updateTime=13;//修改时间
 	string error_msg = 14;
 	int64 error_code = 15; 
+	string appid =16;
+}
 
+//新增商品规格权益 入参
+message GoodsSpecPowerAddReq{
+	int64 id=1;
+	string appid=2;
+	int64 goods_function_id=3;//商品功能id
+	string goods_code=4;//商品代码
+	int64 spec_id=5; //规格id
+	string function_code=6; //功能代码
+	string limit_strategy =7;//限制频率
+	string cycle=8;//周期
+	int64 strategy_count=9;//频率数量
+	int64 max_num=10;//最大数量 不可修改,从原始表带过来
+	int64 use_count=11;//数量
+	int64 power_type=12;//权益所属类型 1:个人 2:企业
+	int64 count_type =13;//数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+	int64 power_count=14;//授权数量
+	int64 judge_repeat_mechanism=15;//判重机制 0:无 1:通用判重 2:应用判重
+	int64 judge_repeat_scope=16;//判重范围
+	string judge_repeat_flag=17;//判重标识 _id、projectid
+	int64  judge_repeat_strategy=18;//判重策略 0:无需判重 1:通用判重 2:应用自己判重
 }
 
 service GoodsCenter {
@@ -178,4 +202,6 @@ service GoodsCenter {
   rpc GoodsSpecDel(GoodsSpecGetReq)returns (StatusResp);
   //修改商品规格
   rpc GoodsSpecUpd(GoodsSpecAddReq)returns (StatusResp);
+  //新增商品规格权益
+  rpc GoodsSpecPowerAdd(GoodsSpecPowerAddReq) returns(StatusResp);
 }

+ 24 - 15
rpc/goodscenter/goodscenter.go

@@ -13,21 +13,22 @@ import (
 )
 
 type (
-	Classify            = pb.Classify
-	ClassifyReq         = pb.ClassifyReq
-	ClassifyResp        = pb.ClassifyResp
-	FunctionDefineReq   = pb.FunctionDefineReq
-	GoodsAddReq         = pb.GoodsAddReq
-	GoodsAddResp        = pb.GoodsAddResp
-	GoodsDelReq         = pb.GoodsDelReq
-	GoodsFunctionAddReq = pb.GoodsFunctionAddReq
-	GoodsGetReq         = pb.GoodsGetReq
-	GoodsGetResp        = pb.GoodsGetResp
-	GoodsSpec           = pb.GoodsSpec
-	GoodsSpecAddReq     = pb.GoodsSpecAddReq
-	GoodsSpecGetReq     = pb.GoodsSpecGetReq
-	GoodsSpecGetResp    = pb.GoodsSpecGetResp
-	StatusResp          = pb.StatusResp
+	Classify             = pb.Classify
+	ClassifyReq          = pb.ClassifyReq
+	ClassifyResp         = pb.ClassifyResp
+	FunctionDefineReq    = pb.FunctionDefineReq
+	GoodsAddReq          = pb.GoodsAddReq
+	GoodsAddResp         = pb.GoodsAddResp
+	GoodsDelReq          = pb.GoodsDelReq
+	GoodsFunctionAddReq  = pb.GoodsFunctionAddReq
+	GoodsGetReq          = pb.GoodsGetReq
+	GoodsGetResp         = pb.GoodsGetResp
+	GoodsSpec            = pb.GoodsSpec
+	GoodsSpecAddReq      = pb.GoodsSpecAddReq
+	GoodsSpecGetReq      = pb.GoodsSpecGetReq
+	GoodsSpecGetResp     = pb.GoodsSpecGetResp
+	GoodsSpecPowerAddReq = pb.GoodsSpecPowerAddReq
+	StatusResp           = pb.StatusResp
 
 	GoodsCenter interface {
 		// 查看标准商品分类
@@ -50,6 +51,8 @@ type (
 		GoodsSpecDel(ctx context.Context, in *GoodsSpecGetReq, opts ...grpc.CallOption) (*StatusResp, error)
 		// 修改商品规格
 		GoodsSpecUpd(ctx context.Context, in *GoodsSpecAddReq, opts ...grpc.CallOption) (*StatusResp, error)
+		// 新增商品规格权益
+		GoodsSpecPowerAdd(ctx context.Context, in *GoodsSpecPowerAddReq, opts ...grpc.CallOption) (*StatusResp, error)
 	}
 
 	defaultGoodsCenter struct {
@@ -122,3 +125,9 @@ func (m *defaultGoodsCenter) GoodsSpecUpd(ctx context.Context, in *GoodsSpecAddR
 	client := pb.NewGoodsCenterClient(m.cli.Conn())
 	return client.GoodsSpecUpd(ctx, in, opts...)
 }
+
+// 新增商品规格权益
+func (m *defaultGoodsCenter) GoodsSpecPowerAdd(ctx context.Context, in *GoodsSpecPowerAddReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	client := pb.NewGoodsCenterClient(m.cli.Conn())
+	return client.GoodsSpecPowerAdd(ctx, in, opts...)
+}

+ 1 - 0
rpc/internal/logic/goodsspecgetlogic.go

@@ -52,5 +52,6 @@ func (l *GoodsSpecGetLogic) GoodsSpecGet(in *pb.GoodsSpecGetReq) (*pb.GoodsSpecG
 	resp.Remark = goods_spec_detail.Remark
 	resp.SkuMax = goods_spec_detail.Sku_max
 	resp.Tag = goods_spec_detail.Tag
+	resp.Appid = goods_spec_detail.Appid
 	return resp, nil
 }

+ 60 - 0
rpc/internal/logic/goodsspecpoweraddlogic.go

@@ -0,0 +1,60 @@
+package logic
+
+import (
+	"context"
+	"fmt"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/public/entity"
+
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/internal/svc"
+	"bp.jydev.jianyu360.cn/BaseService/goodsCenter/rpc/pb"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GoodsSpecPowerAddLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGoodsSpecPowerAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GoodsSpecPowerAddLogic {
+	return &GoodsSpecPowerAddLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 新增商品规格权益
+func (l *GoodsSpecPowerAddLogic) GoodsSpecPowerAdd(in *pb.GoodsSpecPowerAddReq) (*pb.StatusResp, error) {
+	// todo: add your logic here and delete this line
+	resp := &pb.StatusResp{}
+	spec_power := &entity.Base_goods_spec_power_struct{
+		Appid:                  in.Appid,
+		Goods_function_id:      in.GoodsFunctionId,      //商品功能id
+		Goods_code:             in.GoodsCode,            //商品代码
+		Spec_id:                in.SpecId,               //规格id
+		Function_code:          in.FunctionCode,         //功能代码
+		Limit_strategy:         in.LimitStrategy,        //限制频率
+		Cycle:                  in.Cycle,                //周期
+		Strategy_count:         in.StrategyCount,        //频率数量
+		Max_num:                in.MaxNum,               //最大数量 不可修改,从原始表带过来
+		Use_count:              in.UseCount,             //数量
+		Power_type:             in.PowerType,            //权益所属类型 1:个人 2:企业
+		Count_type:             in.CountType,            //数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+		Power_count:            in.PowerCount,           //授权数量
+		Judge_repeat_mechanism: in.JudgeRepeatMechanism, //判重机制 0:无 1:通用判重 2:应用判重
+		Judge_repeat_scope:     in.JudgeRepeatScope,     //判重范围
+		Judge_repeat_flag:      in.JudgeRepeatFlag,      //判重标识 _id、projectid
+		Judge_repeat_strategy:  in.JudgeRepeatStrategy,  //判重策略 0:无需判重 1:通用判重 2:应用自己判重
+	}
+	status, err := spec_power.Add()
+	if err != nil {
+		l.Error(fmt.Sprintf("%+v", in), err.Error())
+		resp.ErrorMsg = err.Error()
+		resp.ErrorCode = -1
+	}
+	resp.Status = status
+	return resp, nil
+}

+ 6 - 0
rpc/internal/server/goodscenterserver.go

@@ -81,3 +81,9 @@ func (s *GoodsCenterServer) GoodsSpecUpd(ctx context.Context, in *pb.GoodsSpecAd
 	l := logic.NewGoodsSpecUpdLogic(ctx, s.svcCtx)
 	return l.GoodsSpecUpd(in)
 }
+
+// 新增商品规格权益
+func (s *GoodsCenterServer) GoodsSpecPowerAdd(ctx context.Context, in *pb.GoodsSpecPowerAddReq) (*pb.StatusResp, error) {
+	l := logic.NewGoodsSpecPowerAddLogic(ctx, s.svcCtx)
+	return l.GoodsSpecPowerAdd(in)
+}

+ 408 - 136
rpc/pb/goodsCenter.pb.go

@@ -747,6 +747,8 @@ type GoodsGetResp struct {
 	Id                   int64  `protobuf:"varint,22,opt,name=id,proto3" json:"id,omitempty"`
 	ErrorMsg             string `protobuf:"bytes,23,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
 	ErrorCode            int64  `protobuf:"varint,24,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+	Describes            string `protobuf:"bytes,25,opt,name=describes,proto3" json:"describes,omitempty"`
+	Label                string `protobuf:"bytes,26,opt,name=label,proto3" json:"label,omitempty"`
 }
 
 func (x *GoodsGetResp) Reset() {
@@ -949,6 +951,20 @@ func (x *GoodsGetResp) GetErrorCode() int64 {
 	return 0
 }
 
+func (x *GoodsGetResp) GetDescribes() string {
+	if x != nil {
+		return x.Describes
+	}
+	return ""
+}
+
+func (x *GoodsGetResp) GetLabel() string {
+	if x != nil {
+		return x.Label
+	}
+	return ""
+}
+
 //
 type FunctionDefineReq struct {
 	state         protoimpl.MessageState
@@ -1288,6 +1304,7 @@ type GoodsSpecGetResp struct {
 	UpdateTime         string `protobuf:"bytes,13,opt,name=updateTime,proto3" json:"updateTime,omitempty"`                                          //修改时间
 	ErrorMsg           string `protobuf:"bytes,14,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
 	ErrorCode          int64  `protobuf:"varint,15,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"`
+	Appid              string `protobuf:"bytes,16,opt,name=appid,proto3" json:"appid,omitempty"`
 }
 
 func (x *GoodsSpecGetResp) Reset() {
@@ -1427,6 +1444,197 @@ func (x *GoodsSpecGetResp) GetErrorCode() int64 {
 	return 0
 }
 
+func (x *GoodsSpecGetResp) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+//新增商品规格权益 入参
+type GoodsSpecPowerAddReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Id                   int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+	Appid                string `protobuf:"bytes,2,opt,name=appid,proto3" json:"appid,omitempty"`
+	GoodsFunctionId      int64  `protobuf:"varint,3,opt,name=goods_function_id,json=goodsFunctionId,proto3" json:"goods_function_id,omitempty"`                 //商品功能id
+	GoodsCode            string `protobuf:"bytes,4,opt,name=goods_code,json=goodsCode,proto3" json:"goods_code,omitempty"`                                      //商品代码
+	SpecId               int64  `protobuf:"varint,5,opt,name=spec_id,json=specId,proto3" json:"spec_id,omitempty"`                                              //规格id
+	FunctionCode         string `protobuf:"bytes,6,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"`                             //功能代码
+	LimitStrategy        string `protobuf:"bytes,7,opt,name=limit_strategy,json=limitStrategy,proto3" json:"limit_strategy,omitempty"`                          //限制频率
+	Cycle                string `protobuf:"bytes,8,opt,name=cycle,proto3" json:"cycle,omitempty"`                                                               //周期
+	StrategyCount        int64  `protobuf:"varint,9,opt,name=strategy_count,json=strategyCount,proto3" json:"strategy_count,omitempty"`                         //频率数量
+	MaxNum               int64  `protobuf:"varint,10,opt,name=max_num,json=maxNum,proto3" json:"max_num,omitempty"`                                             //最大数量 不可修改,从原始表带过来
+	UseCount             int64  `protobuf:"varint,11,opt,name=use_count,json=useCount,proto3" json:"use_count,omitempty"`                                       //数量
+	PowerType            int64  `protobuf:"varint,12,opt,name=power_type,json=powerType,proto3" json:"power_type,omitempty"`                                    //权益所属类型 1:个人 2:企业
+	CountType            int64  `protobuf:"varint,13,opt,name=count_type,json=countType,proto3" json:"count_type,omitempty"`                                    //数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+	PowerCount           int64  `protobuf:"varint,14,opt,name=power_count,json=powerCount,proto3" json:"power_count,omitempty"`                                 //授权数量
+	JudgeRepeatMechanism int64  `protobuf:"varint,15,opt,name=judge_repeat_mechanism,json=judgeRepeatMechanism,proto3" json:"judge_repeat_mechanism,omitempty"` //判重机制 0:无 1:通用判重 2:应用判重
+	JudgeRepeatScope     int64  `protobuf:"varint,16,opt,name=judge_repeat_scope,json=judgeRepeatScope,proto3" json:"judge_repeat_scope,omitempty"`             //判重范围
+	JudgeRepeatFlag      string `protobuf:"bytes,17,opt,name=judge_repeat_flag,json=judgeRepeatFlag,proto3" json:"judge_repeat_flag,omitempty"`                 //判重标识 _id、projectid
+	JudgeRepeatStrategy  int64  `protobuf:"varint,18,opt,name=judge_repeat_strategy,json=judgeRepeatStrategy,proto3" json:"judge_repeat_strategy,omitempty"`    //判重策略 0:无需判重 1:通用判重 2:应用自己判重
+}
+
+func (x *GoodsSpecPowerAddReq) Reset() {
+	*x = GoodsSpecPowerAddReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_goodsCenter_proto_msgTypes[15]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *GoodsSpecPowerAddReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GoodsSpecPowerAddReq) ProtoMessage() {}
+
+func (x *GoodsSpecPowerAddReq) ProtoReflect() protoreflect.Message {
+	mi := &file_goodsCenter_proto_msgTypes[15]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use GoodsSpecPowerAddReq.ProtoReflect.Descriptor instead.
+func (*GoodsSpecPowerAddReq) Descriptor() ([]byte, []int) {
+	return file_goodsCenter_proto_rawDescGZIP(), []int{15}
+}
+
+func (x *GoodsSpecPowerAddReq) GetId() int64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetAppid() string {
+	if x != nil {
+		return x.Appid
+	}
+	return ""
+}
+
+func (x *GoodsSpecPowerAddReq) GetGoodsFunctionId() int64 {
+	if x != nil {
+		return x.GoodsFunctionId
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetGoodsCode() string {
+	if x != nil {
+		return x.GoodsCode
+	}
+	return ""
+}
+
+func (x *GoodsSpecPowerAddReq) GetSpecId() int64 {
+	if x != nil {
+		return x.SpecId
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetFunctionCode() string {
+	if x != nil {
+		return x.FunctionCode
+	}
+	return ""
+}
+
+func (x *GoodsSpecPowerAddReq) GetLimitStrategy() string {
+	if x != nil {
+		return x.LimitStrategy
+	}
+	return ""
+}
+
+func (x *GoodsSpecPowerAddReq) GetCycle() string {
+	if x != nil {
+		return x.Cycle
+	}
+	return ""
+}
+
+func (x *GoodsSpecPowerAddReq) GetStrategyCount() int64 {
+	if x != nil {
+		return x.StrategyCount
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetMaxNum() int64 {
+	if x != nil {
+		return x.MaxNum
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetUseCount() int64 {
+	if x != nil {
+		return x.UseCount
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetPowerType() int64 {
+	if x != nil {
+		return x.PowerType
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetCountType() int64 {
+	if x != nil {
+		return x.CountType
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetPowerCount() int64 {
+	if x != nil {
+		return x.PowerCount
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetJudgeRepeatMechanism() int64 {
+	if x != nil {
+		return x.JudgeRepeatMechanism
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetJudgeRepeatScope() int64 {
+	if x != nil {
+		return x.JudgeRepeatScope
+	}
+	return 0
+}
+
+func (x *GoodsSpecPowerAddReq) GetJudgeRepeatFlag() string {
+	if x != nil {
+		return x.JudgeRepeatFlag
+	}
+	return ""
+}
+
+func (x *GoodsSpecPowerAddReq) GetJudgeRepeatStrategy() int64 {
+	if x != nil {
+		return x.JudgeRepeatStrategy
+	}
+	return 0
+}
+
 var File_goodsCenter_proto protoreflect.FileDescriptor
 
 var file_goodsCenter_proto_rawDesc = []byte{
@@ -1515,7 +1723,7 @@ var file_goodsCenter_proto_rawDesc = []byte{
 	0x72, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x33, 0x0a, 0x0b, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x47, 0x65,
 	0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20,
 	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x88, 0x06, 0x0a, 0x0c, 0x47,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xbc, 0x06, 0x0a, 0x0c, 0x47,
 	0x6f, 0x6f, 0x64, 0x73, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x61,
 	0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69,
 	0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
@@ -1564,112 +1772,161 @@ var file_goodsCenter_proto_rawDesc = []byte{
 	0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72,
 	0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f,
 	0x63, 0x6f, 0x64, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69,
-	0x6f, 0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x67,
-	0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
-	0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
-	0x12, 0x2a, 0x0a, 0x11, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64,
-	0x65, 0x5f, 0x61, 0x72, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x66, 0x75, 0x6e,
-	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x72, 0x72, 0x12, 0x12, 0x0a, 0x04,
-	0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
-	0x22, 0xaa, 0x03, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14,
-	0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61,
-	0x70, 0x70, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64,
-	0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f,
-	0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69,
-	0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f,
-	0x72, 0x69, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x6b,
-	0x75, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x6b, 0x75,
-	0x4d, 0x61, 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69,
-	0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63,
-	0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f,
-	0x0a, 0x13, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f,
-	0x72, 0x6d, 0x75, 0x6c, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x61, 0x6c,
-	0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x75, 0x6c, 0x61, 0x12,
-	0x29, 0x0a, 0x10, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d,
-	0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x6c, 0x63, 0x75,
-	0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61,
-	0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06,
-	0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65,
-	0x6d, 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x70,
-	0x72, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x75,
-	0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x10, 0x67, 0x6f, 0x6f, 0x64, 0x73,
-	0x5f, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x0c, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0e, 0x67,
-	0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x0e, 0x0a,
-	0x02, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3c, 0x0a,
-	0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71,
-	0x12, 0x29, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63,
-	0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x22, 0x40, 0x0a, 0x0f, 0x47,
-	0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17,
-	0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0xeb, 0x03,
-	0x0a, 0x10, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
-	0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
-	0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21,
-	0x0a, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63,
-	0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63,
-	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x50,
-	0x72, 0x69, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x6b, 0x75, 0x5f, 0x6d, 0x61, 0x78, 0x18,
-	0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x6b, 0x75, 0x4d, 0x61, 0x78, 0x12, 0x29, 0x0a,
-	0x10, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70,
-	0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61,
-	0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x61, 0x6c, 0x63,
-	0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x75, 0x6c, 0x61, 0x18,
-	0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69,
-	0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x75, 0x6c, 0x61, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x61, 0x6c,
-	0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
-	0x4d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b,
-	0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1f,
-	0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
-	0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
-	0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x0e, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x0a, 0x0a,
-	0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x32, 0xdf, 0x03, 0x0a, 0x0b,
-	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x19, 0x47,
-	0x65, 0x74, 0x42, 0x61, 0x73, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x74, 0x61, 0x6e, 0x64,
-	0x43, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x79, 0x12, 0x0c, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73,
-	0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66,
-	0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64,
-	0x64, 0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a,
-	0x0d, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25,
-	0x0a, 0x08, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f,
-	0x64, 0x73, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
-	0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x08, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x70,
-	0x64, 0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a,
-	0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08,
-	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x47, 0x65, 0x74, 0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73,
-	0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x47, 0x65,
-	0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
-	0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x41, 0x64, 0x64, 0x12, 0x12, 0x2e, 0x46, 0x75, 0x6e,
-	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0b,
-	0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0c, 0x47,
-	0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x12, 0x10, 0x2e, 0x47, 0x6f,
-	0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e,
-	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0c, 0x47, 0x6f,
-	0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x12, 0x10, 0x2e, 0x47, 0x6f, 0x6f,
-	0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x47,
-	0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
-	0x2d, 0x0a, 0x0c, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x44, 0x65, 0x6c, 0x12,
-	0x10, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65,
-	0x71, 0x1a, 0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d,
-	0x0a, 0x0c, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x55, 0x70, 0x64, 0x12, 0x10,
-	0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71,
-	0x1a, 0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a,
-	0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62,
+	0x65, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
+	0x62, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x1a, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x88, 0x01, 0x0a, 0x11, 0x46, 0x75,
+	0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x12,
+	0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14,
+	0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61,
+	0x70, 0x70, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x61, 0x72, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
+	0x0f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x72, 0x72,
+	0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
+	0x6e, 0x61, 0x6d, 0x65, 0x22, 0xaa, 0x03, 0x0a, 0x09, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70,
+	0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
+	0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f,
+	0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x17,
+	0x0a, 0x07, 0x73, 0x6b, 0x75, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x06, 0x73, 0x6b, 0x75, 0x4d, 0x61, 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x61, 0x6c, 0x63, 0x75,
+	0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79,
+	0x70, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f,
+	0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x75, 0x6c, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x12, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d,
+	0x75, 0x6c, 0x61, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63,
+	0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x10,
+	0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67,
+	0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x75,
+	0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b,
+	0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x34, 0x0a, 0x10, 0x67,
+	0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18,
+	0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65,
+	0x63, 0x52, 0x0e, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x43, 0x68, 0x69, 0x6c,
+	0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
+	0x64, 0x22, 0x3c, 0x0a, 0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64,
+	0x64, 0x52, 0x65, 0x71, 0x12, 0x29, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x73, 0x70,
+	0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73,
+	0x53, 0x70, 0x65, 0x63, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x22,
+	0x40, 0x0a, 0x0f, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52,
+	0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61,
+	0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69,
+	0x64, 0x22, 0x81, 0x04, 0x0a, 0x10, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47,
+	0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69,
+	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12,
+	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+	0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x64,
+	0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f,
+	0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x69,
+	0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
+	0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f,
+	0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x61, 0x63, 0x74,
+	0x75, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x6b, 0x75, 0x5f,
+	0x6d, 0x61, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x6b, 0x75, 0x4d, 0x61,
+	0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x6c,
+	0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x13,
+	0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d,
+	0x75, 0x6c, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x63, 0x61, 0x6c, 0x63, 0x75,
+	0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x75, 0x6c, 0x61, 0x12, 0x29, 0x0a,
+	0x10, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64,
+	0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61,
+	0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18,
+	0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65,
+	0x6d, 0x61, 0x72, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61,
+	0x72, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,
+	0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54,
+	0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
+	0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54,
+	0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67,
+	0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67,
+	0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0f,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
+	0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
+	0x61, 0x70, 0x70, 0x69, 0x64, 0x22, 0x82, 0x05, 0x0a, 0x14, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53,
+	0x70, 0x65, 0x63, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x12, 0x0e,
+	0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14,
+	0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61,
+	0x70, 0x70, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x66, 0x75,
+	0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+	0x0f, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64,
+	0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12,
+	0x17, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x06, 0x73, 0x70, 0x65, 0x63, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a,
+	0x0e, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18,
+	0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x72, 0x61,
+	0x74, 0x65, 0x67, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x08, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74,
+	0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0d, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x43, 0x6f, 0x75, 0x6e,
+	0x74, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73,
+	0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75,
+	0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72,
+	0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f,
+	0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x75, 0x6e,
+	0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x63,
+	0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65,
+	0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x5f,
+	0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d,
+	0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x52, 0x65, 0x70,
+	0x65, 0x61, 0x74, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x12, 0x2c, 0x0a, 0x12,
+	0x6a, 0x75, 0x64, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x5f, 0x73, 0x63, 0x6f,
+	0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x52,
+	0x65, 0x70, 0x65, 0x61, 0x74, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6a, 0x75,
+	0x64, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x18,
+	0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x52, 0x65, 0x70, 0x65,
+	0x61, 0x74, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x32, 0x0a, 0x15, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x5f,
+	0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18,
+	0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x6a, 0x75, 0x64, 0x67, 0x65, 0x52, 0x65, 0x70, 0x65,
+	0x61, 0x74, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x32, 0x98, 0x04, 0x0a, 0x0b, 0x47,
+	0x6f, 0x6f, 0x64, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x19, 0x47, 0x65,
+	0x74, 0x42, 0x61, 0x73, 0x65, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x43,
+	0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x79, 0x12, 0x0c, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x69,
+	0x66, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x79,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64,
+	0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0d,
+	0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a,
+	0x08, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x44, 0x65, 0x6c, 0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64,
+	0x73, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x08, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x55, 0x70, 0x64,
+	0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0b,
+	0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x08, 0x47,
+	0x6f, 0x6f, 0x64, 0x73, 0x47, 0x65, 0x74, 0x12, 0x0c, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x47,
+	0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x47, 0x65, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x41, 0x64, 0x64, 0x12, 0x12, 0x2e, 0x46, 0x75, 0x6e, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e,
+	0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0c, 0x47, 0x6f,
+	0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x12, 0x10, 0x2e, 0x47, 0x6f, 0x6f,
+	0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x53,
+	0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0c, 0x47, 0x6f, 0x6f,
+	0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x12, 0x10, 0x2e, 0x47, 0x6f, 0x6f, 0x64,
+	0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x47, 0x6f,
+	0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d,
+	0x0a, 0x0c, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x44, 0x65, 0x6c, 0x12, 0x10,
+	0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71,
+	0x1a, 0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a,
+	0x0c, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x55, 0x70, 0x64, 0x12, 0x10, 0x2e,
+	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a,
+	0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x11,
+	0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x41, 0x64,
+	0x64, 0x12, 0x15, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x53, 0x70, 0x65, 0x63, 0x50, 0x6f, 0x77,
+	0x65, 0x72, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
+	0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -1684,23 +1941,24 @@ func file_goodsCenter_proto_rawDescGZIP() []byte {
 	return file_goodsCenter_proto_rawDescData
 }
 
-var file_goodsCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
+var file_goodsCenter_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
 var file_goodsCenter_proto_goTypes = []interface{}{
-	(*ClassifyReq)(nil),         // 0: ClassifyReq
-	(*Classify)(nil),            // 1: Classify
-	(*ClassifyResp)(nil),        // 2: ClassifyResp
-	(*GoodsAddReq)(nil),         // 3: GoodsAddReq
-	(*GoodsAddResp)(nil),        // 4: GoodsAddResp
-	(*GoodsFunctionAddReq)(nil), // 5: GoodsFunctionAddReq
-	(*GoodsDelReq)(nil),         // 6: GoodsDelReq
-	(*StatusResp)(nil),          // 7: StatusResp
-	(*GoodsGetReq)(nil),         // 8: GoodsGetReq
-	(*GoodsGetResp)(nil),        // 9: GoodsGetResp
-	(*FunctionDefineReq)(nil),   // 10: FunctionDefineReq
-	(*GoodsSpec)(nil),           // 11: GoodsSpec
-	(*GoodsSpecAddReq)(nil),     // 12: GoodsSpecAddReq
-	(*GoodsSpecGetReq)(nil),     // 13: GoodsSpecGetReq
-	(*GoodsSpecGetResp)(nil),    // 14: GoodsSpecGetResp
+	(*ClassifyReq)(nil),          // 0: ClassifyReq
+	(*Classify)(nil),             // 1: Classify
+	(*ClassifyResp)(nil),         // 2: ClassifyResp
+	(*GoodsAddReq)(nil),          // 3: GoodsAddReq
+	(*GoodsAddResp)(nil),         // 4: GoodsAddResp
+	(*GoodsFunctionAddReq)(nil),  // 5: GoodsFunctionAddReq
+	(*GoodsDelReq)(nil),          // 6: GoodsDelReq
+	(*StatusResp)(nil),           // 7: StatusResp
+	(*GoodsGetReq)(nil),          // 8: GoodsGetReq
+	(*GoodsGetResp)(nil),         // 9: GoodsGetResp
+	(*FunctionDefineReq)(nil),    // 10: FunctionDefineReq
+	(*GoodsSpec)(nil),            // 11: GoodsSpec
+	(*GoodsSpecAddReq)(nil),      // 12: GoodsSpecAddReq
+	(*GoodsSpecGetReq)(nil),      // 13: GoodsSpecGetReq
+	(*GoodsSpecGetResp)(nil),     // 14: GoodsSpecGetResp
+	(*GoodsSpecPowerAddReq)(nil), // 15: GoodsSpecPowerAddReq
 }
 var file_goodsCenter_proto_depIdxs = []int32{
 	1,  // 0: Classify.good:type_name -> Classify
@@ -1717,18 +1975,20 @@ var file_goodsCenter_proto_depIdxs = []int32{
 	13, // 11: GoodsCenter.GoodsSpecGet:input_type -> GoodsSpecGetReq
 	13, // 12: GoodsCenter.GoodsSpecDel:input_type -> GoodsSpecGetReq
 	12, // 13: GoodsCenter.GoodsSpecUpd:input_type -> GoodsSpecAddReq
-	2,  // 14: GoodsCenter.GetBaseGoodsStandClassify:output_type -> ClassifyResp
-	4,  // 15: GoodsCenter.GoodsAdd:output_type -> GoodsAddResp
-	7,  // 16: GoodsCenter.GoodsDel:output_type -> StatusResp
-	7,  // 17: GoodsCenter.GoodsUpd:output_type -> StatusResp
-	9,  // 18: GoodsCenter.GoodsGet:output_type -> GoodsGetResp
-	7,  // 19: GoodsCenter.FunctionDefineAdd:output_type -> StatusResp
-	7,  // 20: GoodsCenter.GoodsSpecAdd:output_type -> StatusResp
-	14, // 21: GoodsCenter.GoodsSpecGet:output_type -> GoodsSpecGetResp
-	7,  // 22: GoodsCenter.GoodsSpecDel:output_type -> StatusResp
-	7,  // 23: GoodsCenter.GoodsSpecUpd:output_type -> StatusResp
-	14, // [14:24] is the sub-list for method output_type
-	4,  // [4:14] is the sub-list for method input_type
+	15, // 14: GoodsCenter.GoodsSpecPowerAdd:input_type -> GoodsSpecPowerAddReq
+	2,  // 15: GoodsCenter.GetBaseGoodsStandClassify:output_type -> ClassifyResp
+	4,  // 16: GoodsCenter.GoodsAdd:output_type -> GoodsAddResp
+	7,  // 17: GoodsCenter.GoodsDel:output_type -> StatusResp
+	7,  // 18: GoodsCenter.GoodsUpd:output_type -> StatusResp
+	9,  // 19: GoodsCenter.GoodsGet:output_type -> GoodsGetResp
+	7,  // 20: GoodsCenter.FunctionDefineAdd:output_type -> StatusResp
+	7,  // 21: GoodsCenter.GoodsSpecAdd:output_type -> StatusResp
+	14, // 22: GoodsCenter.GoodsSpecGet:output_type -> GoodsSpecGetResp
+	7,  // 23: GoodsCenter.GoodsSpecDel:output_type -> StatusResp
+	7,  // 24: GoodsCenter.GoodsSpecUpd:output_type -> StatusResp
+	7,  // 25: GoodsCenter.GoodsSpecPowerAdd:output_type -> StatusResp
+	15, // [15:26] is the sub-list for method output_type
+	4,  // [4:15] is the sub-list for method input_type
 	4,  // [4:4] is the sub-list for extension type_name
 	4,  // [4:4] is the sub-list for extension extendee
 	0,  // [0:4] is the sub-list for field type_name
@@ -1920,6 +2180,18 @@ func file_goodsCenter_proto_init() {
 				return nil
 			}
 		}
+		file_goodsCenter_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GoodsSpecPowerAddReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -1927,7 +2199,7 @@ func file_goodsCenter_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_goodsCenter_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   15,
+			NumMessages:   16,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 38 - 0
rpc/pb/goodsCenter_grpc.pb.go

@@ -42,6 +42,8 @@ type GoodsCenterClient interface {
 	GoodsSpecDel(ctx context.Context, in *GoodsSpecGetReq, opts ...grpc.CallOption) (*StatusResp, error)
 	//修改商品规格
 	GoodsSpecUpd(ctx context.Context, in *GoodsSpecAddReq, opts ...grpc.CallOption) (*StatusResp, error)
+	//新增商品规格权益
+	GoodsSpecPowerAdd(ctx context.Context, in *GoodsSpecPowerAddReq, opts ...grpc.CallOption) (*StatusResp, error)
 }
 
 type goodsCenterClient struct {
@@ -142,6 +144,15 @@ func (c *goodsCenterClient) GoodsSpecUpd(ctx context.Context, in *GoodsSpecAddRe
 	return out, nil
 }
 
+func (c *goodsCenterClient) GoodsSpecPowerAdd(ctx context.Context, in *GoodsSpecPowerAddReq, opts ...grpc.CallOption) (*StatusResp, error) {
+	out := new(StatusResp)
+	err := c.cc.Invoke(ctx, "/GoodsCenter/GoodsSpecPowerAdd", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // GoodsCenterServer is the server API for GoodsCenter service.
 // All implementations must embed UnimplementedGoodsCenterServer
 // for forward compatibility
@@ -166,6 +177,8 @@ type GoodsCenterServer interface {
 	GoodsSpecDel(context.Context, *GoodsSpecGetReq) (*StatusResp, error)
 	//修改商品规格
 	GoodsSpecUpd(context.Context, *GoodsSpecAddReq) (*StatusResp, error)
+	//新增商品规格权益
+	GoodsSpecPowerAdd(context.Context, *GoodsSpecPowerAddReq) (*StatusResp, error)
 	mustEmbedUnimplementedGoodsCenterServer()
 }
 
@@ -203,6 +216,9 @@ func (UnimplementedGoodsCenterServer) GoodsSpecDel(context.Context, *GoodsSpecGe
 func (UnimplementedGoodsCenterServer) GoodsSpecUpd(context.Context, *GoodsSpecAddReq) (*StatusResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GoodsSpecUpd not implemented")
 }
+func (UnimplementedGoodsCenterServer) GoodsSpecPowerAdd(context.Context, *GoodsSpecPowerAddReq) (*StatusResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GoodsSpecPowerAdd not implemented")
+}
 func (UnimplementedGoodsCenterServer) mustEmbedUnimplementedGoodsCenterServer() {}
 
 // UnsafeGoodsCenterServer may be embedded to opt out of forward compatibility for this service.
@@ -396,6 +412,24 @@ func _GoodsCenter_GoodsSpecUpd_Handler(srv interface{}, ctx context.Context, dec
 	return interceptor(ctx, in, info, handler)
 }
 
+func _GoodsCenter_GoodsSpecPowerAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(GoodsSpecPowerAddReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(GoodsCenterServer).GoodsSpecPowerAdd(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/GoodsCenter/GoodsSpecPowerAdd",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(GoodsCenterServer).GoodsSpecPowerAdd(ctx, req.(*GoodsSpecPowerAddReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // GoodsCenter_ServiceDesc is the grpc.ServiceDesc for GoodsCenter service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -443,6 +477,10 @@ var GoodsCenter_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GoodsSpecUpd",
 			Handler:    _GoodsCenter_GoodsSpecUpd_Handler,
 		},
+		{
+			MethodName: "GoodsSpecPowerAdd",
+			Handler:    _GoodsCenter_GoodsSpecPowerAdd_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "goodsCenter.proto",

+ 38 - 10
rpc/test/goods_test.go

@@ -109,7 +109,7 @@ func Test_GoodsGet(t *testing.T) {
 	FileSystem := goodscenter.NewGoodsCenter(zrpc.MustNewClient(c.FileSystemConf))
 	req := &goodspb.GoodsGetReq{
 		Appid: "10000",
-		Id:    13,
+		Id:    14,
 	}
 	res, err := FileSystem.GoodsGet(ctx, req)
 	log.Println("err ", err)
@@ -140,40 +140,40 @@ func Test_GoodsSpecAdd(t *testing.T) {
 	req := &goodspb.GoodsSpecAddReq{
 		GoodsSpec: &goodspb.GoodsSpec{
 			Appid:              "10000",
-			Name:               "导出",
-			GoodsCode:          "order_export",
+			Name:               "画像",
+			GoodsCode:          "bigmember",
 			OriginPrice:        10000,
 			SkuMax:             20000,
 			CalculationType:    1,
 			CalculationFormula: "",
 			CalculationMode:    1,
-			Tag:                "数据导出",
+			Tag:                "画像",
 			Remark:             "备注",
 			ActualPrice:        5000,
 			GoodsSpecChild: []*goodspb.GoodsSpec{
 				&goodspb.GoodsSpec{
 					Appid:              "10000",
-					Name:               "标准导出",
-					GoodsCode:          "order_export",
+					Name:               "企业画像",
+					GoodsCode:          "bigmember",
 					OriginPrice:        10000,
 					SkuMax:             20000,
 					CalculationType:    1,
 					CalculationFormula: "",
 					CalculationMode:    1,
-					Tag:                "标准数据导出",
+					Tag:                "企业画像",
 					Remark:             "备注",
 					ActualPrice:        5000,
 				},
 				&goodspb.GoodsSpec{
 					Appid:              "10000",
-					Name:               "高级导出",
-					GoodsCode:          "order_export",
+					Name:               "采购单位画像",
+					GoodsCode:          "bigmember",
 					OriginPrice:        10000,
 					SkuMax:             20000,
 					CalculationType:    1,
 					CalculationFormula: "",
 					CalculationMode:    1,
-					Tag:                "高级数据导出",
+					Tag:                "采购单位画像",
 					Remark:             "备注",
 					ActualPrice:        5000,
 				},
@@ -229,3 +229,31 @@ func Test_GoodsspecUpd(t *testing.T) {
 	log.Println("err ", err)
 	log.Println("res:", res)
 }
+
+//go test -v -run Test_GoodsspecPowerAdd
+func Test_GoodsspecPowerAdd(t *testing.T) {
+	ctx, _ := context.WithTimeout(context.Background(), 2*time.Second)
+	FileSystem := goodscenter.NewGoodsCenter(zrpc.MustNewClient(c.FileSystemConf))
+	req := &goodspb.GoodsSpecPowerAddReq{
+		Appid:                "10000",
+		GoodsFunctionId:      1,               //商品功能id
+		GoodsCode:            "superVip",      //商品代码
+		SpecId:               2,               //规格id
+		FunctionCode:         "xxfb_gyxx_add", //功能代码
+		LimitStrategy:        "1d",            //限制频率
+		Cycle:                "1y",            //周期
+		StrategyCount:        0,               //频率数量
+		UseCount:             100,             //数量
+		PowerType:            2,               //权益所属类型 1:个人 2:企业
+		CountType:            1,               //数量类型 1:固定值 2:计算公式(生成权益时需要计算,比如:超级订阅送画像)
+		PowerCount:           0,               //授权数量
+		JudgeRepeatMechanism: 0,               //判重机制 0:无 1:通用判重 2:应用判重
+		JudgeRepeatScope:     1,               //判重范围
+		JudgeRepeatFlag:      "",              //判重标识 _id、projectid
+		JudgeRepeatStrategy:  0,               //判重策略 0:无需判重 1:通用判重 2:应用自己判重
+
+	}
+	res, err := FileSystem.GoodsSpecPowerAdd(ctx, req)
+	log.Println("err ", err)
+	log.Println("res:", res)
+}