diff --git a/domain/service/cp_s/cp_relation.go b/domain/service/cp_s/cp_relation.go index 2df57b499d613264cf68d586b5a71beb445d88c4..301e8897a61c24e064961844a3b2eaa7371f2427 100644 --- a/domain/service/cp_s/cp_relation.go +++ b/domain/service/cp_s/cp_relation.go @@ -39,7 +39,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l return err } 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了 inviCp, err := cp_m.GetCp(model, userInvite.ID) @@ -47,7 +47,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l return err } 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邀请,且还未被处理 diff --git a/route/cp_r/cp_relation.go b/route/cp_r/cp_relation.go index 80253cca37e4b13ecd239ea56d87ae64165f8bda..0841f101c3a0a3da8190596b7de521d3a66f743e 100644 --- a/route/cp_r/cp_relation.go +++ b/route/cp_r/cp_relation.go @@ -62,7 +62,7 @@ func CheckUserCpRelation(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, err } 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) if err != nil { @@ -166,7 +166,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, err } 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了 senderCp, err := cp_m.GetCp(model, userSender.ID) @@ -174,7 +174,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { return myCtx, err } 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 {