Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
c78e026e65
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ cmd/luban/
|
||||
pb.bat
|
||||
cmd/v2/.cache.meta
|
||||
cmd/v2/my.db
|
||||
.idea/
|
||||
|
@ -11,13 +11,21 @@ linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- nilerr
|
||||
# 检查没有判断err的场景,这些没有检查的场景可能导致致命bug在某些场景
|
||||
- errcheck
|
||||
# 简化代码
|
||||
- gosimple
|
||||
# 检查源代码、报告可疑的结构体,如果Printf函数调用,参数没有对齐字符串格式
|
||||
- govet
|
||||
# 检查没有使用参数
|
||||
- ineffassign
|
||||
# 专业做静态检查的工具,其它的工具只是一个简单的github仓库
|
||||
- staticcheck
|
||||
# 类似编译的前端,解析和检查type
|
||||
- typecheck
|
||||
# 检查没有使用的go代码,包含没有使用的常量、变量、函数、和类型
|
||||
- unused
|
||||
|
||||
# more linters https://golangci-lint.run/usage/linters/
|
||||
|
||||
linters-settings:
|
||||
|
@ -36,7 +36,7 @@ func (r *Robot) BuildSecStr() string {
|
||||
|
||||
//处理登录请求
|
||||
func (r *Robot) AccountLogin() {
|
||||
log.Printf("区服:[%d] 账号:[%s] login...", r.opts.ServerId, r.opts.Account)
|
||||
log.Printf("区服:[%s] 账号:[%s] login...", r.opts.ServerId, r.opts.Account)
|
||||
builders := []*TestCase{
|
||||
{
|
||||
id: "login",
|
||||
|
@ -143,12 +143,6 @@ func (r *Robot) addBuilders(builders []*TestCase) {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Robot) printBuilders() {
|
||||
for k, v := range r.builderMap {
|
||||
zlog.Debugf("%v %s.%s", k, v.mainType, v.subType)
|
||||
}
|
||||
}
|
||||
|
||||
//处理用例,发送请求
|
||||
func (r *Robot) handleReq() {
|
||||
for len(r.builderMap) > 0 {
|
||||
|
@ -54,11 +54,11 @@ func (c *ConnServiceImpl) WsConnect(wsUrl string) error {
|
||||
}
|
||||
c.ws = ws
|
||||
|
||||
ticker := time.NewTicker(2 * time.Second)
|
||||
defer ticker.Stop()
|
||||
go func() {
|
||||
timer := time.NewTimer(2 * time.Second)
|
||||
for {
|
||||
_ = <-ticker.C
|
||||
timer.Reset(2 * time.Second)
|
||||
<-timer.C
|
||||
if err := c.ws.WriteMessage(websocket.PingMessage, []byte{}); err != nil {
|
||||
c.obs.Notify(observer.EVENT_PING, err)
|
||||
break
|
||||
|
@ -6,5 +6,5 @@ type WindowDefaultOptions struct {
|
||||
windowAction common.WindowAction
|
||||
windowMode common.WindowMode
|
||||
windowAspect common.WindowAspect
|
||||
windowVisible bool
|
||||
// windowVisible bool
|
||||
}
|
||||
|
@ -12,20 +12,20 @@ type mainMenu struct {
|
||||
// aboutSelf *fyne.MenuItem
|
||||
}
|
||||
|
||||
func newMainMenu() *mainMenu {
|
||||
var mm mainMenu
|
||||
// func newMainMenu() *mainMenu {
|
||||
// var mm mainMenu
|
||||
|
||||
// help
|
||||
mm.sysLog = fyne.NewMenuItem("Show Log", func() {
|
||||
newLogViewer().Win.Show()
|
||||
})
|
||||
mm.helpMenu = fyne.NewMenu("Help",
|
||||
mm.sysLog,
|
||||
// mm.aboutSelf,
|
||||
)
|
||||
// // help
|
||||
// mm.sysLog = fyne.NewMenuItem("Show Log", func() {
|
||||
// newLogViewer().Win.Show()
|
||||
// })
|
||||
// mm.helpMenu = fyne.NewMenu("Help",
|
||||
// mm.sysLog,
|
||||
// // mm.aboutSelf,
|
||||
// )
|
||||
|
||||
mm.MainMenu = fyne.NewMainMenu(
|
||||
mm.helpMenu,
|
||||
)
|
||||
return &mm
|
||||
}
|
||||
// mm.MainMenu = fyne.NewMainMenu(
|
||||
// mm.helpMenu,
|
||||
// )
|
||||
// return &mm
|
||||
// }
|
||||
|
@ -37,7 +37,6 @@ type MainWindowImpl struct {
|
||||
UIImpl
|
||||
WindowDefaultOptions
|
||||
w fyne.Window
|
||||
mm *mainMenu
|
||||
tb *toolBar //工具条
|
||||
toys *toys // side
|
||||
sb *statusBar //状态栏
|
||||
@ -55,6 +54,7 @@ func NewMainWindow(ui *UIImpl) MainWindow {
|
||||
|
||||
ui.obs.AddListener(observer.EVENT_PING, observer.Listener{
|
||||
OnNotify: func(data interface{}, args ...interface{}) {
|
||||
logrus.Debug("即将于服务器断开链接")
|
||||
conf := dialog.NewConfirm("链接中断", data.(error).Error(), func(
|
||||
b bool) {
|
||||
if b {
|
||||
@ -121,9 +121,9 @@ func (ui *MainWindowImpl) quiteHandle() {
|
||||
}
|
||||
|
||||
// CreateWindow ....
|
||||
func (ui *MainWindowImpl) CreateWindow(title string, width, height float32, _ bool) {
|
||||
func (ui *MainWindowImpl) CreateWindow(_ string, width, height float32, _ bool) {
|
||||
// init window
|
||||
title = fmt.Sprintf(common.APP_WIN_TITLE, "登录", ui.app.Metadata().Version, ui.app.Metadata().Build, common.APP_NAME)
|
||||
title := fmt.Sprintf(common.APP_WIN_TITLE, "登录", ui.app.Metadata().Version, ui.app.Metadata().Build, common.APP_NAME)
|
||||
w := ui.app.NewWindow(title)
|
||||
ui.AddWindow("main", w)
|
||||
ui.w = w
|
||||
@ -134,10 +134,6 @@ func (ui *MainWindowImpl) CreateWindow(title string, width, height float32, _ bo
|
||||
w.Resize(fyne.NewSize(width, height))
|
||||
}
|
||||
|
||||
// create main window menu
|
||||
// ui.mm = newMainMenu()
|
||||
// w.SetMainMenu(ui.mm.MainMenu)
|
||||
|
||||
w.SetMaster()
|
||||
w.CenterOnScreen()
|
||||
_ = ui.createChooseServerPopUp(w)
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
"go_dreamfactory/modules/linestory"
|
||||
"go_dreamfactory/modules/mainline"
|
||||
"go_dreamfactory/modules/rtask"
|
||||
"go_dreamfactory/modules/sys"
|
||||
"go_dreamfactory/modules/task"
|
||||
"go_dreamfactory/modules/user"
|
||||
"go_dreamfactory/pb"
|
||||
@ -34,6 +35,8 @@ var (
|
||||
viewRegister = map[string]MyCaseView{
|
||||
// gm
|
||||
ff(comm.ModuleGM, "cmd"): &formview.BingoView{},
|
||||
//sys
|
||||
ff(comm.ModuleSys, "funclist"): &formview.SysFuncListView{},
|
||||
//user
|
||||
ff(comm.ModuleUser, user.UserSubTypeModifyName): &formview.UserModifynameView{},
|
||||
ff(comm.ModuleUser, user.UserSubTypeModifySign): &formview.UserSignView{},
|
||||
@ -95,6 +98,7 @@ var (
|
||||
CaseIndex = map[string][]string{
|
||||
"": {
|
||||
string(comm.ModuleGM),
|
||||
string(comm.ModuleSys),
|
||||
string(comm.ModuleUser),
|
||||
string(comm.ModuleHero),
|
||||
string(comm.ModuleTask),
|
||||
@ -109,6 +113,9 @@ var (
|
||||
string(comm.ModuleLinestory),
|
||||
},
|
||||
"gm": {ff(comm.ModuleGM, "cmd")},
|
||||
"sys": {
|
||||
ff(comm.ModuleSys, "funclist"),
|
||||
},
|
||||
"user": {
|
||||
ff(comm.ModuleUser, user.UserSubTypeModifyName),
|
||||
ff(comm.ModuleUser, user.UserSubTypeModifySign),
|
||||
@ -194,6 +201,18 @@ var (
|
||||
Rsp: &pb.GMCmdResp{},
|
||||
Enabled: true,
|
||||
},
|
||||
"sys": {
|
||||
NavLabel: "系统",
|
||||
MainType: string(comm.ModuleSys),
|
||||
Enabled: true,
|
||||
},
|
||||
ff(comm.ModuleSys, "funclist"): {
|
||||
NavLabel: "功能列表",
|
||||
Desc: "返回未开启的功能列表",
|
||||
MainType: string(comm.ModuleSys),
|
||||
SubType: sys.SysSubTypeFunc,
|
||||
Enabled: true,
|
||||
},
|
||||
// user
|
||||
"user": {
|
||||
NavLabel: "用户",
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
|
||||
type appPbGen struct {
|
||||
appAdapter
|
||||
obs observer.Observer
|
||||
folderList *folderList
|
||||
folderChk *widget.List
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ func (a *appWelcome) OpenDefault() bool {
|
||||
}
|
||||
|
||||
func (a *appWelcome) ShortCut() fyne.Shortcut {
|
||||
return &desktop.CustomShortcut{KeyName: fyne.Key1, Modifier: desktop.AltModifier}
|
||||
return &desktop.CustomShortcut{KeyName: fyne.Key1, Modifier: fyne.KeyModifierAlt}
|
||||
}
|
||||
|
||||
func (a *appWelcome) Icon() fyne.Resource {
|
||||
|
@ -168,10 +168,10 @@ func (this *toyUserInfo) dataListener() {
|
||||
this.setProp(5, common.USERINFO_GOLD, rsp.Gold)
|
||||
}
|
||||
// listener exp
|
||||
if data.Msg.MainType == string(comm.ModuleUser) &&
|
||||
data.Msg.SubType == "" {
|
||||
//TODO change exp
|
||||
}
|
||||
// if data.Msg.MainType == string(comm.ModuleUser) &&
|
||||
// data.Msg.SubType == "" {
|
||||
//TODO change exp
|
||||
// }
|
||||
|
||||
},
|
||||
})
|
||||
|
@ -29,25 +29,3 @@ func getTaskTagSelect() *widget.Select {
|
||||
return tagSelect
|
||||
}
|
||||
|
||||
// 获取道具类型
|
||||
func getItemTypeSelect() *widget.Select {
|
||||
var tagSelect *widget.Select
|
||||
tagSelect = widget.NewSelect([]string{
|
||||
common.AAP_TESTCASE_FORM_TASK_DAY,
|
||||
common.APP_TESTCASE_FORM_TASK_WEEK,
|
||||
common.APP_TESTCASE_FORM_TASK_ACHIEVE}, func(s string) {
|
||||
switch s {
|
||||
case common.AAP_TESTCASE_FORM_TASK_DAY:
|
||||
tagSelect.Selected = "1"
|
||||
case common.APP_TESTCASE_FORM_TASK_WEEK:
|
||||
tagSelect.Selected = "2"
|
||||
case common.APP_TESTCASE_FORM_TASK_ACHIEVE:
|
||||
tagSelect.Selected = "3"
|
||||
default:
|
||||
tagSelect.Selected = "0"
|
||||
}
|
||||
|
||||
})
|
||||
tagSelect.SetSelectedIndex(0)
|
||||
return tagSelect
|
||||
}
|
||||
|
28
cmd/v2/ui/views/sys_funclist.go
Normal file
28
cmd/v2/ui/views/sys_funclist.go
Normal file
@ -0,0 +1,28 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type SysFuncListView struct {
|
||||
BaseformView
|
||||
}
|
||||
|
||||
func (this *SysFuncListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
this.form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType,
|
||||
t.SubType,
|
||||
&pb.SysFuncListReq{},
|
||||
); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return this.form
|
||||
}
|
@ -32,6 +32,7 @@ const (
|
||||
|
||||
//模块名定义处
|
||||
const (
|
||||
ModuleSys core.M_Modules = "sys" //系统
|
||||
ModuleGate core.M_Modules = "gateway" //gate模块 网关服务模块
|
||||
ModuleWeb core.M_Modules = "web" //后台模块
|
||||
ModuleUser core.M_Modules = "user" //用户模块
|
||||
@ -122,7 +123,8 @@ const (
|
||||
//
|
||||
TableViking = "viking"
|
||||
// 维京远征排行榜
|
||||
TableVikingRank = "vikingrank"
|
||||
TableVikingRank = "vikingrank"
|
||||
TableVikingRankList = "vikingranklist"
|
||||
|
||||
//月之秘境
|
||||
TableMoonfantasy = "moonfantasy"
|
||||
@ -130,8 +132,8 @@ const (
|
||||
//
|
||||
TableHunting = "hunting"
|
||||
// 维京远征排行榜
|
||||
TableHuntingRank = "huntingrank"
|
||||
|
||||
TableHuntingRank = "huntingrank"
|
||||
TableHuntingRankList = "huntingrankList"
|
||||
// 支线剧情任务
|
||||
TableLinestory = "linestory"
|
||||
|
||||
|
@ -126,6 +126,8 @@ type (
|
||||
ResetFriend(uid string)
|
||||
// 获取好友数量
|
||||
GetFriendCount(uid string) int32
|
||||
// 获取好友列表
|
||||
GetFriendList(uid string) []string
|
||||
}
|
||||
|
||||
//聊天系统
|
||||
|
@ -136,7 +136,6 @@ func (this *ServiceBase) Run(mod ...core.IModule) {
|
||||
//添加进程结束信号
|
||||
signal.Notify(c,
|
||||
os.Interrupt, //退出信号 ctrl+c退出
|
||||
os.Kill, //kill 信号
|
||||
syscall.SIGHUP, //终端控制进程结束(终端连接断开)
|
||||
syscall.SIGINT, //用户发送INTR字符(Ctrl+C)触发
|
||||
syscall.SIGTERM, //结束程序(可以被捕获、阻塞或忽略)
|
||||
|
@ -67,3 +67,10 @@ func (this *Friend) GetFriendCount(uid string) (count int32) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Friend) GetFriendList(uid string) (uids []string) {
|
||||
if friend := this.modelFriend.GetFriend(uid); friend != nil {
|
||||
uids = friend.FriendIds
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package hero
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/lego/sys/redis"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
@ -21,16 +20,6 @@ func (this *ModelRecord) Init(service core.IService, module core.IModule, comp c
|
||||
return
|
||||
}
|
||||
|
||||
//获取用户
|
||||
func (this *ModelRecord) getUserSession(uid string) (cuser *pb.CacheUser) {
|
||||
cuser = &pb.CacheUser{}
|
||||
if err := this.Get(uid, cuser); err != nil {
|
||||
log.Errorf("GetUserSession err:%v", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//获取用户通过扩展表
|
||||
func (this *ModelRecord) GetHeroRecord(uid string) (result *pb.DBHeroRecord, err error) {
|
||||
result = &pb.DBHeroRecord{}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package hunting
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
@ -19,6 +20,7 @@ type apiComp struct {
|
||||
service core.IService
|
||||
configure *configureComp
|
||||
module *Hunting
|
||||
friend comm.IFriend
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
@ -32,6 +34,10 @@ func (this *apiComp) Init(service core.IService, module core.IModule, comp core.
|
||||
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleFriend); err != nil {
|
||||
return
|
||||
}
|
||||
this.friend = module.(comm.IFriend)
|
||||
return
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen
|
||||
code = pb.ErrorCode_PagodaNotFound
|
||||
return
|
||||
}
|
||||
if hunting.ChallengeCount > this.module.configure.GetGlobalConf().HuntingNum {
|
||||
if hunting.ChallengeCount > this.module.configure.GetGlobalConf().HuntingNum+hunting.BuyCount {
|
||||
code = pb.ErrorCode_HuntingMaxChallengeCount
|
||||
return
|
||||
}
|
||||
@ -65,7 +65,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen
|
||||
mapData["boss"] = hunting.Boss
|
||||
//hunting.BossTime[] = 0 // todo 耗时
|
||||
mapData["challengeTime"] = hunting.BossTime
|
||||
|
||||
this.module.modulerank.updatehuntingRankList(session, req.Difficulty, req.BossType)
|
||||
}
|
||||
// 耗时校验 当前战斗胜利时间消耗小于之前刷新数据
|
||||
hunting.ChallengeCount++
|
||||
@ -77,15 +77,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen
|
||||
return
|
||||
}
|
||||
|
||||
mapRankData := make(map[string]interface{}, 0)
|
||||
mapRankData["difficulty"] = req.Difficulty
|
||||
mapRankData["bosstype"] = req.BossType
|
||||
mapRankData["uid"] = session.GetUserId()
|
||||
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
|
||||
mapRankData["nickname"] = userinfo.Name
|
||||
mapRankData["lv"] = userinfo.Lv
|
||||
mapRankData["costTime"] = 120
|
||||
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapRankData)
|
||||
for k := range hunting.Boss {
|
||||
hunting.Boss[k] += 1
|
||||
}
|
||||
|
@ -14,15 +14,29 @@ func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.HuntingRan
|
||||
}
|
||||
|
||||
func (this *apiComp) RankList(session comm.IUserSession, req *pb.HuntingRankListReq) (code pb.ErrorCode, data proto.Message) {
|
||||
|
||||
var (
|
||||
ranks []*pb.DBHuntingRank
|
||||
err error
|
||||
)
|
||||
code = this.RankListCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
szRank, err := this.module.modulerank.GetRankData()
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
if !req.Friend {
|
||||
ranks, err = this.module.modulerank.GetRankData(req.BoosType)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
}
|
||||
} else {
|
||||
uids := this.friend.GetFriendList(session.GetUserId())
|
||||
for _, id := range uids {
|
||||
rankData := this.module.modulerank.getHuntingRankListByBossType(id, req.BoosType)
|
||||
if rankData != nil {
|
||||
ranks = append(ranks, rankData)
|
||||
}
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), HuntingRankListResp, &pb.HuntingRankListResp{Ranks: szRank})
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), HuntingRankListResp, &pb.HuntingRankListResp{Ranks: ranks})
|
||||
return
|
||||
}
|
||||
|
@ -3,30 +3,21 @@ package hunting
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/redis"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type ModelRank struct {
|
||||
modules.MCompModel
|
||||
moduleUser *Hunting
|
||||
moduleHunting *Hunting
|
||||
}
|
||||
|
||||
func (this *ModelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.TableName = comm.TableHuntingRank
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.moduleUser = module.(*Hunting)
|
||||
return
|
||||
}
|
||||
|
||||
//获取用户
|
||||
func (this *ModelRank) getUserSession(uid string) (cuser *pb.CacheUser) {
|
||||
cuser = &pb.CacheUser{}
|
||||
if err := this.Get(uid, cuser); err != nil {
|
||||
this.moduleUser.Errorf("GetUserSession err:%v", err)
|
||||
return
|
||||
}
|
||||
this.moduleHunting = module.(*Hunting)
|
||||
return
|
||||
}
|
||||
|
||||
@ -37,27 +28,78 @@ func (this *ModelRank) AddRank(uId string, data *pb.DBHuntingRank) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *ModelRank) GetUserRandData(uid string) (result *pb.DBHuntingRank, err error) {
|
||||
result = &pb.DBHuntingRank{}
|
||||
if err = this.Get(uid, result); err != nil && redis.RedisNil != err {
|
||||
return
|
||||
}
|
||||
err = nil
|
||||
return result, err
|
||||
}
|
||||
|
||||
// 更新排行榜数据
|
||||
func (this *ModelRank) ChangeUserRank(uid string, value map[string]interface{}) (err error) {
|
||||
func (this *ModelRank) ChangeUserRank(uid string, objId string, value map[string]interface{}) (err error) {
|
||||
if len(value) == 0 {
|
||||
return nil
|
||||
}
|
||||
return this.Change(uid, value)
|
||||
return this.ChangeList(uid, objId, value)
|
||||
}
|
||||
|
||||
// 获取排行榜数据
|
||||
func (this *ModelRank) GetRankData() (data []*pb.DBHuntingRank, err error) {
|
||||
func (this *ModelRank) GetRankData(bossType int32) (data []*pb.DBHuntingRank, err error) {
|
||||
tmpdata := make([]*pb.DBHuntingRank, 0)
|
||||
data = make([]*pb.DBHuntingRank, 0)
|
||||
err = this.Redis.LRange(comm.TableHuntingRank, 0, -1, &data) // 0 表示列表的第一个元素 -1 表示列表的最后一个元素
|
||||
|
||||
err = this.Redis.LRange(comm.TableVikingRank, 0, -1, &tmpdata)
|
||||
if err == nil {
|
||||
for _, v := range tmpdata {
|
||||
if v.Bosstype == bossType {
|
||||
data = append(data, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ModelRank) getHuntingRankList(uid string) []*pb.DBHuntingRank {
|
||||
ranks := make([]*pb.DBHuntingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return ranks
|
||||
}
|
||||
|
||||
func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficulty int32, boosType int32) {
|
||||
// 查询是不是更新数据
|
||||
ranks := this.getHuntingRankList(session.GetUserId())
|
||||
bfind := false
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == boosType {
|
||||
mapRankData := make(map[string]interface{}, 0)
|
||||
mapRankData["difficulty"] = difficulty
|
||||
mapRankData["bosstype"] = boosType
|
||||
this.ChangeUserRank(session.GetUserId(), v.Id, mapRankData)
|
||||
bfind = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !bfind {
|
||||
userinfo := this.moduleHunting.ModuleUser.GetUser(session.GetUserId())
|
||||
new := &pb.DBHuntingRank{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: session.GetUserId(),
|
||||
Difficulty: difficulty,
|
||||
Bosstype: boosType,
|
||||
Nickname: userinfo.Name,
|
||||
Icon: "",
|
||||
Lv: userinfo.Lv,
|
||||
CostTime: 111,
|
||||
}
|
||||
this.AddList(session.GetUserId(), new.Id, new)
|
||||
}
|
||||
return
|
||||
}
|
||||
func (this *ModelRank) getHuntingRankListByBossType(uid string, bossType int32) *pb.DBHuntingRank {
|
||||
ranks := make([]*pb.DBHuntingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == bossType {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -20,16 +20,6 @@ func (this *ModelRank) Init(service core.IService, module core.IModule, comp cor
|
||||
return
|
||||
}
|
||||
|
||||
//获取用户
|
||||
func (this *ModelRank) getUserSession(uid string) (cuser *pb.CacheUser) {
|
||||
cuser = &pb.CacheUser{}
|
||||
if err := this.Get(uid, cuser); err != nil {
|
||||
this.moduleUser.Errorf("GetUserSession err:%v", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ModelRank) AddRank(uId string, data *pb.DBPagodaRank) (err error) {
|
||||
if err = this.Add(uId, data); err != nil {
|
||||
//this.Errorf("err:%v", err)
|
||||
|
28
modules/sys/api.go
Normal file
28
modules/sys/api.go
Normal file
@ -0,0 +1,28 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
const (
|
||||
SysSubTypeFunc = "funclist"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
moduleSys *ModuleSys
|
||||
}
|
||||
|
||||
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.MCompGate.Init(service, module, comp, options)
|
||||
this.moduleSys = module.(*ModuleSys)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
return
|
||||
}
|
37
modules/sys/api_func.go
Normal file
37
modules/sys/api_func.go
Normal file
@ -0,0 +1,37 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (this *apiComp) FunclistCheck(session comm.IUserSession, req *pb.SysFuncListReq) (code pb.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Funclist(session comm.IUserSession, req *pb.SysFuncListReq) (code pb.ErrorCode, data proto.Message) {
|
||||
rsp := &pb.SysFuncListResp{}
|
||||
|
||||
iuser := this.moduleSys.ModuleUser
|
||||
user := iuser.GetUser(session.GetUserId())
|
||||
if user == nil {
|
||||
code = pb.ErrorCode_UserSessionNobeing
|
||||
return
|
||||
}
|
||||
|
||||
var funcList []string
|
||||
confList := this.moduleSys.configure.getOpencondList()
|
||||
for _, v := range confList {
|
||||
// 返回未开启的功能列表
|
||||
if user.Lv < v.Main {
|
||||
funcList = append(funcList, v.Id)
|
||||
}
|
||||
}
|
||||
rsp.FuncIds = funcList
|
||||
if err := session.SendMsg(string(this.moduleSys.GetType()), SysSubTypeFunc, rsp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
return
|
||||
}
|
47
modules/sys/config.go
Normal file
47
modules/sys/config.go
Normal file
@ -0,0 +1,47 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
const (
|
||||
gameOpencond = "game_opencond.json"
|
||||
)
|
||||
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
}
|
||||
|
||||
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.LoadConfigure(gameOpencond, cfg.NewGameOpencond)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getOpencondCfg() (data *cfg.GameOpencond, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(gameOpencond); err != nil {
|
||||
return
|
||||
} else {
|
||||
if data, ok = v.(*cfg.GameOpencond); !ok {
|
||||
err = fmt.Errorf("%T no is *cfg.GameOpencond", v)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getOpencondList() (list []*cfg.GameOpencondData) {
|
||||
if cfg, err := this.getOpencondCfg(); err != nil {
|
||||
return nil
|
||||
} else {
|
||||
list = cfg.GetDataList()
|
||||
}
|
||||
return
|
||||
}
|
27
modules/sys/module.go
Normal file
27
modules/sys/module.go
Normal file
@ -0,0 +1,27 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
type ModuleSys struct {
|
||||
modules.ModuleBase
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &ModuleSys{}
|
||||
}
|
||||
|
||||
func (this *ModuleSys) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
func (this *ModuleSys) GetType() core.M_Modules {
|
||||
return comm.ModuleSys
|
||||
}
|
@ -17,12 +17,13 @@ import (
|
||||
type HuntingRank struct {
|
||||
modules.MCompModel
|
||||
service core.IService
|
||||
DbName string
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *HuntingRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
|
||||
this.TableName = comm.TableHuntingRank
|
||||
this.DbName = comm.TableHuntingRank
|
||||
this.TableName = comm.TableHuntingRankList
|
||||
this.MCompModel.Init(service, module, comp, options)
|
||||
this.service = service
|
||||
return
|
||||
@ -38,7 +39,7 @@ func (this *HuntingRank) Start() (err error) {
|
||||
func (this *HuntingRank) Timer() {
|
||||
data := make([]interface{}, 0) // options.Find().SetLimit(comm.MaxRankList)
|
||||
for i := 1; i <= 4; i++ { // boss 类型 1 2 3 4 后面封装 // 时间参数战斗调完后再加进来
|
||||
if _data, err := this.DB.Find(core.SqlTable(this.TableName), bson.M{"bosstype": i}, options.Find().SetSort(bson.M{"difficulty": -1}).SetLimit(comm.MaxRankList)); err == nil {
|
||||
if _data, err := this.DB.Find(core.SqlTable(this.DbName), bson.M{"bosstype": i}, options.Find().SetSort(bson.M{"difficulty": -1}).SetLimit(comm.MaxRankList)); err == nil {
|
||||
for _data.Next(context.TODO()) {
|
||||
temp := &pb.DBHuntingRank{}
|
||||
if err = _data.Decode(temp); err == nil {
|
||||
|
@ -17,12 +17,13 @@ import (
|
||||
type VikingRank struct {
|
||||
modules.MCompModel
|
||||
service core.IService
|
||||
dbName string
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *VikingRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
|
||||
this.TableName = comm.TableVikingRank
|
||||
this.dbName = comm.TableVikingRank
|
||||
this.TableName = comm.TableVikingRankList
|
||||
this.MCompModel.Init(service, module, comp, options)
|
||||
this.service = service
|
||||
return
|
||||
@ -38,7 +39,7 @@ func (this *VikingRank) Start() (err error) {
|
||||
func (this *VikingRank) Timer() {
|
||||
data := make([]interface{}, 0) // options.Find().SetLimit(comm.MaxRankList)
|
||||
for i := 1; i <= 3; i++ { // boss 类型 1 2 3 后面封装 // 时间参数战斗调完后再加进来
|
||||
if _data, err := this.DB.Find(core.SqlTable(this.TableName), bson.M{"bosstype": i}, options.Find().SetSort(bson.M{"difficulty": -1}).SetLimit(comm.MaxRankList)); err == nil {
|
||||
if _data, err := this.DB.Find(core.SqlTable(this.dbName), bson.M{"bosstype": i}, options.Find().SetSort(bson.M{"difficulty": -1}).SetLimit(comm.MaxRankList)); err == nil {
|
||||
for _data.Next(context.TODO()) {
|
||||
temp := &pb.DBVikingRank{}
|
||||
if err = _data.Decode(temp); err == nil {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package viking
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
@ -19,6 +20,7 @@ type apiComp struct {
|
||||
service core.IService
|
||||
configure *configureComp
|
||||
module *Viking
|
||||
friend comm.IFriend
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
@ -32,6 +34,10 @@ func (this *apiComp) Init(service core.IService, module core.IModule, comp core.
|
||||
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleFriend); err != nil {
|
||||
return
|
||||
}
|
||||
this.friend = module.(comm.IFriend)
|
||||
return
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
||||
return
|
||||
}
|
||||
|
||||
if viking.ChallengeCount > this.module.configure.GetGlobalConf().VikingNum {
|
||||
if viking.ChallengeCount > this.module.configure.GetGlobalConf().VikingNum+viking.BuyCount {
|
||||
code = pb.ErrorCode_VikingMaxChallengeCount
|
||||
return
|
||||
}
|
||||
@ -66,7 +66,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
||||
mapData["Boss"] = viking.Boss
|
||||
// viking.ChallengeTime[req.BossType<<16+req.Difficulty] = 0 // todo 耗时
|
||||
// mapData["challengeTime"] = viking.ChallengeTime
|
||||
|
||||
this.module.modulerank.updateVikingRankList(session, req.Difficulty, req.BossType, 100)
|
||||
}
|
||||
// 耗时校验 当前战斗胜利时间消耗小于之前刷新数据
|
||||
|
||||
@ -79,15 +79,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
||||
return
|
||||
}
|
||||
|
||||
mapRankData := make(map[string]interface{}, 0)
|
||||
mapRankData["difficulty"] = req.Difficulty
|
||||
mapRankData["bosstype"] = req.BossType
|
||||
mapRankData["uid"] = session.GetUserId()
|
||||
userinfo := this.module.ModuleUser.GetUser(session.GetUserId())
|
||||
mapRankData["nickname"] = userinfo.Name
|
||||
mapRankData["lv"] = userinfo.Lv
|
||||
mapRankData["costTime"] = 120
|
||||
this.module.modulerank.ChangeUserRank(session.GetUserId(), mapRankData)
|
||||
session.SendMsg(string(this.module.GetType()), VikingChallengeResp, &pb.VikingChallengeResp{Data: viking})
|
||||
return
|
||||
}
|
||||
|
@ -16,15 +16,29 @@ func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.VikingRank
|
||||
}
|
||||
|
||||
func (this *apiComp) RankList(session comm.IUserSession, req *pb.VikingRankListReq) (code pb.ErrorCode, data proto.Message) {
|
||||
|
||||
var (
|
||||
ranks []*pb.DBVikingRank
|
||||
err error
|
||||
)
|
||||
code = this.RankListCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
szRank, err := this.module.modulerank.GetRankData(req.BoosType)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
if !req.Friend {
|
||||
ranks, err = this.module.modulerank.GetRankData(req.BoosType)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
}
|
||||
} else {
|
||||
uids := this.friend.GetFriendList(session.GetUserId())
|
||||
for _, id := range uids {
|
||||
rankData := this.module.modulerank.getVikingRankListByBossType(id, req.BoosType)
|
||||
if rankData != nil {
|
||||
ranks = append(ranks, rankData)
|
||||
}
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), VikingRankListResp, &pb.VikingRankListResp{Ranks: szRank})
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), VikingRankListResp, &pb.VikingRankListResp{Ranks: ranks})
|
||||
return
|
||||
}
|
||||
|
@ -6,30 +6,21 @@ import (
|
||||
"go_dreamfactory/lego/sys/redis"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type ModelRank struct {
|
||||
modules.MCompModel
|
||||
moduleUser *Viking
|
||||
moduleViking *Viking
|
||||
}
|
||||
|
||||
func (this *ModelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.TableName = comm.TableVikingRank
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.moduleUser = module.(*Viking)
|
||||
this.moduleViking = module.(*Viking)
|
||||
return
|
||||
}
|
||||
|
||||
//获取用户
|
||||
func (this *ModelRank) getUserSession(uid string) (cuser *pb.CacheUser) {
|
||||
cuser = &pb.CacheUser{}
|
||||
if err := this.Get(uid, cuser); err != nil {
|
||||
this.moduleUser.Errorf("GetUserSession err:%v", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ModelRank) AddRank(uId string, data *pb.DBVikingRank) (err error) {
|
||||
if err = this.Add(uId, data); err != nil {
|
||||
return
|
||||
@ -47,21 +38,78 @@ func (this *ModelRank) GetUserRandData(uid string) (result *pb.DBVikingRank, err
|
||||
}
|
||||
|
||||
// 更新排行榜数据
|
||||
func (this *ModelRank) ChangeUserRank(uid string, value map[string]interface{}) (err error) {
|
||||
func (this *ModelRank) ChangeUserRank(uid string, objId string, value map[string]interface{}) (err error) {
|
||||
if len(value) == 0 {
|
||||
return nil
|
||||
}
|
||||
return this.Change(uid, value)
|
||||
return this.ChangeList(uid, objId, value)
|
||||
}
|
||||
|
||||
func (this *ModelRank) GetRankData(bossType int32) (data []*pb.DBVikingRank, err error) {
|
||||
tmpdata := make([]*pb.DBVikingRank, 0)
|
||||
data = make([]*pb.DBVikingRank, 0)
|
||||
err = this.Redis.LRange(comm.TableVikingRank, 0, -1, &tmpdata)
|
||||
for _, v := range tmpdata {
|
||||
if v.Bosstype == bossType {
|
||||
data = append(data, v)
|
||||
if err == nil {
|
||||
for _, v := range tmpdata {
|
||||
if v.Bosstype == bossType {
|
||||
data = append(data, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 获取排行榜数据
|
||||
func (this *ModelRank) getVikingRankList(uid string) []*pb.DBVikingRank {
|
||||
ranks := make([]*pb.DBVikingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return ranks
|
||||
}
|
||||
|
||||
func (this *ModelRank) updateVikingRankList(session comm.IUserSession, difficulty int32, boosType int32, costTime int32) {
|
||||
// 查询是不是更新数据
|
||||
ranks := this.getVikingRankList(session.GetUserId())
|
||||
bfind := false
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == boosType {
|
||||
mapRankData := make(map[string]interface{}, 0)
|
||||
mapRankData["difficulty"] = difficulty
|
||||
mapRankData["bosstype"] = boosType
|
||||
this.ChangeUserRank(session.GetUserId(), v.Id, mapRankData)
|
||||
bfind = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !bfind {
|
||||
userinfo := this.moduleViking.ModuleUser.GetUser(session.GetUserId())
|
||||
new := &pb.DBVikingRank{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: session.GetUserId(),
|
||||
Difficulty: difficulty,
|
||||
Bosstype: boosType,
|
||||
Nickname: userinfo.Name,
|
||||
Icon: "",
|
||||
Lv: userinfo.Lv,
|
||||
CostTime: costTime, //
|
||||
}
|
||||
this.AddList(session.GetUserId(), new.Id, new)
|
||||
}
|
||||
return
|
||||
}
|
||||
func (this *ModelRank) getVikingRankListByBossType(uid string, bossType int32) *pb.DBVikingRank {
|
||||
ranks := make([]*pb.DBVikingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == bossType {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -308,6 +308,9 @@ type HuntingRankListReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
BoosType int32 `protobuf:"varint,1,opt,name=boosType,proto3" json:"boosType"` // boss 类型
|
||||
Friend bool `protobuf:"varint,2,opt,name=friend,proto3" json:"friend"` // 是否是好友榜
|
||||
}
|
||||
|
||||
func (x *HuntingRankListReq) Reset() {
|
||||
@ -342,6 +345,20 @@ func (*HuntingRankListReq) Descriptor() ([]byte, []int) {
|
||||
return file_hunting_hunting_msg_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *HuntingRankListReq) GetBoosType() int32 {
|
||||
if x != nil {
|
||||
return x.BoosType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *HuntingRankListReq) GetFriend() bool {
|
||||
if x != nil {
|
||||
return x.Friend
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type HuntingRankListResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@ -414,13 +431,16 @@ var file_hunting_hunting_msg_proto_rawDesc = []byte{
|
||||
0x6e, 0x74, 0x22, 0x30, 0x0a, 0x0e, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04,
|
||||
0x64, 0x61, 0x74, 0x61, 0x22, 0x14, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x3b, 0x0a, 0x13, 0x48, 0x75,
|
||||
0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
|
||||
0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x64, 0x61, 0x74, 0x61, 0x22, 0x48, 0x0a, 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f,
|
||||
0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f,
|
||||
0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x3b,
|
||||
0x0a, 0x13, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e,
|
||||
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
265
pb/library_db.pb.go
Normal file
265
pb/library_db.pb.go
Normal file
@ -0,0 +1,265 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: library/library_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 Fetter struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid"`
|
||||
Lv int32 `protobuf:"varint,2,opt,name=lv,proto3" json:"lv"`
|
||||
}
|
||||
|
||||
func (x *Fetter) Reset() {
|
||||
*x = Fetter{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_db_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Fetter) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Fetter) ProtoMessage() {}
|
||||
|
||||
func (x *Fetter) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_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 Fetter.ProtoReflect.Descriptor instead.
|
||||
func (*Fetter) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_db_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Fetter) GetCid() string {
|
||||
if x != nil {
|
||||
return x.Cid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Fetter) GetLv() int32 {
|
||||
if x != nil {
|
||||
return x.Lv
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type DBLibrary 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
|
||||
Fid int32 `protobuf:"varint,3,opt,name=fid,proto3" json:"fid"`
|
||||
Hero map[int32]int32 `protobuf:"bytes,4,rep,name=hero,proto3" json:"hero" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key: hid value: favorlv
|
||||
Prize bool `protobuf:"varint,5,opt,name=prize,proto3" json:"prize"` //是否领奖
|
||||
Fetterlv int32 `protobuf:"varint,6,opt,name=fetterlv,proto3" json:"fetterlv"` // 当前羁绊等级
|
||||
}
|
||||
|
||||
func (x *DBLibrary) Reset() {
|
||||
*x = DBLibrary{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_db_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBLibrary) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBLibrary) ProtoMessage() {}
|
||||
|
||||
func (x *DBLibrary) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_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 DBLibrary.ProtoReflect.Descriptor instead.
|
||||
func (*DBLibrary) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_db_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *DBLibrary) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBLibrary) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBLibrary) GetFid() int32 {
|
||||
if x != nil {
|
||||
return x.Fid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBLibrary) GetHero() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.Hero
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBLibrary) GetPrize() bool {
|
||||
if x != nil {
|
||||
return x.Prize
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *DBLibrary) GetFetterlv() int32 {
|
||||
if x != nil {
|
||||
return x.Fetterlv
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_library_library_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_library_library_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x18, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72,
|
||||
0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x06, 0x46, 0x65,
|
||||
0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0xd4, 0x01, 0x0a, 0x09, 0x44, 0x42, 0x4c, 0x69, 0x62,
|
||||
0x72, 0x61, 0x72, 0x79, 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, 0x10, 0x0a, 0x03, 0x66, 0x69, 0x64, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x03, 0x66, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x04, 0x68, 0x65, 0x72, 0x6f,
|
||||
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62, 0x72, 0x61,
|
||||
0x72, 0x79, 0x2e, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x68, 0x65,
|
||||
0x72, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x65, 0x74, 0x74,
|
||||
0x65, 0x72, 0x6c, 0x76, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x65, 0x74, 0x74,
|
||||
0x65, 0x72, 0x6c, 0x76, 0x1a, 0x37, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 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 (
|
||||
file_library_library_db_proto_rawDescOnce sync.Once
|
||||
file_library_library_db_proto_rawDescData = file_library_library_db_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_library_library_db_proto_rawDescGZIP() []byte {
|
||||
file_library_library_db_proto_rawDescOnce.Do(func() {
|
||||
file_library_library_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_library_library_db_proto_rawDescData)
|
||||
})
|
||||
return file_library_library_db_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_library_library_db_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_library_library_db_proto_goTypes = []interface{}{
|
||||
(*Fetter)(nil), // 0: Fetter
|
||||
(*DBLibrary)(nil), // 1: DBLibrary
|
||||
nil, // 2: DBLibrary.HeroEntry
|
||||
}
|
||||
var file_library_library_db_proto_depIdxs = []int32{
|
||||
2, // 0: DBLibrary.hero:type_name -> DBLibrary.HeroEntry
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_library_library_db_proto_init() }
|
||||
func file_library_library_db_proto_init() {
|
||||
if File_library_library_db_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_library_library_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Fetter); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_library_library_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBLibrary); 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_library_library_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_library_library_db_proto_goTypes,
|
||||
DependencyIndexes: file_library_library_db_proto_depIdxs,
|
||||
MessageInfos: file_library_library_db_proto_msgTypes,
|
||||
}.Build()
|
||||
File_library_library_db_proto = out.File
|
||||
file_library_library_db_proto_rawDesc = nil
|
||||
file_library_library_db_proto_goTypes = nil
|
||||
file_library_library_db_proto_depIdxs = nil
|
||||
}
|
329
pb/library_msg.pb.go
Normal file
329
pb/library_msg.pb.go
Normal file
@ -0,0 +1,329 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: library/library_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 LibraryGetListReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *LibraryGetListReq) Reset() {
|
||||
*x = LibraryGetListReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_msg_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LibraryGetListReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LibraryGetListReq) ProtoMessage() {}
|
||||
|
||||
func (x *LibraryGetListReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_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 LibraryGetListReq.ProtoReflect.Descriptor instead.
|
||||
func (*LibraryGetListReq) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_msg_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type LibraryGetListResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data []*DBLibrary `protobuf:"bytes,1,rep,name=data,proto3" json:"data"`
|
||||
}
|
||||
|
||||
func (x *LibraryGetListResp) Reset() {
|
||||
*x = LibraryGetListResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_msg_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LibraryGetListResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LibraryGetListResp) ProtoMessage() {}
|
||||
|
||||
func (x *LibraryGetListResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_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 LibraryGetListResp.ProtoReflect.Descriptor instead.
|
||||
func (*LibraryGetListResp) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_msg_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *LibraryGetListResp) GetData() []*DBLibrary {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 领取奖励
|
||||
type LibraryGetRewardReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ObjId string `protobuf:"bytes,1,opt,name=objId,proto3" json:"objId"`
|
||||
}
|
||||
|
||||
func (x *LibraryGetRewardReq) Reset() {
|
||||
*x = LibraryGetRewardReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_msg_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LibraryGetRewardReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LibraryGetRewardReq) ProtoMessage() {}
|
||||
|
||||
func (x *LibraryGetRewardReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_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 LibraryGetRewardReq.ProtoReflect.Descriptor instead.
|
||||
func (*LibraryGetRewardReq) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_msg_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *LibraryGetRewardReq) GetObjId() string {
|
||||
if x != nil {
|
||||
return x.ObjId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type LibraryGetRewardResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data *DBLibrary `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||
}
|
||||
|
||||
func (x *LibraryGetRewardResp) Reset() {
|
||||
*x = LibraryGetRewardResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_msg_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LibraryGetRewardResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LibraryGetRewardResp) ProtoMessage() {}
|
||||
|
||||
func (x *LibraryGetRewardResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_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 LibraryGetRewardResp.ProtoReflect.Descriptor instead.
|
||||
func (*LibraryGetRewardResp) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_msg_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *LibraryGetRewardResp) GetData() *DBLibrary {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_library_library_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_library_library_msg_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72,
|
||||
0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x6c, 0x69, 0x62,
|
||||
0x72, 0x61, 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x64, 0x62, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79,
|
||||
0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x34, 0x0a, 0x12, 0x4c, 0x69,
|
||||
0x62, 0x72, 0x61, 0x72, 0x79, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
|
||||
0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a,
|
||||
0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||
0x22, 0x2b, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65,
|
||||
0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x62, 0x6a, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x62, 0x6a, 0x49, 0x64, 0x22, 0x36, 0x0a,
|
||||
0x14, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72,
|
||||
0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_library_library_msg_proto_rawDescOnce sync.Once
|
||||
file_library_library_msg_proto_rawDescData = file_library_library_msg_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_library_library_msg_proto_rawDescGZIP() []byte {
|
||||
file_library_library_msg_proto_rawDescOnce.Do(func() {
|
||||
file_library_library_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_library_library_msg_proto_rawDescData)
|
||||
})
|
||||
return file_library_library_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_library_library_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_library_library_msg_proto_goTypes = []interface{}{
|
||||
(*LibraryGetListReq)(nil), // 0: LibraryGetListReq
|
||||
(*LibraryGetListResp)(nil), // 1: LibraryGetListResp
|
||||
(*LibraryGetRewardReq)(nil), // 2: LibraryGetRewardReq
|
||||
(*LibraryGetRewardResp)(nil), // 3: LibraryGetRewardResp
|
||||
(*DBLibrary)(nil), // 4: DBLibrary
|
||||
}
|
||||
var file_library_library_msg_proto_depIdxs = []int32{
|
||||
4, // 0: LibraryGetListResp.data:type_name -> DBLibrary
|
||||
4, // 1: LibraryGetRewardResp.data:type_name -> DBLibrary
|
||||
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_library_library_msg_proto_init() }
|
||||
func file_library_library_msg_proto_init() {
|
||||
if File_library_library_msg_proto != nil {
|
||||
return
|
||||
}
|
||||
file_library_library_db_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_library_library_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LibraryGetListReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_library_library_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LibraryGetListResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_library_library_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LibraryGetRewardReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_library_library_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LibraryGetRewardResp); 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_library_library_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_library_library_msg_proto_goTypes,
|
||||
DependencyIndexes: file_library_library_msg_proto_depIdxs,
|
||||
MessageInfos: file_library_library_msg_proto_msgTypes,
|
||||
}.Build()
|
||||
File_library_library_msg_proto = out.File
|
||||
file_library_library_msg_proto_rawDesc = nil
|
||||
file_library_library_msg_proto_goTypes = nil
|
||||
file_library_library_msg_proto_depIdxs = nil
|
||||
}
|
@ -30,7 +30,7 @@ type DBMainline struct {
|
||||
ChapterId int32 `protobuf:"varint,3,opt,name=chapterId,proto3" json:"chapterId" bson:"chapterId"` //章节ID
|
||||
MainlineId int32 `protobuf:"varint,4,opt,name=mainlineId,proto3" json:"mainlineId" bson:"mainlineId"` //主线关卡ID
|
||||
AwaredID int32 `protobuf:"varint,5,opt,name=awaredID,proto3" json:"awaredID" bson:"awaredID"` //是否领奖(设置int是考虑后续扩展有多个宝箱情况)
|
||||
BranchID []int32 `protobuf:"varint,6,rep,packed,name=branchID,proto3" json:"branchID" bson:"branchID"` // 记录分支通关的情况
|
||||
BranchID []int32 `protobuf:"varint,6,rep,packed,name=branchID,proto3" json:"branchID" bson:"branchID"` //
|
||||
Intensity int32 `protobuf:"varint,7,opt,name=intensity,proto3" json:"intensity"` // 难度
|
||||
}
|
||||
|
||||
|
194
pb/sys_msg.pb.go
Normal file
194
pb/sys_msg.pb.go
Normal file
@ -0,0 +1,194 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: sys/sys_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 SysFuncListReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *SysFuncListReq) Reset() {
|
||||
*x = SysFuncListReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_sys_sys_msg_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SysFuncListReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SysFuncListReq) ProtoMessage() {}
|
||||
|
||||
func (x *SysFuncListReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sys_sys_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 SysFuncListReq.ProtoReflect.Descriptor instead.
|
||||
func (*SysFuncListReq) Descriptor() ([]byte, []int) {
|
||||
return file_sys_sys_msg_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type SysFuncListResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
FuncIds []string `protobuf:"bytes,1,rep,name=funcIds,proto3" json:"funcIds"` //功能ID
|
||||
}
|
||||
|
||||
func (x *SysFuncListResp) Reset() {
|
||||
*x = SysFuncListResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_sys_sys_msg_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SysFuncListResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SysFuncListResp) ProtoMessage() {}
|
||||
|
||||
func (x *SysFuncListResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sys_sys_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 SysFuncListResp.ProtoReflect.Descriptor instead.
|
||||
func (*SysFuncListResp) Descriptor() ([]byte, []int) {
|
||||
return file_sys_sys_msg_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SysFuncListResp) GetFuncIds() []string {
|
||||
if x != nil {
|
||||
return x.FuncIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_sys_sys_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_sys_sys_msg_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x73, 0x79, 0x73, 0x2f, 0x73, 0x79, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x79, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x2b, 0x0a, 0x0f, 0x53, 0x79, 0x73, 0x46, 0x75, 0x6e, 0x63,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x75, 0x6e, 0x63,
|
||||
0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x75, 0x6e, 0x63, 0x49,
|
||||
0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_sys_sys_msg_proto_rawDescOnce sync.Once
|
||||
file_sys_sys_msg_proto_rawDescData = file_sys_sys_msg_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_sys_sys_msg_proto_rawDescGZIP() []byte {
|
||||
file_sys_sys_msg_proto_rawDescOnce.Do(func() {
|
||||
file_sys_sys_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_sys_sys_msg_proto_rawDescData)
|
||||
})
|
||||
return file_sys_sys_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_sys_sys_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_sys_sys_msg_proto_goTypes = []interface{}{
|
||||
(*SysFuncListReq)(nil), // 0: SysFuncListReq
|
||||
(*SysFuncListResp)(nil), // 1: SysFuncListResp
|
||||
}
|
||||
var file_sys_sys_msg_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
|
||||
}
|
||||
|
||||
func init() { file_sys_sys_msg_proto_init() }
|
||||
func file_sys_sys_msg_proto_init() {
|
||||
if File_sys_sys_msg_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_sys_sys_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SysFuncListReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_sys_sys_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SysFuncListResp); 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_sys_sys_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_sys_sys_msg_proto_goTypes,
|
||||
DependencyIndexes: file_sys_sys_msg_proto_depIdxs,
|
||||
MessageInfos: file_sys_sys_msg_proto_msgTypes,
|
||||
}.Build()
|
||||
File_sys_sys_msg_proto = out.File
|
||||
file_sys_sys_msg_proto_rawDesc = nil
|
||||
file_sys_sys_msg_proto_goTypes = nil
|
||||
file_sys_sys_msg_proto_depIdxs = nil
|
||||
}
|
@ -23,6 +23,7 @@ import (
|
||||
"go_dreamfactory/modules/rtask"
|
||||
"go_dreamfactory/modules/shop"
|
||||
"go_dreamfactory/modules/smithy"
|
||||
"go_dreamfactory/modules/sys"
|
||||
"go_dreamfactory/modules/task"
|
||||
"go_dreamfactory/modules/user"
|
||||
"go_dreamfactory/modules/viking"
|
||||
@ -56,6 +57,7 @@ func main() {
|
||||
services.NewGateRouteComp(), //此服务需要接受用户的消息 需要装备网关组件
|
||||
)
|
||||
lego.Run(s, //运行模块
|
||||
sys.NewModule(),
|
||||
user.NewModule(),
|
||||
items.NewModule(),
|
||||
mail.NewModule(),
|
||||
|
Loading…
Reference in New Issue
Block a user