商队任务接口

This commit is contained in:
wh_zcy 2023-05-16 17:18:27 +08:00
parent de36b0da8f
commit 454d12f7ce
3 changed files with 35 additions and 3 deletions

View File

@ -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)

View File

@ -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 {

View File

@ -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) {
}