40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package library
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
// 羁绊剧情-我的主线任务
|
|
func (this *apiComp) FetterstoryTaskCheck(session comm.IUserSession, req *pb.LibraryFetterstoryTaskReq) (code pb.ErrorCode) {
|
|
if req.FetterId == 0 {
|
|
this.module.Error("参数错误", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "params", Value: req.String()})
|
|
code = pb.ErrorCode_ReqParameterError
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) FetterstoryTask(session comm.IUserSession, req *pb.LibraryFetterstoryTaskReq) (code pb.ErrorCode, data proto.Message) {
|
|
if code = this.FetterstoryTaskCheck(session, req); code != pb.ErrorCode_Success {
|
|
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
|
|
}
|