mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
refactor: json tag完善
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package form
|
||||
|
||||
type DbForm struct {
|
||||
Id uint64
|
||||
Id uint64 `json:"id"`
|
||||
Name string `binding:"required" json:"name"`
|
||||
Type string `binding:"required" json:"type"` // 类型,mysql oracle等
|
||||
Host string `binding:"required" json:"host"`
|
||||
@@ -17,10 +17,10 @@ type DbForm struct {
|
||||
}
|
||||
|
||||
type DbSqlSaveForm struct {
|
||||
Name string `binding:"required"`
|
||||
Sql string `binding:"required"`
|
||||
Type int `binding:"required"`
|
||||
Db string `binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Sql string `json:"sql" binding:"required"`
|
||||
Type int `json:"type" binding:"required"`
|
||||
Db string `json:"db" binding:"required"`
|
||||
}
|
||||
|
||||
// 数据库SQL执行表单
|
||||
|
||||
@@ -19,37 +19,37 @@ type MachineForm struct {
|
||||
}
|
||||
|
||||
type MachineRunForm struct {
|
||||
MachineId int64 `binding:"required"`
|
||||
Cmd string `binding:"required"`
|
||||
MachineId int64 `json:"machineId" binding:"required"`
|
||||
Cmd string `json:"cmd" binding:"required"`
|
||||
}
|
||||
|
||||
type MachineFileForm struct {
|
||||
Id uint64
|
||||
Name string `binding:"required"`
|
||||
MachineId uint64 `binding:"required"`
|
||||
Type int `binding:"required"`
|
||||
Path string `binding:"required"`
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
MachineId uint64 `json:"machineId" binding:"required"`
|
||||
Type int `json:"type" binding:"required"`
|
||||
Path string `json:"path" binding:"required"`
|
||||
}
|
||||
|
||||
type MachineScriptForm struct {
|
||||
Id uint64
|
||||
Name string `binding:"required"`
|
||||
MachineId uint64 `binding:"required"`
|
||||
Type int `binding:"required"`
|
||||
Description string `binding:"required"`
|
||||
Params string
|
||||
Script string `binding:"required"`
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
MachineId uint64 `json:"machineId" binding:"required"`
|
||||
Type int `json:"type" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
Params string `json:"params"`
|
||||
Script string `json:"script" binding:"required"`
|
||||
}
|
||||
|
||||
type MachineCreateFileForm struct {
|
||||
Path string `binding:"required"`
|
||||
Type string `binding:"required"`
|
||||
Path string `json:"path" binding:"required"`
|
||||
Type string `json:"type" binding:"required"`
|
||||
}
|
||||
|
||||
type MachineFileUpdateForm struct {
|
||||
Content string `binding:"required"`
|
||||
Id uint64 `binding:"required"`
|
||||
Path string `binding:"required"`
|
||||
Content string `json:"content" binding:"required"`
|
||||
Id uint64 `json:"id" binding:"required"`
|
||||
Path string `json:"path" binding:"required"`
|
||||
}
|
||||
|
||||
// 授权凭证
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package form
|
||||
|
||||
type Mongo struct {
|
||||
Id uint64
|
||||
Id uint64 `json:"id"`
|
||||
Uri string `binding:"required" json:"uri"`
|
||||
SshTunnelMachineId int `json:"sshTunnelMachineId"` // ssh隧道机器id
|
||||
Name string `binding:"required" json:"name"`
|
||||
@@ -23,8 +23,8 @@ type MongoRunCommand struct {
|
||||
type MongoFindCommand struct {
|
||||
MongoCommand
|
||||
Sort map[string]any `json:"sort"`
|
||||
Skip int64
|
||||
Limit int64
|
||||
Skip int64 `json:"skip"`
|
||||
Limit int64 `json:"limit"`
|
||||
}
|
||||
|
||||
type MongoUpdateByIdCommand struct {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package form
|
||||
|
||||
type Redis struct {
|
||||
Id uint64
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Host string `binding:"required" json:"host"`
|
||||
Host string `json:"host" binding:"required"`
|
||||
Password string `json:"password"`
|
||||
Mode string `json:"mode"`
|
||||
Db string `json:"db"`
|
||||
@@ -25,7 +25,7 @@ type Expire struct {
|
||||
|
||||
type KeyInfo struct {
|
||||
Key string `binding:"required" json:"key"`
|
||||
Timed int64
|
||||
Timed int64 `json:"timed"`
|
||||
}
|
||||
|
||||
type StringValue struct {
|
||||
@@ -51,8 +51,8 @@ type ListValue struct {
|
||||
// list lset命令参数入参
|
||||
type ListSetValue struct {
|
||||
Key string `binding:"required" json:"key"`
|
||||
Index int64
|
||||
Value any `binding:"required" json:"value"`
|
||||
Index int64 `json:"index"`
|
||||
Value any `binding:"required" json:"value"`
|
||||
}
|
||||
|
||||
type RedisScanForm struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package form
|
||||
|
||||
type AccountCreateForm struct {
|
||||
Id uint64
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Username string `json:"username" binding:"required,min=4,max=16"`
|
||||
Password string `json:"password"`
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package form
|
||||
|
||||
type ConfigForm struct {
|
||||
Id int
|
||||
Name string
|
||||
Key string
|
||||
Params string
|
||||
Value string
|
||||
Id int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Key string `json:"key"`
|
||||
Params string `json:"params"`
|
||||
Value string `json:"value"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ package form
|
||||
type LoginForm struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
Password string `binding:"required"`
|
||||
Captcha string
|
||||
Cid string
|
||||
Captcha string `json:"captcha"`
|
||||
Cid string `json:"cid"`
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package form
|
||||
|
||||
type ResourceForm struct {
|
||||
Pid int
|
||||
Id int
|
||||
Code string `binding:"required"`
|
||||
Name string `binding:"required"`
|
||||
Type int `binding:"required,oneof=1 2"`
|
||||
Weight int
|
||||
Meta map[string]any
|
||||
Pid int `json:"pid"`
|
||||
Id int `json:"id"`
|
||||
Code string `json:"code" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Type int `json:"type" binding:"required,oneof=1 2"`
|
||||
Weight int `json:"weight"`
|
||||
Meta map[string]any `json:"meta"`
|
||||
}
|
||||
|
||||
type MenuResourceMeta struct {
|
||||
RouteName string `binding:"required"`
|
||||
Component string `binding:"required"`
|
||||
Redirect string
|
||||
Path string `binding:"required"`
|
||||
IsKeepAlive bool //
|
||||
IsHide bool // 是否在菜单栏显示,默认显示
|
||||
IsAffix bool // tag标签是否不可删除
|
||||
IsIframe bool
|
||||
Link string
|
||||
RouteName string `json:"routeName" binding:"required"`
|
||||
Component string `json:"component" binding:"required"`
|
||||
Redirect string `json:"redirect"`
|
||||
Path string `json:"path" binding:"required"`
|
||||
IsKeepAlive bool `json:"isKeepAlive"` //
|
||||
IsHide bool `json:"isHide"` // 是否在菜单栏显示,默认显示
|
||||
IsAffix bool `json:"isAffix"` // tag标签是否不可删除
|
||||
IsIframe bool `json:"isIframe"`
|
||||
Link string `json:"link"`
|
||||
}
|
||||
|
||||
@@ -2,21 +2,21 @@ package form
|
||||
|
||||
// 分配角色资源表单信息
|
||||
type RoleResourceForm struct {
|
||||
Id int
|
||||
ResourceIds string
|
||||
Id int `json:"id"`
|
||||
ResourceIds string `json:"resourceIds"`
|
||||
}
|
||||
|
||||
// 保存角色信息表单
|
||||
type RoleForm struct {
|
||||
Id int
|
||||
Id int `json:"id"`
|
||||
Status int `json:"status"` // 1:可用;-1:不可用
|
||||
Name string `binding:"required"`
|
||||
Code string `binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Code string `json:"code" binding:"required"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
// 账号分配角色表单
|
||||
type AccountRoleForm struct {
|
||||
Id int `binding:"required"`
|
||||
RoleIds string
|
||||
Id int `json:"id" binding:"required"`
|
||||
RoleIds string `json:"roleIds"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user