WH01243 2 years ago
parent
commit
05848746b9

+ 3 - 0
api/activity.api

@@ -238,4 +238,7 @@ service activity-api {
 	//活动获取
 	@handler getAllActivityHandler // TODO: set handler name and delete this comment
 	post /getAllActivity (Request) returns(CurrencyResp)
+	//商品获取
+	@handler getCommodityListHandler // TODO: set handler name and delete this comment
+	post /getCommodityList (Request) returns(UserLotteryResp)
 }

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

@@ -0,0 +1,28 @@
+package handler
+
+import (
+	"net/http"
+
+	"app.yhyue.com/moapp/jyMarketing/api/internal/logic"
+	"app.yhyue.com/moapp/jyMarketing/api/internal/svc"
+	"app.yhyue.com/moapp/jyMarketing/api/internal/types"
+	"github.com/zeromicro/go-zero/rest/httpx"
+)
+
+func getCommodityListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.Request
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewGetCommodityListLogic(r.Context(), svcCtx)
+		resp, err := l.GetCommodityList(&req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

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

@@ -82,6 +82,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/getAllActivity",
 				Handler: getAllActivityHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/getCommodityList",
+				Handler: getCommodityListHandler(serverCtx),
+			},
 		},
 	)
 }

+ 36 - 0
api/internal/logic/getcommoditylistlogic.go

@@ -0,0 +1,36 @@
+package logic
+
+import (
+	"app.yhyue.com/moapp/jyMarketing/rpc/activity"
+	"context"
+
+	"app.yhyue.com/moapp/jyMarketing/api/internal/svc"
+	"app.yhyue.com/moapp/jyMarketing/api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetCommodityListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetCommodityListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCommodityListLogic {
+	return &GetCommodityListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetCommodityListLogic) GetCommodityList(req *types.Request) (*types.UserLotteryResp, error) {
+	// todo: add your logic here and delete this line
+	result := &types.UserLotteryResp{}
+	lsi := l.svcCtx.Activity
+	resp, _ := lsi.GetCommodityList(l.ctx, &activity.Request{
+		ProductCode: req.ProductCode,
+	})
+	result.Data = resp.Data
+	return result, nil
+}

+ 1 - 0
go.mod

@@ -3,6 +3,7 @@ module app.yhyue.com/moapp/jyMarketing
 go 1.16
 
 require (
+	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
 	github.com/garyburd/redigo v1.6.2
 	github.com/gin-contrib/sessions v0.0.5
 	github.com/go-sql-driver/mysql v1.6.0

+ 36 - 0
go.sum

@@ -1,3 +1,6 @@
+app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d/go.mod h1:91/lSD/hS+ckMVP3WdidRzDhC60lLMdyce9QHy0cSMA=
+app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
+app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
@@ -66,6 +69,7 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
 github.com/antonlindstrom/pgstore v0.0.0-20200229204646-b08ebf1105e0/go.mod h1:2Ti6VUHVxpC0VSmTZzEvpzysnaGAfGBOoMIz5ykPyyw=
 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
+github.com/aws/aws-sdk-go v1.35.20/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
 github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
 github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -101,17 +105,21 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+
 github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
 github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/coscms/tagfast v0.0.0-20150925144250-2b69b2496250/go.mod h1:zX8vynptAghuV/KG8BOZlDeo4DsTKWfBQ154RWlkay0=
 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f h1:q/DpyjJjZs94bziQ7YkBmIlpqbVP7yw179rnzoNVX1M=
+github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f/go.mod h1:QGrK8vMWWHQYQ3QU9bw9Y9OPNfxccGzfb41qjvVeXtY=
 github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADGYw5LqMnHqSkyIELsHCGF6PkrmM31V8rF7o=
 github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4/go.mod h1:L7S4x0R7vv3xoOhGuyAJyCO2MYzWOpccM4Isn8jIUgY=
 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
 github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
 github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
@@ -184,6 +192,7 @@ github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y=
@@ -232,7 +241,9 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw
 github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
 github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/gomodule/redigo v1.8.9/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE=
 github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -295,6 +306,7 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplb
 github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@@ -352,7 +364,10 @@ github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aW
 github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
 github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
+github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
 github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
+github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
 github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
 github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -369,6 +384,7 @@ github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNE
 github.com/kidstuff/mongostore v0.0.0-20181113001930-e650cd85ee4b/go.mod h1:g2nVr8KZVXJSS97Jo8pJ0jgq29P6H7dG0oplUA86MQw=
 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
 github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -395,6 +411,8 @@ github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs=
 github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
 github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
 github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
 github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
@@ -439,6 +457,8 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI
 github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
 github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
 github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
+github.com/olivere/elastic v6.2.37+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8=
+github.com/olivere/elastic/v7 v7.0.22/go.mod h1:VDexNy9NjmtAkrjNoI7tImv7FR4tf5zUA3ickqu5Pc8=
 github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -456,6 +476,7 @@ github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
 github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
 github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
 github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
+github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw=
 github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
@@ -529,6 +550,9 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
 github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
 github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
+github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
+github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak=
 github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
 github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
 github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
@@ -552,6 +576,7 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
 github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
 github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
 github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
 github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk=
 github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ=
@@ -561,9 +586,13 @@ github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs
 github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
 github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
 github.com/wader/gormstore/v2 v2.0.0/go.mod h1:3BgNKFxRdVo2E4pq3e/eiim8qRDZzaveaIcIvu2T8r0=
+github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
 github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
+github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w=
 github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
+github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc=
 github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
 github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
 github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -585,6 +614,7 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3
 go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4=
 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
 go.mongodb.org/mongo-driver v1.9.0/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
+go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c=
 go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY=
 go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
 go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
@@ -592,6 +622,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
 go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
 go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg=
 go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM=
@@ -736,6 +767,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -979,6 +1011,7 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
 google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
 google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -988,6 +1021,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
 gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
 gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
 gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
 gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
@@ -1010,10 +1044,12 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gorm.io/driver/mysql v1.0.4/go.mod h1:MEgp8tk2n60cSBCq5iTcPDw3ns8Gs+zOva9EUhkknTs=
+gorm.io/driver/mysql v1.0.5/go.mod h1:N1OIhHAIhx5SunkMGqWbGFVeh4yTNWKmMo1GOAsohLI=
 gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg=
 gorm.io/driver/sqlite v1.1.4/go.mod h1:mJCeTFr7+crvS+TRnWc5Z3UvwxUN1BGBLMrf5LA9DYw=
 gorm.io/gorm v1.20.7/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
 gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
+gorm.io/gorm v1.21.3/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
 honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

+ 23 - 6
rpc/activity.proto

@@ -216,21 +216,29 @@ message UserLotteryResp {
   int64         userLotteryId = 3;          //赠品用户关系标识
   int64         activityType = 4;           //活动类型
 }
+message Commodity{
+  int64         id = 1;                     //赠品标识
+  string        name = 2;                   //赠品名称
+  string        giftCode = 3;               //赠品代码
+  int64         time = 4;               //单位类型
+  int64         timeType = 5;               //单位类型
+
+}
+message CommodityResp {
+  int64         code = 1;                   //响应代码
+  string        message = 2;                //响应消息
+  repeated Commodity data = 3;
+}
+
 service Activity {
   //查询活动下的奖券
   rpc activityLottery(Request) returns(ActivityLotteryResp);
-  //奖券领取
-  rpc lotteryReceive(LotteryOperation) returns(Response);
   // 获取活动详细信息
   rpc getLottery(GetLotteryReq) returns(GetLotteryRes);
   // 主动发放奖券
   rpc lotteryGrant(LotteryGrantReq) returns(Response);
-  //修改奖券状态
-  rpc lotteryStateChange(UpdateStateReq) returns(Response);
   //奖券使用
   rpc activityUse(LotteryOperation) returns(Response);
-  //用户下的奖券
-  rpc userLottery(Request) returns(ActivityLotteryResp);
   //奖券信息
   rpc lotteryInfo(Request) returns(LotteryResp);
   //查看当前商品是否存在买送的卷
@@ -243,6 +251,15 @@ service Activity {
   rpc findUserLotteryId(UserLotteryRequest) returns(UserLotteryResp);
   //限时活动获取
   rpc giveActivity (Request) returns(GiveActivityResp);
+
+  //奖券领取
+  rpc lotteryReceive(LotteryOperation) returns(Response);
   //商品下活动获取
   rpc getAllActivity(Request) returns(ActivityResp);
+  //修改奖券状态
+  rpc lotteryStateChange(UpdateStateReq) returns(Response);
+  //用户下的奖券
+  rpc userLottery(Request) returns(ActivityLotteryResp);
+  //商品获取
+  rpc getCommodityList(Request) returns(CommodityResp);
 }

+ 32 - 24
rpc/activity/activity.go

@@ -14,18 +14,12 @@ type (
 	Activity interface {
 		// 查询活动下的奖券
 		ActivityLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error)
-		// 奖券领取
-		LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error)
 		//  获取活动详细信息
 		GetLottery(ctx context.Context, in *GetLotteryReq, opts ...grpc.CallOption) (*GetLotteryRes, error)
 		//  主动发放奖券
 		LotteryGrant(ctx context.Context, in *LotteryGrantReq, opts ...grpc.CallOption) (*Response, error)
-		// 修改奖券状态
-		LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error)
 		// 奖券使用
 		ActivityUse(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error)
-		// 用户下的奖券
-		UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error)
 		// 奖券信息
 		LotteryInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*LotteryResp, error)
 		// 查看当前商品是否存在买送的卷
@@ -38,8 +32,16 @@ type (
 		FindUserLotteryId(ctx context.Context, in *UserLotteryRequest, opts ...grpc.CallOption) (*UserLotteryResp, error)
 		// 限时活动获取
 		GiveActivity(ctx context.Context, in *Request, opts ...grpc.CallOption) (*GiveActivityResp, error)
+		// 奖券领取
+		LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error)
 		// 商品下活动获取
 		GetAllActivity(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityResp, error)
+		// 修改奖券状态
+		LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error)
+		// 用户下的奖券
+		UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error)
+		// 商品获取
+		GetCommodityList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*CommodityResp, error)
 	}
 
 	defaultActivity struct {
@@ -59,12 +61,6 @@ func (m *defaultActivity) ActivityLottery(ctx context.Context, in *Request, opts
 	return client.ActivityLottery(ctx, in, opts...)
 }
 
-// 奖券领取
-func (m *defaultActivity) LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error) {
-	client := NewActivityClient(m.cli.Conn())
-	return client.LotteryReceive(ctx, in, opts...)
-}
-
 //  获取活动详细信息
 func (m *defaultActivity) GetLottery(ctx context.Context, in *GetLotteryReq, opts ...grpc.CallOption) (*GetLotteryRes, error) {
 	client := NewActivityClient(m.cli.Conn())
@@ -77,24 +73,12 @@ func (m *defaultActivity) LotteryGrant(ctx context.Context, in *LotteryGrantReq,
 	return client.LotteryGrant(ctx, in, opts...)
 }
 
-// 修改奖券状态
-func (m *defaultActivity) LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error) {
-	client := NewActivityClient(m.cli.Conn())
-	return client.LotteryStateChange(ctx, in, opts...)
-}
-
 // 奖券使用
 func (m *defaultActivity) ActivityUse(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error) {
 	client := NewActivityClient(m.cli.Conn())
 	return client.ActivityUse(ctx, in, opts...)
 }
 
-// 用户下的奖券
-func (m *defaultActivity) UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error) {
-	client := NewActivityClient(m.cli.Conn())
-	return client.UserLottery(ctx, in, opts...)
-}
-
 // 奖券信息
 func (m *defaultActivity) LotteryInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*LotteryResp, error) {
 	client := NewActivityClient(m.cli.Conn())
@@ -131,8 +115,32 @@ func (m *defaultActivity) GiveActivity(ctx context.Context, in *Request, opts ..
 	return client.GiveActivity(ctx, in, opts...)
 }
 
+// 奖券领取
+func (m *defaultActivity) LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error) {
+	client := NewActivityClient(m.cli.Conn())
+	return client.LotteryReceive(ctx, in, opts...)
+}
+
 // 商品下活动获取
 func (m *defaultActivity) GetAllActivity(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityResp, error) {
 	client := NewActivityClient(m.cli.Conn())
 	return client.GetAllActivity(ctx, in, opts...)
 }
+
+// 修改奖券状态
+func (m *defaultActivity) LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error) {
+	client := NewActivityClient(m.cli.Conn())
+	return client.LotteryStateChange(ctx, in, opts...)
+}
+
+// 用户下的奖券
+func (m *defaultActivity) UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error) {
+	client := NewActivityClient(m.cli.Conn())
+	return client.UserLottery(ctx, in, opts...)
+}
+
+// 商品获取
+func (m *defaultActivity) GetCommodityList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*CommodityResp, error) {
+	client := NewActivityClient(m.cli.Conn())
+	return client.GetCommodityList(ctx, in, opts...)
+}

File diff suppressed because it is too large
+ 556 - 233
rpc/activity/activity.pb.go


+ 152 - 114
rpc/activity/activity_grpc.pb.go

@@ -24,18 +24,12 @@ const _ = grpc.SupportPackageIsVersion7
 type ActivityClient interface {
 	//查询活动下的奖券
 	ActivityLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error)
-	//奖券领取
-	LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error)
 	// 获取活动详细信息
 	GetLottery(ctx context.Context, in *GetLotteryReq, opts ...grpc.CallOption) (*GetLotteryRes, error)
 	// 主动发放奖券
 	LotteryGrant(ctx context.Context, in *LotteryGrantReq, opts ...grpc.CallOption) (*Response, error)
-	//修改奖券状态
-	LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error)
 	//奖券使用
 	ActivityUse(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error)
-	//用户下的奖券
-	UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error)
 	//奖券信息
 	LotteryInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*LotteryResp, error)
 	//查看当前商品是否存在买送的卷
@@ -48,8 +42,16 @@ type ActivityClient interface {
 	FindUserLotteryId(ctx context.Context, in *UserLotteryRequest, opts ...grpc.CallOption) (*UserLotteryResp, error)
 	//限时活动获取
 	GiveActivity(ctx context.Context, in *Request, opts ...grpc.CallOption) (*GiveActivityResp, error)
+	//奖券领取
+	LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error)
 	//商品下活动获取
 	GetAllActivity(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityResp, error)
+	//修改奖券状态
+	LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error)
+	//用户下的奖券
+	UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error)
+	//商品获取
+	GetCommodityList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*CommodityResp, error)
 }
 
 type activityClient struct {
@@ -69,15 +71,6 @@ func (c *activityClient) ActivityLottery(ctx context.Context, in *Request, opts
 	return out, nil
 }
 
-func (c *activityClient) LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error) {
-	out := new(Response)
-	err := c.cc.Invoke(ctx, "/activity.Activity/lotteryReceive", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
 func (c *activityClient) GetLottery(ctx context.Context, in *GetLotteryReq, opts ...grpc.CallOption) (*GetLotteryRes, error) {
 	out := new(GetLotteryRes)
 	err := c.cc.Invoke(ctx, "/activity.Activity/getLottery", in, out, opts...)
@@ -96,15 +89,6 @@ func (c *activityClient) LotteryGrant(ctx context.Context, in *LotteryGrantReq,
 	return out, nil
 }
 
-func (c *activityClient) LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error) {
-	out := new(Response)
-	err := c.cc.Invoke(ctx, "/activity.Activity/lotteryStateChange", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
 func (c *activityClient) ActivityUse(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error) {
 	out := new(Response)
 	err := c.cc.Invoke(ctx, "/activity.Activity/activityUse", in, out, opts...)
@@ -114,15 +98,6 @@ func (c *activityClient) ActivityUse(ctx context.Context, in *LotteryOperation,
 	return out, nil
 }
 
-func (c *activityClient) UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error) {
-	out := new(ActivityLotteryResp)
-	err := c.cc.Invoke(ctx, "/activity.Activity/userLottery", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
 func (c *activityClient) LotteryInfo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*LotteryResp, error) {
 	out := new(LotteryResp)
 	err := c.cc.Invoke(ctx, "/activity.Activity/lotteryInfo", in, out, opts...)
@@ -177,6 +152,15 @@ func (c *activityClient) GiveActivity(ctx context.Context, in *Request, opts ...
 	return out, nil
 }
 
+func (c *activityClient) LotteryReceive(ctx context.Context, in *LotteryOperation, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
+	err := c.cc.Invoke(ctx, "/activity.Activity/lotteryReceive", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *activityClient) GetAllActivity(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityResp, error) {
 	out := new(ActivityResp)
 	err := c.cc.Invoke(ctx, "/activity.Activity/getAllActivity", in, out, opts...)
@@ -186,24 +170,45 @@ func (c *activityClient) GetAllActivity(ctx context.Context, in *Request, opts .
 	return out, nil
 }
 
+func (c *activityClient) LotteryStateChange(ctx context.Context, in *UpdateStateReq, opts ...grpc.CallOption) (*Response, error) {
+	out := new(Response)
+	err := c.cc.Invoke(ctx, "/activity.Activity/lotteryStateChange", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *activityClient) UserLottery(ctx context.Context, in *Request, opts ...grpc.CallOption) (*ActivityLotteryResp, error) {
+	out := new(ActivityLotteryResp)
+	err := c.cc.Invoke(ctx, "/activity.Activity/userLottery", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *activityClient) GetCommodityList(ctx context.Context, in *Request, opts ...grpc.CallOption) (*CommodityResp, error) {
+	out := new(CommodityResp)
+	err := c.cc.Invoke(ctx, "/activity.Activity/getCommodityList", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // ActivityServer is the server API for Activity service.
 // All implementations must embed UnimplementedActivityServer
 // for forward compatibility
 type ActivityServer interface {
 	//查询活动下的奖券
 	ActivityLottery(context.Context, *Request) (*ActivityLotteryResp, error)
-	//奖券领取
-	LotteryReceive(context.Context, *LotteryOperation) (*Response, error)
 	// 获取活动详细信息
 	GetLottery(context.Context, *GetLotteryReq) (*GetLotteryRes, error)
 	// 主动发放奖券
 	LotteryGrant(context.Context, *LotteryGrantReq) (*Response, error)
-	//修改奖券状态
-	LotteryStateChange(context.Context, *UpdateStateReq) (*Response, error)
 	//奖券使用
 	ActivityUse(context.Context, *LotteryOperation) (*Response, error)
-	//用户下的奖券
-	UserLottery(context.Context, *Request) (*ActivityLotteryResp, error)
 	//奖券信息
 	LotteryInfo(context.Context, *Request) (*LotteryResp, error)
 	//查看当前商品是否存在买送的卷
@@ -216,8 +221,16 @@ type ActivityServer interface {
 	FindUserLotteryId(context.Context, *UserLotteryRequest) (*UserLotteryResp, error)
 	//限时活动获取
 	GiveActivity(context.Context, *Request) (*GiveActivityResp, error)
+	//奖券领取
+	LotteryReceive(context.Context, *LotteryOperation) (*Response, error)
 	//商品下活动获取
 	GetAllActivity(context.Context, *Request) (*ActivityResp, error)
+	//修改奖券状态
+	LotteryStateChange(context.Context, *UpdateStateReq) (*Response, error)
+	//用户下的奖券
+	UserLottery(context.Context, *Request) (*ActivityLotteryResp, error)
+	//商品获取
+	GetCommodityList(context.Context, *Request) (*CommodityResp, error)
 	mustEmbedUnimplementedActivityServer()
 }
 
@@ -228,24 +241,15 @@ type UnimplementedActivityServer struct {
 func (UnimplementedActivityServer) ActivityLottery(context.Context, *Request) (*ActivityLotteryResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ActivityLottery not implemented")
 }
-func (UnimplementedActivityServer) LotteryReceive(context.Context, *LotteryOperation) (*Response, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method LotteryReceive not implemented")
-}
 func (UnimplementedActivityServer) GetLottery(context.Context, *GetLotteryReq) (*GetLotteryRes, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetLottery not implemented")
 }
 func (UnimplementedActivityServer) LotteryGrant(context.Context, *LotteryGrantReq) (*Response, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method LotteryGrant not implemented")
 }
-func (UnimplementedActivityServer) LotteryStateChange(context.Context, *UpdateStateReq) (*Response, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method LotteryStateChange not implemented")
-}
 func (UnimplementedActivityServer) ActivityUse(context.Context, *LotteryOperation) (*Response, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ActivityUse not implemented")
 }
-func (UnimplementedActivityServer) UserLottery(context.Context, *Request) (*ActivityLotteryResp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method UserLottery not implemented")
-}
 func (UnimplementedActivityServer) LotteryInfo(context.Context, *Request) (*LotteryResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method LotteryInfo not implemented")
 }
@@ -264,9 +268,21 @@ func (UnimplementedActivityServer) FindUserLotteryId(context.Context, *UserLotte
 func (UnimplementedActivityServer) GiveActivity(context.Context, *Request) (*GiveActivityResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GiveActivity not implemented")
 }
+func (UnimplementedActivityServer) LotteryReceive(context.Context, *LotteryOperation) (*Response, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method LotteryReceive not implemented")
+}
 func (UnimplementedActivityServer) GetAllActivity(context.Context, *Request) (*ActivityResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetAllActivity not implemented")
 }
+func (UnimplementedActivityServer) LotteryStateChange(context.Context, *UpdateStateReq) (*Response, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method LotteryStateChange not implemented")
+}
+func (UnimplementedActivityServer) UserLottery(context.Context, *Request) (*ActivityLotteryResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UserLottery not implemented")
+}
+func (UnimplementedActivityServer) GetCommodityList(context.Context, *Request) (*CommodityResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetCommodityList not implemented")
+}
 func (UnimplementedActivityServer) mustEmbedUnimplementedActivityServer() {}
 
 // UnsafeActivityServer may be embedded to opt out of forward compatibility for this service.
@@ -298,24 +314,6 @@ func _Activity_ActivityLottery_Handler(srv interface{}, ctx context.Context, dec
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Activity_LotteryReceive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(LotteryOperation)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ActivityServer).LotteryReceive(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/activity.Activity/lotteryReceive",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ActivityServer).LotteryReceive(ctx, req.(*LotteryOperation))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
 func _Activity_GetLottery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(GetLotteryReq)
 	if err := dec(in); err != nil {
@@ -352,24 +350,6 @@ func _Activity_LotteryGrant_Handler(srv interface{}, ctx context.Context, dec fu
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Activity_LotteryStateChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(UpdateStateReq)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ActivityServer).LotteryStateChange(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/activity.Activity/lotteryStateChange",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ActivityServer).LotteryStateChange(ctx, req.(*UpdateStateReq))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
 func _Activity_ActivityUse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(LotteryOperation)
 	if err := dec(in); err != nil {
@@ -388,24 +368,6 @@ func _Activity_ActivityUse_Handler(srv interface{}, ctx context.Context, dec fun
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Activity_UserLottery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(Request)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(ActivityServer).UserLottery(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/activity.Activity/userLottery",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(ActivityServer).UserLottery(ctx, req.(*Request))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
 func _Activity_LotteryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(Request)
 	if err := dec(in); err != nil {
@@ -514,6 +476,24 @@ func _Activity_GiveActivity_Handler(srv interface{}, ctx context.Context, dec fu
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Activity_LotteryReceive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(LotteryOperation)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ActivityServer).LotteryReceive(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/activity.Activity/lotteryReceive",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ActivityServer).LotteryReceive(ctx, req.(*LotteryOperation))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Activity_GetAllActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(Request)
 	if err := dec(in); err != nil {
@@ -532,6 +512,60 @@ func _Activity_GetAllActivity_Handler(srv interface{}, ctx context.Context, dec
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Activity_LotteryStateChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(UpdateStateReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ActivityServer).LotteryStateChange(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/activity.Activity/lotteryStateChange",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ActivityServer).LotteryStateChange(ctx, req.(*UpdateStateReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Activity_UserLottery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(Request)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ActivityServer).UserLottery(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/activity.Activity/userLottery",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ActivityServer).UserLottery(ctx, req.(*Request))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Activity_GetCommodityList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(Request)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ActivityServer).GetCommodityList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/activity.Activity/getCommodityList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ActivityServer).GetCommodityList(ctx, req.(*Request))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Activity_ServiceDesc is the grpc.ServiceDesc for Activity service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -543,10 +577,6 @@ var Activity_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "activityLottery",
 			Handler:    _Activity_ActivityLottery_Handler,
 		},
-		{
-			MethodName: "lotteryReceive",
-			Handler:    _Activity_LotteryReceive_Handler,
-		},
 		{
 			MethodName: "getLottery",
 			Handler:    _Activity_GetLottery_Handler,
@@ -555,18 +585,10 @@ var Activity_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "lotteryGrant",
 			Handler:    _Activity_LotteryGrant_Handler,
 		},
-		{
-			MethodName: "lotteryStateChange",
-			Handler:    _Activity_LotteryStateChange_Handler,
-		},
 		{
 			MethodName: "activityUse",
 			Handler:    _Activity_ActivityUse_Handler,
 		},
-		{
-			MethodName: "userLottery",
-			Handler:    _Activity_UserLottery_Handler,
-		},
 		{
 			MethodName: "lotteryInfo",
 			Handler:    _Activity_LotteryInfo_Handler,
@@ -591,10 +613,26 @@ var Activity_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "giveActivity",
 			Handler:    _Activity_GiveActivity_Handler,
 		},
+		{
+			MethodName: "lotteryReceive",
+			Handler:    _Activity_LotteryReceive_Handler,
+		},
 		{
 			MethodName: "getAllActivity",
 			Handler:    _Activity_GetAllActivity_Handler,
 		},
+		{
+			MethodName: "lotteryStateChange",
+			Handler:    _Activity_LotteryStateChange_Handler,
+		},
+		{
+			MethodName: "userLottery",
+			Handler:    _Activity_UserLottery_Handler,
+		},
+		{
+			MethodName: "getCommodityList",
+			Handler:    _Activity_GetCommodityList_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "activity.proto",

+ 32 - 0
rpc/internal/logic/getcommoditylistlogic.go

@@ -0,0 +1,32 @@
+package logic
+
+import (
+	"context"
+
+	"app.yhyue.com/moapp/jyMarketing/rpc/activity"
+	"app.yhyue.com/moapp/jyMarketing/rpc/internal/svc"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetCommodityListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewGetCommodityListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCommodityListLogic {
+	return &GetCommodityListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 商品获取
+func (l *GetCommodityListLogic) GetCommodityList(in *activity.Request) (*activity.CommodityResp, error) {
+	// todo: add your logic here and delete this line
+	result := &activity.CommodityResp{}
+	result.Data = activityServiceNew.GetCommodityList(in)
+	return result, nil
+}

+ 24 - 18
rpc/internal/server/activityserver.go

@@ -28,12 +28,6 @@ func (s *ActivityServer) ActivityLottery(ctx context.Context, in *activity.Reque
 	return l.ActivityLottery(in)
 }
 
-// 奖券领取
-func (s *ActivityServer) LotteryReceive(ctx context.Context, in *activity.LotteryOperation) (*activity.Response, error) {
-	l := logic.NewLotteryReceiveLogic(ctx, s.svcCtx)
-	return l.LotteryReceive(in)
-}
-
 //  获取活动详细信息
 func (s *ActivityServer) GetLottery(ctx context.Context, in *activity.GetLotteryReq) (*activity.GetLotteryRes, error) {
 	l := logic.NewGetLotteryLogic(ctx, s.svcCtx)
@@ -46,24 +40,12 @@ func (s *ActivityServer) LotteryGrant(ctx context.Context, in *activity.LotteryG
 	return l.LotteryGrant(in)
 }
 
-// 修改奖券状态
-func (s *ActivityServer) LotteryStateChange(ctx context.Context, in *activity.UpdateStateReq) (*activity.Response, error) {
-	l := logic.NewLotteryStateChangeLogic(ctx, s.svcCtx)
-	return l.LotteryStateChange(in)
-}
-
 // 奖券使用
 func (s *ActivityServer) ActivityUse(ctx context.Context, in *activity.LotteryOperation) (*activity.Response, error) {
 	l := logic.NewActivityUseLogic(ctx, s.svcCtx)
 	return l.ActivityUse(in)
 }
 
-// 用户下的奖券
-func (s *ActivityServer) UserLottery(ctx context.Context, in *activity.Request) (*activity.ActivityLotteryResp, error) {
-	l := logic.NewUserLotteryLogic(ctx, s.svcCtx)
-	return l.UserLottery(in)
-}
-
 // 奖券信息
 func (s *ActivityServer) LotteryInfo(ctx context.Context, in *activity.Request) (*activity.LotteryResp, error) {
 	l := logic.NewLotteryInfoLogic(ctx, s.svcCtx)
@@ -100,8 +82,32 @@ func (s *ActivityServer) GiveActivity(ctx context.Context, in *activity.Request)
 	return l.GiveActivity(in)
 }
 
+// 奖券领取
+func (s *ActivityServer) LotteryReceive(ctx context.Context, in *activity.LotteryOperation) (*activity.Response, error) {
+	l := logic.NewLotteryReceiveLogic(ctx, s.svcCtx)
+	return l.LotteryReceive(in)
+}
+
 // 商品下活动获取
 func (s *ActivityServer) GetAllActivity(ctx context.Context, in *activity.Request) (*activity.ActivityResp, error) {
 	l := logic.NewGetAllActivityLogic(ctx, s.svcCtx)
 	return l.GetAllActivity(in)
 }
+
+// 修改奖券状态
+func (s *ActivityServer) LotteryStateChange(ctx context.Context, in *activity.UpdateStateReq) (*activity.Response, error) {
+	l := logic.NewLotteryStateChangeLogic(ctx, s.svcCtx)
+	return l.LotteryStateChange(in)
+}
+
+// 用户下的奖券
+func (s *ActivityServer) UserLottery(ctx context.Context, in *activity.Request) (*activity.ActivityLotteryResp, error) {
+	l := logic.NewUserLotteryLogic(ctx, s.svcCtx)
+	return l.UserLottery(in)
+}
+
+// 商品获取
+func (s *ActivityServer) GetCommodityList(ctx context.Context, in *activity.Request) (*activity.CommodityResp, error) {
+	l := logic.NewGetCommodityListLogic(ctx, s.svcCtx)
+	return l.GetCommodityList(in)
+}

+ 19 - 0
service/activityServiceNew.go

@@ -4,6 +4,7 @@ import (
 	"app.yhyue.com/moapp/jyMarketing/entity"
 	"app.yhyue.com/moapp/jyMarketing/rpc/activity"
 	"app.yhyue.com/moapp/jyMarketing/util"
+	"app.yhyue.com/moapp/jybase/common"
 	"github.com/zeromicro/go-zero/core/logx"
 	"strings"
 	"time"
@@ -129,3 +130,21 @@ func (service *ActivityServiceNew) GetAllActivity(in *activity.Request) (int64,
 	}
 	return entity.SuccessCode, "活动下的奖券", activityArr
 }
+
+func (service *ActivityServiceNew) GetCommodityList(in *activity.Request) []*activity.Commodity {
+	commodityList := []*activity.Commodity{}
+	//1、查找活动信息
+	orm := entity.Engine
+	commodityMap := []map[string]interface{}{}
+	orm.Table("gift").Select("*").Where("parentCode=?", in.ProductCode).Find(&commodityMap)
+	for _, value := range commodityMap {
+		commodity := activity.Commodity{}
+		commodity.Id = common.Int64All(value["id"])
+		commodity.Name = common.InterfaceToStr(value["name"])
+		commodity.Time = common.Int64All(value["time"])
+		commodity.TimeType = common.Int64All(value["timeType"])
+		commodity.GiftCode = common.InterfaceToStr(value["giftCode"])
+		commodityList = append(commodityList, &commodity)
+	}
+	return commodityList
+}

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