This commit is contained in:
孟帅
2023-07-20 18:01:10 +08:00
parent 9113fc5297
commit 373d9627fb
492 changed files with 12170 additions and 6982 deletions

View File

@@ -9,6 +9,7 @@ import (
"context"
"errors"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/consts"
@@ -149,6 +150,24 @@ type TableStatusInp struct {
Status int `json:"status" dc:"状态"`
}
func (in *TableStatusInp) Filter(ctx context.Context) (err error) {
if in.Id <= 0 {
err = gerror.New("ID不能为空")
return
}
if in.Status <= 0 {
err = gerror.New("状态不能为空")
return
}
if !validate.InSlice(consts.StatusSlice, in.Status) {
err = gerror.New("状态不正确")
return
}
return
}
type TableStatusModel struct{}
// TableSwitchInp 更新开关状态