41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package library
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
// 羁绊剧情-我的主线任务
|
|
func (this *apiComp) FetterstoryTaskCheck(session comm.IUserSession, req *pb.LibraryFetterstoryTaskReq) (errdata *pb.ErrorData) {
|
|
if req.FetterId == 0 {
|
|
this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()})
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_ReqParameterError,
|
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) FetterstoryTask(session comm.IUserSession, req *pb.LibraryFetterstoryTaskReq) (errdata *pb.ErrorData) {
|
|
if errdata = this.FetterstoryTaskCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
|
|
uid := session.GetUserId()
|
|
// 我的主线任务
|
|
list := this.module.modelFetterstory.getMaintasks(uid, req.FetterId)
|
|
|
|
rsp := &pb.LibraryFetterstoryTaskResp{
|
|
List: list,
|
|
}
|
|
|
|
if err := session.SendMsg(string(this.module.GetType()), LibraryFetterstoryTaskResp, rsp); err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|