更换为null_time,null_int

This commit is contained in:
xiangheng
2024-08-16 01:03:54 +08:00
parent 1fc96a59b0
commit edd6d9df0e
94 changed files with 2893 additions and 1126 deletions

View File

@@ -8,12 +8,12 @@ import (
// SystemConfig 系统配置实体
type SystemConfig struct {
ID uint `gorm:"primarykey;comment:'主键'"`
Type string `gorm:"default:'';comment:'类型''"`
Name string `gorm:"not null;default:'';comment:'键'"`
Value string `gorm:"type:text;not null;default:'';comment:'值'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.TsTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
ID uint `gorm:"primarykey;comment:'主键'"`
Type string `gorm:"default:'';comment:'类型''"`
Name string `gorm:"not null;default:'';comment:'键'"`
Value string `gorm:"type:text;not null;default:'';comment:'值'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.NullTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
}
// SystemAuthAdmin 系统管理员实体
@@ -31,10 +31,10 @@ type SystemAuthAdmin struct {
IsDisable uint8 `gorm:"not null;default:0;comment:'是否禁用: 0=否, 1=是'"`
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
LastLoginIp string `gorm:"not null;default:'';comment:'最后登录IP'"`
LastLoginTime core.TsTime `gorm:"default:null;comment:'最后登录时间'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.TsTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
DeleteTime core.TsTime `gorm:"default:null;comment:'删除时间'"`
LastLoginTime core.NullTime `gorm:"default:null;comment:'最后登录时间'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.NullTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
DeleteTime core.NullTime `gorm:"default:null;comment:'删除时间'"`
}
// SystemAuthMenu 系统菜单实体
@@ -53,8 +53,8 @@ type SystemAuthMenu struct {
IsCache uint8 `gorm:"not null;default:0;comment:'是否缓存: 0=否, 1=是''"`
IsShow uint8 `gorm:"not null;default:1;comment:'是否显示: 0=否, 1=是'"`
IsDisable soft_delete.DeletedAt `gorm:"not null;default:0;comment:'是否禁用: 0=否, 1=是'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.TsTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.NullTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
}
// SystemAuthPerm 系统角色菜单实体
@@ -66,13 +66,13 @@ type SystemAuthPerm struct {
// SystemAuthRole 系统角色实体
type SystemAuthRole struct {
ID uint `gorm:"primarykey;comment:'主键'"`
Name string `gorm:"not null;default:'';comment:'角色名称''"`
Remark string `gorm:"not null;default:'';comment:'备注信息'"`
IsDisable uint8 `gorm:"not null;default:0;comment:'是否禁用: 0=否, 1=是'"`
Sort uint16 `gorm:"not null;default:0;comment:'角色排序'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.TsTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
ID uint `gorm:"primarykey;comment:'主键'"`
Name string `gorm:"not null;default:'';comment:'角色名称''"`
Remark string `gorm:"not null;default:'';comment:'备注信息'"`
IsDisable uint8 `gorm:"not null;default:0;comment:'是否禁用: 0=否, 1=是'"`
Sort uint16 `gorm:"not null;default:0;comment:'角色排序'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.NullTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
}
// SystemAuthDept 系统部门实体
@@ -86,9 +86,9 @@ type SystemAuthDept struct {
Sort uint16 `gorm:"not null;default:0;comment:'排序编号'"`
IsStop uint8 `gorm:"not null;default:0;comment:'是否停用: 0=否, 1=是'"`
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.TsTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
DeleteTime core.TsTime `gorm:"default:0;comment:'删除时间'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.NullTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
DeleteTime core.NullTime `gorm:"default:0;comment:'删除时间'"`
}
// SystemAuthPost 系统岗位管理
@@ -100,37 +100,37 @@ type SystemAuthPost struct {
Sort uint16 `gorm:"not null;default:0;comment:'岗位排序'"`
IsStop uint8 `gorm:"not null;default:0;comment:'是否停用: 0=否, 1=是'"`
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.TsTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
DeleteTime core.TsTime `gorm:"default:null;comment:'删除时间'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
UpdateTime core.NullTime `gorm:"autoUpdateTime;not null;comment:'更新时间'"`
DeleteTime core.NullTime `gorm:"default:null;comment:'删除时间'"`
}
// SystemLogLogin 系统登录日志实体
type SystemLogLogin struct {
ID uint `gorm:"primarykey;comment:'主键'"`
AdminId uint `gorm:"not null;default:0;comment:'管理员ID'"`
Username string `gorm:"not null;default:'';comment:'登录账号'"`
Ip string `gorm:"not null;default:'';comment:'登录地址'"`
Os string `gorm:"not null;default:'';comment:'操作系统'"`
Browser string `gorm:"not null;default:'';comment:'浏览器'"`
Status uint8 `gorm:"not null;default:0;comment:'操作状态: 1=成功, 0=失败'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
ID uint `gorm:"primarykey;comment:'主键'"`
AdminId uint `gorm:"not null;default:0;comment:'管理员ID'"`
Username string `gorm:"not null;default:'';comment:'登录账号'"`
Ip string `gorm:"not null;default:'';comment:'登录地址'"`
Os string `gorm:"not null;default:'';comment:'操作系统'"`
Browser string `gorm:"not null;default:'';comment:'浏览器'"`
Status uint8 `gorm:"not null;default:0;comment:'操作状态: 1=成功, 0=失败'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
}
// SystemLogOperate 系统操作日志实体
type SystemLogOperate struct {
ID uint `gorm:"primarykey;comment:'主键'"`
AdminId uint `gorm:"not null;default:0;comment:'操作人ID'"`
Type string `gorm:"not null;default:'';comment:'请求类型: GET/POST/PUT'"`
Title string `gorm:"default:'';comment:'操作标题'"`
Ip string `gorm:"not null;default:'';comment:'请求IP'"`
Url string `gorm:"not null;default:'';comment:'请求接口'"`
Method string `gorm:"not null;default:'';comment:'请求方法'"`
Args string `gorm:"comment:'请求参数'"`
Error string `gorm:"comment:'错误信息'"`
Status uint8 `gorm:"not null;default:0;comment:'执行状态: 1=成功, 2=失败'"`
StartTime core.TsTime `gorm:"not null;default:0;comment:'开始时间'"`
EndTime core.TsTime `gorm:"not null;default:0;comment:'结束时间'"`
TaskTime int64 `gorm:"not null;default:0;comment:'执行耗时'"`
CreateTime core.TsTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
ID uint `gorm:"primarykey;comment:'主键'"`
AdminId uint `gorm:"not null;default:0;comment:'操作人ID'"`
Type string `gorm:"not null;default:'';comment:'请求类型: GET/POST/PUT'"`
Title string `gorm:"default:'';comment:'操作标题'"`
Ip string `gorm:"not null;default:'';comment:'请求IP'"`
Url string `gorm:"not null;default:'';comment:'请求接口'"`
Method string `gorm:"not null;default:'';comment:'请求方法'"`
Args string `gorm:"comment:'请求参数'"`
Error string `gorm:"comment:'错误信息'"`
Status uint8 `gorm:"not null;default:0;comment:'执行状态: 1=成功, 2=失败'"`
StartTime core.NullTime `gorm:"not null;default:0;comment:'开始时间'"`
EndTime core.NullTime `gorm:"not null;default:0;comment:'结束时间'"`
TaskTime int64 `gorm:"not null;default:0;comment:'执行耗时'"`
CreateTime core.NullTime `gorm:"autoCreateTime;not null;comment:'创建时间'"`
}