Commit 197caeb4 authored by chenweijian's avatar chenweijian

cp

parent 21363ce6
......@@ -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 { // 接受的时候
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment