From 2ca8a8dec76326a80f3b3057a53acf357023de76 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 13 Jul 2023 11:40:11 +0800 Subject: [PATCH] =?UTF-8?q?cp=E8=A7=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/service/cp_s/cp_relation.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/domain/service/cp_s/cp_relation.go b/domain/service/cp_s/cp_relation.go index bc60eee..ac96772 100644 --- a/domain/service/cp_s/cp_relation.go +++ b/domain/service/cp_s/cp_relation.go @@ -130,6 +130,15 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l return err } + // 我和对方是否是cp,且cp关系存在 + cpRelation, err := cp_m.GetCpByIds(model, myUserId, userRec.ID) + if err != nil { + return err + } + if cpRelation.Id == 0 { + model.Log.Errorf("CancelCpRelation cp关系不存在 id1:%v, id2:%v", myUserId, userRec.ID) + return myerr.WrapErr(bizerr.InvalidParameter) + } // 自己没有cp了 myCp, err := cp_m.GetCp(model, myUserId) if err != nil { @@ -146,15 +155,6 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l if inviCp.Id == 0 { return myerr.WrapErr(bizerr.InvalidParameter) } - // 我和对方是否是cp,且cp关系存在 - cpRelation, err := cp_m.GetCpByIds(model, myUserId, userRec.ID) - if err != nil { - return err - } - if cpRelation.Id == 0 { - model.Log.Errorf("CancelCpRelation cp关系不存在 id1:%v, id2:%v", myUserId, userRec.ID) - return myerr.WrapErr(bizerr.InvalidParameter) - } // 是否有关于我的cp解除申请,且还未被处理 myCancel, err := cp_m.GetCpCancelWithMe(model, user.ID, cp_e.CpCancel) -- 2.22.0