From 454d12f7ce5bef87974a6034448616d4201d71de Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 16 May 2023 17:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E9=98=9F=E4=BB=BB=E5=8A=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/ui/views/globalview.go | 11 ++++++++--- comm/imodule.go | 4 ++++ modules/worldtask/module.go | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/cmd/v2/ui/views/globalview.go b/cmd/v2/ui/views/globalview.go index e56a9f3f2..9f5a028c4 100644 --- a/cmd/v2/ui/views/globalview.go +++ b/cmd/v2/ui/views/globalview.go @@ -8,6 +8,7 @@ import ( "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/widget" "github.com/sirupsen/logrus" + "github.com/spf13/cast" ) // 全局实例配置 @@ -32,25 +33,29 @@ func (this *GlobalConfView) CreateView(t *model.TestCase) fyne.CanvasObject { redisForm := widget.NewForm() //mongo form mongoUrl := widget.NewEntry() + port := widget.NewEntry() user := widget.NewEntry() passd := widget.NewEntry() mongoDatabase := widget.NewEntry() mongoForm := widget.NewForm( - widget.NewFormItem("Addr", mongoUrl), + widget.NewFormItem("Addr", container.NewBorder(nil, nil, nil, port, mongoUrl)), widget.NewFormItem("User", user), widget.NewFormItem("Pass", passd), widget.NewFormItem("DBName", mongoDatabase), ) if this.conf.ServiceDBInfo != nil { - user.Text = this.conf.MgoDB.Name + user.Text = this.conf.MgoDB.User passd.Text = this.conf.MgoDB.Password mongoUrl.Text = this.conf.MgoDB.Host + port.Text = cast.ToString(this.conf.MgoDB.Port) mongoDatabase.Text = this.conf.MgoDB.Database } bottomBtn := widget.NewButton("保存", func() { - + if err := this.storage.StoreConfig(this.conf); err != nil { + logrus.Error(err) + } }) layout := container.NewGridWithRows(2, redisForm, mongoForm) diff --git a/comm/imodule.go b/comm/imodule.go index a0f081e32..2c3eb3b22 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -390,6 +390,10 @@ type ( BingoJumpTask(session IUserSession, groupId, rtaskId int32) error // 查询我的世界任务 GetMyWorldtask(uid string) *pb.DBWorldtask + // + GetWorldTaskBy(uid string, groupId int32) int32 + + UpdateTaskStatus(uid string,taskId int32) } // 支线剧情任务 ILinestory interface { diff --git a/modules/worldtask/module.go b/modules/worldtask/module.go index 811293ce2..30651f4c6 100644 --- a/modules/worldtask/module.go +++ b/modules/worldtask/module.go @@ -210,3 +210,26 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId return session.SendMsg(string(this.GetType()), "finishids", rsp) } + +// 返回任务ID +func (this *Worldtask) GetWorldTaskBy(uid string, groupId int32) (taskId int32) { + mytask, err := this.modelWorldtask.getWorldtask(uid) + if err != nil { + return 0 + } + if gwt, err := this.configure.getWorldtaskCfg(); err == nil { + for _, v := range gwt.GetDataList() { + if v.Group == groupId && v.Des == 5 { + if _, ok := utils.Findx(mytask.TaskList, v.Key); !ok { + return v.Key + } + } + } + } + + return +} + +func(this *Worldtask) UpdateTaskStatus(uid string,taskId int32) { + +} \ No newline at end of file