37 lines
942 B
Go
37 lines
942 B
Go
package wtask
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
// 参数校验
|
|
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.WTaskInfoReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
// /获取系统公告
|
|
func (this *apiComp) Info(session comm.IUserSession, req *pb.WTaskInfoReq) (errdata *pb.ErrorData) {
|
|
var (
|
|
wtask *pb.DBWTask
|
|
err error
|
|
)
|
|
if errdata = this.InfoCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
if wtask, err = this.module.modelwtask.getUserWTasks(session.GetUserId()); err != nil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Title: pb.ErrorCode_DBError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
if errdata = this.module.pushtaskprogress(session, wtask); errdata != nil {
|
|
return
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "info", &pb.WTaskInfoResp{Activations: wtask.Activations, Accepts: wtask.Accepts, Completes: wtask.Completes})
|
|
return
|
|
}
|