32 lines
952 B
Go
32 lines
952 B
Go
package task
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
func (this *apiComp) SendCheck(session comm.IUserSession, req *pb.TaskSendReq) (errdata *pb.ErrorData) {
|
|
if len(req.Params) == 0 || req.TaskType == 0 {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_ReqParameterError,
|
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Send(session comm.IUserSession, req *pb.TaskSendReq) (errdata *pb.ErrorData) {
|
|
// if imodule, err := this.service.GetModule(comm.ModuleRtask); err == nil {
|
|
// if itask, ok := imodule.(comm.IRtask); ok {
|
|
// itask.TriggerTask(session.GetUserId(), comm.GetTaskParam(comm.TaskType(req.TaskType), req.Params...))
|
|
// }
|
|
// }
|
|
|
|
// this.module.ModuleBuried.TriggerBuried(session.GetUserId(),comm.GetBuriedParam(comm.TaskType(req.TaskType)))
|
|
rsp := &pb.TaskSendResp{
|
|
IsSucc: true,
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), TaskSubTypeSend, rsp)
|
|
return
|
|
}
|