From 197caeb482a8abea586bd439f7324c5a1d9c817a Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Mon, 12 Jun 2023 15:38:58 +0800 Subject: [PATCH] cp --- route/cp_r/cp_relation.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/route/cp_r/cp_relation.go b/route/cp_r/cp_relation.go index f109e80..2844272 100644 --- a/route/cp_r/cp_relation.go +++ b/route/cp_r/cp_relation.go @@ -21,6 +21,7 @@ import ( "hilo-user/domain/model/diamond_m" "hilo-user/domain/model/user_m" "hilo-user/domain/service/cp_s" + "hilo-user/myerr" "hilo-user/myerr/bizerr" "hilo-user/req" "hilo-user/resp" @@ -119,11 +120,11 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { myCtx := mycontext.CreateMyContext(c.Keys) externalId := c.PostForm("externalId") if externalId == "" { - return myCtx, bizerr.InvalidParameter + return myCtx, myerr.WrapErr(bizerr.InvalidParameter) } optType, err := strconv.Atoi(c.PostForm("type")) if err != nil || optType > 2 || optType < 1 { - return myCtx, bizerr.InvalidParameter + return myCtx, myerr.WrapErr(bizerr.InvalidParameter) } myUserId, lang, err := req.GetUserIdLang(c, myCtx) @@ -141,7 +142,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, err } if userSender.ID == myUserId { - return myCtx, bizerr.InvalidParameter + return myCtx, myerr.WrapErr(bizerr.InvalidParameter) } cpRecord, err := cp_m.GetCpInvite(model, userSender.ID, user.ID, cp_e.CpInvite) @@ -150,7 +151,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, err } if cpRecord == nil || cpRecord.Id == 0 { - return myCtx, bizerr.InvalidParameter + return myCtx, myerr.WrapErr(bizerr.InvalidParameter) } if optType == 1 { // 接受的时候 -- 2.22.0