38 lines
799 B
Go
38 lines
799 B
Go
package rtask
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func (this *apiComp) ListCheck(session comm.IUserSession, req *pb.RtasklistReq) (code pb.ErrorCode) {
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) List(session comm.IUserSession, req *pb.RtasklistReq) (code pb.ErrorCode, data proto.Message) {
|
|
|
|
// 获取当前玩家
|
|
rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId())
|
|
if rtask == nil {
|
|
code = pb.ErrorCode_RtaskNoRtask
|
|
return
|
|
}
|
|
|
|
ids := make([]int32, 0)
|
|
|
|
if v, ok := rtask.FrtaskIds[req.GroupId]; ok {
|
|
ids = v.RtaskIds
|
|
}
|
|
|
|
rsp := &pb.RtasklistResp{
|
|
RtaskIds: ids,
|
|
}
|
|
if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeList, rsp); err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
return
|
|
}
|
|
return
|
|
}
|