diff --git a/admin/src/api/system/corn.ts b/admin/src/api/system/corn.ts
index a99e2c4..4c55f67 100644
--- a/admin/src/api/system/corn.ts
+++ b/admin/src/api/system/corn.ts
@@ -23,12 +23,14 @@ export type type_system_corn_query = {
TaskName?: string
TaskCode?: string
CornExpr?: string
- Status?: number
+ Status?: any
CreatedBy?: string
CreateTimeStart?: string
CreateTimeEnd?: string
UpdateTimeStart?: string
UpdateTimeEnd?: string
+ CreatedByNickname?: string
+ CreatedByUsername?: string
}
// 添加编辑
export type type_system_corn_edit = {
diff --git a/admin/src/components/material/index.vue b/admin/src/components/material/index.vue
index 4e110c6..aeb7ece 100644
--- a/admin/src/components/material/index.vue
+++ b/admin/src/components/material/index.vue
@@ -112,7 +112,7 @@
-
本地上传
-
+
diff --git a/admin/src/components/upload/index.vue b/admin/src/components/upload/Upload.vue
similarity index 100%
rename from admin/src/components/upload/index.vue
rename to admin/src/components/upload/Upload.vue
diff --git a/admin/src/views/monitor/project/index.vue b/admin/src/views/monitor/project/index.vue
index 891b9a8..5b51d8d 100644
--- a/admin/src/views/monitor/project/index.vue
+++ b/admin/src/views/monitor/project/index.vue
@@ -75,7 +75,7 @@
新增
-
导入
-
+
-
导入
-
+
diff --git a/admin/src/views/system/corn/index.vue b/admin/src/views/system/corn/index.vue
index 2037c2a..056a106 100644
--- a/admin/src/views/system/corn/index.vue
+++ b/admin/src/views/system/corn/index.vue
@@ -21,8 +21,8 @@
-
-
+
+
@@ -51,7 +51,7 @@
新增
-
导入
-
+
-
+
@@ -173,6 +173,7 @@ const queryParams = reactive({
CornExpr: null,
Status: null,
CreatedBy: null,
+ CreatedByNickname: null,
CreateTimeStart: null,
CreateTimeEnd: null,
UpdateTimeStart: null,
diff --git a/admin/src/views/user/protocol/index.vue b/admin/src/views/user/protocol/index.vue
index 0f91f6c..7ef6f31 100644
--- a/admin/src/views/user/protocol/index.vue
+++ b/admin/src/views/user/protocol/index.vue
@@ -46,7 +46,7 @@
新增
-
导入
-
+
-
+
diff --git a/server/app/schema/system_corn_schema.go b/server/app/schema/system_corn_schema.go
index d25bf5a..9e2af69 100644
--- a/server/app/schema/system_corn_schema.go
+++ b/server/app/schema/system_corn_schema.go
@@ -47,13 +47,13 @@ type SystemCornDelBatchReq struct {
// SystemCornResp 定时任务返回信息
type SystemCornResp struct {
- Id string `swaggertype:"string"` //
- TaskName core.NullString `swaggertype:"string"` // 任务名称
- TaskCode core.NullString `swaggertype:"string"` // 任务编码
- CornExpr core.NullString `swaggertype:"string"` // corn表达式
- Status core.NullInt `swaggertype:"number"` // 状态
- CreatedBy core.NullString `swaggertype:"string"` // 创建人
- CreatedUser systemSchema.SystemAuthAdminSimpleInfo `swaggertype:"string"` // 创建人
- CreateTime core.NullTime `swaggertype:"string"` // 创建时间
- UpdateTime core.NullTime `swaggertype:"string"` // 更新时间
+ Id string `swaggertype:"string"` //
+ TaskName core.NullString `swaggertype:"string"` // 任务名称
+ TaskCode core.NullString `swaggertype:"string"` // 任务编码
+ CornExpr core.NullString `swaggertype:"string"` // corn表达式
+ Status core.NullInt `swaggertype:"number"` // 状态
+ CreatedBy core.NullString `swaggertype:"string"` // 创建人
+ CreatedByUser systemSchema.SystemAuthAdminSimpleInfo `swaggertype:"string"` // 创建人
+ CreateTime core.NullTime `swaggertype:"string"` // 创建时间
+ UpdateTime core.NullTime `swaggertype:"string"` // 更新时间
}
diff --git a/server/app/schema/user_protocol_schema.go b/server/app/schema/user_protocol_schema.go
index e9a1209..d387716 100644
--- a/server/app/schema/user_protocol_schema.go
+++ b/server/app/schema/user_protocol_schema.go
@@ -57,12 +57,12 @@ type UserProtocolDelBatchReq struct {
// UserProtocolResp 用户协议返回信息
type UserProtocolResp struct {
UserProtocolPrimarykey
- Tag core.NullString `swaggertype:"string"` // 标识
- Version core.NullInt `swaggertype:"number"` // 版本
- Title core.NullString `swaggertype:"string"` // 标题
- Content core.NullString `swaggertype:"string"` // 协议内容
- CreateTime core.NullTime `swaggertype:"string"` // 创建时间
- UpdateTime core.NullTime `swaggertype:"string"` // 更新时间
- CreatedBy string `swaggertype:"string"` // 创建人id
- CreatedUser systemSchema.SystemAuthAdminSimpleInfo `swaggertype:"string"` // 创建人
+ Tag core.NullString `swaggertype:"string"` // 标识
+ Version core.NullInt `swaggertype:"number"` // 版本
+ Title core.NullString `swaggertype:"string"` // 标题
+ Content core.NullString `swaggertype:"string"` // 协议内容
+ CreateTime core.NullTime `swaggertype:"string"` // 创建时间
+ UpdateTime core.NullTime `swaggertype:"string"` // 更新时间
+ CreatedBy string `swaggertype:"string"` // 创建人id
+ CreatedByUser systemSchema.SystemAuthAdminSimpleInfo `swaggertype:"string"` // 创建人
}
diff --git a/server/app/service/generatorService/tpl_utils/constants.go b/server/app/service/generatorService/tpl_utils/constants.go
index c5d377d..af4d5a5 100644
--- a/server/app/service/generatorService/tpl_utils/constants.go
+++ b/server/app/service/generatorService/tpl_utils/constants.go
@@ -69,6 +69,9 @@ var SqlConstants = sqlConstants{
ColumnNameNotList: []string{"id", "is_delete", "delete_time"},
//页面不需要查询字段
ColumnNameNotQuery: []string{"is_delete", "delete_time"}, //"create_time", "update_time",
+
+ // 常用user id字段
+ ColumnNameUserFiled: []string{"created_by", "updated_by", "deleted_by"},
}
// HtmlConstants HTML相关常量
@@ -109,11 +112,12 @@ type sqlConstants struct {
ColumnTypeInt []string
ColumnTypeFloat []string
- ColumnTimeName []string
- ColumnNameNotAdd []string
- ColumnNameNotEdit []string
- ColumnNameNotList []string
- ColumnNameNotQuery []string
+ ColumnTimeName []string
+ ColumnNameNotAdd []string
+ ColumnNameNotEdit []string
+ ColumnNameNotList []string
+ ColumnNameNotQuery []string
+ ColumnNameUserFiled []string
}
type htmlConstants struct {
diff --git a/server/app/service/generatorService/tpl_utils/templates/gocode/model.go.tpl b/server/app/service/generatorService/tpl_utils/templates/gocode/model.go.tpl
index 01a3723..d501c99 100644
--- a/server/app/service/generatorService/tpl_utils/templates/gocode/model.go.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/gocode/model.go.tpl
@@ -10,9 +10,9 @@ import (
type {{{ toUpperCamelCase .EntityName }}} struct {
{{{- range .Columns }}}
{{{- if ne .ID "" }}}
- {{{- if eq .ColumnName "created_by" }}}
- CreatedBy {{{.GoNullType }}} `gorm:"column:created_by;type:{{{toSqlType .ColumnType .ColumnLength}}};comment:'{{{ .ColumnComment }}}'"`
- CreatedUser system_model.SystemAuthAdminSimple `gorm:"foreignKey:CreatedBy"`
+ {{{- if .IsUid }}}
+ {{{.GoField}}} {{{.GoNullType }}} `gorm:"column:{{{.ColumnName}}};type:{{{toSqlType .ColumnType .ColumnLength}}};comment:'{{{ .ColumnComment }}}'"`
+ {{{.GoField}}}User system_model.SystemAuthAdminSimple `gorm:"foreignKey:{{{.GoField}}}"`
{{{- else if eq .ColumnName "is_delete" }}}
IsDelete soft_delete.DeletedAt `gorm:"column:{{{.ColumnName}}};type:{{{toSqlType .ColumnType .ColumnLength}}};not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
{{{- else if eq .GoType "time.Time" }}}
@@ -28,11 +28,13 @@ type {{{ toUpperCamelCase .EntityName }}} struct {
{{{- if eq .PrimaryKeyGoType "string" }}}
// 自动在创建时设置 UUIDv7
func (u *{{{ toUpperCamelCase .EntityName }}}) BeforeCreate(tx *gorm.DB) error {
- id, err := uuid.NewV7()
- if err != nil {
- return err
- }
- u.Id = id.String()
+ if u.{{{toUpperCamelCase .PrimaryKey }}} == "" {
+ id, err := uuid.NewV7()
+ if err != nil {
+ return err
+ }
+ u.{{{toUpperCamelCase .PrimaryKey }}} = id.String()
+ }
return nil
}
{{{- end }}}
\ No newline at end of file
diff --git a/server/app/service/generatorService/tpl_utils/templates/gocode/service.go.tpl b/server/app/service/generatorService/tpl_utils/templates/gocode/service.go.tpl
index c5ef999..5940467 100644
--- a/server/app/service/generatorService/tpl_utils/templates/gocode/service.go.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/gocode/service.go.tpl
@@ -37,7 +37,7 @@ type {{{ .EntityName }}}Service struct {
// List {{{ .FunctionName }}}列表
func (service {{{ .EntityName }}}Service) GetModel(listReq schema.{{{ toUpperCamelCase .EntityName }}}ListReq) *gorm.DB {
// 查询
- dbModel := service.db.Model(&model.{{{ toUpperCamelCase .EntityName }}}{}).Joins("CreatedUser")
+ dbModel := service.db.Model(&model.{{{ toUpperCamelCase .EntityName }}}{}).Joins("CreatedByUser")
tableName := core.DBTableName(&model.{{{ toUpperCamelCase .EntityName }}}{})
{{{- range .Columns }}}
{{{- if .IsQuery }}}
@@ -47,10 +47,10 @@ func (service {{{ .EntityName }}}Service) GetModel(listReq schema.{{{ toUpperCam
dbModel = dbModel.Where(tableName+".created_by = ?", *listReq.CreatedBy.GetValue())
}
if listReq.Nickname.GetValue() != nil {
- dbModel = dbModel.Where("CreatedUser.nickname like ?", "%"+*listReq.Nickname.GetValue()+"%")
+ dbModel = dbModel.Where("CreatedByUser.nickname like ?", "%"+*listReq.Nickname.GetValue()+"%")
}
if listReq.Username.GetValue() != nil {
- dbModel = dbModel.Where("CreatedUser.nickname like ?", "%"+*listReq.Username.GetValue()+"%")
+ dbModel = dbModel.Where("CreatedByUser.nickname like ?", "%"+*listReq.Username.GetValue()+"%")
}
{{{- else if eq .HtmlType "datetime" }}}
if listReq.{{{ toUpperCamelCase .ColumnName }}}Start.GetValue() != nil {
@@ -141,7 +141,7 @@ func (service {{{ .EntityName }}}Service) Detail({{{ toUpperCamelCase .PrimaryKe
var obj = model.{{{ toUpperCamelCase .EntityName }}}{}
err := service.CacheUtil.GetCache({{{ toUpperCamelCase .PrimaryKey }}}, &obj)
if err != nil {
- err := service.db.Where("{{{ $.PrimaryKey }}} = ?{{{ if contains .AllFields "is_delete" }}} AND is_delete = ?{{{ end }}}", {{{ toUpperCamelCase .PrimaryKey }}}{{{ if contains .AllFields "is_delete" }}}, 0{{{ end }}}).Preload("CreatedUser").Limit(1).First(&obj).Error
+ err := service.db.Where("{{{ $.PrimaryKey }}} = ?{{{ if contains .AllFields "is_delete" }}} AND is_delete = ?{{{ end }}}", {{{ toUpperCamelCase .PrimaryKey }}}{{{ if contains .AllFields "is_delete" }}}, 0{{{ end }}}).Preload("CreatedByUser").Limit(1).First(&obj).Error
if e = response.CheckErrDBNotRecord(err, "数据不存在!"); e != nil {
return
}
@@ -201,8 +201,8 @@ func (service {{{ .EntityName }}}Service) Edit(editReq schema.{{{ toUpperCamelCa
if e = response.CheckErr(err, "编辑失败"); e != nil {
return
}
- service.CacheUtil.RemoveCache(obj.Id)
- // service.Detail(obj.Id)
+ service.CacheUtil.RemoveCache(obj.{{{toUpperCamelCase .PrimaryKey }}})
+
return
}
diff --git a/server/app/service/generatorService/tpl_utils/templates/uniapp/edit.vue.tpl b/server/app/service/generatorService/tpl_utils/templates/uniapp/edit.vue.tpl
index c281dca..2b83831 100644
--- a/server/app/service/generatorService/tpl_utils/templates/uniapp/edit.vue.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/uniapp/edit.vue.tpl
@@ -16,7 +16,7 @@
{{{- if ne .DictType "" }}}
{{{- else if ne .ListAllApi "" }}}
-
+
{{{- else }}}
请选择字典生成代码
{{{- end }}}
diff --git a/server/app/service/generatorService/tpl_utils/templates/uniapp/search.vue.tpl b/server/app/service/generatorService/tpl_utils/templates/uniapp/search.vue.tpl
index 0349e9a..993dd55 100644
--- a/server/app/service/generatorService/tpl_utils/templates/uniapp/search.vue.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/uniapp/search.vue.tpl
@@ -11,7 +11,7 @@
{{{- if ne .DictType "" }}}
{{{- else if ne .ListAllApi "" }}}
-
+
{{{- end }}}
{{{- else if eq .HtmlType "input" }}}
diff --git a/server/app/service/generatorService/tpl_utils/templates/vue/api.ts.tpl b/server/app/service/generatorService/tpl_utils/templates/vue/api.ts.tpl
index 8d93213..1056a5d 100644
--- a/server/app/service/generatorService/tpl_utils/templates/vue/api.ts.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/vue/api.ts.tpl
@@ -8,7 +8,7 @@ import { clearEmpty } from '@/utils/util'
export type type_{{{.ModuleName}}} = {
{{{- range .Columns }}}
-{{{- if .IsList }}}
+{{{- if or .IsList .IsPk }}}
{{{.TsField }}}?: {{{.TsType}}}
{{{- end }}}
{{{- end }}}
diff --git a/server/app/service/generatorService/tpl_utils/templates/vue/details.vue.tpl b/server/app/service/generatorService/tpl_utils/templates/vue/details.vue.tpl
index 6bc3a11..d5b59f9 100644
--- a/server/app/service/generatorService/tpl_utils/templates/vue/details.vue.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/vue/details.vue.tpl
@@ -28,7 +28,7 @@
{{{- end }}}
{{{- range .Columns }}}
{{{- if .IsEdit }}}
- {{{- if ne .TsField "Id" }}}
+ {{{- if not .IsPk }}}
{{{- if eq .HtmlType "input" }}}
@@ -43,109 +43,34 @@
{{{- else if eq .HtmlType "checkbox" }}}
-
-
{{{- if ne .DictType "" }}}
- {{!-- --}}
+
{{{- else if ne .ListAllApi "" }}}
- {{!-- --}}
-
- {{!-- 请选择字典生成 --}}
{{{- end }}}
{{{- else if eq .HtmlType "select" }}}
-
- {{!-- --}}
+
{{{- if ne .DictType "" }}}
- {{!-- --}}
+
{{{- else if ne .ListAllApi "" }}}
- {{!-- --}}
-
- {{!-- --}}
- {{{- end }}}
- {{!-- --}}
+ {{{- end }}}
{{{- else if eq .HtmlType "radio" }}}
{{{- if ne .DictType "" }}}
- {{!-- --}}
{{{- else if ne .ListAllApi "" }}}
- {{!--
- {{ item.Id }}
- --}}
-
- {{!-- 请选择字典生成 --}}
{{{- end }}}
{{{- else if eq .HtmlType "datetime" }}}
- {{!-- --}}
{{{- else if eq .HtmlType "editor" }}}
diff --git a/server/app/service/generatorService/tpl_utils/templates/vue/edit.vue.tpl b/server/app/service/generatorService/tpl_utils/templates/vue/edit.vue.tpl
index 601dba0..efb553c 100644
--- a/server/app/service/generatorService/tpl_utils/templates/vue/edit.vue.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/vue/edit.vue.tpl
@@ -60,8 +60,8 @@
{{{- else }}}
请选择字典生成
@@ -88,11 +88,11 @@
@@ -122,12 +122,12 @@
:key="index"
:label="item.name"
{{{- if eq .GoType "int" }}}
- :value="parseInt(item.Id)"
+ :value="parseInt(item.ID)"
{{{- else }}}
- :value="item.Id"
+ :value="item.ID"
{{{- end }}}
>
- {{ item.Id }}
+ {{ item.ID }}
{{{- else }}}
请选择字典生成
diff --git a/server/app/service/generatorService/tpl_utils/templates/vue/index.vue.tpl b/server/app/service/generatorService/tpl_utils/templates/vue/index.vue.tpl
index 2c59e6f..e3a6a9b 100644
--- a/server/app/service/generatorService/tpl_utils/templates/vue/index.vue.tpl
+++ b/server/app/service/generatorService/tpl_utils/templates/vue/index.vue.tpl
@@ -33,8 +33,8 @@
{{{- else }}}
@@ -62,7 +62,7 @@
新增
-
导入
-
+
@@ -102,38 +102,35 @@
{{{- range .Columns }}}
- {{{- if .IsList }}}
- {{{- if eq .ColumnName "created_by" }}}
- {{{- else if eq .ColumnName "created_user" }}}
-
- {{{- else if and (ne .DictType "") (or (eq .HtmlType "select") (eq .HtmlType "radio") (eq .HtmlType "checkbox")) }}}
-
+ {{{- if and .IsList .IsListShow }}}
+ {{{- if and (ne .DictType "") (or (eq .HtmlType "select") (eq .HtmlType "radio") (eq .HtmlType "checkbox")) }}}
+
-
+
{{{- else if and (ne .ListAllApi "") (or (eq .HtmlType "select") (eq .HtmlType "radio") (eq .HtmlType "checkbox")) }}}
-
+
-
+
{{{- else if eq .HtmlType "imageUpload" }}}
-
+
{{{- else }}}
-
+
{{{- end }}}
{{{- end }}}
{{{- end }}}
@@ -217,7 +214,10 @@ const showDetails = ref(false)
const queryParams = reactive({
{{{- range .Columns }}}
{{{- if .IsQuery }}}
- {{{- if eq .HtmlType "datetime" }}}
+ {{{- if eq .ColumnName "created_by" }}}
+ CreatedBy: null,
+ CreatedByNickname: null,
+ {{{- else if eq .HtmlType "datetime" }}}
{{{ .TsField }}}Start: null,
{{{ .TsField }}}End: null,
{{{- else }}}
diff --git a/server/app/service/generatorService/tpl_utils/tpl.go b/server/app/service/generatorService/tpl_utils/tpl.go
index 99a1c02..b5ba806 100644
--- a/server/app/service/generatorService/tpl_utils/tpl.go
+++ b/server/app/service/generatorService/tpl_utils/tpl.go
@@ -67,6 +67,8 @@ type ExtentGenTableColumn struct {
IsInsert uint8 //是否为插入字段: [1=是, 0=否]
IsEdit uint8 //是否编辑字段: [1=是, 0=否]
IsList uint8 //是否列表字段: [1=是, 0=否]
+ IsListShow uint8 //表格列表是否显示字段: [1=是, 0=否]
+ IsUid uint8 //是否用户ID: [1=是, 0=否]
IsQuery uint8 //是否查询字段: [1=是, 0=否]
QueryType string //查询方式: [等于、不等于、大于、小于、范围]
HtmlType string //显示类型: [文本框、文本域、下拉框、复选框、单选框、日期控件]
@@ -82,6 +84,8 @@ type ExtentGenTableColumn struct {
TsField string //TS字段名
SwagType string //swagger类型
+
+ TableColumnProp string //表格列表prop属性,默认赋值TsField,用户名称赋值xxxUser.nickname、xxxUser.username
}
// TplVars 模板变量
@@ -159,109 +163,124 @@ func (tu templateUtil) PrepareVars(table gen_model.GenTable, columns []gen_model
// convert_util.Copy(&subColumns, oriSubPriCol)
// }
- var haveCreatedBy bool = false
+ var userFiled = []ExtentGenTableColumn{}
+
for i, column := range newColumns {
- // 判断ColumnName=created_by
- if column.ColumnName == "created_by" {
- haveCreatedBy = true
+ newColumns[i].IsListShow = 1
+
+ // 获取用户字段
+ for _, columnName := range SqlConstants.ColumnNameUserFiled {
+ if column.ColumnName == columnName {
+ userFiled = append(userFiled, column)
+ // 列表不显示用户id
+ newColumns[i].IsListShow = 0
+ // 是用户ID
+ newColumns[i].IsUid = 1
+ }
}
newColumns[i].GoNullType = GenUtil.GoTypeToNullType(column.GoType)
newColumns[i].TsType = GenUtil.GoToTsType(column.GoType)
// newColumns[i].TsField = column.ColumnName
newColumns[i].TsField = column.GoField
-
+ newColumns[i].TableColumnProp = newColumns[i].TsField
newColumns[i].SwagType = GenUtil.GoTypeToSwagType(column.GoType)
}
- if haveCreatedBy {
+ if len(userFiled) > 0 {
// 添加可查询字段
- CreatedByColumns := []ExtentGenTableColumn{
- {
+ for _, column := range userFiled {
+ CreatedByColumns := []ExtentGenTableColumn{
- ColumnName: "nickname",
- ColumnComment: "创建人姓名",
- ColumnLength: 32,
- ColumnType: "char",
- GoType: GoConstants.TypeString,
- GoNullType: GoConstants.TypeString,
+ {
+ // 查询用户名称
+ ColumnName: column.ColumnName + "_nickname",
+ ColumnComment: column.ColumnComment + "名称",
+ ColumnLength: 32,
+ ColumnType: "char",
+ GoType: GoConstants.TypeString,
+ GoNullType: GenUtil.GoTypeToNullType(column.GoType),
- GoField: "Nickname",
- TsType: "string",
- TsField: "Nickname",
+ GoField: column.GoField + "Nickname",
+ TsType: "string",
+ TsField: column.GoField + "Nickname",
+ TableColumnProp: "",
+ SwagType: SwagTypeConstants.String,
- SwagType: SwagTypeConstants.String,
+ IsPk: 0,
+ IsIncrement: 0,
+ IsRequired: 0,
+ IsInsert: 0,
+ IsEdit: 0,
+ IsList: 0,
+ IsListShow: 0,
+ IsQuery: 1,
+ QueryType: "LIKE",
+ HtmlType: "input",
+ DictType: "",
+ ListAllApi: "",
+ Sort: 6,
+ }, {
+ // 查询用户账号(一般不用)
+ ColumnName: column.ColumnName + "_username",
+ ColumnComment: column.ColumnComment + "账号",
+ ColumnLength: 32,
+ ColumnType: "char",
+ GoType: GoConstants.TypeString,
+ GoNullType: GenUtil.GoTypeToNullType(column.GoType),
- IsPk: 0,
- IsIncrement: 0,
- IsRequired: 0,
- IsInsert: 0,
- IsEdit: 0,
- IsList: 0,
- IsQuery: 1,
- QueryType: "LIKE",
- HtmlType: "input",
- DictType: "",
- ListAllApi: "",
- Sort: 6,
- }, {
+ GoField: column.GoField + "Username",
- ColumnName: "username",
- ColumnComment: "创建人账号",
- ColumnLength: 32,
- ColumnType: "char",
- GoType: GoConstants.TypeString,
- GoNullType: GoConstants.TypeString,
+ TsType: "string",
+ TsField: column.GoField + "Username",
+ SwagType: SwagTypeConstants.String,
- GoField: "Username",
+ IsPk: 0,
+ IsIncrement: 0,
+ IsRequired: 0,
+ IsInsert: 0,
+ IsEdit: 0,
+ IsList: 0,
+ IsListShow: 0,
+ IsQuery: 1,
+ QueryType: "=",
+ HtmlType: "input",
+ DictType: "",
+ ListAllApi: "",
+ Sort: 6,
+ }, {
+ // 列表用户名称
+ ColumnName: column.ColumnName + "_user",
+ ColumnComment: column.ColumnComment,
+ ColumnLength: 32,
+ ColumnType: "char",
+ GoType: "systemSchema.SystemAuthAdminSimpleInfo",
- TsType: "string",
- TsField: "Username",
- SwagType: SwagTypeConstants.String,
+ GoNullType: "systemSchema.SystemAuthAdminSimpleInfo",
+ GoField: column.GoField + "User",
- IsPk: 0,
- IsIncrement: 0,
- IsRequired: 0,
- IsInsert: 0,
- IsEdit: 0,
- IsList: 0,
- IsQuery: 1,
- QueryType: "=",
- HtmlType: "input",
- DictType: "",
- ListAllApi: "",
- Sort: 6,
- }, {
-
- ColumnName: "created_user",
- ColumnComment: "创建人",
- ColumnLength: 32,
- ColumnType: "char",
- GoType: "systemSchema.SystemAuthAdminSimpleInfo",
-
- GoNullType: "systemSchema.SystemAuthAdminSimpleInfo",
- GoField: "CreatedUser",
-
- TsType: "object",
- TsField: "CreatedUser",
-
- SwagType: SwagTypeConstants.Object,
- IsPk: 0,
- IsIncrement: 0,
- IsRequired: 0,
- IsInsert: 0,
- IsEdit: 0,
- IsList: 1,
- IsQuery: 0,
- QueryType: "=",
- HtmlType: "input",
- DictType: "",
- ListAllApi: "",
- Sort: 6,
- },
+ TsType: "object",
+ TsField: column.GoField + "User",
+ TableColumnProp: column.GoField + "User" + ".nickname",
+ SwagType: SwagTypeConstants.Object,
+ IsPk: 0,
+ IsIncrement: 0,
+ IsRequired: 0,
+ IsInsert: 0,
+ IsEdit: 0,
+ IsListShow: 1,
+ IsList: 1,
+ IsQuery: 0,
+ QueryType: "=",
+ HtmlType: "input",
+ DictType: "",
+ ListAllApi: "",
+ Sort: 6,
+ },
+ }
+ newColumns = append(newColumns, CreatedByColumns...)
}
- newColumns = append(newColumns, CreatedByColumns...)
}
for _, column := range newColumns {
diff --git a/server/app/service/system_corn_service.go b/server/app/service/system_corn_service.go
index 93ea63d..f4dbe1f 100644
--- a/server/app/service/system_corn_service.go
+++ b/server/app/service/system_corn_service.go
@@ -35,7 +35,7 @@ type systemCornService struct {
// List 定时任务列表
func (service systemCornService) GetModel(listReq schema.SystemCornListReq) *gorm.DB {
// 查询
- dbModel := service.db.Model(&model.SystemCorn{}).Joins("CreatedUser")
+ dbModel := service.db.Model(&model.SystemCorn{}).Joins("CreatedByUser")
tableName := core.DBTableName(&model.SystemCorn{})
if listReq.TaskName.GetValue() != nil {
dbModel = dbModel.Where(tableName+".task_name like ?", "%"+*listReq.TaskName.GetValue()+"%")
@@ -54,7 +54,7 @@ func (service systemCornService) GetModel(listReq schema.SystemCornListReq) *gor
dbModel = dbModel.Where(tableName+".created_by = ?", *listReq.CreatedBy.GetValue())
}
if listReq.Nickname.GetValue() != nil {
- dbModel = dbModel.Where("CreatedUser.nickname like ?", "%"+*listReq.Nickname.GetValue()+"%")
+ dbModel = dbModel.Where("CreatedByUser.nickname like ?", "%"+*listReq.Nickname.GetValue()+"%")
}
if listReq.CreateTimeStart.GetValue() != nil {
@@ -141,7 +141,7 @@ func (service systemCornService) Detail(Id string) (res schema.SystemCornResp, e
var obj = model.SystemCorn{}
err := service.CacheUtil.GetCache(Id, &obj)
if err != nil {
- err := service.db.Where("id = ? AND is_delete = ?", Id, 0).Preload("CreatedUser").Limit(1).First(&obj).Error
+ err := service.db.Where("id = ? AND is_delete = ?", Id, 0).Preload("CreatedByUser").Limit(1).First(&obj).Error
if e = response.CheckErrDBNotRecord(err, "数据不存在!"); e != nil {
return
}
diff --git a/server/app/service/user_protocol_service.go b/server/app/service/user_protocol_service.go
index 368e757..64ed8fc 100644
--- a/server/app/service/user_protocol_service.go
+++ b/server/app/service/user_protocol_service.go
@@ -36,7 +36,7 @@ type userProtocolService struct {
// List 用户协议列表
func (service userProtocolService) GetModel(listReq schema.UserProtocolListReq) *gorm.DB {
// 查询
- dbModel := service.db.Model(&model.UserProtocol{}).Preload("CreatedUser")
+ dbModel := service.db.Model(&model.UserProtocol{}).Preload("CreatedByUser")
if listReq.Title.GetValue() != nil {
dbModel = dbModel.Where("title like ?", "%"+*listReq.Title.GetValue()+"%")
}
@@ -129,7 +129,7 @@ func (service userProtocolService) Detail(Id string) (res schema.UserProtocolRes
var obj = model.UserProtocol{}
err := service.CacheUtil.GetCache(Id, &obj)
if err != nil {
- err := service.db.Where("id = ? AND is_delete = ?", Id, 0).Preload("CreatedUser").Limit(1).First(&obj).Error
+ err := service.db.Where("id = ? AND is_delete = ?", Id, 0).Preload("CreatedByUser").Limit(1).First(&obj).Error
if e = response.CheckErrDBNotRecord(err, "数据不存在!"); e != nil {
return
}
diff --git a/server/go.mod b/server/go.mod
index 30c956c..4eab6ba 100644
--- a/server/go.mod
+++ b/server/go.mod
@@ -8,7 +8,7 @@ require (
github.com/gin-gonic/gin v1.11.0
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
- github.com/go-playground/validator/v10 v10.28.0
+ github.com/go-playground/validator/v10 v10.30.0
github.com/go-sql-driver/mysql v1.9.3
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/google/uuid v1.6.0
@@ -29,13 +29,12 @@ require (
github.com/duke-git/lancet/v2 v2.3.8
github.com/gorilla/websocket v1.5.3
github.com/lionsoul2014/ip2region/binding/golang v0.0.0-20251113013923-bd30b77d5468
- github.com/mitchellh/mapstructure v1.5.0
github.com/redis/go-redis/v9 v9.17.2
github.com/robfig/cron/v3 v3.0.1
github.com/wneessen/go-mail v0.7.2
go.uber.org/ratelimit v0.3.1
- golang.org/x/sync v0.18.0
- golang.org/x/text v0.31.0
+ golang.org/x/sync v0.19.0
+ golang.org/x/text v0.32.0
)
require (
@@ -49,7 +48,7 @@ require (
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
- github.com/gabriel-vasile/mimetype v1.4.11 // indirect
+ github.com/gabriel-vasile/mimetype v1.4.12 // indirect
github.com/gin-contrib/sse v1.1.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.22.2 // indirect
@@ -96,11 +95,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.23.0 // indirect
- golang.org/x/crypto v0.44.0 // indirect
+ golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/net v0.47.0 // indirect
- golang.org/x/sys v0.38.0 // indirect
+ golang.org/x/sys v0.39.0 // indirect
golang.org/x/tools v0.39.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/server/go.sum b/server/go.sum
index 23b5091..5ffa216 100644
--- a/server/go.sum
+++ b/server/go.sum
@@ -31,8 +31,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
-github.com/gabriel-vasile/mimetype v1.4.11 h1:AQvxbp830wPhHTqc1u7nzoLT+ZFxGY7emj5DR5DYFik=
-github.com/gabriel-vasile/mimetype v1.4.11/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
+github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw=
+github.com/gabriel-vasile/mimetype v1.4.12/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
github.com/gin-contrib/cors v1.7.6 h1:3gQ8GMzs1Ylpf70y8bMw4fVpycXIeX1ZemuSQIsnQQY=
github.com/gin-contrib/cors v1.7.6/go.mod h1:Ulcl+xN4jel9t1Ry8vqph23a60FwH9xVLd+3ykmTjOk=
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
@@ -73,8 +73,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
-github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
+github.com/go-playground/validator/v10 v10.30.0 h1:5YBPNs273uzsZJD1I8uiB4Aqg9sN6sMDVX3s6LxmhWU=
+github.com/go-playground/validator/v10 v10.30.0/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM=
github.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=
github.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
@@ -119,8 +119,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D
github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
-github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
-github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -210,8 +208,8 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/arch v0.23.0 h1:lKF64A2jF6Zd8L0knGltUnegD62JMFBiCPBmQpToHhg=
golang.org/x/arch v0.23.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
-golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
-golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
+golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
+golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 h1:zfMcR1Cs4KNuomFFgGefv5N0czO2XZpUbxGUy8i8ug0=
golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=
golang.org/x/image v0.33.0 h1:LXRZRnv1+zGd5XBUVRFmYEphyyKJjQjCRiOuAP3sZfQ=
@@ -220,15 +218,15 @@ golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
-golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
-golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
+golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
+golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
-golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
-golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
-golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
+golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
+golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
+golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
+golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
diff --git a/server/model/system_corn.go b/server/model/system_corn.go
index 752ae26..6b90200 100644
--- a/server/model/system_corn.go
+++ b/server/model/system_corn.go
@@ -11,17 +11,17 @@ import (
// SystemCorn 定时任务实体
type SystemCorn struct {
- Id string `gorm:"column:id;type:char(36);primarykey;comment:'id'"`
- TaskName core.NullString `gorm:"column:task_name;type:char(100);comment:'任务名称'"`
- TaskCode core.NullString `gorm:"column:task_code;type:char(100);comment:'任务编码'"`
- CornExpr core.NullString `gorm:"column:corn_expr;type:char(100);comment:'corn表达式'"`
- Status core.NullInt `gorm:"column:status;type:tinyint(1);comment:'状态'"`
- CreatedBy core.NullString `gorm:"column:created_by;type:char(36);comment:'创建人'"`
- CreatedUser system_model.SystemAuthAdminSimple `gorm:"foreignKey:CreatedBy"`
- IsDelete soft_delete.DeletedAt `gorm:"column:is_delete;type:tinyint(1);not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
- CreateTime core.NullTime `gorm:"column:create_time;type:datetime;autoCreateTime;comment:'创建时间'"`
- UpdateTime core.NullTime `gorm:"column:update_time;type:datetime;autoUpdateTime;comment:'更新时间'"`
- DeleteTime core.NullTime `gorm:"column:delete_time;type:datetime;comment:'删除时间'"`
+ Id string `gorm:"column:id;type:char(36);primarykey;comment:'id'"`
+ TaskName core.NullString `gorm:"column:task_name;type:char(100);comment:'任务名称'"`
+ TaskCode core.NullString `gorm:"column:task_code;type:char(100);comment:'任务编码'"`
+ CornExpr core.NullString `gorm:"column:corn_expr;type:char(100);comment:'corn表达式'"`
+ Status core.NullInt `gorm:"column:status;type:tinyint(1);comment:'状态'"`
+ CreatedBy core.NullString `gorm:"column:created_by;type:char(36);comment:'创建人'"`
+ CreatedByUser system_model.SystemAuthAdminSimple `gorm:"foreignKey:CreatedBy"`
+ IsDelete soft_delete.DeletedAt `gorm:"column:is_delete;type:tinyint(1);not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
+ CreateTime core.NullTime `gorm:"column:create_time;type:datetime;autoCreateTime;comment:'创建时间'"`
+ UpdateTime core.NullTime `gorm:"column:update_time;type:datetime;autoUpdateTime;comment:'更新时间'"`
+ DeleteTime core.NullTime `gorm:"column:delete_time;type:datetime;comment:'删除时间'"`
}
// 自动在创建时设置 UUIDv7
diff --git a/server/model/system_model/auth_admin.go b/server/model/system_model/auth_admin.go
index f5140b4..aef76a7 100644
--- a/server/model/system_model/auth_admin.go
+++ b/server/model/system_model/auth_admin.go
@@ -41,10 +41,12 @@ func (m *SystemAuthAdmin) BeforeCreate(tx *gorm.DB) (err error) {
// SystemAuthAdminSimple 简化版系统管理员实体,用于关联查询
type SystemAuthAdminSimple struct {
- ID string `gorm:"primarykey;type:char(36);comment:'uuid'"`
- Username string `gorm:"not null;default:'';comment:'用户账号''"`
- Nickname string `gorm:"not null;default:'';comment:'用户昵称'"`
- Avatar string `gorm:"not null;default:'';comment:'用户头像'"`
+ ID string `gorm:"primarykey;type:char(36);comment:'uuid'"`
+ Username string `gorm:"not null;default:'';comment:'用户账号''"`
+ Nickname string `gorm:"not null;default:'';comment:'用户昵称'"`
+ Avatar string `gorm:"not null;default:'';comment:'用户头像'"`
+ IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
+ DeleteTime core.NullTime `gorm:"default:null;comment:'删除时间'"`
}
func (m *SystemAuthAdminSimple) TableName() string {
diff --git a/server/model/user_protocol.go b/server/model/user_protocol.go
index ea82e26..f2c1173 100644
--- a/server/model/user_protocol.go
+++ b/server/model/user_protocol.go
@@ -11,17 +11,17 @@ import (
// UserProtocol 用户协议实体
type UserProtocol struct {
- Id string `gorm:"primarykey;type:char(36);comment:''"` //
- Tag core.NullString `gorm:"comment:'标识'"` // 标识
- Version core.NullInt `gorm:"column:version;comment:'排序'"` // 排序
- Title core.NullString `gorm:"comment:'标题'"` // 标题
- Content core.NullString `gorm:"comment:'协议内容'"` // 协议内容
- CreatedBy core.NullString `gorm:"column:created_by;type:char(36);comment:'创建人'"`
- CreatedUser system_model.SystemAuthAdminSimple `gorm:"foreignKey:CreatedBy"`
- IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
- CreateTime core.NullTime `gorm:"autoCreateTime;comment:'创建时间'"` // 创建时间
- UpdateTime core.NullTime `gorm:"autoUpdateTime;comment:'更新时间'"` // 更新时间
- DeleteTime core.NullTime `gorm:"comment:'删除时间'"` // 删除时间
+ Id string `gorm:"primarykey;type:char(36);comment:''"` //
+ Tag core.NullString `gorm:"comment:'标识'"` // 标识
+ Version core.NullInt `gorm:"column:version;comment:'排序'"` // 排序
+ Title core.NullString `gorm:"comment:'标题'"` // 标题
+ Content core.NullString `gorm:"comment:'协议内容'"` // 协议内容
+ CreatedBy core.NullString `gorm:"column:created_by;type:char(36);comment:'创建人'"`
+ CreatedByUser system_model.SystemAuthAdminSimple `gorm:"foreignKey:CreatedBy"`
+ IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
+ CreateTime core.NullTime `gorm:"autoCreateTime;comment:'创建时间'"` // 创建时间
+ UpdateTime core.NullTime `gorm:"autoUpdateTime;comment:'更新时间'"` // 更新时间
+ DeleteTime core.NullTime `gorm:"comment:'删除时间'"` // 删除时间
}
// 自动在创建时设置 UUIDv7