From 58e8c2f7fd237f02f1909040330a50baa1b01fd7 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 29 Sep 2022 14:57:49 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/upgrade/main.go | 6 ++++ cmd/v2/FyneApp.toml | 4 +-- cmd/v2/build.bat | 7 ++-- cmd/v2/ui/about.go | 8 ++++- cmd/v2/ui/tip.go | 2 +- cmd/v2/ui/tool_gen.go | 9 ++++-- cmd/v2/ui/tool_term.go | 72 ++++++++++++++++++++++++++++-------------- 7 files changed, 76 insertions(+), 32 deletions(-) diff --git a/cmd/upgrade/main.go b/cmd/upgrade/main.go index 687b52f26..4d8eb2ee5 100644 --- a/cmd/upgrade/main.go +++ b/cmd/upgrade/main.go @@ -10,6 +10,7 @@ import ( "log" "net/http" "path" + "sort" "strings" "time" @@ -115,6 +116,11 @@ func main() { // } } + // 排序 + sort.SliceStable(dirs, func(i, j int) bool { + return dirs[i].DateTime > dirs[j].DateTime + }) + c.JSON(http.StatusOK, gin.H{ "dirs": dirs, }) diff --git a/cmd/v2/FyneApp.toml b/cmd/v2/FyneApp.toml index 4c5ddd5c0..5642e3312 100644 --- a/cmd/v2/FyneApp.toml +++ b/cmd/v2/FyneApp.toml @@ -4,5 +4,5 @@ Website = "http://legu.cc" Icon = "app.png" Name = "RobotGUI" ID = "cc.legu.app" - Version = "1.0.11" - Build = 14 + Version = "1.0.12" + Build = 15 diff --git a/cmd/v2/build.bat b/cmd/v2/build.bat index a6ba0569f..176f17f9c 100644 --- a/cmd/v2/build.bat +++ b/cmd/v2/build.bat @@ -1,4 +1,7 @@ @echo off -rem build desktop -go build -ldflags -H=windowsgui -o robot.exe \ No newline at end of file +set input=%1% + +echo build version:%input% + +fyne package --name RobotGUI-%input% -os windows \ No newline at end of file diff --git a/cmd/v2/ui/about.go b/cmd/v2/ui/about.go index ee270ea33..09646cdca 100644 --- a/cmd/v2/ui/about.go +++ b/cmd/v2/ui/about.go @@ -2,7 +2,10 @@ package ui import ( "go_dreamfactory/cmd/v2/lib/common" + "net/url" + "fyne.io/fyne/v2" + "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/widget" ) @@ -14,12 +17,15 @@ type about struct { func newAbout() *about { var a about ver := toolWin.app.Metadata().Version + link, _ := url.Parse("http://10.0.0.9:8080") + wlink := widget.NewHyperlinkWithStyle("更新包", link, fyne.TextAlignLeading, fyne.TextStyle{}) content := widget.NewCard("", "", widget.NewRichTextFromMarkdown( ` 梦工厂项目辅助工具GUI @v`+ver, )) - a.aboutDialog = dialog.NewCustom(common.APP_ABOUT_TITLE, common.APP_ABOUT_CONFIRM, content, toolWin.w) + a.aboutDialog = dialog.NewCustom(common.APP_ABOUT_TITLE, common.APP_ABOUT_CONFIRM, + container.NewVBox(content, wlink), toolWin.w) return &a } diff --git a/cmd/v2/ui/tip.go b/cmd/v2/ui/tip.go index 763e0428f..89ad4236c 100644 --- a/cmd/v2/ui/tip.go +++ b/cmd/v2/ui/tip.go @@ -17,7 +17,7 @@ func showTip(content string) { w.Show() go func() { - time.Sleep(time.Second * 2) + time.Sleep(time.Millisecond * 1500) w.Close() }() } diff --git a/cmd/v2/ui/tool_gen.go b/cmd/v2/ui/tool_gen.go index fd007ceaa..fb56b230f 100644 --- a/cmd/v2/ui/tool_gen.go +++ b/cmd/v2/ui/tool_gen.go @@ -397,6 +397,7 @@ type fileList struct { titleLabel *widget.Label cachedList List itemList *widget.List + searchItem []Item //用于暂存搜索结果 } func NewFileList() *fileList { @@ -450,7 +451,7 @@ func (f *fileList) addItem(val string) { newItem := Item{ Text: val, Quantity: 1, - Checked: true, //默认选中 + Checked: false, //默认不选中 } f.cachedList.Items = append(f.cachedList.Items, newItem) sort.Sort(f.cachedList) @@ -480,11 +481,13 @@ func (f *fileList) loadItem(dirPath string) { for _, file := range files { if !file.IsDir() { f.addItem(file.Name()) - f.selItemIds = append(f.selItemIds, file.Name()) + // f.selItemIds = append(f.selItemIds, file.Name()) f.fileTotal++ - logrus.Debugf("%v", file.Name()) + // logrus.Debugf("%v", file.Name()) } } + + f.searchItem = f.cachedList.Items } // 改变列表项目 diff --git a/cmd/v2/ui/tool_term.go b/cmd/v2/ui/tool_term.go index 548520062..d6f22914a 100644 --- a/cmd/v2/ui/tool_term.go +++ b/cmd/v2/ui/tool_term.go @@ -8,12 +8,11 @@ import ( "go_dreamfactory/cmd/v2/service" "go_dreamfactory/cmd/v2/service/observer" "image/color" - "math/rand" "os/exec" "path/filepath" "runtime" + "strings" "sync" - "time" "fyne.io/fyne/v2" "fyne.io/fyne/v2/canvas" @@ -112,6 +111,16 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { jsonDir := widget.NewEntry() jsonDir.PlaceHolder = "Json目录" + svnForm := widget.NewForm( + &widget.FormItem{Text: "服务地址", Widget: lubanAddr}, + &widget.FormItem{Text: "工作目录", Widget: container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { + openFolder(workDir) + }), workDir)}, + &widget.FormItem{Text: "LubanCli", Widget: lubanCli}, + &widget.FormItem{Text: "Data目录", Widget: dataDir}, + &widget.FormItem{Text: "JSON目录", Widget: jsonDir}, + ) + //set input entry if sshConf != nil { ip.Text = sshConf.Ip @@ -128,18 +137,11 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { jsonDir.Text = sshConf.JsonDir } - svnForm := widget.NewForm( - &widget.FormItem{Text: "服务地址", Widget: lubanAddr}, - &widget.FormItem{Text: "工作目录", Widget: container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { - openFolder(workDir) - }), workDir)}, - &widget.FormItem{Text: "LubanCli", Widget: lubanCli}, - &widget.FormItem{Text: "Data目录", Widget: dataDir}, - &widget.FormItem{Text: "JSON目录", Widget: jsonDir}, - ) - - // 非明文显示 + // 解决文本没显示的问题 passwordItem.Widget.Refresh() + ip.Refresh() + localDir.Refresh() + workDir.Refresh() // save func saveFunc := func() { @@ -171,6 +173,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { refreshBtn := &widget.Button{Text: "刷新", Icon: theme.ViewRefreshIcon()} svnBtn := &widget.Button{Text: "SVN更新", Icon: theme.ConfirmIcon()} explorBtn := &widget.Button{Text: "资源管理器", Icon: theme.FolderIcon()} + searchEntry := widget.NewEntry() // 全选/全取消 allSelBtn := &widget.Button{Icon: theme.CheckButtonCheckedIcon()} @@ -226,25 +229,26 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { disConnBtn.Enable() syncBtn.Enable() this.upProgress.Hide() - allCancelBtn.Hide() - allSelBtn.Show() + allCancelBtn.Show() + allSelBtn.Hide() refreshBtn.Enable() } } // 刷新JSON列表 refreshBtn.Disable() - refreshBtn.OnTapped = func() { + reloadItem := func() { defer func() { syncBtn.Enable() - allSelBtn.Show() - allCancelBtn.Hide() + allSelBtn.Hide() + allCancelBtn.Show() }() this.jsonList.loadItem(localDir.Text) } + refreshBtn.OnTapped = reloadItem - disConnBtn.Disable() // 断开 + disConnBtn.Disable() disConnBtn.OnTapped = func() { defer func() { this.jsonList.reset() @@ -302,7 +306,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { * 服务地址:10.0.1.11 (保持一致) * 工作目录:svn下ExcelFile目录全路径 * LubanCli:Luban.Client\Luban.Client.exe (保持一致) - * Datas:Datas(保持一致) + * Data目录:Datas(保持一致) * JSON目录:output\json(保持一致) * 全部填写完点击【保存配置】 * 点击【SVN更新】生成json文件 @@ -344,7 +348,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { for _, fileName := range this.jsonList.selItemIds { this.endProgress.Add(1) go func(fn string) { - time.Sleep(time.Second * time.Duration(rand.Intn(3))) + // time.Sleep(time.Second * time.Duration(rand.Intn(3))) if err := this.sshService.ScpCopy(filepath.Join(localDir.Text, fn), remoteDir.Text); err != nil { logrus.WithField("err", err).Error("同步json") showTip(err.Error()) @@ -352,6 +356,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { increment(&this.endProgress) // 移除已上传的 this.jsonList.deleteItem(fn) + showTip(fmt.Sprintf("%s 成功上传", fn)) }(fileName) } this.endProgress.Wait() @@ -398,6 +403,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { } this.jsonList.itemList.Refresh() } + // 全选 allSelBtn.OnTapped = func() { defer func() { @@ -409,10 +415,28 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { this.jsonList.cachedList.Items[i].Checked = false this.jsonList.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - // this.jsonList.changeFileCount() this.jsonList.itemList.Refresh() } + // 搜索 + searchEntry.PlaceHolder = "搜索" + searchEntry.OnChanged = func(s string) { + if s == "" { + reloadItem() + } else { + // go func() { + newList := []Item{} + for _, v := range this.jsonList.searchItem { + if strings.Contains(v.Text, s) { + newList = append(newList, v) + } + } + this.jsonList.cachedList.Items = newList + this.jsonList.itemList.Refresh() + // }() + } + } + // 创建json列表 this.jsonList.itemList = this.jsonList.createList() @@ -420,7 +444,9 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { btns2 := container.NewHBox(helpBtn2, &layout.Spacer{}, saveBtn2, svnBtn) split := container.NewHSplit(container.NewVBox(canvas.NewText("---只能在非上产环境!!!同步Json的操作仅限于数值热更,非结构热更---", color.RGBA{255, 0, 0, 255}), configForm, - btns1, svnForm, btns2, this.cProgress), container.NewBorder(container.NewHBox(allCancelBtn, allSelBtn, syncBtn, refreshBtn, explorBtn), nil, nil, nil, this.jsonList.itemList)) + btns1, svnForm, btns2, this.cProgress), container.NewBorder( + container.NewBorder(nil, nil, container.NewHBox(allCancelBtn, allSelBtn, syncBtn, refreshBtn), container.NewHBox(explorBtn), searchEntry), + nil, nil, nil, this.jsonList.itemList)) split.Offset = 0.45 content.Objects = append(content.Objects, container.NewBorder(nil, this.upProgress, nil, nil, split)) From 7f7b5492745b8aafe4f590283362a7b6c2bd3a70 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 29 Sep 2022 14:57:59 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/chat/module.go | 6 ++++-- modules/rtask/module.go | 34 +++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/modules/chat/module.go b/modules/chat/module.go index 0cb723dee..03ced0fa3 100644 --- a/modules/chat/module.go +++ b/modules/chat/module.go @@ -7,6 +7,7 @@ import ( "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/event" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/utils/codec/json" "go_dreamfactory/modules" "go_dreamfactory/pb" @@ -74,8 +75,9 @@ func (this *Chat) OnInstallComp() { //Event------------------------------------------------------------------------------------------------------------ func (this *Chat) EventUserOffline(session comm.IUserSession) { - err := this.modelChat.RemoveCrossChannelMember(session) - this.Debugf("EventUserOffline:%s err:%v", session, err) + if err := this.modelChat.RemoveCrossChannelMember(session); err != nil { + this.Debug("EventUserOffline:", log.Field{"uid", session.GetUserId()}, log.Field{"err", err}) + } } //对外接口---------------------------------------------------------------------------------------------------------- diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 09cf773b2..f81979804 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -195,12 +195,11 @@ func (this *ModuleRtask) initRtaskVerifyHandle() { } func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.TaskType, params ...int32) (code pb.ErrorCode) { - this.Debugf("receive Rtask %v params: %v", rtaskType, params) + this.Debug("任务事件触发", log.Field{"uid", session.GetUserId()}, log.Field{"taskType", rtaskType}, log.Field{"params", params}) var ( err error condiId int32 - // condi *rtaskCondi - condis []*rtaskCondi + condis []*rtaskCondi ) user := this.ModuleUser.GetUser(session.GetUserId()) @@ -210,18 +209,24 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T } for _, codi := range this.configure.getRtaskCondis(int32(rtaskType)) { - if v, ok := this.handleMap[codi.Id]; ok { - if v.find == nil { - return - } - if condiId, err = v.find(v.cfg, params...); condiId == 0 { - if err != nil { - this.Error(err.Error()) - } - } else { - condis = append(condis, v) - } + v, ok := this.handleMap[codi.Id] + if !ok { + this.Warn("未注册事件处理器", log.Field{"uid", session.GetUserId()}, log.Field{"condiId", codi.Id}) + code = pb.ErrorCode_RtaskCondiNoFound + return } + + if v.find == nil { + return + } + if condiId, err = v.find(v.cfg, params...); condiId == 0 { + if err != nil { + this.Error(err.Error()) + } + } else { + condis = append(condis, v) + } + } // update @@ -233,7 +238,6 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T code = pb.ErrorCode_DBError } } - } } From f00ecaab68490fcd7fd0da835cb0e2c95e0ad715 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Sat, 8 Oct 2022 11:03:35 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/FyneApp.toml | 4 +- cmd/v2/lib/common/lang.go | 2 + cmd/v2/lib/common/utils.go | 39 ++++ cmd/v2/lib/common/utils_test.go | 6 + cmd/v2/main.go | 4 +- cmd/v2/model/ssh.go | 5 + cmd/v2/service/sshService.go | 86 ++++++++ cmd/v2/service/ssh_test.go | 29 +++ cmd/v2/ui/app_monitor.go | 2 +- cmd/v2/ui/list.go | 9 +- cmd/v2/ui/mainwindow.go | 17 +- cmd/v2/ui/tip.go | 16 ++ cmd/v2/ui/tool_gen.go | 81 ++++++- cmd/v2/ui/tool_pb.go | 69 +++--- cmd/v2/ui/tool_term.go | 372 ++++++++++++++++++++++++++++---- cmd/v2/ui/toolwindow.go | 3 +- cmd/v2/ui/toy_userinfo.go | 26 ++- 17 files changed, 667 insertions(+), 103 deletions(-) diff --git a/cmd/v2/FyneApp.toml b/cmd/v2/FyneApp.toml index 5642e3312..4bb08fb2d 100644 --- a/cmd/v2/FyneApp.toml +++ b/cmd/v2/FyneApp.toml @@ -4,5 +4,5 @@ Website = "http://legu.cc" Icon = "app.png" Name = "RobotGUI" ID = "cc.legu.app" - Version = "1.0.12" - Build = 15 + Version = "1.0.13" + Build = 16 diff --git a/cmd/v2/lib/common/lang.go b/cmd/v2/lib/common/lang.go index d0d04273a..bb0f3ed4b 100644 --- a/cmd/v2/lib/common/lang.go +++ b/cmd/v2/lib/common/lang.go @@ -172,4 +172,6 @@ const ( USERINFO_MODINAME = "免费改名次数" USERINFO_ACTIVE_DAY = "日活" USERINFO_ACTIVE_WEEK = "周活" + USERINFO_CREATETM = "创建" + USERINFO_UPDATETM = "更新" ) diff --git a/cmd/v2/lib/common/utils.go b/cmd/v2/lib/common/utils.go index 4f6bf4c1d..b524d658e 100644 --- a/cmd/v2/lib/common/utils.go +++ b/cmd/v2/lib/common/utils.go @@ -4,8 +4,10 @@ import ( "bytes" "encoding/json" "io" + "math" "os" "path/filepath" + "strconv" "strings" "github.com/sirupsen/logrus" @@ -117,3 +119,40 @@ func RemoveContents(dir string) error { } return nil } + +func ConvertFileSize(size int64) string { + if size == 0 { + return "0" + } + + kb := float64(size) / float64(1024) + + if kb < 1024 { + f := math.Ceil(kb) + return strconv.Itoa(int(f)) + " KB" + } + + mb := kb / float64(1024) + if mb < 1024 { + f := math.Ceil(mb) + return strconv.Itoa(int(f)) + " MB" + } + + gb := mb / float64(1024) + if gb < 1024 { + f := math.Ceil(mb) + return strconv.Itoa(int(f)) + " G" + } + + t := gb / float64(1024) + if t < 1024 { + f := math.Ceil(mb) + return strconv.Itoa(int(f)) + " T" + } + + if t >= 1024 { + return "VeryBig" + } + + return "0" +} diff --git a/cmd/v2/lib/common/utils_test.go b/cmd/v2/lib/common/utils_test.go index a43bfde6b..5184da103 100644 --- a/cmd/v2/lib/common/utils_test.go +++ b/cmd/v2/lib/common/utils_test.go @@ -10,3 +10,9 @@ func TestSubStr(t *testing.T) { r := SubStr(str, 20, len(str)) fmt.Println(r) } + +func TestConver(t *testing.T) { + + s := ConvertFileSize(25325466) + fmt.Println(s) +} diff --git a/cmd/v2/main.go b/cmd/v2/main.go index b6e45c4a9..71d718cd1 100644 --- a/cmd/v2/main.go +++ b/cmd/v2/main.go @@ -81,12 +81,12 @@ func main() { w.SetContent(container.NewGridWithColumns(2, widget.NewButton("工具", func() { toolWindow := ui.NewToolWindow(appUI, w) - toolWindow.CreateWindow(common.APP_NAME, 1366, 768, true) + toolWindow.CreateWindow(common.APP_NAME, 1499, 800, true) w.Hide() }), widget.NewButton("登服", func() { mainWindow := ui.NewMainWindow(appUI, w) - mainWindow.CreateWindow(common.APP_NAME, 1366, 768, true) + mainWindow.CreateWindow(common.APP_NAME, 1499, 800, true) w.Hide() }))) w.SetFixedSize(true) diff --git a/cmd/v2/model/ssh.go b/cmd/v2/model/ssh.go index 989262c9b..5c4229e13 100644 --- a/cmd/v2/model/ssh.go +++ b/cmd/v2/model/ssh.go @@ -13,4 +13,9 @@ type SSHModel struct { LubanCli string DataDir string JsonDir string + + // + SaveDir string //保存目录 + LogDir string //远程日志目录 + Editor string //编辑器 } diff --git a/cmd/v2/service/sshService.go b/cmd/v2/service/sshService.go index 532d3ab42..8c8d90d69 100644 --- a/cmd/v2/service/sshService.go +++ b/cmd/v2/service/sshService.go @@ -2,6 +2,8 @@ package service import ( "fmt" + "io" + "io/fs" "io/ioutil" "log" "net" @@ -281,7 +283,91 @@ func (ss *SSHService) Scp(targetDir, srcFileName string) (int, error) { return n, nil } +//Download +func (ss *SSHService) ScpDownload(localDir, remoteFilePath string) error { + sftpCli, err = ss.getSftp() + if err != nil { + return fmt.Errorf("new sftp client error: %w", err) + } + + remoteFile, err := sftpCli.Open(remoteFilePath) + if err != nil { + log.Println("scpCopy:", err) + return err + } + defer remoteFile.Close() + + fileName := path.Base(remoteFile.Name()) + + if err := os.MkdirAll(localDir, fs.ModePerm); err != nil { + return err + } + + target, err := os.OpenFile(localDir+fileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fs.ModePerm) + if err != nil { + return fmt.Errorf("open local file error: %w", err) + } + defer target.Close() + + _, err = io.Copy(target, remoteFile) + if err != nil { + return fmt.Errorf("write file error: %w", err) + } + return nil +} + +func (ss *SSHService) GetRemoteDir(remoteDir string) (files []File, err error) { + sftpCli, err = ss.getSftp() + if err != nil { + return nil, fmt.Errorf("new sftp client error: %w", err) + } + + remoteFiles, err := sftpCli.ReadDir(remoteDir) + if err != nil { + log.Println("read remote Dir:", err) + return nil, err + } + + for _, f := range remoteFiles { + fi := File{ + FileName: f.Name(), + FilePath: filepath.Join(remoteDir, f.Name()), + Size: f.Size(), + } + files = append(files, fi) + // logrus.WithFields(logrus.Fields{"name": f.Name(), "size": f.Size()}).Debug("远程日志文件") + } + return +} + +func (ss *SSHService) BatchScpDownload(localDir, remoteDir string) error { + sftpCli, err = ss.getSftp() + if err != nil { + return fmt.Errorf("new sftp client error: %w", err) + } + + remoteFiles, err := sftpCli.ReadDir(remoteDir) + if err != nil { + log.Println("read remote Dir:", err) + return err + } + + for _, f := range remoteFiles { + if err := ss.ScpDownload(localDir, filepath.Join(remoteDir, f.Name())); err != nil { + return err + } + } + + return nil +} + type CopyFiles struct { Dir string FileName string } + +type File struct { + FileName string + FilePath string + Size int64 +} diff --git a/cmd/v2/service/ssh_test.go b/cmd/v2/service/ssh_test.go index 86a1b264a..8674219b8 100644 --- a/cmd/v2/service/ssh_test.go +++ b/cmd/v2/service/ssh_test.go @@ -2,6 +2,7 @@ package service import ( "fmt" + "log" "path" "path/filepath" "testing" @@ -56,3 +57,31 @@ func TestMath(t *testing.T) { a := float64(10) / float64(3) fmt.Println(a) } + +func TestScpDown(t *testing.T) { + ciphers := []string{} + ssh := &SSHService{} + + err := ssh.Connect(username, password, ip, "", port, ciphers) + if err != nil { + t.Fatal(err) + } + + sftpCli, err = ssh.getSftp() + if err != nil { + fmt.Errorf("new sftp client error: %w", err) + } + + remoteFiles, err := sftpCli.ReadDir("/home/liwei/go_dreamfactory/bin/log") + if err != nil { + log.Println("scpCopy:", err) + } + + for _, v := range remoteFiles { + fmt.Println(v.Name()) + if err := ssh.ScpDownload("G:/log/", "/home/liwei/go_dreamfactory/bin/log/"+v.Name()); err != nil { + fmt.Println(err) + } + } + +} diff --git a/cmd/v2/ui/app_monitor.go b/cmd/v2/ui/app_monitor.go index c840a1d6e..c21e3a06b 100644 --- a/cmd/v2/ui/app_monitor.go +++ b/cmd/v2/ui/app_monitor.go @@ -78,7 +78,7 @@ func (this *appMonitor) Run() { data := d.(*model.PushModel) this.monitorData.DataList = append(this.monitorData.DataList, data) this.reloadMonitorData() - showTip("收到新的数据推送,请打开[监控]页面") + showCanvasTip("收到新的数据推送,请打开[推送]页面") }, }) } diff --git a/cmd/v2/ui/list.go b/cmd/v2/ui/list.go index 722600133..849ed31e3 100644 --- a/cmd/v2/ui/list.go +++ b/cmd/v2/ui/list.go @@ -57,10 +57,11 @@ func (l List) Less(i, j int) bool { } type Item struct { - Title string `json:"title"` - Text string `json:"text"` - Quantity int `json:"quantity"` - Checked bool `json:"checked"` + Title string `json:"title"` + Text string `json:"text"` + Quantity int `json:"quantity"` + Checked bool `json:"checked"` + Size int64 `json:"size"` } func NewList(name string) List { diff --git a/cmd/v2/ui/mainwindow.go b/cmd/v2/ui/mainwindow.go index 4c1a1a9c9..0c7b7eba7 100644 --- a/cmd/v2/ui/mainwindow.go +++ b/cmd/v2/ui/mainwindow.go @@ -1,6 +1,7 @@ package ui import ( + "errors" "fmt" "go_dreamfactory/cmd/v2/lib/common" "go_dreamfactory/cmd/v2/service" @@ -107,7 +108,7 @@ func (ui *MainWindowImpl) SetStatusMsg(msg string) { } func (ui *MainWindowImpl) quiteHandle() { - dialog.ShowConfirm("推出系统", "确定退出吗", func(b bool) { + dialog.ShowConfirm("提示", "确定退出吗", func(b bool) { if !b { return } @@ -265,6 +266,20 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) { // create role ui.createRoleWindowPopUp() } + } else if msg.MainType == "notify" && msg.SubType == "errornotify" { + push := &pb.NotifyErrorNotifyPush{} + if !comm.ProtoUnmarshal(msg, push) { + logrus.Error("unmarsh err") + return + } + + if push.Code == pb.ErrorCode_UserLogined { + cf := dialog.NewError(errors.New("【"+account.Text+"】账号已在其它终端登录,退出重新登录"), ui.w) + cf.SetOnClosed(func() { + ui.app.Quit() + }) + cf.Show() + } } }, }) diff --git a/cmd/v2/ui/tip.go b/cmd/v2/ui/tip.go index 89ad4236c..13b16a040 100644 --- a/cmd/v2/ui/tip.go +++ b/cmd/v2/ui/tip.go @@ -1,9 +1,11 @@ package ui import ( + "image/color" "time" "fyne.io/fyne/v2" + "fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/driver/desktop" "fyne.io/fyne/v2/widget" ) @@ -22,3 +24,17 @@ func showTip(content string) { }() } } + +func showCanvasTip(content string) { + drv := fyne.CurrentApp().Driver() + if drv, ok := drv.(desktop.Driver); ok { + w := drv.CreateSplashWindow() + w.SetContent(canvas.NewText(content, color.RGBA{255, 0, 0, 255})) + w.Show() + + go func() { + time.Sleep(time.Millisecond * 1500) + w.Close() + }() + } +} diff --git a/cmd/v2/ui/tool_gen.go b/cmd/v2/ui/tool_gen.go index fb56b230f..177db34b2 100644 --- a/cmd/v2/ui/tool_gen.go +++ b/cmd/v2/ui/tool_gen.go @@ -100,17 +100,17 @@ func (this *appGen) LazyInit(obs observer.Observer) error { form := widget.NewForm( widget.NewFormItem("服务地址", serverAddr), widget.NewFormItem("项目目录", container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { - openFolder(projectDir) + openFolder(projectDir, toolWin.w) }), projectDir)), widget.NewFormItem("工作目录", container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { - openFolder(workDir) + openFolder(workDir, toolWin.w) }), workDir)), widget.NewFormItem("LuBan Cli", client), widget.NewFormItem("输入目录", inputDir), widget.NewFormItem("输出Code目录", outputCodeDir), widget.NewFormItem("输出JSON目录", outputJsonDir), widget.NewFormItem("临时目录", container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { - openFolder(tmpDir) + openFolder(tmpDir, toolWin.w) }), tmpDir)), widget.NewFormItem("生成类型", genType), ) @@ -151,7 +151,7 @@ func (this *appGen) LazyInit(obs observer.Observer) error { this.goList.titleLabel = widget.NewLabel("Go文件") this.goList.titleLabel.Hide() // 复选列表 - this.goList.itemList = this.goList.createList() + this.goList.itemList = this.goList.CreateDefaultList() // 覆盖 -go go_allSelBtn := &widget.Button{Icon: theme.CheckButtonIcon()} @@ -216,7 +216,7 @@ func (this *appGen) LazyInit(obs observer.Observer) error { this.jsonList.titleLabel = widget.NewLabel("Json文件") this.jsonList.titleLabel.Hide() // 复选列表 - this.jsonList.itemList = this.jsonList.createList() + this.jsonList.itemList = this.jsonList.CreateDefaultList() // 覆盖 -go json_allSelBtn := &widget.Button{Icon: theme.CheckButtonIcon()} @@ -375,14 +375,14 @@ func (this *appGen) LazyInit(obs observer.Observer) error { } // 打开目录 -func openFolder(entry *widget.Entry) { +func openFolder(entry *widget.Entry, w fyne.Window) { dConf := dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) { if lu == nil { return } entry.Text = lu.Path() entry.Refresh() - }, toolWin.w) + }, w) luri, _ := storage.ListerForURI(storage.NewFileURI(".")) dConf.SetLocation(luri) dConf.SetConfirmText("打开") @@ -391,6 +391,21 @@ func openFolder(entry *widget.Entry) { dConf.Show() } +func openFile(entry *widget.Entry, w fyne.Window) { + dConf := dialog.NewFileOpen(func(lu fyne.URIReadCloser, err error) { + if lu == nil { + return + } + entry.SetText(lu.URI().Path()) + entry.Refresh() + }, w) + dConf.SetConfirmText("打开") + dConf.SetDismissText("取消") + dConf.SetFilter(storage.NewExtensionFileFilter([]string{".exe"})) + dConf.Resize(fyne.NewSize(750, 500)) + dConf.Show() +} + type fileList struct { selItemIds []string //选择的ID fileTotal int //文件总数 @@ -413,7 +428,8 @@ func (f *fileList) reset() { f.cachedList = NewList("") } -func (f *fileList) createList() *widget.List { +// 创建默认的列表 +func (f *fileList) CreateDefaultList() *widget.List { f.itemList = widget.NewList( func() int { return len(f.cachedList.Items) @@ -443,7 +459,50 @@ func (f *fileList) createList() *widget.List { return f.itemList } -func (f *fileList) addItem(val string) { +// 创建可扩展属性的列表 +func (f *fileList) CreateDownloadList() *widget.List { + f.itemList = widget.NewList( + func() int { + return len(f.cachedList.Items) + }, + func() fyne.CanvasObject { + chk := widget.NewCheck("Template", func(bool) {}) + lb := widget.NewLabel("Template") + items := container.NewHBox(chk, &layout.Spacer{}, lb) + return items + }, + func(id widget.ListItemID, item fyne.CanvasObject) { + c, _ := item.(*fyne.Container) + chk := c.Objects[0].(*widget.Check) + data := f.cachedList.Items[id] + chk.Text = data.Text + chk.Checked = data.Checked + chk.OnChanged = func(b bool) { + if b { + f.selItemIds = append(f.selItemIds, chk.Text) + } else { + f.selItemIds = utils.DeleteString(f.selItemIds, chk.Text) + } + f.cachedList.Items[id].Checked = b + // sort.Sort(f.cachedList) + f.itemList.Refresh() + } + + lb := c.Objects[2].(*widget.Label) + lb.Text = common.ConvertFileSize(data.Size) + c.Refresh() + }, + ) + return f.itemList +} + +func (f *fileList) AddItem(item Item) { + f.cachedList.Items = append(f.cachedList.Items, item) + // sort.Sort(f.cachedList) + f.itemList.Refresh() +} + +func (f *fileList) AddItemWithText(val string) { val = strings.TrimSpace(val) if len(val) == 0 { return @@ -480,7 +539,7 @@ func (f *fileList) loadItem(dirPath string) { for _, file := range files { if !file.IsDir() { - f.addItem(file.Name()) + f.AddItemWithText(file.Name()) // f.selItemIds = append(f.selItemIds, file.Name()) f.fileTotal++ // logrus.Debugf("%v", file.Name()) @@ -527,7 +586,7 @@ func (f *fileList) changeItem(tmpDir, projectDir string) { continue } } - f.addItem(file.Name()) + f.AddItemWithText(file.Name()) f.selItemIds = append(f.selItemIds, file.Name()) f.fileTotal++ logrus.Debugf("%v", file.Name()) diff --git a/cmd/v2/ui/tool_pb.go b/cmd/v2/ui/tool_pb.go index 20eff78a1..315ee92f1 100644 --- a/cmd/v2/ui/tool_pb.go +++ b/cmd/v2/ui/tool_pb.go @@ -15,7 +15,6 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" - "fyne.io/fyne/v2/data/binding" "fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/layout" "fyne.io/fyne/v2/storage" @@ -27,13 +26,11 @@ import ( type appPbGen struct { appAdapter folderList *folderList - folderChk *widget.List } func (this *appPbGen) LazyInit(obs observer.Observer) error { this.tabItem = container.NewTabItemWithIcon(common.TOOLBAR_PB, theme.ContentAddIcon(), nil) this.folderList = NewFolderList() - this.folderChk = this.folderList.createList() countLabel := widget.NewLabel("") @@ -155,12 +152,15 @@ func (this *appPbGen) LazyInit(obs observer.Observer) error { } logrus.Debug("save pb conf") } + + this.folderList.itemList = this.folderList.createList() + // layout c := container.NewBorder( form, container.NewHBox(confBtn, genBtn, layout.NewSpacer(), countLabel), nil, nil, container.NewMax( - container.NewVScroll(this.folderChk), + container.NewVScroll(this.folderList.itemList), ), ) @@ -174,46 +174,47 @@ func (a *appPbGen) GetAppName() string { } type folderList struct { - dataBinding binding.UntypedList - selItemIds []string //选择的ID - itemListData *model.ItemModelList - fileTotal int //文件总数 + selItemIds []string //选择的ID + cachedList List + itemList *widget.List + fileTotal int //文件总数 } func NewFolderList() *folderList { return &folderList{ - dataBinding: binding.NewUntypedList(), + cachedList: NewList(""), } } func (f *folderList) createList() *widget.List { - return widget.NewListWithData(f.dataBinding, - func() fyne.CanvasObject { - return container.NewHBox( - // &widget.Check{Checked: true}, - widget.NewCheck("", func(b bool) {}), - widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabel(""), - ) + return widget.NewList( + func() int { + return len(f.cachedList.Items) }, - func(data binding.DataItem, item fyne.CanvasObject) { - o, _ := data.(binding.Untyped).Get() - pd := o.(*model.ItemModel) - item.(*fyne.Container).Objects[0].(*widget.Check).OnChanged = func(b bool) { + func() fyne.CanvasObject { + return widget.NewCheck("Template", func(b bool) {}) + }, + func(id widget.ListItemID, item fyne.CanvasObject) { + c, _ := item.(*widget.Check) + im := f.cachedList.Items[id] + c.Text = im.Text + c.Checked = im.Checked + + c.OnChanged = func(b bool) { if b { - f.selItemIds = append(f.selItemIds, pd.Id) + f.selItemIds = append(f.selItemIds, c.Text) } else { - f.selItemIds = utils.DeleteString(f.selItemIds, pd.Id) + f.selItemIds = utils.DeleteString(f.selItemIds, c.Text) } + f.cachedList.Items[id].Checked = b + f.itemList.Refresh() } - item.(*fyne.Container).Objects[1].(*widget.Label).SetText(pd.Label) + c.Refresh() }, ) } func (f *folderList) initItem(dir string) { - f.itemListData = model.NewItemModelList() - files, err := ioutil.ReadDir(dir) if err != nil { logrus.Error(err) @@ -225,23 +226,15 @@ func (f *folderList) initItem(dir string) { if file.Name() == ".vscode" { continue } - fm := &model.ItemModel{ - Id: file.Name(), - Label: file.Name(), + fm := Item{ + Text: file.Name(), + Checked: false, } - f.itemListData.DataList = append(f.itemListData.DataList, fm) + f.cachedList.Items = append(f.cachedList.Items, fm) // f.selItemIds = append(f.selItemIds, fm.Id) f.fileTotal++ // logrus.Debugf("%v", fm.Id) } } - f.reloadListData() -} - -func (f *folderList) reloadListData() { - if f.itemListData != nil { - d := f.itemListData.AsInterfaceArray() - f.dataBinding.Set(d) - } } diff --git a/cmd/v2/ui/tool_term.go b/cmd/v2/ui/tool_term.go index d6f22914a..849e829d1 100644 --- a/cmd/v2/ui/tool_term.go +++ b/cmd/v2/ui/tool_term.go @@ -1,7 +1,6 @@ package ui import ( - "errors" "fmt" "go_dreamfactory/cmd/v2/lib/common" "go_dreamfactory/cmd/v2/model" @@ -14,6 +13,8 @@ import ( "strings" "sync" + "github.com/pkg/errors" + "fyne.io/fyne/v2" "fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/container" @@ -35,6 +36,8 @@ type appTerm struct { cProgress *widget.ProgressBarInfinite //连接进度条进度条 upProgress *widget.ProgressBar //上传进度条 endProgress sync.WaitGroup + + downloadList *fileList //download列表 } func (this *appTerm) LazyInit(obs observer.Observer) error { @@ -83,7 +86,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { &widget.FormItem{Text: "用户名:", Widget: userName}, passwordItem, widget.NewFormItem("Json目录", container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { - openFolder(localDir) + openFolder(localDir, toolWin.w) }), localDir)), widget.NewFormItem("远程目录", remoteDir), ) @@ -114,7 +117,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { svnForm := widget.NewForm( &widget.FormItem{Text: "服务地址", Widget: lubanAddr}, &widget.FormItem{Text: "工作目录", Widget: container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { - openFolder(workDir) + openFolder(workDir, toolWin.w) }), workDir)}, &widget.FormItem{Text: "LubanCli", Widget: lubanCli}, &widget.FormItem{Text: "Data目录", Widget: dataDir}, @@ -135,6 +138,18 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { lubanCli.Text = sshConf.LubanCli dataDir.Text = sshConf.DataDir jsonDir.Text = sshConf.JsonDir + } else { + sshConf = &model.SSHModel{ + Ip: "10.0.0.9", + UserName: "root", + Password: "Legu.cc()123", + RemoteDir: "/home/liwei/go_dreamfactory/bin/json/", + + ServerIp: "10.0.1.11", + LubanCli: `Luban.Client\Luban.Client.exe`, + DataDir: "Datas", + JsonDir: `output\json`, + } } // 解决文本没显示的问题 @@ -145,20 +160,18 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { // save func saveFunc := func() { - if err := service.GetDbService().SaveSSHConf(&model.SSHModel{ - Ip: ip.Text, - UserName: userName.Text, - Password: password.Text, - Port: port.Text, - LocalDir: localDir.Text, - RemoteDir: remoteDir.Text, - //// - ServerIp: lubanAddr.Text, - WorkDir: workDir.Text, - LubanCli: lubanCli.Text, - DataDir: dataDir.Text, - JsonDir: jsonDir.Text, - }); err != nil { + sshConf.Ip = ip.Text + sshConf.UserName = userName.Text + sshConf.Password = password.Text + sshConf.Port = port.Text + sshConf.LocalDir = localDir.Text + sshConf.RemoteDir = remoteDir.Text + sshConf.ServerIp = lubanAddr.Text + sshConf.WorkDir = workDir.Text + sshConf.LubanCli = lubanCli.Text + sshConf.DataDir = dataDir.Text + sshConf.JsonDir = jsonDir.Text + if err := service.GetDbService().SaveSSHConf(sshConf); err != nil { logrus.WithField("err", err).Debug("保存配置") } } @@ -172,7 +185,10 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { syncBtn := &widget.Button{Text: "同步JSON", Icon: theme.ConfirmIcon()} refreshBtn := &widget.Button{Text: "刷新", Icon: theme.ViewRefreshIcon()} svnBtn := &widget.Button{Text: "SVN更新", Icon: theme.ConfirmIcon()} + excelBtn := &widget.Button{Text: "更新Excel", Icon: theme.FolderIcon()} explorBtn := &widget.Button{Text: "资源管理器", Icon: theme.FolderIcon()} + dlBtn := widget.NewButtonWithIcon("", theme.DownloadIcon(), nil) + searchEntry := widget.NewEntry() // 全选/全取消 @@ -232,6 +248,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { allCancelBtn.Show() allSelBtn.Hide() refreshBtn.Enable() + dlBtn.Enable() } } @@ -258,20 +275,27 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { allSelBtn.Hide() allCancelBtn.Show() refreshBtn.Disable() + dlBtn.Disable() }() this.sshService.Close() } //资源管理器 - explorBtn.OnTapped = func() { - logrus.Debug(localDir.Text) + openExplor := func(dir string) { if runtime.GOOS == "windows" { if err := exec.Command("explorer", filepath.Join(localDir.Text)).Start(); err != nil { - dialog.ShowError(err, toolWin.w) + dialog.ShowError(errors.WithMessage(err, "请确认Json目录是否填写正确"), toolWin.w) return } } - + } + explorBtn.OnTapped = func() { + // logrus.Debug(localDir.Text) + if localDir.Text == "" { + showTip("Json目录必须填写") + } else { + openExplor(localDir.Text) + } } //使用说明 @@ -321,18 +345,13 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { //同步JSON syncBtn.Disable() - syncBtn.OnTapped = func() { - syncBtn.Disable() + syncNext := func() { defer func() { syncBtn.Enable() this.upProgress.Hide() + dialog.ShowConfirm("提示", "所有文件均上传完毕,静等1-2分钟", func(b bool) {}, toolWin.w) }() - - if this.sshService.Client == nil { - dialog.ShowError(errors.New("请先连接终端"), toolWin.w) - return - } - + syncBtn.Disable() this.upProgress.Show() this.upProgress.SetValue(0) @@ -362,17 +381,50 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { this.endProgress.Wait() this.upProgress.SetValue(1) } + syncBtn.OnTapped = func() { + if this.sshService.Client == nil { + dialog.ShowError(errors.New("请先连接终端"), toolWin.w) + return + } + + //SVN更新提示 + dc := dialog.NewConfirm("提示", "是否要进行SVN更新?", func(b bool) { + if b { + showTip("单击【SVN更新】按钮进行更新") + svnBtn.FocusGained() + return + } else { + if len(this.jsonList.selItemIds) == 0 { + showTip("没有选择任何文件,或尝试点击【刷新】") + return + } + syncNext() + } + }, toolWin.w) + dc.SetConfirmText("必须的") + dc.SetDismissText("我拿生命担保无需更新") + dc.Show() + } + + // excel更新 + excelBtn.OnTapped = func() { + if workDir.Text == "" { + showTip("工作目录必须填写") + } else { + openExplor(workDir.Text) + } + } // SVN更新 - svnBtn.OnTapped = func() { - this.cProgress.Show() - this.cProgress.Start() - svnBtn.Disable() + svnNext := func() { defer func() { this.cProgress.Hide() this.cProgress.Stop() svnBtn.Enable() }() + svnBtn.Disable() + this.cProgress.Show() + this.cProgress.Start() commandStr := `%s -h %s -j cfg -- -d %s --input_data_dir %s --output_data_dir %s --gen_types data_json -s server` arg := fmt.Sprintf(commandStr, filepath.Join(workDir.Text, lubanCli.Text), @@ -389,6 +441,22 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { return } } + svnBtn.OnTapped = func() { + + //提示更新excel + dc := dialog.NewConfirm("提示", "是否要更新excel?", func(b bool) { + if b { + //打开资源管理器 + openExplor(workDir.Text) + return + } else { + svnNext() + } + }, toolWin.w) + dc.SetConfirmText("必须的") + dc.SetDismissText("我拿生命担保无需更新") + dc.Show() + } // 全部取消 allCancelBtn.OnTapped = func() { @@ -403,7 +471,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { } this.jsonList.itemList.Refresh() } - + // 全选 allSelBtn.OnTapped = func() { defer func() { @@ -421,6 +489,10 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { // 搜索 searchEntry.PlaceHolder = "搜索" searchEntry.OnChanged = func(s string) { + if this.sshService.Client == nil { + dialog.ShowError(errors.New("请先连接终端"), toolWin.w) + return + } if s == "" { reloadItem() } else { @@ -437,11 +509,23 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { } } - // 创建json列表 - this.jsonList.itemList = this.jsonList.createList() + // 下载日志 + dlBtn.Disable() + dlBtn.OnTapped = func() { + w := this.createDownloadWindow() + w.Show() + w.SetCloseIntercept(func() { + dlBtn.Enable() + w.Close() + }) + dlBtn.Disable() + } - btns1 := container.NewHBox(helpBtn1, &layout.Spacer{}, saveBtn1, connBtn, disConnBtn) - btns2 := container.NewHBox(helpBtn2, &layout.Spacer{}, saveBtn2, svnBtn) + // 创建json列表 + this.jsonList.itemList = this.jsonList.CreateDefaultList() + + btns1 := container.NewHBox(helpBtn1, dlBtn, &layout.Spacer{}, saveBtn1, connBtn, disConnBtn) + btns2 := container.NewHBox(helpBtn2, &layout.Spacer{}, saveBtn2, excelBtn, svnBtn) split := container.NewHSplit(container.NewVBox(canvas.NewText("---只能在非上产环境!!!同步Json的操作仅限于数值热更,非结构热更---", color.RGBA{255, 0, 0, 255}), configForm, btns1, svnForm, btns2, this.cProgress), container.NewBorder( @@ -459,6 +543,19 @@ func (a *appTerm) GetAppName() string { return common.TOOLBAR_TERM } +func OpenExplor(dir string) { + if dir == "" { + showTip("资源管理器路径错误") + return + } + if runtime.GOOS == "windows" { + if err := exec.Command("explorer", filepath.Join(dir)).Start(); err != nil { + dialog.ShowError(errors.WithMessage(err, "请确认Json目录是否填写正确"), toolWin.w) + return + } + } +} + func (a *appTerm) OnClose() bool { dialog.ShowConfirm("关闭终端", "你希望断开连接吗?", func(b bool) { if !b { @@ -470,3 +567,202 @@ func (a *appTerm) OnClose() bool { }, toolWin.w) return true } + +func (a *appTerm) createDownloadWindow() fyne.Window { + w := toolWin.app.NewWindow("日志") + + a.downloadList = NewFileList() + + a.downloadList.itemList = a.downloadList.CreateDownloadList() + + remoteLogDirEntry := widget.NewEntry() + remoteLogDirEntry.PlaceHolder = "下载到" + remoteLogDirEntry.Text = "/home/liwei/go_dreamfactory/bin/log/" + + saveDirEntry := widget.NewEntry() + saveDirEntry.PlaceHolder = "保存目录" + + editorEntry := widget.NewEntry() + editorEntry.PlaceHolder = "编辑器可执行文件路径" + + // config + confForm := widget.NewForm( + widget.NewFormItem("远程目录", remoteLogDirEntry), + widget.NewFormItem("下载目录", saveDirEntry), + widget.NewFormItem("编辑器", container.NewBorder(nil, nil, nil, widget.NewButtonWithIcon("", theme.FolderIcon(), func() { + openFile(editorEntry, w) + }), editorEntry)), + ) + + // 进度条 + downloadProgress := widget.NewProgressBarInfinite() + + var sshConf *model.SSHModel + defer func() { + downloadProgress.Hide() + //加载配置 + sshConf = service.GetDbService().GetSSHConf(common.BUCKET_SSHCONF) + if sshConf != nil { + if sshConf.LogDir == "" { + remoteLogDirEntry.Text = "/home/liwei/go_dreamfactory/bin/log/" + } else { + remoteLogDirEntry.Text = sshConf.LogDir + } + + saveDirEntry.Text = sshConf.SaveDir + editorEntry.Text = sshConf.Editor + } else { + sshConf = &model.SSHModel{} + } + + remoteLogDirEntry.Refresh() + saveDirEntry.Refresh() + editorEntry.Refresh() + + //load list + if remoteLogDirEntry.Text == "" { + return + } + files, err := a.sshService.GetRemoteDir(remoteLogDirEntry.Text) + if err != nil { + dialog.ShowError(err, toolWin.w) + return + } + + for _, f := range files { + a.downloadList.AddItem(Item{Text: f.FileName, Size: f.Size}) + } + }() + + //下载 + allDownloadBtn := widget.NewButtonWithIcon("下载", theme.DownloadIcon(), nil) + DownloadDirBtn := widget.NewButtonWithIcon("打开下载目录", theme.FolderIcon(), nil) + EditorBtn := widget.NewButtonWithIcon("打开编辑器", theme.FolderIcon(), nil) + saveConfBtn := widget.NewButtonWithIcon("保存配置", theme.DocumentSaveIcon(), func() { + // 保存配置 + sshConf.LogDir = remoteLogDirEntry.Text + sshConf.SaveDir = saveDirEntry.Text + sshConf.Editor = editorEntry.Text + if err := service.GetDbService().SaveSSHConf(sshConf); err != nil { + logrus.WithField("err", err).Debug("保存日志配置") + } + }) + + allSelBtn := &widget.Button{Icon: theme.CheckButtonCheckedIcon()} + allCancelBtn := &widget.Button{Icon: theme.CheckButtonIcon()} + allSelBtn.Hide() + + // 全部取消 + allCancelBtn.OnTapped = func() { + defer func() { + allCancelBtn.Hide() + allSelBtn.Show() + }() + dlist := a.downloadList + for i, v := range dlist.cachedList.Items { + dlist.cachedList.Items[i].Checked = true + dlist.selItemIds = append(dlist.selItemIds, v.Text) + dlist.itemList.UpdateItem(i, container.NewHBox( + widget.NewCheck(v.Text, nil), + &layout.Spacer{}, + widget.NewLabel(common.ConvertFileSize(v.Size)))) + } + dlist.itemList.Refresh() + } + + // 全选 + allSelBtn.OnTapped = func() { + defer func() { + allCancelBtn.Show() + allSelBtn.Hide() + }() + dlist := a.downloadList + dlist.selItemIds = []string{} + for i, v := range dlist.cachedList.Items { + dlist.cachedList.Items[i].Checked = false + dlist.itemList.UpdateItem(i, container.NewHBox( + widget.NewCheck(v.Text, nil), + &layout.Spacer{}, + widget.NewLabel(common.ConvertFileSize(v.Size)))) + } + dlist.itemList.Refresh() + } + + // 打开下载目录 + DownloadDirBtn.OnTapped = func() { + OpenExplor(saveDirEntry.Text) + } + + EditorBtn.OnTapped = func() { + if editorEntry.Text == "" { + showTip("请配置编辑器") + return + } + if runtime.GOOS == "windows" { + for _, v := range a.downloadList.selItemIds { + if err := exec.Command(editorEntry.Text, filepath.Join(saveDirEntry.Text, v)).Start(); err != nil { + dialog.ShowError(errors.WithMessage(err, "请确认编辑器目录是否填写正确"), toolWin.w) + return + } + } + + } + } + + //使用说明 + helpBtn := widget.NewButtonWithIcon("", theme.QuestionIcon(), func() { + quesWin := fyne.CurrentApp().NewWindow("日志使用说明") + quesWin.SetContent(widget.NewRichTextFromMarkdown( + ` + * 下载远程服务日志到本地分析 + * 提示: + * 远程目录 (保持一致) + * 下载目录:填写本地任意目录 + * 编辑器:选择已安装的编辑器(例如:notepad++、Sublime) + * 操作: + * 选择文件,点击【打开编辑器】 + `)) + quesWin.Resize(fyne.NewSize(350, 200)) + quesWin.SetFixedSize(true) + quesWin.CenterOnScreen() + quesWin.Show() + }) + + var wg sync.WaitGroup + //download + allDownloadBtn.OnTapped = func() { + downloadProgress.Show() + downloadProgress.Start() + selItems := a.downloadList.selItemIds + if len(selItems) == 0 { + showTip("请选择下载的文件") + return + } else { + for _, item := range selItems { + wg.Add(1) + go func(name string) { + defer func() { + downloadProgress.Hide() + wg.Done() + }() + logrus.WithField("filepath", remoteLogDirEntry.Text+name).Debug("下载") + if err := a.sshService.ScpDownload(saveDirEntry.Text, remoteLogDirEntry.Text+name); err != nil { + showTip(name + " 下载失败") + } + }(item) + } + wg.Wait() + } + } + + btns := container.NewHBox(allSelBtn, allCancelBtn, allDownloadBtn, DownloadDirBtn, EditorBtn, helpBtn) + //toolbar + toolbar := container.NewBorder(nil, btns, nil, saveConfBtn, confForm) + + //layout + w.SetContent(container.NewBorder(toolbar, downloadProgress, nil, nil, a.downloadList.itemList)) + + w.Resize(fyne.NewSize(800, 450)) + w.CenterOnScreen() + return w +} diff --git a/cmd/v2/ui/toolwindow.go b/cmd/v2/ui/toolwindow.go index 08b9e9c6e..cdae1cb20 100644 --- a/cmd/v2/ui/toolwindow.go +++ b/cmd/v2/ui/toolwindow.go @@ -1,6 +1,7 @@ package ui import ( + "fmt" "go_dreamfactory/cmd/v2/lib/common" "fyne.io/fyne/v2" @@ -64,7 +65,7 @@ func NewToolWindow(ui *UIImpl, parent fyne.Window) ToolWindow { } func (ui *ToolWindowImpl) CreateWindow(title string, width, height float32, _ bool) { - w := ui.app.NewWindow(title) + w := ui.app.NewWindow(fmt.Sprintf("工具箱 %s %s", title, ui.app.Metadata().Version)) ui.AddWindow("tool", w) ui.w = w diff --git a/cmd/v2/ui/toy_userinfo.go b/cmd/v2/ui/toy_userinfo.go index 70ca8232b..ce82de21f 100644 --- a/cmd/v2/ui/toy_userinfo.go +++ b/cmd/v2/ui/toy_userinfo.go @@ -115,7 +115,10 @@ func (this *toyUserInfo) dataListener() { _ = this.data.Append(this.getActiveWeek()) //11 _ = this.data.Append(this.getFriendPoint()) //12 _ = this.data.Append(this.getModiNameCount()) //13 - _ = this.data.Append(this.getSign()) //14 + _ = this.data.Append(this.getCreateTime()) + _ = this.data.Append(this.getSign()) + + this.setProp(2, common.USERINFO_NAME, this.userInfo.DbUser.Name) }, }) @@ -155,7 +158,6 @@ func (this *toyUserInfo) dataListener() { this.setProp(11, common.USERINFO_ACTIVE_WEEK, rsp.Ex.Activeweek) this.setProp(12, common.USERINFO_FRIENDPOINT, rsp.Ex.FriendPoint) this.setProp(13, common.USERINFO_MODINAME, rsp.Ex.ModifynameCount) - this.setProp(14, common.USERINFO_SIGN, rsp.Ex.Sign) } }, }) @@ -171,9 +173,9 @@ func (this *toyUserInfo) dataListener() { logrus.Error("unmarshal err") return } - this.setProp(6, common.USERINFO_GOLD, rsp.Gold) - this.setProp(7, common.USERINFO_EXP, rsp.Exp) - this.setProp(8, common.USERINFO_DIAMOND, rsp.Diamond) + // this.setProp(6, common.USERINFO_GOLD, rsp.Gold) + // this.setProp(7, common.USERINFO_EXP, rsp.Exp) + // this.setProp(8, common.USERINFO_DIAMOND, rsp.Diamond) } // listener exp // if data.Msg.MainType == string(comm.ModuleUser) && @@ -186,9 +188,13 @@ func (this *toyUserInfo) dataListener() { } func (this *toyUserInfo) setProp(idx int, label string, val interface{}) { + // v, _ := this.data.GetValue(idx) + // if v != "" { + logrus.WithFields(logrus.Fields{"idx": idx, "lbl": label, "val": val}).Debug("更新Prop") if err := this.data.SetValue(idx, fmt.Sprintf("%-3s\t: %v", label, val)); err != nil { logrus.WithFields(logrus.Fields{"idx": idx, "val": val}).Error(err) } + // } } func (this *toyUserInfo) getAcc() string { @@ -265,3 +271,13 @@ func (this *toyUserInfo) getSign() string { } return fmt.Sprintf("%-3s\t: %s", common.USERINFO_SIGN, cast.ToString(this.userInfo.DbUserExpand.Sign)) } + +func (this *toyUserInfo) getCreateTime() string { + ctime := this.userInfo.DbUser.Ctime + if ctime <= 0 { + return "" + } + tt := time.Unix(ctime, 0) + + return fmt.Sprintf("%-3s\t: %s", common.USERINFO_CREATETM, tt.Format(time.RFC3339)) +} From 03bd4e3efad63dc5ebfc774ad3eae406caa01c02 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Sat, 8 Oct 2022 11:03:53 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gm/module.go | 6 +- modules/modulebase.go | 18 ++--- modules/rtask/api_list.go | 1 + modules/rtask/module.go | 12 ++-- modules/task/model_task.go | 58 +++++++++------ pb/rtask_msg.pb.go | 143 ++++++++++++++++++++----------------- 6 files changed, 134 insertions(+), 104 deletions(-) diff --git a/modules/gm/module.go b/modules/gm/module.go index 64a7af01c..347a0e3d6 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -3,6 +3,7 @@ package gm import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -69,8 +70,8 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC }, true) if code == pb.ErrorCode_Success { // 成功直接返回 session.SendMsg(string(this.GetType()), "cmd", &pb.GMCmdResp{IsSucc: true}) - return } + this.Debug("使用bingo命令", log.Field{"uid", session.GetUserId()}, log.Field{"A", datas[0]}, log.Field{"T", datas[1]}, log.Field{"N", int32(num)}) } else if len(datas) == 2 && (datas[0] == "mapid") { module1, err := this.service.GetModule(comm.ModuleMainline) if err != nil { @@ -82,6 +83,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC return } code = module1.(comm.IMainline).ModifyMainlineData(session.GetUserId(), int32(num)) + this.Debug("使用bingo命令", log.Field{"uid", session.GetUserId()}, log.Field{"0", datas[0]}, log.Field{"N", int32(num)}) } else if len(datas) == 2 && (datas[0] == "pataid") { module1, err := this.service.GetModule(comm.ModulePagoda) if err != nil { @@ -93,6 +95,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC return } code = module1.(comm.IPagoda).ModifyPagodaFloor(session, int32(num)) + this.Debug("使用bingo命令", log.Field{"uid", session.GetUserId()}, log.Field{"0", datas[0]}, log.Field{"N", int32(num)}) } else if len(datas) == 1 && (datas[0] == "Iamyoudad" || datas[0] == "iamyoudad") { var ( res []*cfg.Gameatn @@ -107,6 +110,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC this.Errorf("资源发放失败,%v", code) } } + this.Debugf("使用bingo命令", log.Field{"uid", session.GetUserId()}, datas[0], res) } } } diff --git a/modules/modulebase.go b/modules/modulebase.go index bca45c380..90678536a 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -7,7 +7,7 @@ import ( "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/lego/core/cbase" - + "go_dreamfactory/lego/sys/log" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -21,10 +21,10 @@ import ( */ type ModuleBase struct { cbase.ModuleBase - module core.IModule - service base.IRPCXService - options IOptions - scomp comm.ISC_GateRouteComp //网关服务组件 + module core.IModule + service base.IRPCXService + options IOptions + scomp comm.ISC_GateRouteComp //网关服务组件 //常用的一些通用模块 在底层注册好 ModuleSys comm.ISys //系统 ModuleUser comm.IUser //用户模块 @@ -292,19 +292,19 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat if len(attrs) > 0 { //用户属性资源 code = this.ModuleUser.AddAttributeValues(session, attrs, bPush) - this.Debugf("发放用户资源: %v", attrs) + this.Debugf("发放用户资源: %v [%v]", attrs, code) } if len(items) > 0 { //道具资源 code = this.ModuleItems.AddItems(source, session, items, bPush) - this.Debugf("发放道具资源: %v", items) + this.Debugf("发放道具资源: %v [%v]", items, code) } if len(heros) > 0 { //卡片资源 code = this.ModuleHero.CreateRepeatHeros(session, heros, bPush) - this.Debugf("发放英雄资源: %v", heros) + this.Debugf("发放英雄资源: %v [%v]", heros, code) } if len(equips) > 0 { code = this.ModuleEquipment.AddNewEquipments(source, session, equips, bPush) - this.Debugf("发放装备资源: %v", equips) + this.Debugf("发放装备资源: %v [%v]", equips, code) } return diff --git a/modules/rtask/api_list.go b/modules/rtask/api_list.go index 79305cb6d..2059f4ea7 100644 --- a/modules/rtask/api_list.go +++ b/modules/rtask/api_list.go @@ -28,6 +28,7 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.RtasklistReq) (code rsp := &pb.RtasklistResp{ RtaskIds: ids, + GroupId: req.GroupId, } if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeList, rsp); err != nil { code = pb.ErrorCode_SystemError diff --git a/modules/rtask/module.go b/modules/rtask/module.go index f81979804..8c80553b5 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -8,6 +8,8 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + + "github.com/pkg/errors" ) var _ comm.IRtask = (*ModuleRtask)(nil) @@ -221,7 +223,7 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T } if condiId, err = v.find(v.cfg, params...); condiId == 0 { if err != nil { - this.Error(err.Error()) + this.Warn(errors.WithMessage(err, session.GetUserId()).Error()) } } else { condis = append(condis, v) @@ -233,11 +235,11 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T for _, v := range condis { if v.update != nil { //条件未达成才更新数据 - if code = this.CheckCondi(user.Id, v.cfg.Id); code != pb.ErrorCode_Success { - if err := v.update(session.GetUserId(), v.cfg, params...); err != nil { - code = pb.ErrorCode_DBError - } + // if code = this.CheckCondi(user.Id, v.cfg.Id); code != pb.ErrorCode_Success { + if err := v.update(session.GetUserId(), v.cfg, params...); err != nil { + code = pb.ErrorCode_DBError } + // } } } diff --git a/modules/task/model_task.go b/modules/task/model_task.go index abf3a16d1..fce8500de 100644 --- a/modules/task/model_task.go +++ b/modules/task/model_task.go @@ -5,6 +5,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" event_v2 "go_dreamfactory/lego/sys/event/v2" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" "sort" @@ -280,31 +281,44 @@ func (this *ModelTask) doTaskHandle(event interface{}, next func(event interface continue } - if task, ok := this.checkTask(tl.Uid, conf.Key); ok { - update := make(map[string]interface{}) - var progress int32 - if code := this.moduleTask.ModuleRtask.CheckCondi(tl.Uid, conf.TypeId); code == pb.ErrorCode_Success { - // update data - if ret != nil && len(ret.Data) > 0 { - progress = ret.Data[0] - } - update = map[string]interface{}{ - "progress": progress, - "status": 1, - } - // err = this.updateActive(tl.Uid, conf.Key) - } else { - if ret != nil && len(ret.Data) > 0 { - progress = ret.Data[0] - } - update = map[string]interface{}{ - "progress": progress, - } + task, ok := this.checkTask(tl.Uid, conf.Key) + if !ok { + this.moduleTask.Debug("任务已完成", log.Field{"uid", tl.Uid}, log.Field{"任务ID", conf.Key}) + continue + } + + var ( + progress int32 + update map[string]interface{} + ) + if code := this.moduleTask.ModuleRtask.CheckCondi(tl.Uid, conf.TypeId); code == pb.ErrorCode_Success { + // update data + if ret != nil && len(ret.Data) > 0 { + progress = ret.Data[0] } - if err = this.modifyUserTask(tl.Uid, task.Id, update); err != nil { - return + update = map[string]interface{}{ + "progress": progress, + "status": 1, + } + // err = this.updateActive(tl.Uid, conf.Key) + } else { + if ret != nil && len(ret.Data) > 0 { + progress = ret.Data[0] + } + update = map[string]interface{}{ + "progress": progress, } } + if err = this.modifyUserTask(tl.Uid, task.Id, update); err != nil { + return + } + this.moduleTask.Debug("更新任务", + log.Field{"uid", tl.Uid}, + log.Field{"任务ID", conf.Key}, + log.Field{"事件ID", conf.TypeId}, + log.Field{"progress", update["progress"]}, + log.Field{"status", update["status"]}, + ) } return } diff --git a/pb/rtask_msg.pb.go b/pb/rtask_msg.pb.go index 5c1ac5faa..8dd114143 100644 --- a/pb/rtask_msg.pb.go +++ b/pb/rtask_msg.pb.go @@ -177,6 +177,7 @@ type RtasklistResp struct { unknownFields protoimpl.UnknownFields RtaskIds []int32 `protobuf:"varint,1,rep,packed,name=rtaskIds,proto3" json:"rtaskIds"` + GroupId int32 `protobuf:"varint,2,opt,name=groupId,proto3" json:"groupId"` } func (x *RtasklistResp) Reset() { @@ -218,6 +219,13 @@ func (x *RtasklistResp) GetRtaskIds() []int32 { return nil } +func (x *RtasklistResp) GetGroupId() int32 { + if x != nil { + return x.GroupId + } + return 0 +} + // 对话选项 type RtaskChooseReq struct { state protoimpl.MessageState @@ -972,78 +980,79 @@ var file_rtask_rtask_msg_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, - 0x6b, 0x49, 0x64, 0x73, 0x22, 0x66, 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, - 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, - 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x0f, - 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, - 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, - 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, - 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, - 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, - 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, - 0x64, 0x22, 0x4e, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, - 0x64, 0x22, 0x6d, 0x0a, 0x13, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, - 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, - 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, - 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, - 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, - 0x22, 0x37, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x6c, 0x0a, 0x14, 0x52, 0x74, 0x61, - 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, + 0x6b, 0x49, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x66, + 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, + 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, + 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, + 0x75, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, + 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, + 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, + 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, + 0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, + 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x50, 0x75, + 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x11, + 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, - 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, - 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x22, 0x51, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, 0x6b, - 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, - 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x74, - 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, - 0x3c, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x94, 0x01, - 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, - 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x09, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, - 0x6b, 0x49, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, - 0x6b, 0x49, 0x64, 0x73, 0x22, 0x3f, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, - 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, - 0x73, 0x6b, 0x49, 0x64, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x12, 0x52, + 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, + 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x22, 0x6d, 0x0a, 0x13, 0x52, + 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x22, 0x37, 0x0a, 0x14, 0x52, 0x74, + 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, + 0x6e, 0x66, 0x6f, 0x22, 0x6c, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, + 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, + 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, + 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, + 0x53, 0x75, 0x62, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, + 0x64, 0x22, 0x51, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, + 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, + 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, + 0x75, 0x62, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x12, 0x52, 0x74, 0x61, + 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x44, 0x42, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x94, 0x01, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, + 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x74, 0x61, 0x73, + 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x74, 0x61, + 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x22, 0x3f, + 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, + 0x6c, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 05e00e0c0bb1d52b76192da05450f2cefdee65f1 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Sat, 8 Oct 2022 15:32:51 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=94=B9=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/lib/common/itemlist.go | 231 ++++++++++++++++++++++ cmd/v2/{ui => lib/common}/list.go | 3 +- cmd/v2/{ui => lib/common}/tip.go | 6 +- cmd/v2/model/item.go | 2 +- cmd/v2/ui/app_monitor.go | 2 +- cmd/v2/ui/tool_gen.go | 306 +++++------------------------- cmd/v2/ui/tool_newlock.go | 2 +- cmd/v2/ui/tool_pb.go | 8 +- cmd/v2/ui/tool_term.go | 104 +++++----- cmd/v2/ui/toy_userinfo.go | 2 +- cmd/v2/ui/views/task_list.go | 27 ++- modules/rtask/updateHandle.go | 5 +- 12 files changed, 364 insertions(+), 334 deletions(-) create mode 100644 cmd/v2/lib/common/itemlist.go rename cmd/v2/{ui => lib/common}/list.go (97%) rename cmd/v2/{ui => lib/common}/tip.go (89%) diff --git a/cmd/v2/lib/common/itemlist.go b/cmd/v2/lib/common/itemlist.go new file mode 100644 index 000000000..636b352cf --- /dev/null +++ b/cmd/v2/lib/common/itemlist.go @@ -0,0 +1,231 @@ +package common + +import ( + "fmt" + "go_dreamfactory/utils" + "io/ioutil" + "sort" + "strings" + + "fyne.io/fyne/v2" + "fyne.io/fyne/v2/container" + "fyne.io/fyne/v2/layout" + "fyne.io/fyne/v2/widget" + "github.com/sirupsen/logrus" +) + +type ItemList struct { + SelItemIds []string //选择的ID + ItemTotal int //总数 + TitleLabel *widget.Label + CachedList List + ItemList *widget.List + SearchItem []Item //用于暂存搜索结果 +} + +func NewItemList() *ItemList { + return &ItemList{ + TitleLabel: &widget.Label{}, + CachedList: NewList(""), + } +} + +// 重置 +func (f *ItemList) Reset() { + f.ItemTotal = 0 + f.SelItemIds = []string{} + f.CachedList = NewList("") +} + +func (f *ItemList) CreateList() *widget.List { + f.ItemList = widget.NewList( + func() int { + return len(f.CachedList.Items) + }, + func() fyne.CanvasObject { + return widget.NewLabel("Template") + }, + func(id widget.ListItemID, item fyne.CanvasObject) { + c, _ := item.(*widget.Label) + c.Text = f.CachedList.Items[id].Text + c.Refresh() + }, + ) + f.ItemList.OnSelected = func(id widget.ListItemID) { + selId := f.CachedList.Items[id].Id + f.SelItemIds = append(f.SelItemIds, selId) + return + } + return f.ItemList +} + +// 创建默认的列表 +func (f *ItemList) CreateDefaultCheckList() *widget.List { + f.ItemList = widget.NewList( + func() int { + return len(f.CachedList.Items) + }, + func() fyne.CanvasObject { + return widget.NewCheck("Template", func(bool) {}) + }, + func(id widget.ListItemID, item fyne.CanvasObject) { + c, _ := item.(*widget.Check) + c.Text = f.CachedList.Items[id].Text + c.Checked = f.CachedList.Items[id].Checked + + c.OnChanged = func(b bool) { + if b { + f.SelItemIds = append(f.SelItemIds, c.Text) + } else { + f.SelItemIds = utils.DeleteString(f.SelItemIds, c.Text) + } + f.TitleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.SelItemIds), f.ItemTotal)) + f.CachedList.Items[id].Checked = b + // sort.Sort(f.cachedList) + f.ItemList.Refresh() + } + c.Refresh() + }, + ) + return f.ItemList +} + +// 创建下载列表 +func (f *ItemList) CreateDownloadList() *widget.List { + f.ItemList = widget.NewList( + func() int { + return len(f.CachedList.Items) + }, + func() fyne.CanvasObject { + chk := widget.NewCheck("Template", func(bool) {}) + lb := widget.NewLabel("Template") + items := container.NewHBox(chk, &layout.Spacer{}, lb) + return items + }, + func(id widget.ListItemID, item fyne.CanvasObject) { + c, _ := item.(*fyne.Container) + chk := c.Objects[0].(*widget.Check) + data := f.CachedList.Items[id] + chk.Text = data.Text + chk.Checked = data.Checked + chk.OnChanged = func(b bool) { + if b { + f.SelItemIds = append(f.SelItemIds, chk.Text) + } else { + f.SelItemIds = utils.DeleteString(f.SelItemIds, chk.Text) + } + f.CachedList.Items[id].Checked = b + // sort.Sort(f.cachedList) + f.ItemList.Refresh() + } + + lb := c.Objects[2].(*widget.Label) + lb.Text = ConvertFileSize(data.Size) + c.Refresh() + }, + ) + return f.ItemList +} + +func (f *ItemList) AddItem(item Item) { + f.CachedList.Items = append(f.CachedList.Items, item) + // sort.Sort(f.cachedList) + f.ItemList.Refresh() +} + +func (f *ItemList) AddItemWithText(val string) { + val = strings.TrimSpace(val) + if len(val) == 0 { + return + } + newItem := Item{ + Text: val, + Quantity: 1, + Checked: false, //默认不选中 + } + f.CachedList.Items = append(f.CachedList.Items, newItem) + sort.Sort(f.CachedList) + f.ItemList.Refresh() +} + +func (f *ItemList) LoadItem(dirPath string) { + f.Reset() + files, err := ioutil.ReadDir(dirPath) + if err != nil { + logrus.Error(err) + return + } + + for _, file := range files { + if !file.IsDir() { + f.AddItemWithText(file.Name()) + // f.selItemIds = append(f.selItemIds, file.Name()) + f.ItemTotal++ + // logrus.Debugf("%v", file.Name()) + } + } + + f.SearchItem = f.CachedList.Items +} + +// 改变列表项目 +func (f *ItemList) ChangeItem(tmpDir, projectDir string) { + f.ItemTotal = 0 + f.SelItemIds = []string{} + f.CachedList = NewList("") + tmpFiles, err := ioutil.ReadDir(tmpDir) + if err != nil { + logrus.Error(err) + return + } + + defer func() { + if len(tmpFiles) == 0 || len(f.CachedList.Items) == 0 { + ShowTip("没有任何变更的项目") + } + }() + + projectFiles, err := ioutil.ReadDir(projectDir) + if err != nil { + logrus.Error(err) + return + } + + pfMap := make(map[string]int64) + for _, v := range projectFiles { + if !v.IsDir() { + pfMap[v.Name()] = v.ModTime().Unix() + } + } + + for _, file := range tmpFiles { + if !file.IsDir() { + if pfTime, ok := pfMap[file.Name()]; ok { + if file.ModTime().Unix() <= pfTime { + continue + } + } + f.AddItemWithText(file.Name()) + f.SelItemIds = append(f.SelItemIds, file.Name()) + f.ItemTotal++ + logrus.Debugf("%v", file.Name()) + } + } +} + +// 刷新文件数 +func (f *ItemList) ChangeFileCount() { + f.TitleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.SelItemIds), f.ItemTotal)) +} + +func (f *ItemList) DeleteItem(name string) { + for i, v := range f.CachedList.Items { + if v.Text == name { + f.SelItemIds = utils.DeleteString(f.SelItemIds, v.Text) + f.CachedList.Items = append(f.CachedList.Items[:i], f.CachedList.Items[i+1:]...) + if f.ItemTotal > 0 { + f.ItemTotal-- + } + } + } +} diff --git a/cmd/v2/ui/list.go b/cmd/v2/lib/common/list.go similarity index 97% rename from cmd/v2/ui/list.go rename to cmd/v2/lib/common/list.go index 849ed31e3..2d983d8ba 100644 --- a/cmd/v2/ui/list.go +++ b/cmd/v2/lib/common/list.go @@ -1,4 +1,4 @@ -package ui +package common import "strings" @@ -57,6 +57,7 @@ func (l List) Less(i, j int) bool { } type Item struct { + Id string `json:"id"` Title string `json:"title"` Text string `json:"text"` Quantity int `json:"quantity"` diff --git a/cmd/v2/ui/tip.go b/cmd/v2/lib/common/tip.go similarity index 89% rename from cmd/v2/ui/tip.go rename to cmd/v2/lib/common/tip.go index 13b16a040..fb1a12958 100644 --- a/cmd/v2/ui/tip.go +++ b/cmd/v2/lib/common/tip.go @@ -1,4 +1,4 @@ -package ui +package common import ( "image/color" @@ -11,7 +11,7 @@ import ( ) // 显示Tip -func showTip(content string) { +func ShowTip(content string) { drv := fyne.CurrentApp().Driver() if drv, ok := drv.(desktop.Driver); ok { w := drv.CreateSplashWindow() @@ -25,7 +25,7 @@ func showTip(content string) { } } -func showCanvasTip(content string) { +func ShowCanvasTip(content string) { drv := fyne.CurrentApp().Driver() if drv, ok := drv.(desktop.Driver); ok { w := drv.CreateSplashWindow() diff --git a/cmd/v2/model/item.go b/cmd/v2/model/item.go index d5f68c385..ec3282e22 100644 --- a/cmd/v2/model/item.go +++ b/cmd/v2/model/item.go @@ -21,4 +21,4 @@ func (s *ItemModelList) AsInterfaceArray() []interface{} { rs[i] = v } return rs -} +} \ No newline at end of file diff --git a/cmd/v2/ui/app_monitor.go b/cmd/v2/ui/app_monitor.go index c21e3a06b..c19e1acf5 100644 --- a/cmd/v2/ui/app_monitor.go +++ b/cmd/v2/ui/app_monitor.go @@ -78,7 +78,7 @@ func (this *appMonitor) Run() { data := d.(*model.PushModel) this.monitorData.DataList = append(this.monitorData.DataList, data) this.reloadMonitorData() - showCanvasTip("收到新的数据推送,请打开[推送]页面") + common.ShowCanvasTip("收到新的数据推送,请打开[推送]页面") }, }) } diff --git a/cmd/v2/ui/tool_gen.go b/cmd/v2/ui/tool_gen.go index 177db34b2..6e5ff0ef0 100644 --- a/cmd/v2/ui/tool_gen.go +++ b/cmd/v2/ui/tool_gen.go @@ -7,13 +7,9 @@ import ( "go_dreamfactory/cmd/v2/model" "go_dreamfactory/cmd/v2/service" "go_dreamfactory/cmd/v2/service/observer" - "go_dreamfactory/utils" - "io/ioutil" "os/exec" "path/filepath" "runtime" - "sort" - "strings" "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" @@ -29,14 +25,14 @@ type appGen struct { appAdapter obs observer.Observer - goList *fileList - jsonList *fileList + goList *common.ItemList + jsonList *common.ItemList } func (this *appGen) LazyInit(obs observer.Observer) error { this.obs = obs - this.goList = NewFileList() - this.jsonList = NewFileList() + this.goList = common.NewItemList() + this.jsonList = common.NewItemList() this.tabItem = container.NewTabItemWithIcon(common.TOOLBAR_GEN, theme.ContentCopyIcon(), nil) @@ -148,10 +144,10 @@ func (this *appGen) LazyInit(obs observer.Observer) error { }) //go - this.goList.titleLabel = widget.NewLabel("Go文件") - this.goList.titleLabel.Hide() + this.goList.TitleLabel = widget.NewLabel("Go文件") + this.goList.TitleLabel.Hide() // 复选列表 - this.goList.itemList = this.goList.CreateDefaultList() + this.goList.ItemList = this.goList.CreateDefaultCheckList() // 覆盖 -go go_allSelBtn := &widget.Button{Icon: theme.CheckButtonIcon()} @@ -165,9 +161,9 @@ func (this *appGen) LazyInit(obs observer.Observer) error { go_overrideBtn.Disable() defer func() { go_overrideBtn.Enable() - this.goList.itemList.Refresh() + this.goList.ItemList.Refresh() }() - for _, v := range this.goList.selItemIds { + for _, v := range this.goList.SelItemIds { // logrus.WithField("path1", filepath.Join(tmpDir.Text, "go", v)).Debug("copy go") // logrus.WithField("path2", filepath.Join(projectDir.Text, outputCodeDir.Text, v)).Debug("copy go") _, err := common.Copy(filepath.Join(tmpDir.Text, "go", v), @@ -176,9 +172,9 @@ func (this *appGen) LazyInit(obs observer.Observer) error { logrus.Error(err) return } - this.goList.deleteItem(v) + this.goList.DeleteItem(v) } - this.goList.changeFileCount() + this.goList.ChangeFileCount() } //取消checked @@ -187,13 +183,13 @@ func (this *appGen) LazyInit(obs observer.Observer) error { go_allCancelBtn.Hide() go_allSelBtn.Show() }() - this.goList.selItemIds = []string{} - for i, v := range this.goList.cachedList.Items { - this.goList.cachedList.Items[i].Checked = false - this.goList.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) + this.goList.SelItemIds = []string{} + for i, v := range this.goList.CachedList.Items { + this.goList.CachedList.Items[i].Checked = false + this.goList.ItemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - this.goList.changeFileCount() - this.goList.itemList.Refresh() + this.goList.ChangeFileCount() + this.goList.ItemList.Refresh() } //选择所有 @@ -202,21 +198,21 @@ func (this *appGen) LazyInit(obs observer.Observer) error { go_allCancelBtn.Show() go_allSelBtn.Hide() }() - for i, v := range this.goList.cachedList.Items { - this.goList.cachedList.Items[i].Checked = true - this.goList.selItemIds = append(this.goList.selItemIds, v.Text) - this.goList.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) + for i, v := range this.goList.CachedList.Items { + this.goList.CachedList.Items[i].Checked = true + this.goList.SelItemIds = append(this.goList.SelItemIds, v.Text) + this.goList.ItemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - this.goList.changeFileCount() + this.goList.ChangeFileCount() // this.goList.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(this.goList.selItemIds), this.goList.fileTotal)) - this.goList.itemList.Refresh() + this.goList.ItemList.Refresh() } // json - this.jsonList.titleLabel = widget.NewLabel("Json文件") - this.jsonList.titleLabel.Hide() + this.jsonList.TitleLabel = widget.NewLabel("Json文件") + this.jsonList.TitleLabel.Hide() // 复选列表 - this.jsonList.itemList = this.jsonList.CreateDefaultList() + this.jsonList.ItemList = this.jsonList.CreateDefaultCheckList() // 覆盖 -go json_allSelBtn := &widget.Button{Icon: theme.CheckButtonIcon()} @@ -228,9 +224,9 @@ func (this *appGen) LazyInit(obs observer.Observer) error { json_overrideBtn.Disable() defer func() { json_overrideBtn.Enable() - this.jsonList.itemList.Refresh() + this.jsonList.ItemList.Refresh() }() - for _, v := range this.jsonList.selItemIds { + for _, v := range this.jsonList.SelItemIds { // logrus.WithField("path1", filepath.Join(tmpDir.Text, "json", v)).Debug("copy json") // logrus.WithField("path2", filepath.Join(projectDir.Text, outputJsonDir.Text, v)).Debug("copy json") _, err := common.Copy(filepath.Join(tmpDir.Text, "json", v), @@ -239,9 +235,9 @@ func (this *appGen) LazyInit(obs observer.Observer) error { logrus.Error(err) return } - this.jsonList.deleteItem(v) + this.jsonList.DeleteItem(v) } - this.jsonList.changeFileCount() + this.jsonList.ChangeFileCount() } //取消checked @@ -251,13 +247,13 @@ func (this *appGen) LazyInit(obs observer.Observer) error { json_allSelBtn.Show() }() list := this.jsonList - list.selItemIds = []string{} - for i, v := range list.cachedList.Items { - list.cachedList.Items[i].Checked = false - list.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) + list.SelItemIds = []string{} + for i, v := range list.CachedList.Items { + list.CachedList.Items[i].Checked = false + list.ItemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - this.jsonList.changeFileCount() - list.itemList.Refresh() + this.jsonList.ChangeFileCount() + list.ItemList.Refresh() } //选择所有 @@ -267,13 +263,13 @@ func (this *appGen) LazyInit(obs observer.Observer) error { json_allSelBtn.Hide() }() list := this.jsonList - for i, v := range list.cachedList.Items { - list.cachedList.Items[i].Checked = true - list.selItemIds = append(list.selItemIds, v.Text) - list.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) + for i, v := range list.CachedList.Items { + list.CachedList.Items[i].Checked = true + list.SelItemIds = append(list.SelItemIds, v.Text) + list.ItemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - list.changeFileCount() - list.itemList.Refresh() + list.ChangeFileCount() + list.ItemList.Refresh() } genBtn := &widget.Button{Text: "生成", Icon: theme.ConfirmIcon()} @@ -316,17 +312,17 @@ func (this *appGen) LazyInit(obs observer.Observer) error { } changeGo := func() { - this.goList.changeItem(filepath.Join(tmpDir.Text, "go"), filepath.Join(projectDir.Text, outputCodeDir.Text)) - this.goList.titleLabel.SetText(fmt.Sprintf("(%d/%d个)", len(this.goList.selItemIds), this.goList.fileTotal)) + this.goList.ChangeItem(filepath.Join(tmpDir.Text, "go"), filepath.Join(projectDir.Text, outputCodeDir.Text)) + this.goList.TitleLabel.SetText(fmt.Sprintf("(%d/%d个)", len(this.goList.SelItemIds), this.goList.ItemTotal)) go_overrideBtn.Show() - this.goList.titleLabel.Show() + this.goList.TitleLabel.Show() } changeJson := func() { - this.jsonList.changeItem(filepath.Join(tmpDir.Text, "json"), filepath.Join(projectDir.Text, outputJsonDir.Text)) - this.jsonList.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(this.jsonList.selItemIds), this.jsonList.fileTotal)) + this.jsonList.ChangeItem(filepath.Join(tmpDir.Text, "json"), filepath.Join(projectDir.Text, outputJsonDir.Text)) + this.jsonList.TitleLabel.SetText(fmt.Sprintf("(%d/%d)", len(this.jsonList.SelItemIds), this.jsonList.ItemTotal)) json_overrideBtn.Show() - this.jsonList.titleLabel.Show() + this.jsonList.TitleLabel.Show() } // 更新列表 @@ -360,13 +356,13 @@ func (this *appGen) LazyInit(obs observer.Observer) error { left := container.NewVBox(form, container.NewHBox(&layout.Spacer{}, desBtn, saveBtn, genBtn)) right := container.NewGridWithColumns(2, container.NewBorder( - container.NewHBox(go_allSelBtn, go_allCancelBtn, go_overrideBtn, widget.NewLabel("Go文件"), this.goList.titleLabel), + container.NewHBox(go_allSelBtn, go_allCancelBtn, go_overrideBtn, widget.NewLabel("Go文件"), this.goList.TitleLabel), nil, nil, nil, - this.goList.itemList), + this.goList.ItemList), container.NewBorder( - container.NewHBox(json_allSelBtn, json_allCancelBtn, json_overrideBtn, widget.NewLabel("Json文件"), this.jsonList.titleLabel), + container.NewHBox(json_allSelBtn, json_allCancelBtn, json_overrideBtn, widget.NewLabel("Json文件"), this.jsonList.TitleLabel), nil, nil, nil, - this.jsonList.itemList)) + this.jsonList.ItemList)) content.Objects = append(content.Objects, container.NewGridWithColumns(2, left, right)) @@ -406,204 +402,6 @@ func openFile(entry *widget.Entry, w fyne.Window) { dConf.Show() } -type fileList struct { - selItemIds []string //选择的ID - fileTotal int //文件总数 - titleLabel *widget.Label - cachedList List - itemList *widget.List - searchItem []Item //用于暂存搜索结果 -} - -func NewFileList() *fileList { - return &fileList{ - titleLabel: &widget.Label{}, - cachedList: NewList(""), - } -} - -func (f *fileList) reset() { - f.fileTotal = 0 - f.selItemIds = []string{} - f.cachedList = NewList("") -} - -// 创建默认的列表 -func (f *fileList) CreateDefaultList() *widget.List { - f.itemList = widget.NewList( - func() int { - return len(f.cachedList.Items) - }, - func() fyne.CanvasObject { - return widget.NewCheck("Template", func(bool) {}) - }, - func(id widget.ListItemID, item fyne.CanvasObject) { - c, _ := item.(*widget.Check) - c.Text = f.cachedList.Items[id].Text - c.Checked = f.cachedList.Items[id].Checked - - c.OnChanged = func(b bool) { - if b { - f.selItemIds = append(f.selItemIds, c.Text) - } else { - f.selItemIds = utils.DeleteString(f.selItemIds, c.Text) - } - f.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.selItemIds), f.fileTotal)) - f.cachedList.Items[id].Checked = b - // sort.Sort(f.cachedList) - f.itemList.Refresh() - } - c.Refresh() - }, - ) - return f.itemList -} - -// 创建可扩展属性的列表 -func (f *fileList) CreateDownloadList() *widget.List { - f.itemList = widget.NewList( - func() int { - return len(f.cachedList.Items) - }, - func() fyne.CanvasObject { - chk := widget.NewCheck("Template", func(bool) {}) - lb := widget.NewLabel("Template") - items := container.NewHBox(chk, &layout.Spacer{}, lb) - return items - }, - func(id widget.ListItemID, item fyne.CanvasObject) { - c, _ := item.(*fyne.Container) - chk := c.Objects[0].(*widget.Check) - data := f.cachedList.Items[id] - chk.Text = data.Text - chk.Checked = data.Checked - chk.OnChanged = func(b bool) { - if b { - f.selItemIds = append(f.selItemIds, chk.Text) - } else { - f.selItemIds = utils.DeleteString(f.selItemIds, chk.Text) - } - f.cachedList.Items[id].Checked = b - // sort.Sort(f.cachedList) - f.itemList.Refresh() - } - - lb := c.Objects[2].(*widget.Label) - lb.Text = common.ConvertFileSize(data.Size) - c.Refresh() - }, - ) - return f.itemList -} - -func (f *fileList) AddItem(item Item) { - f.cachedList.Items = append(f.cachedList.Items, item) - // sort.Sort(f.cachedList) - f.itemList.Refresh() -} - -func (f *fileList) AddItemWithText(val string) { - val = strings.TrimSpace(val) - if len(val) == 0 { - return - } - newItem := Item{ - Text: val, - Quantity: 1, - Checked: false, //默认不选中 - } - f.cachedList.Items = append(f.cachedList.Items, newItem) - sort.Sort(f.cachedList) - f.itemList.Refresh() -} - -func (f *fileList) deleteItem(name string) { - for i, v := range f.cachedList.Items { - if v.Text == name { - f.selItemIds = utils.DeleteString(f.selItemIds, v.Text) - f.cachedList.Items = append(f.cachedList.Items[:i], f.cachedList.Items[i+1:]...) - if f.fileTotal > 0 { - f.fileTotal-- - } - } - } -} - -func (f *fileList) loadItem(dirPath string) { - f.reset() - files, err := ioutil.ReadDir(dirPath) - if err != nil { - logrus.Error(err) - return - } - - for _, file := range files { - if !file.IsDir() { - f.AddItemWithText(file.Name()) - // f.selItemIds = append(f.selItemIds, file.Name()) - f.fileTotal++ - // logrus.Debugf("%v", file.Name()) - } - } - - f.searchItem = f.cachedList.Items -} - -// 改变列表项目 -func (f *fileList) changeItem(tmpDir, projectDir string) { - f.fileTotal = 0 - f.selItemIds = []string{} - f.cachedList = NewList("") - tmpFiles, err := ioutil.ReadDir(tmpDir) - if err != nil { - logrus.Error(err) - return - } - - defer func() { - if len(tmpFiles) == 0 || len(f.cachedList.Items) == 0 { - showTip("没有任何变更的文件,请确定SVN拉取最新文件") - } - }() - - projectFiles, err := ioutil.ReadDir(projectDir) - if err != nil { - logrus.Error(err) - return - } - - pfMap := make(map[string]int64) - for _, v := range projectFiles { - if !v.IsDir() { - pfMap[v.Name()] = v.ModTime().Unix() - } - } - - for _, file := range tmpFiles { - if !file.IsDir() { - if pfTime, ok := pfMap[file.Name()]; ok { - if file.ModTime().Unix() <= pfTime { - continue - } - } - f.AddItemWithText(file.Name()) - f.selItemIds = append(f.selItemIds, file.Name()) - f.fileTotal++ - logrus.Debugf("%v", file.Name()) - } - } -} - -// 刷新文件数 -func (f *fileList) changeFileCount() { - f.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.selItemIds), f.fileTotal)) -} - -type CopyFiles struct { - Dir string - FileName string -} - func (a *appGen) GetAppName() string { return common.TOOLBAR_GEN } diff --git a/cmd/v2/ui/tool_newlock.go b/cmd/v2/ui/tool_newlock.go index d2bfc61ef..fd35fefe3 100644 --- a/cmd/v2/ui/tool_newlock.go +++ b/cmd/v2/ui/tool_newlock.go @@ -54,7 +54,7 @@ func (this *appLock) LazyInit(obs observer.Observer) error { return } toolWin.w.Clipboard().SetContent(text.Text) - showTip("已复制到剪贴板") + common.ShowTip("已复制到剪贴板") }) c := container.NewVBox(title, input, text, btn, copybtn) diff --git a/cmd/v2/ui/tool_pb.go b/cmd/v2/ui/tool_pb.go index 315ee92f1..a4c230ad4 100644 --- a/cmd/v2/ui/tool_pb.go +++ b/cmd/v2/ui/tool_pb.go @@ -175,14 +175,14 @@ func (a *appPbGen) GetAppName() string { type folderList struct { selItemIds []string //选择的ID - cachedList List + cachedList common.List itemList *widget.List fileTotal int //文件总数 } func NewFolderList() *folderList { return &folderList{ - cachedList: NewList(""), + cachedList: common.NewList(""), } } @@ -192,7 +192,7 @@ func (f *folderList) createList() *widget.List { return len(f.cachedList.Items) }, func() fyne.CanvasObject { - return widget.NewCheck("Template", func(b bool) {}) + return widget.NewCheck("Template", func(b bool) {}) }, func(id widget.ListItemID, item fyne.CanvasObject) { c, _ := item.(*widget.Check) @@ -226,7 +226,7 @@ func (f *folderList) initItem(dir string) { if file.Name() == ".vscode" { continue } - fm := Item{ + fm := common.Item{ Text: file.Name(), Checked: false, } diff --git a/cmd/v2/ui/tool_term.go b/cmd/v2/ui/tool_term.go index 849e829d1..6ec21036a 100644 --- a/cmd/v2/ui/tool_term.go +++ b/cmd/v2/ui/tool_term.go @@ -32,18 +32,18 @@ type appTerm struct { obs observer.Observer sshService *service.SSHService - jsonList *fileList //json列表 + jsonList *common.ItemList //json列表 cProgress *widget.ProgressBarInfinite //连接进度条进度条 upProgress *widget.ProgressBar //上传进度条 endProgress sync.WaitGroup - downloadList *fileList //download列表 + downloadList *common.ItemList //download列表 } func (this *appTerm) LazyInit(obs observer.Observer) error { this.obs = obs this.sshService = &service.SSHService{} - this.jsonList = NewFileList() + this.jsonList = common.NewItemList() //progress this.cProgress = widget.NewProgressBarInfinite() @@ -238,7 +238,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { connBtn.Enable() return } else { - this.jsonList.loadItem(localDir.Text) + this.jsonList.LoadItem(localDir.Text) this.cProgress.Stop() this.cProgress.Hide() @@ -260,7 +260,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { allSelBtn.Hide() allCancelBtn.Show() }() - this.jsonList.loadItem(localDir.Text) + this.jsonList.LoadItem(localDir.Text) } refreshBtn.OnTapped = reloadItem @@ -268,7 +268,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { disConnBtn.Disable() disConnBtn.OnTapped = func() { defer func() { - this.jsonList.reset() + this.jsonList.Reset() connBtn.Enable() disConnBtn.Disable() syncBtn.Disable() @@ -292,7 +292,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { explorBtn.OnTapped = func() { // logrus.Debug(localDir.Text) if localDir.Text == "" { - showTip("Json目录必须填写") + common.ShowTip("Json目录必须填写") } else { openExplor(localDir.Text) } @@ -355,7 +355,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { this.upProgress.Show() this.upProgress.SetValue(0) - len := len(this.jsonList.selItemIds) + len := len(this.jsonList.SelItemIds) num := 0.0 increment := func(wg *sync.WaitGroup) { @@ -364,18 +364,18 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { wg.Done() } - for _, fileName := range this.jsonList.selItemIds { + for _, fileName := range this.jsonList.SelItemIds { this.endProgress.Add(1) go func(fn string) { // time.Sleep(time.Second * time.Duration(rand.Intn(3))) if err := this.sshService.ScpCopy(filepath.Join(localDir.Text, fn), remoteDir.Text); err != nil { logrus.WithField("err", err).Error("同步json") - showTip(err.Error()) + common.ShowTip(err.Error()) } increment(&this.endProgress) // 移除已上传的 - this.jsonList.deleteItem(fn) - showTip(fmt.Sprintf("%s 成功上传", fn)) + this.jsonList.DeleteItem(fn) + common.ShowTip(fmt.Sprintf("%s 成功上传", fn)) }(fileName) } this.endProgress.Wait() @@ -390,12 +390,12 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { //SVN更新提示 dc := dialog.NewConfirm("提示", "是否要进行SVN更新?", func(b bool) { if b { - showTip("单击【SVN更新】按钮进行更新") + common.ShowTip("单击【SVN更新】按钮进行更新") svnBtn.FocusGained() return } else { - if len(this.jsonList.selItemIds) == 0 { - showTip("没有选择任何文件,或尝试点击【刷新】") + if len(this.jsonList.SelItemIds) == 0 { + common.ShowTip("没有选择任何文件,或尝试点击【刷新】") return } syncNext() @@ -409,7 +409,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { // excel更新 excelBtn.OnTapped = func() { if workDir.Text == "" { - showTip("工作目录必须填写") + common.ShowTip("工作目录必须填写") } else { openExplor(workDir.Text) } @@ -464,12 +464,12 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { allCancelBtn.Hide() allSelBtn.Show() }() - for i, v := range this.jsonList.cachedList.Items { - this.jsonList.cachedList.Items[i].Checked = true - this.jsonList.selItemIds = append(this.jsonList.selItemIds, v.Text) - this.jsonList.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) + for i, v := range this.jsonList.CachedList.Items { + this.jsonList.CachedList.Items[i].Checked = true + this.jsonList.SelItemIds = append(this.jsonList.SelItemIds, v.Text) + this.jsonList.ItemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - this.jsonList.itemList.Refresh() + this.jsonList.ItemList.Refresh() } // 全选 @@ -478,12 +478,12 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { allCancelBtn.Show() allSelBtn.Hide() }() - this.jsonList.selItemIds = []string{} - for i, v := range this.jsonList.cachedList.Items { - this.jsonList.cachedList.Items[i].Checked = false - this.jsonList.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) + this.jsonList.SelItemIds = []string{} + for i, v := range this.jsonList.CachedList.Items { + this.jsonList.CachedList.Items[i].Checked = false + this.jsonList.ItemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - this.jsonList.itemList.Refresh() + this.jsonList.ItemList.Refresh() } // 搜索 @@ -497,14 +497,14 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { reloadItem() } else { // go func() { - newList := []Item{} - for _, v := range this.jsonList.searchItem { + newList := []common.Item{} + for _, v := range this.jsonList.SearchItem { if strings.Contains(v.Text, s) { newList = append(newList, v) } } - this.jsonList.cachedList.Items = newList - this.jsonList.itemList.Refresh() + this.jsonList.CachedList.Items = newList + this.jsonList.ItemList.Refresh() // }() } } @@ -522,7 +522,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { } // 创建json列表 - this.jsonList.itemList = this.jsonList.CreateDefaultList() + this.jsonList.ItemList = this.jsonList.CreateDefaultCheckList() btns1 := container.NewHBox(helpBtn1, dlBtn, &layout.Spacer{}, saveBtn1, connBtn, disConnBtn) btns2 := container.NewHBox(helpBtn2, &layout.Spacer{}, saveBtn2, excelBtn, svnBtn) @@ -530,7 +530,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error { split := container.NewHSplit(container.NewVBox(canvas.NewText("---只能在非上产环境!!!同步Json的操作仅限于数值热更,非结构热更---", color.RGBA{255, 0, 0, 255}), configForm, btns1, svnForm, btns2, this.cProgress), container.NewBorder( container.NewBorder(nil, nil, container.NewHBox(allCancelBtn, allSelBtn, syncBtn, refreshBtn), container.NewHBox(explorBtn), searchEntry), - nil, nil, nil, this.jsonList.itemList)) + nil, nil, nil, this.jsonList.ItemList)) split.Offset = 0.45 content.Objects = append(content.Objects, container.NewBorder(nil, this.upProgress, nil, nil, split)) @@ -545,7 +545,7 @@ func (a *appTerm) GetAppName() string { func OpenExplor(dir string) { if dir == "" { - showTip("资源管理器路径错误") + common.ShowTip("资源管理器路径错误") return } if runtime.GOOS == "windows" { @@ -571,9 +571,9 @@ func (a *appTerm) OnClose() bool { func (a *appTerm) createDownloadWindow() fyne.Window { w := toolWin.app.NewWindow("日志") - a.downloadList = NewFileList() + a.downloadList = common.NewItemList() - a.downloadList.itemList = a.downloadList.CreateDownloadList() + a.downloadList.ItemList = a.downloadList.CreateDownloadList() remoteLogDirEntry := widget.NewEntry() remoteLogDirEntry.PlaceHolder = "下载到" @@ -630,7 +630,7 @@ func (a *appTerm) createDownloadWindow() fyne.Window { } for _, f := range files { - a.downloadList.AddItem(Item{Text: f.FileName, Size: f.Size}) + a.downloadList.AddItem(common.Item{Text: f.FileName, Size: f.Size}) } }() @@ -659,15 +659,15 @@ func (a *appTerm) createDownloadWindow() fyne.Window { allSelBtn.Show() }() dlist := a.downloadList - for i, v := range dlist.cachedList.Items { - dlist.cachedList.Items[i].Checked = true - dlist.selItemIds = append(dlist.selItemIds, v.Text) - dlist.itemList.UpdateItem(i, container.NewHBox( + for i, v := range dlist.CachedList.Items { + dlist.CachedList.Items[i].Checked = true + dlist.SelItemIds = append(dlist.SelItemIds, v.Text) + dlist.ItemList.UpdateItem(i, container.NewHBox( widget.NewCheck(v.Text, nil), &layout.Spacer{}, widget.NewLabel(common.ConvertFileSize(v.Size)))) } - dlist.itemList.Refresh() + dlist.ItemList.Refresh() } // 全选 @@ -677,15 +677,15 @@ func (a *appTerm) createDownloadWindow() fyne.Window { allSelBtn.Hide() }() dlist := a.downloadList - dlist.selItemIds = []string{} - for i, v := range dlist.cachedList.Items { - dlist.cachedList.Items[i].Checked = false - dlist.itemList.UpdateItem(i, container.NewHBox( + dlist.SelItemIds = []string{} + for i, v := range dlist.CachedList.Items { + dlist.CachedList.Items[i].Checked = false + dlist.ItemList.UpdateItem(i, container.NewHBox( widget.NewCheck(v.Text, nil), &layout.Spacer{}, widget.NewLabel(common.ConvertFileSize(v.Size)))) } - dlist.itemList.Refresh() + dlist.ItemList.Refresh() } // 打开下载目录 @@ -695,11 +695,11 @@ func (a *appTerm) createDownloadWindow() fyne.Window { EditorBtn.OnTapped = func() { if editorEntry.Text == "" { - showTip("请配置编辑器") + common.ShowTip("请配置编辑器") return } if runtime.GOOS == "windows" { - for _, v := range a.downloadList.selItemIds { + for _, v := range a.downloadList.SelItemIds { if err := exec.Command(editorEntry.Text, filepath.Join(saveDirEntry.Text, v)).Start(); err != nil { dialog.ShowError(errors.WithMessage(err, "请确认编辑器目录是否填写正确"), toolWin.w) return @@ -733,9 +733,9 @@ func (a *appTerm) createDownloadWindow() fyne.Window { allDownloadBtn.OnTapped = func() { downloadProgress.Show() downloadProgress.Start() - selItems := a.downloadList.selItemIds + selItems := a.downloadList.SelItemIds if len(selItems) == 0 { - showTip("请选择下载的文件") + common.ShowTip("请选择下载的文件") return } else { for _, item := range selItems { @@ -747,7 +747,7 @@ func (a *appTerm) createDownloadWindow() fyne.Window { }() logrus.WithField("filepath", remoteLogDirEntry.Text+name).Debug("下载") if err := a.sshService.ScpDownload(saveDirEntry.Text, remoteLogDirEntry.Text+name); err != nil { - showTip(name + " 下载失败") + common.ShowTip(name + " 下载失败") } }(item) } @@ -760,7 +760,7 @@ func (a *appTerm) createDownloadWindow() fyne.Window { toolbar := container.NewBorder(nil, btns, nil, saveConfBtn, confForm) //layout - w.SetContent(container.NewBorder(toolbar, downloadProgress, nil, nil, a.downloadList.itemList)) + w.SetContent(container.NewBorder(toolbar, downloadProgress, nil, nil, a.downloadList.ItemList)) w.Resize(fyne.NewSize(800, 450)) w.CenterOnScreen() diff --git a/cmd/v2/ui/toy_userinfo.go b/cmd/v2/ui/toy_userinfo.go index ce82de21f..4763c3b3c 100644 --- a/cmd/v2/ui/toy_userinfo.go +++ b/cmd/v2/ui/toy_userinfo.go @@ -45,7 +45,7 @@ func (this *toyUserInfo) Init(obs observer.Observer) error { this.copyBtn = widget.NewButtonWithIcon("", theme.ContentCopyIcon(), func() { if this.userInfo != nil && this.userInfo.DbUser != nil { _ = clipboard.WriteAll(this.userInfo.DbUser.Uid) - showTip("已复制UID到剪贴板") + common.ShowTip("已复制UID到剪贴板") } }) this.copyBtn.Disable() diff --git a/cmd/v2/ui/views/task_list.go b/cmd/v2/ui/views/task_list.go index 9e5c07ed6..880317751 100644 --- a/cmd/v2/ui/views/task_list.go +++ b/cmd/v2/ui/views/task_list.go @@ -21,15 +21,14 @@ import ( ) type TaskListView struct { - ListBaseView + BaseformView + itemList common.ItemList } func (this *TaskListView) CreateView(t *model.TestCase) fyne.CanvasObject { - // init required - this.initItemList() + this.itemList = *common.NewItemList() - // create friend list view - this.createItemList() + this.itemList.ItemList = this.itemList.CreateList() // select widget tagSelect := getTaskTagSelect() @@ -46,20 +45,20 @@ func (this *TaskListView) CreateView(t *model.TestCase) fyne.CanvasObject { // task receive button receiveBtn := widget.NewButtonWithIcon("任务领取", theme.ConfirmIcon(), func() { - if len(this.selItemIds) != 1 { + if len(this.itemList.SelItemIds) != 1 { dialog.ShowError(errors.New("请选择一项"), this.w) return } if err := service.GetPttService().SendToClient( t.MainType, "receive", - &pb.TaskReceiveReq{Id: this.selItemIds[0], TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil { + &pb.TaskReceiveReq{Id: this.itemList.SelItemIds[0], TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil { logrus.Error(err) return } }) // layout - split := container.NewHSplit(this.dataListWidget, container.NewVBox(this.form, taskListBtn, receiveBtn)) + split := container.NewHSplit(this.itemList.ItemList, container.NewVBox(this.form, taskListBtn, receiveBtn)) split.Offset = 1 //data listener for @@ -83,15 +82,15 @@ func (this *TaskListView) dataListener() { return } - this.itemListData = model.NewItemModelList() + this.itemList.Reset() + for _, v := range rsp.List { - fm := &model.ItemModel{ - Id: cast.ToString(v.Id), - Label: fmt.Sprintf("%s S:%d R:%d", cast.ToString(v.TaskId), v.Status, v.Received), + item := common.Item{ + Id: cast.ToString(v.Id), + Text: fmt.Sprintf("%s 是否完成:%d 是否领奖:%d 进度:%d", cast.ToString(v.TaskId), v.Status, v.Received, v.Progress), } - this.itemListData.DataList = append(this.itemListData.DataList, fm) + this.itemList.AddItem(item) } - this.reloadListData() }, }) } diff --git a/modules/rtask/updateHandle.go b/modules/rtask/updateHandle.go index 8f483add1..14912494b 100644 --- a/modules/rtask/updateHandle.go +++ b/modules/rtask/updateHandle.go @@ -99,9 +99,10 @@ func (this *ModelRtaskRecord) addUpdate(uid string, cfg *cfg.GameRdtaskCondiData } else { //查找任务数据 if v, ok := record.Vals[cfg.Id]; ok { + newCount := make([]int32, len(vals)) srcCount := v.Data[0] - vals[0] = srcCount + vals[0] - v.Data = toMap(vals...) + newCount[0] = srcCount + vals[0] + v.Data = toMap(newCount...) v.Timestamp = time.Now().Unix() update := map[string]interface{}{ From 65d4128452bacccba0f9396ac207de6612afa2f6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sat, 8 Oct 2022 15:44:09 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E5=BF=83=E9=AD=94=E5=A1=94=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pagoda/api_challengeover.go | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index cea9b9120..ccadb97dd 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -84,7 +84,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal return } pagoda.PagodaId = conf.LayerNum // 更新层数 - mapData["pagodaId"] = conf.LayerNum code = this.module.ModifyPagodaData(session.GetUserId(), mapData) session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda}) From 1f46ee40dfb2128b5e9fd5d39fe5e2794de1272b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sat, 8 Oct 2022 18:02:50 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=AF=B9=E5=BA=94=E7=9A=84pb=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/battle/module_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/battle/module_test.go b/modules/battle/module_test.go index 3676b8f86..f56773078 100644 --- a/modules/battle/module_test.go +++ b/modules/battle/module_test.go @@ -85,3 +85,5 @@ func testdefer(data *[]int) { }() *data = append(*data, 0) } + +// 3 From f28a16cde09207edbb7f4052d770527f0d4910f4 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sat, 8 Oct 2022 18:05:46 +0800 Subject: [PATCH 08/10] =?UTF-8?q?pb=20=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pb/hero_db.pb.go | 10 +- pb/library_db.pb.go | 2 +- pb/userexpand.pb.go | 229 ++++++++++++++++++++++++++++++-------------- 3 files changed, 162 insertions(+), 79 deletions(-) diff --git a/pb/hero_db.pb.go b/pb/hero_db.pb.go index c005dade1..1ccf64cab 100644 --- a/pb/hero_db.pb.go +++ b/pb/hero_db.pb.go @@ -151,11 +151,11 @@ type DBHero struct { IsOverlying bool `protobuf:"varint,23,opt,name=isOverlying,proto3" json:"isOverlying"` // go_tags(`bson:"isOverlying"`) 是否允许叠加 默认true EnergyProperty map[string]int32 `protobuf:"bytes,24,rep,name=energyProperty,proto3" json:"energyProperty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"energyProperty"` // JuexProperty map[string]int32 `protobuf:"bytes,25,rep,name=juexProperty,proto3" json:"juexProperty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"juexProperty"` ////hp - Status HeroType `protobuf:"varint,26,opt,name=status,proto3,enum=HeroType" json:"status" bson:"heroType"` //状态 (1 练功) - Suite1Star int32 `protobuf:"varint,27,opt,name=suite1Star,proto3" json:"suite1Star"` - Suite2Star int32 `protobuf:"varint,28,opt,name=suite2Star,proto3" json:"suite2Star"` - Suite1Lv int32 `protobuf:"varint,29,opt,name=suite1Lv,proto3" json:"suite1Lv"` - Suite2Lv int32 `protobuf:"varint,30,opt,name=suite2Lv,proto3" json:"suite2Lv"` + Status HeroType `protobuf:"varint,26,opt,name=status,proto3,enum=HeroType" json:"status" bson:"status"` //状态 (1 练功) + Suite1Star int32 `protobuf:"varint,27,opt,name=suite1Star,proto3" json:"suite1Star" bson:"suite1Star"` // + Suite2Star int32 `protobuf:"varint,28,opt,name=suite2Star,proto3" json:"suite2Star" bson:"suite2Star"` + Suite1Lv int32 `protobuf:"varint,29,opt,name=suite1Lv,proto3" json:"suite1Lv" bson:"suite1Lv"` + Suite2Lv int32 `protobuf:"varint,30,opt,name=suite2Lv,proto3" json:"suite2Lv" bson:"suite2Lv"` } func (x *DBHero) Reset() { diff --git a/pb/library_db.pb.go b/pb/library_db.pb.go index 027365d56..bc803c501 100644 --- a/pb/library_db.pb.go +++ b/pb/library_db.pb.go @@ -84,7 +84,7 @@ type DBLibrary struct { 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"` // 配置表id 羁绊id Hero map[string]int32 `protobuf:"bytes,4,rep,name=hero,proto3" json:"hero" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key: hid value: favorlv - Prize map[int32]int32 `protobuf:"bytes,5,rep,name=prize,proto3" json:"prize" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //是否领奖 + Prize map[int32]int32 `protobuf:"bytes,5,rep,name=prize,proto3" json:"prize" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //是否领奖 key 好感度等级 Fetterlv int32 `protobuf:"varint,6,opt,name=fetterlv,proto3" json:"fetterlv"` // 当前羁绊等级 Storyid int32 `protobuf:"varint,7,opt,name=storyid,proto3" json:"storyid"` // 故事id 用来判断是否领奖 } diff --git a/pb/userexpand.pb.go b/pb/userexpand.pb.go index 85869fcb5..2f08c7ce0 100644 --- a/pb/userexpand.pb.go +++ b/pb/userexpand.pb.go @@ -364,6 +364,70 @@ func (x *Figure) GetComplexion() *Complexion { return nil } +// 传记 +type Story struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + History int32 `protobuf:"varint,1,opt,name=history,proto3" json:"history"` // 传记往事ID + Favorlv int32 `protobuf:"varint,2,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级 + Stroyprize int32 `protobuf:"varint,3,opt,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励 +} + +func (x *Story) Reset() { + *x = Story{} + if protoimpl.UnsafeEnabled { + mi := &file_userexpand_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Story) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Story) ProtoMessage() {} + +func (x *Story) ProtoReflect() protoreflect.Message { + mi := &file_userexpand_proto_msgTypes[6] + 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 Story.ProtoReflect.Descriptor instead. +func (*Story) Descriptor() ([]byte, []int) { + return file_userexpand_proto_rawDescGZIP(), []int{6} +} + +func (x *Story) GetHistory() int32 { + if x != nil { + return x.History + } + return 0 +} + +func (x *Story) GetFavorlv() int32 { + if x != nil { + return x.Favorlv + } + return 0 +} + +func (x *Story) GetStroyprize() int32 { + if x != nil { + return x.Stroyprize + } + return 0 +} + //用户扩展数据 type DBUserExpand struct { state protoimpl.MessageState @@ -397,7 +461,7 @@ type DBUserExpand struct { func (x *DBUserExpand) Reset() { *x = DBUserExpand{} if protoimpl.UnsafeEnabled { - mi := &file_userexpand_proto_msgTypes[6] + mi := &file_userexpand_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -410,7 +474,7 @@ func (x *DBUserExpand) String() string { func (*DBUserExpand) ProtoMessage() {} func (x *DBUserExpand) ProtoReflect() protoreflect.Message { - mi := &file_userexpand_proto_msgTypes[6] + mi := &file_userexpand_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -423,7 +487,7 @@ func (x *DBUserExpand) ProtoReflect() protoreflect.Message { // Deprecated: Use DBUserExpand.ProtoReflect.Descriptor instead. func (*DBUserExpand) Descriptor() ([]byte, []int) { - return file_userexpand_proto_rawDescGZIP(), []int{6} + return file_userexpand_proto_rawDescGZIP(), []int{7} } func (x *DBUserExpand) GetId() string { @@ -608,69 +672,75 @@ var file_userexpand_proto_rawDesc = []byte{ 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0xd5, 0x07, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, - 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, - 0x74, 0x72, 0x65, 0x61, 0x64, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x64, 0x6e, 0x6f, - 0x74, 0x69, 0x66, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x49, - 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, - 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, - 0x74, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, - 0x63, 0x68, 0x61, 0x74, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x6d, - 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x74, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, - 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x06, 0x74, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x46, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, - 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x44, 0x42, 0x55, - 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, - 0x61, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x64, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, - 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, - 0x65, 0x65, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x12, - 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x44, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, - 0x69, 0x6e, 0x74, 0x4f, 0x44, 0x12, 0x34, 0x0a, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, - 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x11, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, - 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x16, 0x6d, - 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6d, 0x6f, 0x6f, - 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x69, 0x67, - 0x67, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x6f, 0x67, - 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, - 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x18, 0x15, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, - 0x61, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x16, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x54, - 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x1a, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 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, + 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x76, + 0x6f, 0x72, 0x6c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x61, 0x76, 0x6f, + 0x72, 0x6c, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x70, 0x72, + 0x69, 0x7a, 0x65, 0x22, 0xd5, 0x07, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, + 0x70, 0x61, 0x6e, 0x64, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x64, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x64, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, + 0x64, 0x61, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, + 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, + 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x74, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, + 0x74, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x74, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, + 0x64, 0x2e, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, + 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x46, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, + 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x61, 0x79, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x61, 0x79, + 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, 0x6b, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, 0x6b, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x73, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x44, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x4f, 0x44, 0x12, 0x34, 0x0a, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, + 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, + 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x16, 0x6d, 0x6f, 0x6f, 0x6e, + 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, + 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, + 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, + 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x14, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, + 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 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, 0x1a, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, + 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 ( @@ -685,7 +755,7 @@ func file_userexpand_proto_rawDescGZIP() []byte { return file_userexpand_proto_rawDescData } -var file_userexpand_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_userexpand_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_userexpand_proto_goTypes = []interface{}{ (*Hair)(nil), // 0: Hair (*Eyes)(nil), // 1: Eyes @@ -693,9 +763,10 @@ var file_userexpand_proto_goTypes = []interface{}{ (*Body)(nil), // 3: Body (*Complexion)(nil), // 4: Complexion (*Figure)(nil), // 5: Figure - (*DBUserExpand)(nil), // 6: DBUserExpand - nil, // 7: DBUserExpand.TujianEntry - nil, // 8: DBUserExpand.PreinstallEntry + (*Story)(nil), // 6: Story + (*DBUserExpand)(nil), // 7: DBUserExpand + nil, // 8: DBUserExpand.TujianEntry + nil, // 9: DBUserExpand.PreinstallEntry } var file_userexpand_proto_depIdxs = []int32{ 0, // 0: Figure.hair:type_name -> Hair @@ -703,8 +774,8 @@ var file_userexpand_proto_depIdxs = []int32{ 2, // 2: Figure.mouth:type_name -> Mouth 3, // 3: Figure.body:type_name -> Body 4, // 4: Figure.complexion:type_name -> Complexion - 7, // 5: DBUserExpand.tujian:type_name -> DBUserExpand.TujianEntry - 8, // 6: DBUserExpand.preinstall:type_name -> DBUserExpand.PreinstallEntry + 8, // 5: DBUserExpand.tujian:type_name -> DBUserExpand.TujianEntry + 9, // 6: DBUserExpand.preinstall:type_name -> DBUserExpand.PreinstallEntry 5, // 7: DBUserExpand.PreinstallEntry.value:type_name -> Figure 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type @@ -792,6 +863,18 @@ func file_userexpand_proto_init() { } } file_userexpand_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Story); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_userexpand_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBUserExpand); i { case 0: return &v.state @@ -810,7 +893,7 @@ func file_userexpand_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_userexpand_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, From fc54a8d8881dc1a405f70db2cef06219bda1184b Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sun, 9 Oct 2022 10:33:20 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E7=BE=81=E7=BB=8A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/comp_configure.go | 80 +++++++++++++++++++++++++------ modules/library/model_fetter.go | 61 +++++++++++++++++++++++ modules/library/module.go | 2 +- services/worker/main.go | 2 + 4 files changed, 130 insertions(+), 15 deletions(-) create mode 100644 modules/library/model_fetter.go diff --git a/modules/library/comp_configure.go b/modules/library/comp_configure.go index df5b197ee..dcca4b8d5 100644 --- a/modules/library/comp_configure.go +++ b/modules/library/comp_configure.go @@ -1,6 +1,7 @@ package library import ( + "fmt" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" @@ -9,27 +10,58 @@ import ( ) const ( - game_libraryhero = "game_libraryhero.json" - game_libraryfetter = "game_libraryfetter.json" + game_libraryhero = "game_libraryhero.json" // 英雄对应的羁绊id信息 + game_libraryfetter = "game_libraryfetter.json" // 羁绊信息表 + game_libraryhistory = "game_libraryhistory.json" // 往事id 对应的奖励 + game_libraryfavor = "game_libraryfavor.json" // 英雄好感度升级所需的经验 + game_librarystory = "game_librarystory.json" // 羁绊id对应剧情奖励 ) ///配置管理基础组件 type configureComp struct { modules.MCompConfigure + fetter map[int64]*cfg.GameLibraryFetterData } //组件初始化接口 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) - - //err = this.LoadConfigure(game_libraryhero, cfg.NewGameLibraryHero) err = this.LoadMultiConfigure(map[string]interface{}{ - game_libraryhero: cfg.NewGameLibraryHero, - game_libraryfetter: cfg.NewGameLibraryFetter, + game_libraryhero: cfg.NewGameLibraryHero, + game_libraryhistory: cfg.NewGameLibraryHistory, + game_libraryfavor: cfg.NewGameLibraryFavor, + game_librarystory: cfg.NewGameLibraryStory, }) + + this.fetter = make(map[int64]*cfg.GameLibraryFetterData, 0) + + configure.RegisterConfigure(game_libraryfetter, cfg.NewGameLibraryFetter, this.SetLibraryFetter) + + // _data := this.GetLibraryStory(101) + // fmt.Printf("%v", _data) + // _data1 := this.GetLibraryFavor(2) + // fmt.Printf("%v", _data1) + // _data2 := this.GetLibraryHistory("350011") + // fmt.Printf("%v", _data2) return } +func (this *configureComp) SetLibraryFetter() { + if v, err := this.GetConfigure(game_libraryfetter); err == nil { + if _configure, ok := v.(*cfg.GameLibraryFetter); ok { + for _, v := range _configure.GetDataList() { + this.fetter[int64(v.Fid<<8)+int64(v.Favorlv)] = v + } + return + } + } else { + err = fmt.Errorf("%T no is *cfg.GameLibraryFetter", v) + } +} +func (this *configureComp) GetLibraryFetter(fid, favorlv int32) (data *cfg.GameLibraryFetterData) { + return this.fetter[int64(fid<<8)+int64(favorlv)] +} + //加载多个配置文件 func (this *configureComp) LoadMultiConfigure(confs map[string]interface{}) (err error) { for k, v := range confs { @@ -51,22 +83,42 @@ func (this *configureComp) GetLibraryHero(hid string) (data *cfg.GameLibraryHero if v, err := this.GetConfigure(game_libraryhero); err == nil { if configure, ok := v.(*cfg.GameLibraryHero); ok { data = configure.Get(hid) - return } } else { - log.Errorf("get game_challenge conf err:%v", err) + log.Errorf("get GetLibraryHero conf err:%v", err) } return } -func (this *configureComp) GetLibraryFetter(fid int32) (data *cfg.GameLibraryFetterData) { - if v, err := this.GetConfigure(game_libraryfetter); err == nil { - if configure, ok := v.(*cfg.GameLibraryFetter); ok { - data = configure.Get(fid) - return +func (this *configureComp) GetLibraryFavor(id int32) (data *cfg.GameLibraryFavorData) { + if v, err := this.GetConfigure(game_libraryfavor); err == nil { + if configure, ok := v.(*cfg.GameLibraryFavor); ok { + data = configure.Get(id) } } else { - log.Errorf("get game_challenge conf err:%v", err) + log.Errorf("GetLibraryFavor conf err:%v", err) + } + return +} + +func (this *configureComp) GetLibraryHistory(id string) (data *cfg.GameLibraryHistoryData) { + if v, err := this.GetConfigure(game_libraryhistory); err == nil { + if configure, ok := v.(*cfg.GameLibraryHistory); ok { + data = configure.Get(id) + } + } else { + log.Errorf("GetLibraryHistory conf err:%v", err) + } + return +} + +func (this *configureComp) GetLibraryStory(fid int32) (data *cfg.GameLibraryStoryData) { + if v, err := this.GetConfigure(game_librarystory); err == nil { + if configure, ok := v.(*cfg.GameLibraryStory); ok { + data = configure.Get(fid) + } + } else { + log.Errorf("GetLibraryStory conf err:%v", err) } return } diff --git a/modules/library/model_fetter.go b/modules/library/model_fetter.go new file mode 100644 index 000000000..193d09258 --- /dev/null +++ b/modules/library/model_fetter.go @@ -0,0 +1,61 @@ +package library + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/lego/core" + "go_dreamfactory/modules" + "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" +) + +type modelFetter struct { + modules.MCompModel + module *Library +} + +func (this *modelFetter) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { + this.TableName = string(comm.TableLibrary) + err = this.MCompModel.Init(service, module, comp, options) + this.module = module.(*Library) + // uid 创建索引 + this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) + return +} + +func (this *modelFetter) modifyLibraryDataByObjId(uid string, data map[string]interface{}) error { + return this.Change(uid, data) +} + +// 获取列表信息 +func (this *modelFetter) getLibraryList(uid string) []*pb.DBLibrary { + libs := make([]*pb.DBLibrary, 0) + err := this.GetList(uid, &libs) + if err != nil { + return nil + } + return libs +} + +//创建一条信息 +func (this *modelFetter) createLibrary(uid string, fetter *pb.DBLibrary) (err error) { + + if err = this.AddList(uid, fetter.Id, fetter); err != nil { + this.module.Errorf("%v", err) + return + } + return +} + +// 通过objid 找对应的数据 +func (this *modelFetter) getOneLibrary(uid, oid string) *pb.DBLibrary { + fetter := &pb.DBLibrary{} + err := this.GetListObj(uid, oid, fetter) + if err != nil { + return nil + } + return fetter +} diff --git a/modules/library/module.go b/modules/library/module.go index 95526b041..9f1226c00 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -64,7 +64,7 @@ func (this *Library) CreateLibrary(uid string, fids []int32, heroConfId string) Fetterlv: 0, } - conf := this.configure.GetLibraryFetter(fid) + conf := this.configure.GetLibraryFetter(fid, 1) if conf == nil { for _, v := range conf.Hid { obj.Hero[v] = 0 diff --git a/services/worker/main.go b/services/worker/main.go index 64a632a1a..05693f3af 100644 --- a/services/worker/main.go +++ b/services/worker/main.go @@ -13,6 +13,7 @@ import ( "go_dreamfactory/modules/hero" "go_dreamfactory/modules/hunting" "go_dreamfactory/modules/items" + "go_dreamfactory/modules/library" "go_dreamfactory/modules/linestory" "go_dreamfactory/modules/mail" "go_dreamfactory/modules/mainline" @@ -81,6 +82,7 @@ func main() { hunting.NewModule(), battle.NewModule(), linestory.NewModule(), + library.NewModule(), ) } From f60f0b6f5bb66367b915a95fc481ab6cc0f3cf67 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sun, 9 Oct 2022 10:35:30 +0800 Subject: [PATCH 10/10] =?UTF-8?q?pb=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pb/library_db.pb.go | 218 ++++++++++++++++++++++++----------------- pb/userexpand.pb.go | 229 ++++++++++++++------------------------------ 2 files changed, 202 insertions(+), 245 deletions(-) diff --git a/pb/library_db.pb.go b/pb/library_db.pb.go index bc803c501..747f07efe 100644 --- a/pb/library_db.pb.go +++ b/pb/library_db.pb.go @@ -20,61 +20,6 @@ const ( _ = 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 @@ -92,7 +37,7 @@ type DBLibrary struct { func (x *DBLibrary) Reset() { *x = DBLibrary{} if protoimpl.UnsafeEnabled { - mi := &file_library_library_db_proto_msgTypes[1] + mi := &file_library_library_db_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -105,7 +50,7 @@ func (x *DBLibrary) String() string { func (*DBLibrary) ProtoMessage() {} func (x *DBLibrary) ProtoReflect() protoreflect.Message { - mi := &file_library_library_db_proto_msgTypes[1] + mi := &file_library_library_db_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -118,7 +63,7 @@ func (x *DBLibrary) ProtoReflect() protoreflect.Message { // Deprecated: Use DBLibrary.ProtoReflect.Descriptor instead. func (*DBLibrary) Descriptor() ([]byte, []int) { - return file_library_library_db_proto_rawDescGZIP(), []int{1} + return file_library_library_db_proto_rawDescGZIP(), []int{0} } func (x *DBLibrary) GetId() string { @@ -170,35 +115,130 @@ func (x *DBLibrary) GetStoryid() int32 { return 0 } +// 羁绊英雄数据 +type DBHeroFetter 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 + Heroid string `protobuf:"bytes,3,opt,name=heroid,proto3" json:"heroid"` // 英雄配置表id + History int32 `protobuf:"varint,4,opt,name=history,proto3" json:"history"` // 传记往事ID + Favorlv int32 `protobuf:"varint,5,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级 + Stroyprize int32 `protobuf:"varint,6,opt,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励 +} + +func (x *DBHeroFetter) Reset() { + *x = DBHeroFetter{} + if protoimpl.UnsafeEnabled { + mi := &file_library_library_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DBHeroFetter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBHeroFetter) ProtoMessage() {} + +func (x *DBHeroFetter) 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 DBHeroFetter.ProtoReflect.Descriptor instead. +func (*DBHeroFetter) Descriptor() ([]byte, []int) { + return file_library_library_db_proto_rawDescGZIP(), []int{1} +} + +func (x *DBHeroFetter) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBHeroFetter) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBHeroFetter) GetHeroid() string { + if x != nil { + return x.Heroid + } + return "" +} + +func (x *DBHeroFetter) GetHistory() int32 { + if x != nil { + return x.History + } + return 0 +} + +func (x *DBHeroFetter) GetFavorlv() int32 { + if x != nil { + return x.Favorlv + } + return 0 +} + +func (x *DBHeroFetter) GetStroyprize() int32 { + if x != nil { + return x.Stroyprize + } + 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, 0xbf, 0x02, 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, 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x50, 0x72, - 0x69, 0x7a, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, - 0x6f, 0x72, 0x79, 0x69, 0x64, 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, 0x09, 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, 0x1a, 0x38, - 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x7a, 0x65, 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, + 0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x02, 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, 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x2e, 0x50, 0x72, 0x69, 0x7a, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 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, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x69, 0x64, 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, 0x09, 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, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x7a, 0x65, 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, 0x22, 0x9c, 0x01, 0x0a, + 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 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, + 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x6c, 0x76, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x6c, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x73, + 0x74, 0x72, 0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -215,10 +255,10 @@ func file_library_library_db_proto_rawDescGZIP() []byte { var file_library_library_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_library_library_db_proto_goTypes = []interface{}{ - (*Fetter)(nil), // 0: Fetter - (*DBLibrary)(nil), // 1: DBLibrary - nil, // 2: DBLibrary.HeroEntry - nil, // 3: DBLibrary.PrizeEntry + (*DBLibrary)(nil), // 0: DBLibrary + (*DBHeroFetter)(nil), // 1: DBHeroFetter + nil, // 2: DBLibrary.HeroEntry + nil, // 3: DBLibrary.PrizeEntry } var file_library_library_db_proto_depIdxs = []int32{ 2, // 0: DBLibrary.hero:type_name -> DBLibrary.HeroEntry @@ -237,7 +277,7 @@ func file_library_library_db_proto_init() { } if !protoimpl.UnsafeEnabled { file_library_library_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Fetter); i { + switch v := v.(*DBLibrary); i { case 0: return &v.state case 1: @@ -249,7 +289,7 @@ func file_library_library_db_proto_init() { } } file_library_library_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DBLibrary); i { + switch v := v.(*DBHeroFetter); i { case 0: return &v.state case 1: diff --git a/pb/userexpand.pb.go b/pb/userexpand.pb.go index 2f08c7ce0..85869fcb5 100644 --- a/pb/userexpand.pb.go +++ b/pb/userexpand.pb.go @@ -364,70 +364,6 @@ func (x *Figure) GetComplexion() *Complexion { return nil } -// 传记 -type Story struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - History int32 `protobuf:"varint,1,opt,name=history,proto3" json:"history"` // 传记往事ID - Favorlv int32 `protobuf:"varint,2,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级 - Stroyprize int32 `protobuf:"varint,3,opt,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励 -} - -func (x *Story) Reset() { - *x = Story{} - if protoimpl.UnsafeEnabled { - mi := &file_userexpand_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Story) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Story) ProtoMessage() {} - -func (x *Story) ProtoReflect() protoreflect.Message { - mi := &file_userexpand_proto_msgTypes[6] - 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 Story.ProtoReflect.Descriptor instead. -func (*Story) Descriptor() ([]byte, []int) { - return file_userexpand_proto_rawDescGZIP(), []int{6} -} - -func (x *Story) GetHistory() int32 { - if x != nil { - return x.History - } - return 0 -} - -func (x *Story) GetFavorlv() int32 { - if x != nil { - return x.Favorlv - } - return 0 -} - -func (x *Story) GetStroyprize() int32 { - if x != nil { - return x.Stroyprize - } - return 0 -} - //用户扩展数据 type DBUserExpand struct { state protoimpl.MessageState @@ -461,7 +397,7 @@ type DBUserExpand struct { func (x *DBUserExpand) Reset() { *x = DBUserExpand{} if protoimpl.UnsafeEnabled { - mi := &file_userexpand_proto_msgTypes[7] + mi := &file_userexpand_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -474,7 +410,7 @@ func (x *DBUserExpand) String() string { func (*DBUserExpand) ProtoMessage() {} func (x *DBUserExpand) ProtoReflect() protoreflect.Message { - mi := &file_userexpand_proto_msgTypes[7] + mi := &file_userexpand_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -487,7 +423,7 @@ func (x *DBUserExpand) ProtoReflect() protoreflect.Message { // Deprecated: Use DBUserExpand.ProtoReflect.Descriptor instead. func (*DBUserExpand) Descriptor() ([]byte, []int) { - return file_userexpand_proto_rawDescGZIP(), []int{7} + return file_userexpand_proto_rawDescGZIP(), []int{6} } func (x *DBUserExpand) GetId() string { @@ -672,75 +608,69 @@ var file_userexpand_proto_rawDesc = []byte{ 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x18, 0x0a, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x76, - 0x6f, 0x72, 0x6c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x61, 0x76, 0x6f, - 0x72, 0x6c, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x70, 0x72, - 0x69, 0x7a, 0x65, 0x22, 0xd5, 0x07, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, - 0x70, 0x61, 0x6e, 0x64, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x64, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x64, 0x6e, 0x6f, 0x74, 0x69, 0x66, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, - 0x64, 0x61, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, - 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, - 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x74, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x68, 0x61, - 0x74, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x69, - 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x74, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, - 0x64, 0x2e, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, - 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x46, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, - 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x61, 0x79, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, 0x61, 0x79, - 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, 0x6b, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, 0x6b, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x73, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, - 0x69, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x44, 0x18, 0x10, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x4f, 0x44, 0x12, 0x34, 0x0a, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, - 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, - 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x16, 0x6d, 0x6f, 0x6f, 0x6e, - 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, - 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, - 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, - 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x14, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, - 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, - 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 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, 0x1a, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, - 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, + 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0xd5, 0x07, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, + 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x64, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x64, 0x6e, 0x6f, + 0x74, 0x69, 0x66, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x49, + 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, + 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, + 0x74, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x63, 0x68, 0x61, 0x74, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x6d, + 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x06, 0x74, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, + 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x74, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x46, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, + 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x44, 0x42, 0x55, + 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x64, + 0x61, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x64, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, 0x65, 0x65, + 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x77, + 0x65, 0x65, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x44, 0x12, + 0x24, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x44, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x4f, 0x44, 0x12, 0x34, 0x0a, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, + 0x74, 0x61, 0x73, 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, + 0x79, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x36, 0x0a, 0x16, 0x6d, + 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, + 0x69, 0x67, 0x67, 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x6d, 0x6f, 0x6f, + 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x6c, 0x6f, 0x67, + 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, + 0x69, 0x6e, 0x75, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x16, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x54, + 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x1a, 0x46, 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 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 ( @@ -755,7 +685,7 @@ func file_userexpand_proto_rawDescGZIP() []byte { return file_userexpand_proto_rawDescData } -var file_userexpand_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_userexpand_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_userexpand_proto_goTypes = []interface{}{ (*Hair)(nil), // 0: Hair (*Eyes)(nil), // 1: Eyes @@ -763,10 +693,9 @@ var file_userexpand_proto_goTypes = []interface{}{ (*Body)(nil), // 3: Body (*Complexion)(nil), // 4: Complexion (*Figure)(nil), // 5: Figure - (*Story)(nil), // 6: Story - (*DBUserExpand)(nil), // 7: DBUserExpand - nil, // 8: DBUserExpand.TujianEntry - nil, // 9: DBUserExpand.PreinstallEntry + (*DBUserExpand)(nil), // 6: DBUserExpand + nil, // 7: DBUserExpand.TujianEntry + nil, // 8: DBUserExpand.PreinstallEntry } var file_userexpand_proto_depIdxs = []int32{ 0, // 0: Figure.hair:type_name -> Hair @@ -774,8 +703,8 @@ var file_userexpand_proto_depIdxs = []int32{ 2, // 2: Figure.mouth:type_name -> Mouth 3, // 3: Figure.body:type_name -> Body 4, // 4: Figure.complexion:type_name -> Complexion - 8, // 5: DBUserExpand.tujian:type_name -> DBUserExpand.TujianEntry - 9, // 6: DBUserExpand.preinstall:type_name -> DBUserExpand.PreinstallEntry + 7, // 5: DBUserExpand.tujian:type_name -> DBUserExpand.TujianEntry + 8, // 6: DBUserExpand.preinstall:type_name -> DBUserExpand.PreinstallEntry 5, // 7: DBUserExpand.PreinstallEntry.value:type_name -> Figure 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type @@ -863,18 +792,6 @@ func file_userexpand_proto_init() { } } file_userexpand_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Story); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_userexpand_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DBUserExpand); i { case 0: return &v.state @@ -893,7 +810,7 @@ func file_userexpand_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_userexpand_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 9, NumExtensions: 0, NumServices: 0, },