Commit b308b069 authored by chenweijian's avatar chenweijian

cp

parent 92b6d007
......@@ -27,6 +27,10 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err
}
if userInvite.ID == myUserId {
return bizerr.InvalidParameter
}
// 自己是否有cp了
myCp, err := cp_m.GetCp(model, myUserId)
if err != nil {
......@@ -100,6 +104,10 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err
}
if userRec.ID == myUserId {
return bizerr.InvalidParameter
}
// 自己没有cp了
myCp, err := cp_m.GetCp(model, myUserId)
if err != nil {
......
......@@ -126,6 +126,9 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
if err != nil {
return myCtx, err
}
if userSender.ID == myUserId {
return myCtx, bizerr.InvalidParameter
}
cpRecord, err := cp_m.GetCpInvite(model, userSender.ID, user.ID, cp_e.CpInvite)
if err != nil {
......@@ -253,6 +256,10 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err
}
if user2.ID == myUserId {
return myCtx, bizerr.InvalidParameter
}
cpCancel, err := cp_m.GetCpCancel(model, []uint64{myUser.ID, user2.ID}, cp_e.CpCancel)
if err != nil {
model.Log.Errorf("ReplyCpCancel myUser:%d, user2:%d, err:%v", myUser.ID, user2.ID, err)
......
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