mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-22 15:49:32 +08:00
统一软删除字段
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
package model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// ArticleCollect 文章收藏实体
|
||||
type ArticleCollect struct {
|
||||
Id int `gorm:"primarykey;comment:'主键'"` // 主键
|
||||
UserId int `gorm:"comment:'用户ID'"` // 用户ID
|
||||
ArticleId int `gorm:"comment:'文章ID'"` // 文章ID
|
||||
IsDelete int `gorm:"comment:'是否删除'"` // 是否删除
|
||||
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
|
||||
UpdateTime core.TsTime `gorm:"autoUpdateTime;comment:'更新时间'"` // 更新时间
|
||||
CreateTime core.TsTime `gorm:"autoCreateTime;comment:'创建时间'"` // 创建时间
|
||||
DeleteTime core.TsTime `gorm:"default:null;comment:'删除时间'"` // 删除时间
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package common_model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// Album 相册实体
|
||||
type Album struct {
|
||||
@@ -13,7 +17,7 @@ type Album struct {
|
||||
Uri string `gorm:"not null;comment:'文件路径'"`
|
||||
Ext string `gorm:"not null;default:'';comment:'文件扩展'"`
|
||||
Size int64 `gorm:"not null;default:0;comment:文件大小"`
|
||||
IsDelete uint8 `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;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:'删除时间'"`
|
||||
@@ -25,7 +29,7 @@ type AlbumCate struct {
|
||||
Pid uint `gorm:"not null;default:0;comment:'父级ID'"`
|
||||
Type int `gorm:"not null;default:10;comment:'文件类型: [10=图片, 20=视频]''"`
|
||||
Name string `gorm:"not null;default:'';comment:'分类名称''"`
|
||||
IsDelete uint8 `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;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:'删除时间'"`
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// FlowApply 申请流程实体
|
||||
type FlowApply struct {
|
||||
@@ -16,7 +20,7 @@ type FlowApply struct {
|
||||
FlowProcessDataList string `gorm:"comment:'流程配置list数据'"` // 流程配置list数据
|
||||
FormValue string `gorm:"comment:'表单值'"` // 表单值
|
||||
Status int `gorm:"comment:'状态:1待提交,2审批中,3审批完成,4审批失败'"` // 状态:0待提交,1审批中,2审批完成,3审批失败
|
||||
IsDelete int `gorm:"comment:'是否删除'"` // 是否删除
|
||||
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
|
||||
UpdateTime core.TsTime `gorm:"autoUpdateTime;comment:'更新时间'"` // 更新时间
|
||||
CreateTime core.TsTime `gorm:"autoCreateTime;comment:'创建时间'"` // 创建时间
|
||||
DeleteTime core.TsTime `gorm:"default:null;comment:'删除时间'"` // 删除时间
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// FlowTemplate 流程模板实体
|
||||
type FlowTemplate struct {
|
||||
@@ -12,7 +16,7 @@ type FlowTemplate struct {
|
||||
FlowProcessData string `gorm:"comment:'流程配置'"` // 流程配置
|
||||
FlowProcessDataList string `gorm:"comment:'流程配置list数据'"` // 流程配置list数据
|
||||
|
||||
IsDelete uint8 `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
|
||||
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
|
||||
UpdateTime core.TsTime `gorm:"autoUpdateTime;comment:'更新时间'"` // 更新时间
|
||||
CreateTime core.TsTime `gorm:"autoCreateTime;comment:'创建时间'"` // 创建时间
|
||||
DeleteTime core.TsTime `gorm:"default:null;comment:'删除时间'"` // 删除时间
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// MonitorProject 错误项目实体
|
||||
type MonitorProject struct {
|
||||
@@ -12,7 +16,7 @@ type MonitorProject struct {
|
||||
|
||||
ProjectType string `gorm:"comment:'项目类型go java web node php 等'" excel:"name:项目类型"` // 项目类型go java web node php 等
|
||||
|
||||
IsDelete int `gorm:"comment:'是否删除: 0=否, 1=是'" excel:"name:是否删除: 0=否, 1=是;"` // 是否删除: 0=否, 1=是
|
||||
IsDelete soft_delete.DeletedAt `gorm:"not null;default:0;softDelete:flag,DeletedAtField:DeleteTime;comment:'是否删除: 0=否, 1=是'"`
|
||||
|
||||
UpdateTime core.TsTime `gorm:"autoUpdateTime;comment:'更新时间'" excel:"name:更新时间;"` // 更新时间
|
||||
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package setting_model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// DictData 字典数据实体
|
||||
type DictData struct {
|
||||
@@ -12,7 +16,7 @@ type DictData struct {
|
||||
Remark string `gorm:"not null;default:'';comment:'备注'"`
|
||||
Sort uint16 `gorm:"not null;default:0;comment:'排序'"`
|
||||
Status uint8 `gorm:"not null;default:1;comment:'字典状态: 0=停用, 1=正常'"`
|
||||
IsDelete 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:'删除时间'"`
|
||||
|
@@ -1,6 +1,10 @@
|
||||
package setting_model
|
||||
|
||||
import "x_admin/core"
|
||||
import (
|
||||
"x_admin/core"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// DictType 字典类型实体
|
||||
type DictType struct {
|
||||
@@ -9,7 +13,7 @@ type DictType struct {
|
||||
DictType string `gorm:"not null;default:'';comment:'字典类型'"`
|
||||
DictRemark string `gorm:"not null;default:'';comment:'字典备注'"`
|
||||
DictStatus uint8 `gorm:"not null;default:1;comment:'字典状态: 0=停用, 1=正常'"`
|
||||
IsDelete 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:'删除时间'"`
|
||||
|
Reference in New Issue
Block a user