This commit is contained in:
meixiongfeng 2023-07-21 20:41:54 +08:00
commit b1b6df83a8
11 changed files with 1041 additions and 178 deletions

View File

@ -28,9 +28,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 2,
@ -61,9 +59,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 3,
@ -94,9 +90,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 4,
@ -127,9 +121,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 5,
@ -160,9 +152,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 6,
@ -193,9 +183,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 7,
@ -226,9 +214,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 8,
@ -259,9 +245,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 9,
@ -292,9 +276,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 10,
@ -325,9 +307,7 @@
"True": "",
"flase": "",
"fraction": 1,
"plantrue": [
1
]
"plantrue": 1
},
{
"id": 11,
@ -358,10 +338,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 12,
@ -392,10 +369,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 13,
@ -426,10 +400,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 14,
@ -460,10 +431,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 15,
@ -494,10 +462,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 16,
@ -528,10 +493,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 17,
@ -562,10 +524,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 18,
@ -596,10 +555,7 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
},
{
"id": 19,
@ -630,9 +586,6 @@
"True": "",
"flase": "",
"fraction": 3,
"plantrue": [
1,
2
]
"plantrue": 3
}
]

View File

@ -93,6 +93,7 @@ const (
ModuleWarorder core.M_Modules = "warorder" //战令
ModuleUnionGve core.M_Modules = "uniongve" //工会boos战
ModuleDailytask core.M_Modules = "dailytask" //每日任务
ModuleQuestionnaire core.M_Modules = "questionnaire" //问卷调查
)
// 数据表名定义处

View File

@ -0,0 +1,98 @@
package questionnaire
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
// 参数校验
func (this *apiComp) AnswerCheck(session comm.IUserSession, req *pb.QuestionnaireAnswerReq) (errdata *pb.ErrorData) {
return
}
// /设置战斗阵型
func (this *apiComp) Answer(session comm.IUserSession, req *pb.QuestionnaireAnswerReq) (errdata *pb.ErrorData) {
var (
info *pb.DBQuestionnaire
group *pb.DBQuestionGroup
groupconfig *cfg.GameAskAllData
asks []*cfg.GameAskLibraryData
ok bool
finish bool
correct []int32
totalsocre int32
err error
award []*pb.UserAssets
)
if errdata = this.AnswerCheck(session, req); errdata != nil {
return
}
if info, err = this.module.modelQuestionnaire.getUserQuestionnaire(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if group, ok = info.Group[req.Group]; !ok {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("no found group:%d", req.Group),
}
}
finish = true
correct = make([]int32, 0)
for i, v := range group.Questions {
if asks[i], err = this.module.configure.getGameAskLibraryDataById(v); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
totalsocre += asks[i].Fraction
if v == req.Qid && group.Answer[i] == 0 {
group.Answer[i] = req.Answer
if req.Answer == asks[i].Plantrue {
correct = append(correct, v)
group.Fraction += asks[i].Fraction
}
}
if group.Answer[i] == 0 {
finish = false
}
}
if finish { //题目做完了
if float32(group.Fraction) > float32(totalsocre)/float32(2) {
if groupconfig, err = this.module.configure.getAskAllData(group.Group); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
award = make([]*pb.UserAssets, 0)
for _, v := range groupconfig.Reward {
award = append(award, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
this.module.DispenseRes(session, groupconfig.Reward, true)
}
}
session.SendMsg(string(this.module.GetType()), "answer", &pb.QuestionnaireAnswerResp{Info: info.Group[req.Group], Group: req.Group, Award: award})
return
}

View File

@ -0,0 +1,73 @@
package questionnaire
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
// 参数校验
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.QuestionnaireInfoReq) (errdata *pb.ErrorData) {
return
}
// /设置战斗阵型
func (this *apiComp) Info(session comm.IUserSession, req *pb.QuestionnaireInfoReq) (errdata *pb.ErrorData) {
var (
info *pb.DBQuestionnaire
conf *cfg.GameAskAllData
asks []*cfg.GameAskLibraryData
ok bool
err error
)
if errdata = this.InfoCheck(session, req); errdata != nil {
return
}
if info, err = this.module.modelQuestionnaire.getUserQuestionnaire(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if _, ok = info.Group[req.Group]; !ok {
if conf, err = this.module.configure.getAskAllData(req.Group); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
if asks, err = this.module.configure.getGameAskLibraryData(conf.ExaminationGroup, conf.Examinationnum); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),
Message: err.Error(),
}
return
}
info.Group[req.Group] = &pb.DBQuestionGroup{
Group: req.Group,
Questions: make([]int32, len(asks)),
Answer: make([]int32, len(asks)),
}
for i, v := range asks {
info.Group[req.Group].Questions[i] = v.Id
info.Group[req.Group].Answer[i] = 0
}
if err = this.module.modelQuestionnaire.updateUserQuestionnaire(session.GetUserId(), info); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
}
session.SendMsg(string(this.module.GetType()), "info", &pb.QuestionnaireInfoResp{Info: info.Group[req.Group], Group: req.Group})
return
}

View File

@ -1,33 +1,129 @@
package questionnaire
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"sync"
)
const (
gameWorldTask = "game_worldtask.json"
gameWorldtaskBattle = "game_worldbattle.json"
gameWorldAll = "game_worldall.json"
gameburiedCond = "game_buriedcondi.json"
gamerdtasknpc = "game_rdtasknpc.json"
game_askall = "game_askall.json"
game_asklibrary = "game_asklibrary.json"
)
type configureComp struct {
modules.MCompConfigure
module *Questionnaire
lock sync.RWMutex
groupAsk map[int32][]*cfg.GameAskLibraryData //key 条件ID
}
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompConfigure.Init(service, module, comp, options)
this.module = module.(*Questionnaire)
err = this.LoadMultiConfigure(map[string]interface{}{
gameWorldTask: cfg.NewGameWorldTask,
gameWorldtaskBattle: cfg.NewGameWorldBattle,
gameWorldAll: cfg.NewGameWorldAll,
gameburiedCond: cfg.NewGameBuriedCondi,
gamerdtasknpc: cfg.NewGameRdtaskNpc,
game_askall: cfg.NewGameAskAll,
})
configure.RegisterConfigure(game_asklibrary, cfg.NewGameAskLibrary, this.updateconfigure)
return
}
// 更新任务配置表
func (this *configureComp) updateconfigure() {
var (
v interface{}
conf *cfg.GameAskLibrary
ok bool
err error
)
if v, err = this.GetConfigure(game_asklibrary); err != nil {
return
}
if conf, ok = v.(*cfg.GameAskLibrary); !ok {
this.module.Error("日常任务配置异常!")
return
}
groupTasksConf := make(map[int32][]*cfg.GameAskLibraryData)
for _, v := range conf.GetDataList() {
if _, ok := groupTasksConf[v.ExaminationGroup]; !ok {
groupTasksConf[v.ExaminationGroup] = make([]*cfg.GameAskLibraryData, 0)
}
groupTasksConf[v.ExaminationGroup] = append(groupTasksConf[v.ExaminationGroup], v)
}
this.lock.Lock()
this.groupAsk = groupTasksConf
this.lock.Unlock()
}
// 获取装备配置数据
func (this *configureComp) getAskAllData(id int32) (configure *cfg.GameAskAllData, err error) {
var (
v interface{}
ok bool
)
if v, err = this.GetConfigure(game_askall); err != nil {
this.module.Errorf("err:%v", err)
return
} else {
if configure, ok = v.(*cfg.GameAskAll).GetDataMap()[id]; !ok {
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_askall, id)
this.module.Errorf("err:%v", err)
return
}
}
return
}
// 获取装备配置数据
func (this *configureComp) getGameAskLibraryDataById(id int32) (configure *cfg.GameAskLibraryData, err error) {
var (
v interface{}
ok bool
)
if v, err = this.GetConfigure(game_asklibrary); err != nil {
this.module.Errorf("err:%v", err)
return
} else {
if configure, ok = v.(*cfg.GameAskLibrary).GetDataMap()[id]; !ok {
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_asklibrary, id)
this.module.Errorf("err:%v", err)
return
}
}
return
}
// 随机任务
func (this *configureComp) getGameAskLibraryData(group, num int32) (results []*cfg.GameAskLibraryData, err error) {
var (
asks []*cfg.GameAskLibraryData
rands []int
ok bool
)
this.lock.RLock()
asks, ok = this.groupAsk[group]
this.lock.RUnlock()
if !ok {
err = fmt.Errorf("no found group:%d", group)
return
}
if num > int32(len(asks)) {
num = int32(len(asks))
}
results = make([]*cfg.GameAskLibraryData, 0)
rands = comm.RandShuffle(len(asks))
for i := 0; i < int(num); i++ {
results = append(results, asks[rands[i]])
}
return
}

View File

@ -13,12 +13,12 @@ import (
"go.mongodb.org/mongo-driver/x/bsonx"
)
type ModelDailytask struct {
type ModelQuestionnaire struct {
modules.MCompModel
module *Questionnaire
}
func (this *ModelDailytask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
func (this *ModelQuestionnaire) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options)
this.TableName = comm.TableWtask
this.module = module.(*Questionnaire)
@ -29,35 +29,27 @@ func (this *ModelDailytask) Init(service core.IService, module core.IModule, com
}
// 获取用户全部的埋点数据
func (this *ModelDailytask) getUserWTasks(uid string) (results *pb.DBWTask, err error) {
results = &pb.DBWTask{}
func (this *ModelQuestionnaire) getUserQuestionnaire(uid string) (results *pb.DBQuestionnaire, err error) {
results = &pb.DBQuestionnaire{}
if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err)
return
}
if err == mgo.MongodbNil {
err = nil
results = &pb.DBWTask{
results = &pb.DBQuestionnaire{
Id: primitive.NewObjectID().Hex(),
Uid: uid,
Currchapter: 0,
Activations: make([]int32, 0),
Accepts: make([]int32, 0),
Completes: make([]int32, 0),
Groups: make(map[int32]int32),
Group: make(map[int32]*pb.DBQuestionGroup),
}
err = this.Add(uid, results)
}
return
}
func (this *ModelDailytask) updateUserWTasks(uid string, data *pb.DBWTask) (err error) {
func (this *ModelQuestionnaire) updateUserQuestionnaire(uid string, data *pb.DBQuestionnaire) (err error) {
if err = this.Change(uid, map[string]interface{}{
"currchapter": data.Currchapter,
"activations": data.Activations,
"accepts": data.Accepts,
"completes": data.Completes,
"groups": data.Groups,
"group": data.Group,
}); err != nil {
this.module.Error("更新用户任务数据 错误!", log.Field{Key: "err", Value: err.Error()})
return

View File

@ -14,7 +14,7 @@ type Questionnaire struct {
sys comm.ISys
api *apiComp
configure *configureComp
modelDailytask *ModelDailytask
modelQuestionnaire *ModelQuestionnaire
}
func NewModule() core.IModule {
@ -22,7 +22,7 @@ func NewModule() core.IModule {
}
func (this *Questionnaire) GetType() core.M_Modules {
return comm.ModuleDailytask
return comm.ModuleQuestionnaire
}
func (this *Questionnaire) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
@ -52,7 +52,7 @@ func (this *Questionnaire) Start() (err error) {
func (this *Questionnaire) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelDailytask = this.RegisterComp(new(ModelDailytask)).(*ModelDailytask)
this.modelQuestionnaire = this.RegisterComp(new(ModelQuestionnaire)).(*ModelQuestionnaire)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}

263
pb/questionnaire_db.pb.go Normal file
View File

@ -0,0 +1,263 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: questionnaire/questionnaire_db.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//问卷系统
type DBQuestionnaire struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
Group map[int32]*DBQuestionGroup `protobuf:"bytes,3,rep,name=group,proto3" json:"group" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *DBQuestionnaire) Reset() {
*x = DBQuestionnaire{}
if protoimpl.UnsafeEnabled {
mi := &file_questionnaire_questionnaire_db_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBQuestionnaire) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBQuestionnaire) ProtoMessage() {}
func (x *DBQuestionnaire) ProtoReflect() protoreflect.Message {
mi := &file_questionnaire_questionnaire_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 DBQuestionnaire.ProtoReflect.Descriptor instead.
func (*DBQuestionnaire) Descriptor() ([]byte, []int) {
return file_questionnaire_questionnaire_db_proto_rawDescGZIP(), []int{0}
}
func (x *DBQuestionnaire) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *DBQuestionnaire) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBQuestionnaire) GetGroup() map[int32]*DBQuestionGroup {
if x != nil {
return x.Group
}
return nil
}
type DBQuestionGroup struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
Questions []int32 `protobuf:"varint,2,rep,packed,name=questions,proto3" json:"questions"`
Answer []int32 `protobuf:"varint,3,rep,packed,name=answer,proto3" json:"answer"` //采用位运算记录多选情况 0 表示为回答 1,2,4,8 分别表示1,2,3,4的答案的值
Fraction int32 `protobuf:"varint,4,opt,name=fraction,proto3" json:"fraction"` //分值
}
func (x *DBQuestionGroup) Reset() {
*x = DBQuestionGroup{}
if protoimpl.UnsafeEnabled {
mi := &file_questionnaire_questionnaire_db_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBQuestionGroup) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBQuestionGroup) ProtoMessage() {}
func (x *DBQuestionGroup) ProtoReflect() protoreflect.Message {
mi := &file_questionnaire_questionnaire_db_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 DBQuestionGroup.ProtoReflect.Descriptor instead.
func (*DBQuestionGroup) Descriptor() ([]byte, []int) {
return file_questionnaire_questionnaire_db_proto_rawDescGZIP(), []int{1}
}
func (x *DBQuestionGroup) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
func (x *DBQuestionGroup) GetQuestions() []int32 {
if x != nil {
return x.Questions
}
return nil
}
func (x *DBQuestionGroup) GetAnswer() []int32 {
if x != nil {
return x.Answer
}
return nil
}
func (x *DBQuestionGroup) GetFraction() int32 {
if x != nil {
return x.Fraction
}
return 0
}
var File_questionnaire_questionnaire_db_proto protoreflect.FileDescriptor
var file_questionnaire_questionnaire_db_proto_rawDesc = []byte{
0x0a, 0x24, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x2f,
0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x5f, 0x64, 0x62,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x0f, 0x44, 0x42, 0x51, 0x75, 0x65,
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 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, 0x31, 0x0a, 0x05,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x44, 0x42,
0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x2e, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a,
0x4a, 0x0a, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10,
0x2e, 0x44, 0x42, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x79, 0x0a, 0x0f, 0x44,
0x42, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14,
0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67,
0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03,
0x28, 0x05, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x72,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_questionnaire_questionnaire_db_proto_rawDescOnce sync.Once
file_questionnaire_questionnaire_db_proto_rawDescData = file_questionnaire_questionnaire_db_proto_rawDesc
)
func file_questionnaire_questionnaire_db_proto_rawDescGZIP() []byte {
file_questionnaire_questionnaire_db_proto_rawDescOnce.Do(func() {
file_questionnaire_questionnaire_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_questionnaire_questionnaire_db_proto_rawDescData)
})
return file_questionnaire_questionnaire_db_proto_rawDescData
}
var file_questionnaire_questionnaire_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_questionnaire_questionnaire_db_proto_goTypes = []interface{}{
(*DBQuestionnaire)(nil), // 0: DBQuestionnaire
(*DBQuestionGroup)(nil), // 1: DBQuestionGroup
nil, // 2: DBQuestionnaire.GroupEntry
}
var file_questionnaire_questionnaire_db_proto_depIdxs = []int32{
2, // 0: DBQuestionnaire.group:type_name -> DBQuestionnaire.GroupEntry
1, // 1: DBQuestionnaire.GroupEntry.value:type_name -> DBQuestionGroup
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_questionnaire_questionnaire_db_proto_init() }
func file_questionnaire_questionnaire_db_proto_init() {
if File_questionnaire_questionnaire_db_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_questionnaire_questionnaire_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBQuestionnaire); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_questionnaire_questionnaire_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBQuestionGroup); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_questionnaire_questionnaire_db_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_questionnaire_questionnaire_db_proto_goTypes,
DependencyIndexes: file_questionnaire_questionnaire_db_proto_depIdxs,
MessageInfos: file_questionnaire_questionnaire_db_proto_msgTypes,
}.Build()
File_questionnaire_questionnaire_db_proto = out.File
file_questionnaire_questionnaire_db_proto_rawDesc = nil
file_questionnaire_questionnaire_db_proto_goTypes = nil
file_questionnaire_questionnaire_db_proto_depIdxs = nil
}

394
pb/questionnaire_msg.pb.go Normal file
View File

@ -0,0 +1,394 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.20.0
// source: questionnaire/questionnaire_msg.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
//问卷信息请求
type QuestionnaireInfoReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
}
func (x *QuestionnaireInfoReq) Reset() {
*x = QuestionnaireInfoReq{}
if protoimpl.UnsafeEnabled {
mi := &file_questionnaire_questionnaire_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QuestionnaireInfoReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QuestionnaireInfoReq) ProtoMessage() {}
func (x *QuestionnaireInfoReq) ProtoReflect() protoreflect.Message {
mi := &file_questionnaire_questionnaire_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 QuestionnaireInfoReq.ProtoReflect.Descriptor instead.
func (*QuestionnaireInfoReq) Descriptor() ([]byte, []int) {
return file_questionnaire_questionnaire_msg_proto_rawDescGZIP(), []int{0}
}
func (x *QuestionnaireInfoReq) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
type QuestionnaireInfoResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
Info *DBQuestionGroup `protobuf:"bytes,2,opt,name=info,proto3" json:"info"`
}
func (x *QuestionnaireInfoResp) Reset() {
*x = QuestionnaireInfoResp{}
if protoimpl.UnsafeEnabled {
mi := &file_questionnaire_questionnaire_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QuestionnaireInfoResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QuestionnaireInfoResp) ProtoMessage() {}
func (x *QuestionnaireInfoResp) ProtoReflect() protoreflect.Message {
mi := &file_questionnaire_questionnaire_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 QuestionnaireInfoResp.ProtoReflect.Descriptor instead.
func (*QuestionnaireInfoResp) Descriptor() ([]byte, []int) {
return file_questionnaire_questionnaire_msg_proto_rawDescGZIP(), []int{1}
}
func (x *QuestionnaireInfoResp) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
func (x *QuestionnaireInfoResp) GetInfo() *DBQuestionGroup {
if x != nil {
return x.Info
}
return nil
}
//回答问题
type QuestionnaireAnswerReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
Qid int32 `protobuf:"varint,2,opt,name=qid,proto3" json:"qid"`
Answer int32 `protobuf:"varint,3,opt,name=answer,proto3" json:"answer"`
}
func (x *QuestionnaireAnswerReq) Reset() {
*x = QuestionnaireAnswerReq{}
if protoimpl.UnsafeEnabled {
mi := &file_questionnaire_questionnaire_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QuestionnaireAnswerReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QuestionnaireAnswerReq) ProtoMessage() {}
func (x *QuestionnaireAnswerReq) ProtoReflect() protoreflect.Message {
mi := &file_questionnaire_questionnaire_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 QuestionnaireAnswerReq.ProtoReflect.Descriptor instead.
func (*QuestionnaireAnswerReq) Descriptor() ([]byte, []int) {
return file_questionnaire_questionnaire_msg_proto_rawDescGZIP(), []int{2}
}
func (x *QuestionnaireAnswerReq) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
func (x *QuestionnaireAnswerReq) GetQid() int32 {
if x != nil {
return x.Qid
}
return 0
}
func (x *QuestionnaireAnswerReq) GetAnswer() int32 {
if x != nil {
return x.Answer
}
return 0
}
//回答问题
type QuestionnaireAnswerResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Group int32 `protobuf:"varint,1,opt,name=group,proto3" json:"group"`
Info *DBQuestionGroup `protobuf:"bytes,2,opt,name=info,proto3" json:"info"`
Award []*UserAssets `protobuf:"bytes,3,rep,name=award,proto3" json:"award"` //奖励
}
func (x *QuestionnaireAnswerResp) Reset() {
*x = QuestionnaireAnswerResp{}
if protoimpl.UnsafeEnabled {
mi := &file_questionnaire_questionnaire_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *QuestionnaireAnswerResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QuestionnaireAnswerResp) ProtoMessage() {}
func (x *QuestionnaireAnswerResp) ProtoReflect() protoreflect.Message {
mi := &file_questionnaire_questionnaire_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 QuestionnaireAnswerResp.ProtoReflect.Descriptor instead.
func (*QuestionnaireAnswerResp) Descriptor() ([]byte, []int) {
return file_questionnaire_questionnaire_msg_proto_rawDescGZIP(), []int{3}
}
func (x *QuestionnaireAnswerResp) GetGroup() int32 {
if x != nil {
return x.Group
}
return 0
}
func (x *QuestionnaireAnswerResp) GetInfo() *DBQuestionGroup {
if x != nil {
return x.Info
}
return nil
}
func (x *QuestionnaireAnswerResp) GetAward() []*UserAssets {
if x != nil {
return x.Award
}
return nil
}
var File_questionnaire_questionnaire_msg_proto protoreflect.FileDescriptor
var file_questionnaire_questionnaire_msg_proto_rawDesc = []byte{
0x0a, 0x25, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x2f,
0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x5f, 0x6d, 0x73,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e,
0x61, 0x69, 0x72, 0x65, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63,
0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x14, 0x51, 0x75, 0x65,
0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x71, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x53, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x73, 0x74,
0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f,
0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x58, 0x0a, 0x16,
0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x41, 0x6e, 0x73,
0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03,
0x71, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x71, 0x69, 0x64, 0x12, 0x16,
0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x22, 0x78, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69,
0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73,
0x70, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69,
0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a,
0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_questionnaire_questionnaire_msg_proto_rawDescOnce sync.Once
file_questionnaire_questionnaire_msg_proto_rawDescData = file_questionnaire_questionnaire_msg_proto_rawDesc
)
func file_questionnaire_questionnaire_msg_proto_rawDescGZIP() []byte {
file_questionnaire_questionnaire_msg_proto_rawDescOnce.Do(func() {
file_questionnaire_questionnaire_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_questionnaire_questionnaire_msg_proto_rawDescData)
})
return file_questionnaire_questionnaire_msg_proto_rawDescData
}
var file_questionnaire_questionnaire_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_questionnaire_questionnaire_msg_proto_goTypes = []interface{}{
(*QuestionnaireInfoReq)(nil), // 0: QuestionnaireInfoReq
(*QuestionnaireInfoResp)(nil), // 1: QuestionnaireInfoResp
(*QuestionnaireAnswerReq)(nil), // 2: QuestionnaireAnswerReq
(*QuestionnaireAnswerResp)(nil), // 3: QuestionnaireAnswerResp
(*DBQuestionGroup)(nil), // 4: DBQuestionGroup
(*UserAssets)(nil), // 5: UserAssets
}
var file_questionnaire_questionnaire_msg_proto_depIdxs = []int32{
4, // 0: QuestionnaireInfoResp.info:type_name -> DBQuestionGroup
4, // 1: QuestionnaireAnswerResp.info:type_name -> DBQuestionGroup
5, // 2: QuestionnaireAnswerResp.award:type_name -> UserAssets
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_questionnaire_questionnaire_msg_proto_init() }
func file_questionnaire_questionnaire_msg_proto_init() {
if File_questionnaire_questionnaire_msg_proto != nil {
return
}
file_questionnaire_questionnaire_db_proto_init()
file_comm_proto_init()
if !protoimpl.UnsafeEnabled {
file_questionnaire_questionnaire_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QuestionnaireInfoReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_questionnaire_questionnaire_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QuestionnaireInfoResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_questionnaire_questionnaire_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QuestionnaireAnswerReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_questionnaire_questionnaire_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QuestionnaireAnswerResp); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_questionnaire_questionnaire_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_questionnaire_questionnaire_msg_proto_goTypes,
DependencyIndexes: file_questionnaire_questionnaire_msg_proto_depIdxs,
MessageInfos: file_questionnaire_questionnaire_msg_proto_msgTypes,
}.Build()
File_questionnaire_questionnaire_msg_proto = out.File
file_questionnaire_questionnaire_msg_proto_rawDesc = nil
file_questionnaire_questionnaire_msg_proto_goTypes = nil
file_questionnaire_questionnaire_msg_proto_depIdxs = nil
}

View File

@ -12,6 +12,7 @@ import (
"go_dreamfactory/modules/caravan"
"go_dreamfactory/modules/chat"
"go_dreamfactory/modules/combat"
"go_dreamfactory/modules/dailytask"
"go_dreamfactory/modules/dispatch"
"go_dreamfactory/modules/enchant"
"go_dreamfactory/modules/equipment"
@ -39,6 +40,7 @@ import (
"go_dreamfactory/modules/practice"
"go_dreamfactory/modules/privilege"
"go_dreamfactory/modules/pvp"
"go_dreamfactory/modules/questionnaire"
"go_dreamfactory/modules/reddot"
"go_dreamfactory/modules/reputation"
"go_dreamfactory/modules/shop"
@ -135,8 +137,12 @@ func main() {
passon.NewModule(),
warorder.NewModule(),
uniongve.NewModule(),
// dailytask.NewModule(),
stonehenge.NewModule(),
dailytask.NewModule(),
questionnaire.NewModule(),
)
}

View File

@ -24,7 +24,7 @@ type GameAskLibraryData struct {
True string
Flase string
Fraction int32
Plantrue []int32
Plantrue int32
}
const TypeId_GameAskLibraryData = -162756536
@ -47,20 +47,7 @@ func (_v *GameAskLibraryData)Deserialize(_buf map[string]interface{}) (err error
{ var _ok_ bool; if _v.True, _ok_ = _buf["True"].(string); !_ok_ { err = errors.New("True error"); return } }
{ var _ok_ bool; if _v.Flase, _ok_ = _buf["flase"].(string); !_ok_ { err = errors.New("flase error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["fraction"].(float64); !_ok_ { err = errors.New("fraction error"); return }; _v.Fraction = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["plantrue"].([]interface{}); !_ok_ { err = errors.New("plantrue error"); return }
_v.Plantrue = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
_v.Plantrue = append(_v.Plantrue, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["plantrue"].(float64); !_ok_ { err = errors.New("plantrue error"); return }; _v.Plantrue = int32(_tempNum_) }
return
}