From b50c0bfee2fa9ef39818d99a7a3d9d46dcef095b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 12 Dec 2022 11:27:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/hero_test.go | 1 + modules/web/api_creatmail.go | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/hero/hero_test.go b/modules/hero/hero_test.go index f83b6a0ec..2ee415446 100644 --- a/modules/hero/hero_test.go +++ b/modules/hero/hero_test.go @@ -70,6 +70,7 @@ func GetMonthStartEnd() (int64, int64) { return _d1, _d2 } func Test_Main(t *testing.T) { + ids := utils.RandomNumbers(0, 10, 5) for _, v := range ids { fmt.Printf("%d", v) diff --git a/modules/web/api_creatmail.go b/modules/web/api_creatmail.go index c4e67e631..b9acfb604 100644 --- a/modules/web/api_creatmail.go +++ b/modules/web/api_creatmail.go @@ -41,21 +41,17 @@ func (this *Api_Comp) CreateMail(c *engine.Context) { } defer c.JSON(http.StatusOK, &Respond{Code: code, Message: msg, Data: data}) if sign := gin.ParamSign(this.options.Key, map[string]interface{}{ - "Uid": req.Uid, - "Title": req.Title, - "Contex": req.Contex, - "Cid": req.Cid, + "uid": req.Uid, + "title": req.Title, + "contex": req.Contex, + "cid": req.Cid, }); sign != req.Sign { this.module.Errorf("LoginByCaptchaReq SignError sgin:%s", sign) code = pb.ErrorCode_SignError msg = pb.GetErrorCodeMsg(code) return } - if len(req.Title) == 0 { - code = pb.ErrorCode_ReqParameterError - msg = pb.GetErrorCodeMsg(code) - return - } + mail := &pb.DBMailData{ ObjId: primitive.NewObjectID().Hex(), Uid: req.Uid, @@ -82,5 +78,6 @@ func (this *Api_Comp) CreateMail(c *engine.Context) { mail, nil); err != nil { this.module.Errorln(err) code = pb.ErrorCode_RpcFuncExecutionError + msg = pb.GetErrorCodeMsg(code) } }