35 lines
866 B
Go
35 lines
866 B
Go
package rtask
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (this *apiComp) ChkcondiCheck(session comm.IUserSession, req *pb.RtaskChkCondiReq) (code pb.ErrorCode) {
|
|
if req.CondiId <= 0 {
|
|
code = pb.ErrorCode_ReqParameterError
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Chkcondi(session comm.IUserSession, req *pb.RtaskChkCondiReq) (code pb.ErrorCode, data proto.Message) {
|
|
if code = this.ChkcondiCheck(session, req); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
|
|
rsp := &pb.RtaskChkCondiResp{}
|
|
err, ok := this.moduleRtask.modelRtask.checkCondi(session.GetUserId(), req.CondiId)
|
|
if err != nil {
|
|
code = pb.ErrorCode_RtaskCondiNoReach
|
|
return
|
|
}
|
|
rsp.Result = ok
|
|
|
|
if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeChkcondi, rsp); err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
}
|
|
return
|
|
}
|