更新随机任务协议

This commit is contained in:
wh_zcy 2022-08-22 15:24:46 +08:00
parent a007f255f1
commit 6840a0c890
10 changed files with 583 additions and 50 deletions

View File

@ -7,6 +7,7 @@ import (
const (
RtaskSubTypeChoose = "choose" //选择
RtaskSubTypeList = "list" //随机任务列表
)
type apiComp struct {

View File

@ -0,0 +1,47 @@
package rtask
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
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 {
return
}
// 获取当前玩家
rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId())
if rtask == nil {
code = pb.ErrorCode_RtaskNoRtask
return
}
//验证该任务是否已完成
if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); ok {
code = pb.ErrorCode_RtaskFinished
return
}
rtask.FrtaskIds = append(rtask.FrtaskIds, req.RtaskId)
// 更新完成的任务
update := map[string]interface{}{
"frtaskIds": rtask.FrtaskIds,
}
if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

25
modules/rtask/api_list.go Normal file
View File

@ -0,0 +1,25 @@
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) {
rsp := &pb.RtasklistResp{}
if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeList, rsp); err != nil {
code = pb.ErrorCode_SystemError
return
}
return
}

View File

@ -0,0 +1,51 @@
package rtask
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.RtaskGetRewardReq) (code pb.ErrorCode) {
if req.RtaskId == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (this *apiComp) GetReward(session comm.IUserSession, req *pb.RtaskGetRewardReq) (code pb.ErrorCode, data proto.Message) {
if code = this.GetRewardCheck(session, req); code != pb.ErrorCode_Success {
return
}
// 获取当前玩家
rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId())
if rtask == nil {
code = pb.ErrorCode_RtaskNoRtask
return
}
// 是否已领取奖励
if rtask.IsReward {
code = pb.ErrorCode_RtaskRewarded
return
}
conf := this.moduleRtask.configure.getRtaskById(req.RtaskId)
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
//发奖励
code = this.moduleRtask.DispenseRes(session, conf.Reward, true)
update := map[string]interface{}{
"isReward": true,
}
if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil {
code = pb.ErrorCode_SystemError
}
return
}

View File

@ -10,7 +10,7 @@ import (
const (
gameRtask = "game_rdtask.json"
gameRtaskChoose = "game_rdtaskchoose.json"
gameRtaskType = "game_rdtaskcondi.json"
gameRtaskCondi = "game_rdtaskcondi.json"
)
type configureComp struct {
@ -22,7 +22,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.LoadMultiConfigure(map[string]interface{}{
gameRtask: cfg.NewGameRdtask,
gameRtaskChoose: cfg.NewGameRdtaskChoose,
gameRtaskType: cfg.NewGameRdtaskCondi,
gameRtaskCondi: cfg.NewGameRdtaskCondi,
})
return
}

View File

@ -4,9 +4,12 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go.mongodb.org/mongo-driver/mongo"
)
type ModelRtask struct {
@ -21,6 +24,20 @@ func (this *ModelRtask) Init(service core.IService, module core.IModule, comp co
return
}
//查询用户随机任务
func (this *ModelRtask) GetRtask(uid string) *pb.DBRtask {
rtask := &pb.DBRtask{Uid: uid}
err := this.Get(uid, rtask)
if err != nil {
if err == redis.RedisNil || err == mongo.ErrNoDocuments {
if err := this.Add(uid, rtask); err != nil {
return nil
}
}
}
return rtask
}
func (this *ModelRtask) setNextTask(uid string, rtaskId int32) error {
update := map[string]interface{}{
"nextRtaskId": rtaskId,

View File

@ -70,9 +70,13 @@ func (this *ModelTask) getTaskListByTag(uid string, taskTag comm.TaskTag) (newli
if taskTag == comm.TASK_ACHIEVE {
for _, v := range taskList {
if curTask := this.moduleTask.configure.getTaskById(v.TaskId); curTask != nil {
if v.Received == 0 && curTask.IdAfter == 0 && this.moduleTask.configure.isFirstTask(curTask.Key) { //未领取和没有下个连续任务的
if v.Received == 0 {
isFirst := this.moduleTask.configure.isFirstTask(curTask.Key)
if curTask.IdAfter == 0 && isFirst { //未领取和没有下个连续任务的
newlist = append(newlist, v)
} else if this.moduleTask.configure.isFirstTask(curTask.Key) && curTask.IdAfter != 0 { //连续任务的第一个任务
}
if isFirst && curTask.IdAfter != 0 { //连续任务的第一个任务
next := this.moduleTask.configure.getTaskById(curTask.IdAfter)
if next != nil && v.Received == 0 {
newlist = append(newlist, v)
@ -86,6 +90,8 @@ func (this *ModelTask) getTaskListByTag(uid string, taskTag comm.TaskTag) (newli
}
}
}
} else {
newlist = taskList
}

View File

@ -153,6 +153,8 @@ const (
// rtask
ErrorCode_RtaskFinished ErrorCode = 2201 //任务已完成
ErrorCode_RtaskUnFinished ErrorCode = 2202 //任务未完成
ErrorCode_RtaskNoRtask ErrorCode = 2203 //任务未开启
ErrorCode_RtaskRewarded ErrorCode = 2204 //已获取奖励
)
// Enum value maps for ErrorCode.
@ -275,6 +277,8 @@ var (
2102: "GourmetSkillMaxLv",
2201: "RtaskFinished",
2202: "RtaskUnFinished",
2203: "RtaskNoRtask",
2204: "RtaskRewarded",
}
ErrorCode_value = map[string]int32{
"Success": 0,
@ -394,6 +398,8 @@ var (
"GourmetSkillMaxLv": 2102,
"RtaskFinished": 2201,
"RtaskUnFinished": 2202,
"RtaskNoRtask": 2203,
"RtaskRewarded": 2204,
}
)
@ -428,7 +434,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, 0xd4, 0x13, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x6f, 0x2a, 0xfb, 0x13, 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,
@ -585,8 +591,10 @@ var file_errorcode_proto_rawDesc = []byte{
0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0xb6, 0x10, 0x12, 0x12,
0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10,
0x99, 0x11, 0x12, 0x14, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x55, 0x6e, 0x46, 0x69, 0x6e,
0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0x9a, 0x11, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0x9a, 0x11, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73,
0x6b, 0x4e, 0x6f, 0x52, 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, 0x42,
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -28,7 +28,8 @@ type DBRtask struct {
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"` //@go_tags(`bson:"nextRtaskId"`)下个任务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() {
@ -91,19 +92,27 @@ func (x *DBRtask) GetNextRtaskId() int32 {
return 0
}
func (x *DBRtask) GetIsReward() bool {
if x != nil {
return x.IsReward
}
return false
}
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, 0x6b, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
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,
}
var (

View File

@ -20,6 +20,187 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// 申请做任务
type RtaskApplyReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
}
func (x *RtaskApplyReq) Reset() {
*x = RtaskApplyReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtaskApplyReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtaskApplyReq) ProtoMessage() {}
func (x *RtaskApplyReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_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 RtaskApplyReq.ProtoReflect.Descriptor instead.
func (*RtaskApplyReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{0}
}
func (x *RtaskApplyReq) GetRtaskId() int32 {
if x != nil {
return x.RtaskId
}
return 0
}
type RtaskApplyResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
}
func (x *RtaskApplyResp) Reset() {
*x = RtaskApplyResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtaskApplyResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtaskApplyResp) ProtoMessage() {}
func (x *RtaskApplyResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[1]
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 RtaskApplyResp.ProtoReflect.Descriptor instead.
func (*RtaskApplyResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{1}
}
func (x *RtaskApplyResp) GetRtaskId() int32 {
if x != nil {
return x.RtaskId
}
return 0
}
// 任务列表
type RtasklistReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *RtasklistReq) Reset() {
*x = RtasklistReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtasklistReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtasklistReq) ProtoMessage() {}
func (x *RtasklistReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[2]
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 RtasklistReq.ProtoReflect.Descriptor instead.
func (*RtasklistReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{2}
}
type RtasklistResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId []int32 `protobuf:"varint,1,rep,packed,name=rtaskId,proto3" json:"rtaskId"`
}
func (x *RtasklistResp) Reset() {
*x = RtasklistResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtasklistResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtasklistResp) ProtoMessage() {}
func (x *RtasklistResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[3]
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 RtasklistResp.ProtoReflect.Descriptor instead.
func (*RtasklistResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{3}
}
func (x *RtasklistResp) GetRtaskId() []int32 {
if x != nil {
return x.RtaskId
}
return nil
}
// 对话选项
type RtaskChooseReq struct {
state protoimpl.MessageState
@ -33,7 +214,7 @@ type RtaskChooseReq struct {
func (x *RtaskChooseReq) Reset() {
*x = RtaskChooseReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[0]
mi := &file_rtask_rtask_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -46,7 +227,7 @@ func (x *RtaskChooseReq) String() string {
func (*RtaskChooseReq) ProtoMessage() {}
func (x *RtaskChooseReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[0]
mi := &file_rtask_rtask_msg_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -59,7 +240,7 @@ func (x *RtaskChooseReq) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskChooseReq.ProtoReflect.Descriptor instead.
func (*RtaskChooseReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{0}
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{4}
}
func (x *RtaskChooseReq) GetRtaskId() int32 {
@ -85,7 +266,7 @@ type RtaskChooseResp struct {
func (x *RtaskChooseResp) Reset() {
*x = RtaskChooseResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[1]
mi := &file_rtask_rtask_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -98,7 +279,7 @@ func (x *RtaskChooseResp) String() string {
func (*RtaskChooseResp) ProtoMessage() {}
func (x *RtaskChooseResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[1]
mi := &file_rtask_rtask_msg_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -111,7 +292,7 @@ func (x *RtaskChooseResp) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskChooseResp.ProtoReflect.Descriptor instead.
func (*RtaskChooseResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{1}
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{5}
}
// 任务完成推送
@ -126,7 +307,7 @@ type RtaskFinishPush struct {
func (x *RtaskFinishPush) Reset() {
*x = RtaskFinishPush{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[2]
mi := &file_rtask_rtask_msg_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -139,7 +320,7 @@ func (x *RtaskFinishPush) String() string {
func (*RtaskFinishPush) ProtoMessage() {}
func (x *RtaskFinishPush) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[2]
mi := &file_rtask_rtask_msg_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -152,7 +333,7 @@ func (x *RtaskFinishPush) ProtoReflect() protoreflect.Message {
// Deprecated: Use RtaskFinishPush.ProtoReflect.Descriptor instead.
func (*RtaskFinishPush) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{2}
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{6}
}
func (x *RtaskFinishPush) GetRtaskId() int32 {
@ -162,20 +343,130 @@ func (x *RtaskFinishPush) GetRtaskId() int32 {
return 0
}
// 领奖
type RtaskGetRewardReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
}
func (x *RtaskGetRewardReq) Reset() {
*x = RtaskGetRewardReq{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtaskGetRewardReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtaskGetRewardReq) ProtoMessage() {}
func (x *RtaskGetRewardReq) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[7]
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 RtaskGetRewardReq.ProtoReflect.Descriptor instead.
func (*RtaskGetRewardReq) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{7}
}
func (x *RtaskGetRewardReq) GetRtaskId() int32 {
if x != nil {
return x.RtaskId
}
return 0
}
type RtaskGetRewardResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
}
func (x *RtaskGetRewardResp) Reset() {
*x = RtaskGetRewardResp{}
if protoimpl.UnsafeEnabled {
mi := &file_rtask_rtask_msg_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RtaskGetRewardResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RtaskGetRewardResp) ProtoMessage() {}
func (x *RtaskGetRewardResp) ProtoReflect() protoreflect.Message {
mi := &file_rtask_rtask_msg_proto_msgTypes[8]
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 RtaskGetRewardResp.ProtoReflect.Descriptor instead.
func (*RtaskGetRewardResp) Descriptor() ([]byte, []int) {
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{8}
}
func (x *RtaskGetRewardResp) GetRtaskId() int32 {
if x != nil {
return x.RtaskId
}
return 0
}
var File_rtask_rtask_msg_proto protoreflect.FileDescriptor
var file_rtask_rtask_msg_proto_rawDesc = []byte{
0x0a, 0x15, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 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,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b,
0x41, 0x70, 0x70, 0x6c, 0x79, 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, 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,
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 (
@ -190,11 +481,17 @@ func file_rtask_rtask_msg_proto_rawDescGZIP() []byte {
return file_rtask_rtask_msg_proto_rawDescData
}
var file_rtask_rtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_rtask_rtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_rtask_rtask_msg_proto_goTypes = []interface{}{
(*RtaskChooseReq)(nil), // 0: RtaskChooseReq
(*RtaskChooseResp)(nil), // 1: RtaskChooseResp
(*RtaskFinishPush)(nil), // 2: RtaskFinishPush
(*RtaskApplyReq)(nil), // 0: RtaskApplyReq
(*RtaskApplyResp)(nil), // 1: RtaskApplyResp
(*RtasklistReq)(nil), // 2: RtasklistReq
(*RtasklistResp)(nil), // 3: RtasklistResp
(*RtaskChooseReq)(nil), // 4: RtaskChooseReq
(*RtaskChooseResp)(nil), // 5: RtaskChooseResp
(*RtaskFinishPush)(nil), // 6: RtaskFinishPush
(*RtaskGetRewardReq)(nil), // 7: RtaskGetRewardReq
(*RtaskGetRewardResp)(nil), // 8: RtaskGetRewardResp
}
var file_rtask_rtask_msg_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
@ -211,7 +508,7 @@ func file_rtask_rtask_msg_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_rtask_rtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskChooseReq); i {
switch v := v.(*RtaskApplyReq); i {
case 0:
return &v.state
case 1:
@ -223,7 +520,7 @@ func file_rtask_rtask_msg_proto_init() {
}
}
file_rtask_rtask_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskChooseResp); i {
switch v := v.(*RtaskApplyResp); i {
case 0:
return &v.state
case 1:
@ -235,6 +532,54 @@ func file_rtask_rtask_msg_proto_init() {
}
}
file_rtask_rtask_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtasklistReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtasklistResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskChooseReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskChooseResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskFinishPush); i {
case 0:
return &v.state
@ -246,6 +591,30 @@ func file_rtask_rtask_msg_proto_init() {
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskGetRewardReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rtask_rtask_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RtaskGetRewardResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -253,7 +622,7 @@ func file_rtask_rtask_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rtask_rtask_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},