33 lines
870 B
Go
33 lines
870 B
Go
package practice
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
// 切磋终止
|
|
func (this *apiComp) RefuseCheck(session comm.IUserSession, req *pb.PracticeRefuseReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Refuse(session comm.IUserSession, req *pb.PracticeRefuseReq) (code pb.ErrorCode, data proto.Message) {
|
|
if code = this.RefuseCheck(session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
|
|
//清楚切磋请求记录
|
|
this.module.modelQiecuo.DelByUId(req.Uid)
|
|
|
|
if err := session.SendMsg(string(this.module.GetType()), "refuse", &pb.PracticeRefuseResp{
|
|
IsSucc: true,
|
|
}); err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
return
|
|
}
|
|
this.module.SendMsgToUser(string(this.module.GetType()), "qiecuonotify",
|
|
&pb.PracticeQiecuonotifyPush{Uid: session.GetUserId(), NotifyType: 3}, req.Uid)
|
|
return
|
|
}
|