改协议名

This commit is contained in:
wh_zcy 2022-10-11 09:39:25 +08:00
parent d95e45c574
commit cb703366fc
4 changed files with 20 additions and 5 deletions

View File

@ -283,7 +283,7 @@ func (this *appTerm) LazyInit(obs observer.Observer) error {
//资源管理器 //资源管理器
openExplor := func(dir string) { openExplor := func(dir string) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
if err := exec.Command("explorer", filepath.Join(localDir.Text)).Start(); err != nil { if err := exec.Command("explorer", filepath.Join(dir)).Start(); err != nil {
dialog.ShowError(errors.WithMessage(err, "请确认Json目录是否填写正确"), toolWin.w) dialog.ShowError(errors.WithMessage(err, "请确认Json目录是否填写正确"), toolWin.w)
return return
} }

View File

@ -87,15 +87,14 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
customForm := widget.NewForm(widget.NewFormItem("bingo", bingoEntry)) customForm := widget.NewForm(widget.NewFormItem("bingo", bingoEntry))
customForm.OnSubmit = func() { customForm.OnSubmit = func() {
if bingoEntry.Text == "" || strings.HasPrefix(bingoEntry.Text, "bingo:") { if bingoEntry.Text == "" || !strings.HasPrefix(bingoEntry.Text, "bingo:") {
dialog.ShowError(errors.New("请填写完整并加上bingo:前缀"), this.w) dialog.ShowError(errors.New("请填写完整并加上bingo:前缀"), this.w)
return return
} }
bingo := fmt.Sprintf("bingo:%s", bingoEntry.Text)
if err := service.GetPttService().SendToClient( if err := service.GetPttService().SendToClient(
t.MainType, t.MainType,
t.SubType, t.SubType,
&pb.GMCmdReq{Cmod: bingo}, &pb.GMCmdReq{Cmod: bingoEntry.Text},
); err != nil { ); err != nil {
logrus.Error(err) logrus.Error(err)
return return

View File

@ -316,7 +316,7 @@ func (this *ModuleRtask) BingoRtask(session comm.IUserSession, groupId, rtaskId
return err return err
} }
if err := session.SendMsg(string(this.GetType()), "FinishIds", if err := session.SendMsg(string(this.GetType()), "finishids",
&pb.RtaskFinishIdsPush{RtaskId: frtaskArr.RtaskIds, GroupId: groupId}); err != nil { &pb.RtaskFinishIdsPush{RtaskId: frtaskArr.RtaskIds, GroupId: groupId}); err != nil {
return err return err
} }

View File

@ -1,6 +1,7 @@
package utils package utils
import ( import (
"fmt"
"time" "time"
"github.com/jinzhu/now" "github.com/jinzhu/now"
@ -37,3 +38,18 @@ func IsYestoday(timestamp int64) bool {
yesTime := time.Now().AddDate(0, 0, -1) yesTime := time.Now().AddDate(0, 0, -1)
return tt.Year() == yesTime.Year() && tt.Month() == yesTime.Month() && tt.Day() == yesTime.Day() return tt.Year() == yesTime.Year() && tt.Month() == yesTime.Month() && tt.Day() == yesTime.Day()
} }
func MatrixingHour(beginTime string) {
location, err := time.LoadLocation("Asia/Shanghai")
if err != nil {
return
}
myConfig := &now.Config{
WeekStartDay: time.Monday,
TimeLocation: location,
TimeFormats: []string{"2006-01-02 15:04:05"},
}
t, _ := myConfig.Parse(beginTime)
fmt.Println(t)
}