Commit 44670695 authored by chenweijian's avatar chenweijian

err

parent 9a2dbaa0
...@@ -39,7 +39,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -39,7 +39,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err return err
} }
if myCp.Id > 0 { if myCp.Id > 0 {
return msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp) return myerr.ToLocal(msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp))
} }
// 对方是否已经有cp了 // 对方是否已经有cp了
inviCp, err := cp_m.GetCp(model, userInvite.ID) inviCp, err := cp_m.GetCp(model, userInvite.ID)
...@@ -47,7 +47,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -47,7 +47,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err return err
} }
if inviCp.Id > 0 { if inviCp.Id > 0 {
return msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp) return myerr.ToLocal(msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp))
} }
// 我是否发起过cp邀请,且还未被处理 // 我是否发起过cp邀请,且还未被处理
......
...@@ -62,7 +62,7 @@ func CheckUserCpRelation(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -62,7 +62,7 @@ func CheckUserCpRelation(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err return myCtx, err
} }
if cp.Id > 0 { if cp.Id > 0 {
return myCtx, msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp) return myCtx, myerr.ToLocal(msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp))
} }
msg, err := msg.GetResMultiTextBy(model, common.MSG_ID_INVITE_CP, lang) msg, err := msg.GetResMultiTextBy(model, common.MSG_ID_INVITE_CP, lang)
if err != nil { if err != nil {
...@@ -166,7 +166,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -166,7 +166,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err return myCtx, err
} }
if myCp.Id > 0 { if myCp.Id > 0 {
return myCtx, msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp) return myCtx, myerr.ToLocal(msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp))
} }
// 对方是否已经有cp了 // 对方是否已经有cp了
senderCp, err := cp_m.GetCp(model, userSender.ID) senderCp, err := cp_m.GetCp(model, userSender.ID)
...@@ -174,7 +174,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -174,7 +174,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err return myCtx, err
} }
if senderCp.Id > 0 { if senderCp.Id > 0 {
return myCtx, msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp) return myCtx, myerr.ToLocal(msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp))
} }
} }
err = model.Transaction(func(model *domain.Model) error { err = model.Transaction(func(model *domain.Model) error {
......
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