更新任务

This commit is contained in:
wh_zcy 2022-08-23 16:43:12 +08:00
parent a689a9b4ea
commit b7bb3ab4dc
14 changed files with 255 additions and 108 deletions

View File

@ -190,10 +190,10 @@ const (
// 随机任务类型
const (
RtaskTypeHeroTarget TaskType = 1 //英雄指定
RtaskTypeHeroLvTarget TaskType = 4 //指定英雄的等级
RtaskTypeEquipNum TaskType = 5 //指定英雄的装备数量
RtaskTypePoltId TaskType = 2 //剧情ID
RtaskTypeTaskDay TaskType = 3 //每日任务
RtaskTypeHeroLvTarget TaskType = 4 //指定英雄的等级
RtaskTypeEquipNum TaskType = 5 //指定英雄的装备数量
RtaskTypeHeroStarTarget TaskType = 6 //指定英雄的星级
)

1
go.mod
View File

@ -24,6 +24,7 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/rs/xid v1.3.0
github.com/satori/go.uuid v1.2.0
github.com/sethvargo/go-password v0.2.0
github.com/sirupsen/logrus v1.8.1
github.com/smallnest/rpcx v1.7.4
github.com/spf13/cast v1.3.1

2
go.sum
View File

@ -633,6 +633,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUt
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI=
github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE=
github.com/shirou/gopsutil/v3 v3.22.2 h1:wCrArWFkHYIdDxx/FSfF5RB4dpJYW6t7rcp3+zL8uks=
github.com/shirou/gopsutil/v3 v3.22.2/go.mod h1:WapW1AOOPlHyXr+yOyw3uYx36enocrtSoSBy0L5vUHY=
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=

View File

@ -6,9 +6,10 @@ import (
)
const (
RtaskSubTypeChoose = "choose" //选择
RtaskSubTypeList = "list" //随机任务列表
RtaskSubTypeDotask = "dotask" //做任务
RtaskSubTypeChoose = "choose" //选择
RtaskSubTypeList = "list" //随机任务列表
RtaskSubTypeDotask = "dotask" //做任务
RtaskSubTypeReward = "getreward" //奖励
)
type apiComp struct {

View File

@ -8,7 +8,9 @@ import (
)
func (this *apiComp) ChooseCheck(session comm.IUserSession, req *pb.RtaskChooseReq) (code pb.ErrorCode) {
if req.ChooseId == 0 || req.RtaskId == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
@ -22,12 +24,6 @@ func (this *apiComp) Choose(session comm.IUserSession, req *pb.RtaskChooseReq) (
return
}
// 是否已完成
// if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); !ok {
// code = pb.ErrorCode_RtaskUnFinished
// return
// }
// 获取当前任务配置
conf := this.moduleRtask.configure.getRtaskById(req.RtaskId)
if conf == nil {
@ -44,9 +40,32 @@ func (this *apiComp) Choose(session comm.IUserSession, req *pb.RtaskChooseReq) (
// 校验限定条件
if ok := this.moduleRtask.modelRtask.checkCondi(session.GetUserId(), chooseCnf.PreTid); !ok {
code = pb.ErrorCode_RtaskCondiNoReach
return
}
var (
frtaskArr *pb.FrtaskIds
ok bool
)
if frtaskArr, ok = rtask.FrtaskIds[conf.Group]; !ok {
frtaskArr = &pb.FrtaskIds{}
}
// 更新完成的任务
frtaskArr.RtaskIds = append(frtaskArr.RtaskIds, req.RtaskId)
if rtask.FrtaskIds == nil {
rtask.FrtaskIds = make(map[int32]*pb.FrtaskIds)
}
rtask.FrtaskIds[conf.Group] = frtaskArr
update := map[string]interface{}{
"frtaskIds": rtask.FrtaskIds,
}
if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_SystemError
}
//发奖励
code = this.moduleRtask.DispenseRes(session, conf.Reward, true)

View File

@ -5,22 +5,23 @@ import (
"go_dreamfactory/pb"
"go_dreamfactory/utils"
"go.mongodb.org/mongo-driver/bson/primitive"
"google.golang.org/protobuf/proto"
)
func (this *apiComp) dotaskCheck(session comm.IUserSession, req *pb.RtaskApplyReq) (code pb.ErrorCode) {
func (this *apiComp) DotaskCheck(session comm.IUserSession, req *pb.RtaskApplyReq) (code pb.ErrorCode) {
if req.RtaskId == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (this *apiComp) dotask(session comm.IUserSession, req *pb.RtaskApplyReq) (code pb.ErrorCode, data proto.Message) {
if code = this.dotaskCheck(session, req); code != pb.ErrorCode_Success {
func (this *apiComp) Dotask(session comm.IUserSession, req *pb.RtaskApplyReq) (code pb.ErrorCode, data proto.Message) {
if code = this.DotaskCheck(session, req); code != pb.ErrorCode_Success {
return
}
// 获取当前玩家
// 获取当前玩家任务
rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId())
if rtask == nil {
code = pb.ErrorCode_RtaskNoRtask
@ -34,27 +35,39 @@ func (this *apiComp) dotask(session comm.IUserSession, req *pb.RtaskApplyReq) (c
return
}
var (
frtaskArr *pb.FrtaskIds
ok bool
)
if frtaskArr, ok = rtask.FrtaskIds[conf.Group]; !ok {
frtaskArr = &pb.FrtaskIds{}
}
//验证该任务是否已完成
if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); ok {
if _, ok := utils.Findx(frtaskArr.RtaskIds, req.RtaskId); ok {
code = pb.ErrorCode_RtaskFinished
return
}
//校验限定条件
var ok bool
if code, ok = this.moduleRtask.modelRtask.checkHandle(session.GetUserId(), conf); !ok {
if code, ok = this.moduleRtask.modelRtask.checkHandle(session.GetUserId(), frtaskArr.RtaskIds, conf); !ok {
code = pb.ErrorCode_RtaskCondiNoReach
return
}
// 没有设置选项,表示任务完成
if len(conf.ChooseId) == 0 {
rtask.FrtaskIds = append(rtask.FrtaskIds, req.RtaskId)
frtaskArr.RtaskIds = append(frtaskArr.RtaskIds, req.RtaskId)
// 更新完成的任务
update := map[string]interface{}{
"frtaskIds": rtask.FrtaskIds,
_id := primitive.NewObjectID().Hex()
rtask := &pb.DBRtask{
Id: _id,
Uid: session.GetUserId(),
FrtaskIds: rtask.FrtaskIds,
}
if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil {
if err := this.moduleRtask.modelRtask.Add(session.GetUserId(), rtask); err != nil {
code = pb.ErrorCode_SystemError
}

View File

@ -7,11 +7,11 @@ import (
"google.golang.org/protobuf/proto"
)
func (this *apiComp) listCheck(session comm.IUserSession, req *pb.RtasklistReq) (code pb.ErrorCode) {
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) {
func (this *apiComp) List(session comm.IUserSession, req *pb.RtasklistReq) (code pb.ErrorCode, data proto.Message) {
// 获取当前玩家
rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId())
@ -20,8 +20,16 @@ func (this *apiComp) list(session comm.IUserSession, req *pb.RtasklistReq) (code
return
}
var rtaskIds []int32
if v, ok := rtask.FrtaskIds[req.GroupId]; ok {
for _, id := range v.RtaskIds {
rtaskIds = append(rtaskIds, id)
}
}
rsp := &pb.RtasklistResp{
RtaskId: rtask.FrtaskIds,
RtaskIds: rtaskIds,
}
if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeList, rsp); err != nil {
code = pb.ErrorCode_SystemError

View File

@ -18,6 +18,17 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.RtaskGetReward
if code = this.GetRewardCheck(session, req); code != pb.ErrorCode_Success {
return
}
conf := this.moduleRtask.configure.getRtaskById(req.RtaskId)
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
//校验是否最后一个任务
if conf.NextTid != 0 {
code = pb.ErrorCode_RtaskLastOne
return
}
// 获取当前玩家
rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId())
@ -32,12 +43,6 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.RtaskGetReward
return
}
conf := this.moduleRtask.configure.getRtaskById(req.RtaskId)
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
//发奖励
code = this.moduleRtask.DispenseRes(session, conf.Reward, true)
@ -47,5 +52,12 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.RtaskGetReward
if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_SystemError
}
rsp := &pb.RtaskGetRewardResp{
RtaskId: req.RtaskId,
}
if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeReward, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -48,11 +48,11 @@ func (this *configureComp) getRtaskTypeCfg() (data *cfg.GameRdtaskCondi, err err
v interface{}
ok bool
)
if v, err = this.GetConfigure(gameRtask); err != nil {
if v, err = this.GetConfigure(gameRtaskCondi); err != nil {
return
} else {
if data, ok = v.(*cfg.GameRdtaskCondi); !ok {
err = fmt.Errorf("%T is *cfg.GameRdtaskType", v)
err = fmt.Errorf("%T is *cfg.GameRdtaskCondi", v)
return
}
}

View File

@ -51,17 +51,10 @@ func (this *ModelRtask) setNextTask(uid string, rtaskId int32) error {
}
// 做任务之前的校验
func (this *ModelRtask) checkHandle(uid string, conf *cfg.GameRdtaskData) (code pb.ErrorCode, ok bool) {
//查询玩家的
rtask := &pb.DBRtask{}
if err := this.Get(uid, rtask); err != nil {
code = pb.ErrorCode_DBError
return
}
func (this *ModelRtask) checkHandle(uid string, frtaskIds []int32, conf *cfg.GameRdtaskData) (code pb.ErrorCode, ok bool) {
//判断前置任务状态
if conf.PreTid != 0 {
if _, ok := utils.Findx(rtask.FrtaskIds, conf.PreTid); !ok {
if _, ok := utils.Findx(frtaskIds, conf.PreTid); !ok {
code = pb.ErrorCode_RtaskPreNoFinish
return code, false
}
@ -69,7 +62,9 @@ func (this *ModelRtask) checkHandle(uid string, conf *cfg.GameRdtaskData) (code
//验证限定条件
for _, v := range conf.Condition {
this.checkCondi(uid, v)
if ok = this.checkCondi(uid, v); !ok {
return
}
}
return
@ -77,11 +72,16 @@ func (this *ModelRtask) checkHandle(uid string, conf *cfg.GameRdtaskData) (code
// 确定选项前的校验
func (this *ModelRtask) checkCondi(uid string, condiId int32) (ok bool) {
if condiId == 0 {
return true
}
//验证限定条件
if condi, ok := this.moduleRtask.rtaskHandleMap[condiId]; ok {
if ok = condi.fn(uid, condi.cfg); !ok {
log.Infof("uid: %v do rtask %v condition not", uid, condiId)
log.Infof("uid: %v do rtask %v condition not reach", uid, condiId)
return false
}
return true
}
return false
}

View File

@ -71,7 +71,7 @@ func (this *ModuleRtask) initRtaskHandle() {
for _, v := range conf.GetDataList() {
if typeCfg, err := this.configure.getRtaskTypeById(v.Id); err == nil {
if typeCfg != nil {
switch comm.TaskType(typeCfg.GetTypeId()) {
switch comm.TaskType(typeCfg.Type) {
case comm.RtaskTypeHeroTarget:
this.register(v.Id, &rtaskCondi{
cfg: typeCfg,
@ -106,7 +106,7 @@ func (this *ModuleRtask) initRtaskHandle() {
fn: this.modelRtask.TaskDay,
})
default:
log.Warnf("%v rtask type not configure", typeCfg.GetTypeId())
log.Warnf("%v rtask type not configure", typeCfg.Type)
}
}
}

View File

@ -152,11 +152,13 @@ const (
ErrorCode_GourmetMoreOrderTime ErrorCode = 2101 // 超过订单时长
ErrorCode_GourmetSkillMaxLv ErrorCode = 2102 // 技能已经达到满级
// rtask
ErrorCode_RtaskFinished ErrorCode = 2201 //任务已完成
ErrorCode_RtaskUnFinished ErrorCode = 2202 //任务未完成
ErrorCode_RtaskNoRtask ErrorCode = 2203 //任务未开启
ErrorCode_RtaskRewarded ErrorCode = 2204 //已获取奖励
ErrorCode_RtaskPreNoFinish ErrorCode = 2205 //前置未完成
ErrorCode_RtaskFinished ErrorCode = 2201 //任务已完成
ErrorCode_RtaskUnFinished ErrorCode = 2202 //任务未完成
ErrorCode_RtaskNoRtask ErrorCode = 2203 //任务未开启
ErrorCode_RtaskRewarded ErrorCode = 2204 //已获取奖励
ErrorCode_RtaskPreNoFinish ErrorCode = 2205 //前置未完成
ErrorCode_RtaskCondiNoReach ErrorCode = 2206 //未达到限定条件
ErrorCode_RtaskNoLastOne ErrorCode = 2207 //不是最后一个任务
)
// Enum value maps for ErrorCode.
@ -283,6 +285,8 @@ var (
2203: "RtaskNoRtask",
2204: "RtaskRewarded",
2205: "RtaskPreNoFinish",
2206: "RtaskCondiNoReach",
2207: "RtaskNoLastOne",
}
ErrorCode_value = map[string]int32{
"Success": 0,
@ -406,6 +410,8 @@ var (
"RtaskNoRtask": 2203,
"RtaskRewarded": 2204,
"RtaskPreNoFinish": 2205,
"RtaskCondiNoReach": 2206,
"RtaskNoLastOne": 2207,
}
)
@ -440,7 +446,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2a, 0xae, 0x14, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x6f, 0x2a, 0xdb, 0x14, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -603,8 +609,10 @@ var file_errorcode_proto_rawDesc = []byte{
0x74, 0x61, 0x73, 0x6b, 0x10, 0x9b, 0x11, 0x12, 0x12, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b,
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x65, 0x64, 0x10, 0x9c, 0x11, 0x12, 0x15, 0x0a, 0x10, 0x52,
0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x10,
0x9d, 0x11, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
0x9d, 0x11, 0x12, 0x16, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x6f, 0x6e, 0x64, 0x69,
0x4e, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x68, 0x10, 0x9e, 0x11, 0x12, 0x13, 0x0a, 0x0e, 0x52, 0x74,
0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x4c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x65, 0x10, 0x9f, 0x11, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -20,22 +20,69 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type FrtaskIds struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskIds []int32 `protobuf:"varint,1,rep,packed,name=rtaskIds,proto3" json:"rtaskIds"`
}
func (x *FrtaskIds) Reset() {
*x = FrtaskIds{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FrtaskIds) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FrtaskIds) ProtoMessage() {}
func (x *FrtaskIds) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_db_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FrtaskIds.ProtoReflect.Descriptor instead.
func (*FrtaskIds) Descriptor() ([]byte, []int) {
return file_rtask_rtask_db_proto_rawDescGZIP(), []int{0}
}
func (x *FrtaskIds) GetRtaskIds() []int32 {
if x != nil {
return x.RtaskIds
}
return nil
}
type DBRtask struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
FrtaskIds []int32 `protobuf:"varint,3,rep,packed,name=frtaskIds,proto3" json:"frtaskIds" bson:"frtaskIds"` //已完成的任务Id
NextRtaskId int32 `protobuf:"varint,4,opt,name=nextRtaskId,proto3" json:"nextRtaskId" bson:"nextRtaskId"` //下个任务Id
IsReward bool `protobuf:"varint,5,opt,name=isReward,proto3" json:"isReward" bson:"isReward"` //接收奖励
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
FrtaskIds map[int32]*FrtaskIds `protobuf:"bytes,3,rep,name=frtaskIds,proto3" json:"frtaskIds" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" bson:"frtaskIds"` //已完成的任务Id
NextRtaskId int32 `protobuf:"varint,4,opt,name=nextRtaskId,proto3" json:"nextRtaskId" bson:"nextRtaskId"` //下个任务Id
IsReward bool `protobuf:"varint,5,opt,name=isReward,proto3" json:"isReward" bson:"isReward"` //接收奖励
}
func (x *DBRtask) Reset() {
*x = DBRtask{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_db_proto_msgTypes[0]
mi := &file_rtask_rtask_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -48,7 +95,7 @@ func (x *DBRtask) String() string {
func (*DBRtask) ProtoMessage() {}
func (x *DBRtask) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_db_proto_msgTypes[0]
mi := &file_rtask_rtask_db_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -61,7 +108,7 @@ func (x *DBRtask) ProtoReflect() protoreflect.Message {
// Deprecated: Use DBRtask.ProtoReflect.Descriptor instead.
func (*DBRtask) Descriptor() ([]byte, []int) {
return file_rtask_rtask_db_proto_rawDescGZIP(), []int{0}
return file_rtask_rtask_db_proto_rawDescGZIP(), []int{1}
}
func (x *DBRtask) GetId() string {
@ -78,7 +125,7 @@ func (x *DBRtask) GetUid() string {
return ""
}
func (x *DBRtask) GetFrtaskIds() []int32 {
func (x *DBRtask) GetFrtaskIds() map[int32]*FrtaskIds {
if x != nil {
return x.FrtaskIds
}
@ -103,16 +150,25 @@ var File_rtask_rtask_db_proto protoreflect.FileDescriptor
var file_rtask_rtask_db_proto_rawDesc = []byte{
0x0a, 0x14, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x07, 0x44, 0x42, 0x52, 0x74, 0x61,
0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x52, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x27, 0x0a, 0x09, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22,
0xea, 0x01, 0x0a, 0x07, 0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x35, 0x0a,
0x09, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x17, 0x2e, 0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x46, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x66, 0x72, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x52, 0x74, 0x61, 0x73,
0x6b, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x52,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x52, 0x65, 0x77, 0x61,
0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x52, 0x65, 0x77, 0x61,
0x72, 0x64, 0x1a, 0x48, 0x0a, 0x0e, 0x46, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -127,16 +183,20 @@ func file_rtask_rtask_db_proto_rawDescGZIP() []byte {
return file_rtask_rtask_db_proto_rawDescData
}
var file_rtask_rtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_rtask_rtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_rtask_rtask_db_proto_goTypes = []interface{}{
(*DBRtask)(nil), // 0: DBRtask
(*FrtaskIds)(nil), // 0: frtaskIds
(*DBRtask)(nil), // 1: DBRtask
nil, // 2: DBRtask.FrtaskIdsEntry
}
var file_rtask_rtask_db_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
2, // 0: DBRtask.frtaskIds:type_name -> DBRtask.FrtaskIdsEntry
0, // 1: DBRtask.FrtaskIdsEntry.value:type_name -> frtaskIds
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_rtask_rtask_db_proto_init() }
@ -146,6 +206,18 @@ func file_rtask_rtask_db_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_rtask_rtask_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FrtaskIds); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBRtask); i {
case 0:
return &v.state
@ -164,7 +236,7 @@ func file_rtask_rtask_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rtask_rtask_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -26,7 +26,7 @@ type RtaskApplyReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID
}
func (x *RtaskApplyReq) Reset() {
@ -120,6 +120,8 @@ type RtasklistReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
GroupId int32 `protobuf:"varint,1,opt,name=groupId,proto3" json:"groupId"` //分组ID
}
func (x *RtasklistReq) Reset() {
@ -154,12 +156,19 @@ func (*RtasklistReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{2}
}
func (x *RtasklistReq) GetGroupId() int32 {
if x != nil {
return x.GroupId
}
return 0
}
type RtasklistResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId []int32 `protobuf:"varint,1,rep,packed,name=rtaskId,proto3" json:"rtaskId"`
RtaskIds []int32 `protobuf:"varint,1,rep,packed,name=rtaskIds,proto3" json:"rtaskIds"`
}
func (x *RtasklistResp) Reset() {
@ -194,9 +203,9 @@ func (*RtasklistResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{3}
}
func (x *RtasklistResp) GetRtaskId() []int32 {
func (x *RtasklistResp) GetRtaskIds() []int32 {
if x != nil {
return x.RtaskId
return x.RtaskIds
}
return nil
}
@ -207,8 +216,8 @@ type RtaskChooseReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
ChooseId int32 `protobuf:"varint,2,opt,name=chooseId,proto3" json:"chooseId"`
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID
ChooseId int32 `protobuf:"varint,2,opt,name=chooseId,proto3" json:"chooseId"` //选项配置ID
}
func (x *RtaskChooseReq) Reset() {
@ -447,26 +456,28 @@ var file_rtask_rtask_msg_proto_rawDesc = []byte{
0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x41, 0x70, 0x70, 0x6c, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x0e,
0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x29,
0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05,
0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x46, 0x0a, 0x0e, 0x52, 0x74, 0x61,
0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72,
0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74,
0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49,
0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65,
0x52, 0x65, 0x73, 0x70, 0x22, 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e,
0x69, 0x73, 0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x28,
0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18,
0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73,
0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61,
0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x46, 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68,
0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x22, 0x2d, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77,
0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x22, 0x2e, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61,
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x22, 0x11, 0x0a,
0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70,
0x22, 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x50,
0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x2d, 0x0a,
0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52,
0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x12,
0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (