migrate ✅ 优化migrate
This commit is contained in:
1 parent
e40047a88e
commit
1a111f0666
49 files changed
+677
-202
No files matched your search
@@ -3,12 +3,10 @@ package version
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"go-admin/app/admin/models/system"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/models/tools"
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -19,23 +17,23 @@ func init() {
|
||||
|
||||
func _1599190683659Tables(db *gorm.DB, version string) error {
|
||||
err := db.Debug().Migrator().AutoMigrate(
|
||||
new(system.CasbinRule),
|
||||
new(system.SysDept),
|
||||
new(system.SysConfig),
|
||||
new(tools.SysTables),
|
||||
new(tools.SysColumns),
|
||||
new(system.SysMenu),
|
||||
new(system.SysLoginLog),
|
||||
new(system.SysOperaLog),
|
||||
new(models.CasbinRule),
|
||||
new(models.SysDept),
|
||||
new(models.SysConfig),
|
||||
new(models.SysTables),
|
||||
new(models.SysColumns),
|
||||
new(models.SysMenu),
|
||||
new(models.SysLoginLog),
|
||||
new(models.SysOperaLog),
|
||||
new(models.RoleMenu),
|
||||
new(system.SysRoleDept),
|
||||
new(system.SysUser),
|
||||
new(system.SysRole),
|
||||
new(Post),
|
||||
new(DictData),
|
||||
new(DictType),
|
||||
new(models.SysRoleDept),
|
||||
new(models.SysUser),
|
||||
new(models.SysRole),
|
||||
new(models.Post),
|
||||
new(models.DictData),
|
||||
new(models.DictType),
|
||||
new(models.SysJob),
|
||||
new(system.SysConfig),
|
||||
new(models.SysConfig),
|
||||
new(models.SysSetting),
|
||||
new(models.SysFileDir),
|
||||
new(models.SysFileInfo),
|
||||
|
||||
@@ -6,9 +6,8 @@ import (
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/models/system"
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,31 +19,31 @@ func init() {
|
||||
func _1599190683670Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
list3 := []system.SysDept{
|
||||
{DeptId: 1, ParentId: 0, DeptPath: "/0/1", DeptName: "爱拓科技", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 7, ParentId: 1, DeptPath: "/0/1/7", DeptName: "研发部", Sort: 1, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 8, ParentId: 1, DeptPath: "/0/1/8", DeptName: "运维部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 9, ParentId: 1, DeptPath: "/0/1/9", DeptName: "客服部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 10, ParentId: 1, DeptPath: "/0/1/10", DeptName: "人力资源", Sort: 3, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "1", ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
list3 := []models.SysDept{
|
||||
{DeptId: 1, ParentId: 0, DeptPath: "/0/1", DeptName: "爱拓科技", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 7, ParentId: 1, DeptPath: "/0/1/7", DeptName: "研发部", Sort: 1, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 8, ParentId: 1, DeptPath: "/0/1/8", DeptName: "运维部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 9, ParentId: 1, DeptPath: "/0/1/9", DeptName: "客服部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DeptId: 10, ParentId: 1, DeptPath: "/0/1/10", DeptName: "人力资源", Sort: 3, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
}
|
||||
|
||||
list4 := []system.SysConfig{
|
||||
{Model: common.Model{Id: 1}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "主框架页-默认皮肤样式名称", ConfigKey: "sys_index_skinName", ConfigValue: "skin-blue", ConfigType: "Y", Remark: "蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow"},
|
||||
{Model: common.Model{Id: 2}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "用户管理-账号初始密码", ConfigKey: "sys.user.initPassword", ConfigValue: "123456", ConfigType: "Y", Remark: "初始化密码 123456"},
|
||||
{Model: common.Model{Id: 3}, ModelTime: common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ControlBy: common.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "主框架页-侧边栏主题", ConfigKey: "sys_index_sideTheme", ConfigValue: "theme-dark", ConfigType: "Y", Remark: "深色主题theme-dark,浅色主题theme-light"},
|
||||
list4 := []models.SysConfig{
|
||||
{Model: models.Model{Id: 1}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "主框架页-默认皮肤样式名称", ConfigKey: "sys_index_skinName", ConfigValue: "skin-blue", ConfigType: "Y", Remark: "蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow"},
|
||||
{Model: models.Model{Id: 2}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "用户管理-账号初始密码", ConfigKey: "sys.user.initPassword", ConfigValue: "123456", ConfigType: "Y", Remark: "初始化密码 123456"},
|
||||
{Model: models.Model{Id: 3}, ModelTime: models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, ConfigName: "主框架页-侧边栏主题", ConfigKey: "sys_index_sideTheme", ConfigValue: "theme-dark", ConfigType: "Y", Remark: "深色主题theme-dark,浅色主题theme-light"},
|
||||
}
|
||||
|
||||
list5 := []Post{
|
||||
list5 := []models.Post{
|
||||
{PostId: 1, PostName: "首席执行官", PostCode: "CEO", Sort: 0, Status: "2", Remark: "首席执行官", CreateBy: "1", UpdateBy: "1", CreatedAt: time.Now(), UpdatedAt: time.Now()},
|
||||
{PostId: 2, PostName: "首席技术执行官", PostCode: "CTO", Sort: 2, Status: "2", Remark: "首席技术执行官", CreateBy: "1", UpdateBy: "1", CreatedAt: time.Now(), UpdatedAt: time.Now()},
|
||||
{PostId: 3, PostName: "首席运营官", PostCode: "COO", Sort: 3, Status: "2", Remark: "测试工程师", CreateBy: "1", UpdateBy: "1", CreatedAt: time.Now(), UpdatedAt: time.Now()},
|
||||
}
|
||||
|
||||
list6 := []models.SysRole{
|
||||
{1, "系统管理员", "2", "admin", 1, "", "1", "0", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", []int{}, []int{}},
|
||||
{1, "系统管理员", "2", "admin", 1, "", "1", "0", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
}
|
||||
|
||||
list7 := []DictType{
|
||||
list7 := []models.DictType{
|
||||
{DictId: 1, DictName: "系统开关", DictType: "sys_normal_disable", Status: "2", CreateBy: "1", UpdateBy: "1", Remark: "系统开关列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DictId: 2, DictName: "用户性别", DictType: "sys_user_sex", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "用户性别列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DictId: 3, DictName: "菜单状态", DictType: "sys_show_hide", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "菜单状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
@@ -57,13 +56,13 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
||||
{DictId: 10, DictName: "通知状态", DictType: "sys_notice_status", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "通知状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
}
|
||||
|
||||
list8 := []system.SysUser{
|
||||
list8 := []models.SysUser{
|
||||
{
|
||||
ControlBy: common.ControlBy{
|
||||
ControlBy: models.ControlBy{
|
||||
CreateBy: 1,
|
||||
UpdateBy: 1,
|
||||
},
|
||||
ModelTime: common.ModelTime{
|
||||
ModelTime: models.ModelTime{
|
||||
CreatedAt: time.Now(),
|
||||
UpdatedAt: time.Now(),
|
||||
},
|
||||
@@ -85,7 +84,7 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
||||
//{models.SysUserId{1}, models.LoginM{models.UserName{"admin"}, models.PassWord{"$2a$10$cKFFTCzGOvaIHHJY2K45Zuwt8TD6oPzYi4s5MzYIBAWCLL6ZhouP2"}}, models.SysUserB{"zhangwj", "13818888888", 1, "", "", "0", "1@qq.com", 1, 1, "1", "1", "", "2", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", ""}},
|
||||
}
|
||||
|
||||
list9 := []DictData{
|
||||
list9 := []models.DictData{
|
||||
{DictCode: 1, DictSort: 0, DictLabel: "正常", DictValue: "2", DictType: "sys_normal_disable", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统正常", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DictCode: 2, DictSort: 0, DictLabel: "停用", DictValue: "1", DictType: "sys_normal_disable", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统停用", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{DictCode: 3, DictSort: 0, DictLabel: "男", DictValue: "0", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别男", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
@@ -120,7 +119,7 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
||||
}
|
||||
|
||||
list10 := []models.SysSetting{
|
||||
{1, "go-admin管理系统", "https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png", common.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
{1, "go-admin管理系统", "https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png", models.ModelTime{CreatedAt: time.Now(), UpdatedAt: time.Now()}},
|
||||
}
|
||||
|
||||
list11 := []models.SysJob{
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -19,32 +19,32 @@ func _1599190683680Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
var err error
|
||||
|
||||
list := []models.Menu{
|
||||
{MenuId: 496, MenuName: "Sources", Title: "资源管理", Icon: "network", Path: "/sources", Paths: "/0/496", MenuType: "M", Action: "无", Permission: "", ParentId: 0, NoCache: true, Breadcrumb: "", Component: "Layout", Sort: 3, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "1"},
|
||||
{MenuId: 497, MenuName: "File", Title: "文件管理", Icon: "documentation", Path: "file-manage", Paths: "/0/496/497", MenuType: "C", Action: "", Permission: "", ParentId: 496, NoCache: true, Breadcrumb: "", Component: "/fileManage/index", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "1"},
|
||||
{MenuId: 498, MenuName: "", Title: "内容管理", Icon: "pass", Path: "/content", Paths: "/0/498", MenuType: "M", Action: "无", Permission: "", ParentId: 0, NoCache: true, Breadcrumb: "", Component: "Layout", Sort: 4, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "1"},
|
||||
{MenuId: 499, MenuName: "SysCategory", Title: "分类", Icon: "pass", Path: "syscategory", Paths: "/0/498/499", MenuType: "C", Action: "无", Permission: "syscategory:syscategory:list", ParentId: 498, NoCache: true, Breadcrumb: "", Component: "/syscategory/index", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 500, MenuName: "", Title: "分页获取分类", Icon: "pass", Path: "", Paths: "/0/498/499/500", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:query", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 501, MenuName: "", Title: "创建分类", Icon: "pass", Path: "", Paths: "/0/498/499/501", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:add", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 502, MenuName: "", Title: "修改分类", Icon: "pass", Path: "", Paths: "/0/498/499/502", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:edit", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 503, MenuName: "", Title: "删除分类", Icon: "pass", Path: "", Paths: "/0/498/499/503", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:remove", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 504, MenuName: "Category", Title: "分类", Icon: "bug", Path: "category", Paths: "/0/63/504", MenuType: "M", Action: "无", Permission: "", ParentId: 63, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 505, MenuName: "", Title: "分页获取分类", Icon: "bug", Path: "/api/v1/syscategoryList", Paths: "/0/63/504/505", MenuType: "A", Action: "GET", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 506, MenuName: "", Title: "根据id获取分类", Icon: "bug", Path: "/api/v1/syscategory/:id", Paths: "/0/63/504/506", MenuType: "A", Action: "GET", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 507, MenuName: "", Title: "创建分类", Icon: "bug", Path: "/api/v1/syscategory", Paths: "/0/63/504/507", MenuType: "A", Action: "POST", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 508, MenuName: "", Title: "修改分类", Icon: "bug", Path: "/api/v1/syscategory", Paths: "/0/63/504/508", MenuType: "A", Action: "PUT", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 509, MenuName: "", Title: "删除分类", Icon: "bug", Path: "/api/v1/syscategory/:id", Paths: "/0/63/504/509", MenuType: "A", Action: "DELETE", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 511, MenuName: "SysContent", Title: "内容管理", Icon: "pass", Path: "syscontent", Paths: "/0/498/511", MenuType: "C", Action: "无", Permission: "syscontent:syscontent:list", ParentId: 498, NoCache: true, Breadcrumb: "", Component: "/syscontent/index", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 512, MenuName: "", Title: "分页获取内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/512", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:query", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 513, MenuName: "", Title: "创建内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/513", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:add", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 514, MenuName: "", Title: "修改内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/514", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:edit", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 515, MenuName: "", Title: "删除内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/515", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:remove", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 516, MenuName: "Content", Title: "内容管理", Icon: "bug", Path: "content", Paths: "/0/63/516", MenuType: "M", Action: "无", Permission: "", ParentId: 63, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 517, MenuName: "", Title: "分页获取内容管理", Icon: "bug", Path: "/api/v1/syscontentList", Paths: "/0/63/516/517", MenuType: "A", Action: "GET", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 518, MenuName: "", Title: "根据id获取内容管理", Icon: "bug", Path: "/api/v1/syscontent/:id", Paths: "/0/63/516/518", MenuType: "A", Action: "GET", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 519, MenuName: "", Title: "创建内容管理", Icon: "bug", Path: "/api/v1/syscontent", Paths: "/0/63/516/519", MenuType: "A", Action: "POST", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 520, MenuName: "", Title: "修改内容管理", Icon: "bug", Path: "/api/v1/syscontent", Paths: "/0/63/516/520", MenuType: "A", Action: "PUT", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
{MenuId: 521, MenuName: "", Title: "删除内容管理", Icon: "bug", Path: "/api/v1/syscontent/:id", Paths: "/0/63/516/521", MenuType: "A", Action: "DELETE", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", CreateBy: "1", UpdateBy: "1", IsFrame: "0"},
|
||||
list := []models.SysMenu{
|
||||
{MenuId: 496, MenuName: "Sources", Title: "资源管理", Icon: "network", Path: "/sources", Paths: "/0/496", MenuType: "M", Action: "无", Permission: "", ParentId: 0, NoCache: true, Breadcrumb: "", Component: "Layout", Sort: 3, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "1"},
|
||||
{MenuId: 497, MenuName: "File", Title: "文件管理", Icon: "documentation", Path: "file-manage", Paths: "/0/496/497", MenuType: "C", Action: "", Permission: "", ParentId: 496, NoCache: true, Breadcrumb: "", Component: "/fileManage/index", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "1"},
|
||||
{MenuId: 498, MenuName: "", Title: "内容管理", Icon: "pass", Path: "/content", Paths: "/0/498", MenuType: "M", Action: "无", Permission: "", ParentId: 0, NoCache: true, Breadcrumb: "", Component: "Layout", Sort: 4, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "1"},
|
||||
{MenuId: 499, MenuName: "SysCategory", Title: "分类", Icon: "pass", Path: "syscategory", Paths: "/0/498/499", MenuType: "C", Action: "无", Permission: "syscategory:syscategory:list", ParentId: 498, NoCache: true, Breadcrumb: "", Component: "/syscategory/index", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 500, MenuName: "", Title: "分页获取分类", Icon: "pass", Path: "", Paths: "/0/498/499/500", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:query", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 501, MenuName: "", Title: "创建分类", Icon: "pass", Path: "", Paths: "/0/498/499/501", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:add", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 502, MenuName: "", Title: "修改分类", Icon: "pass", Path: "", Paths: "/0/498/499/502", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:edit", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 503, MenuName: "", Title: "删除分类", Icon: "pass", Path: "", Paths: "/0/498/499/503", MenuType: "F", Action: "无", Permission: "syscategory:syscategory:remove", ParentId: 499, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 504, MenuName: "Category", Title: "分类", Icon: "bug", Path: "category", Paths: "/0/63/504", MenuType: "M", Action: "无", Permission: "", ParentId: 63, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 505, MenuName: "", Title: "分页获取分类", Icon: "bug", Path: "/api/v1/syscategoryList", Paths: "/0/63/504/505", MenuType: "A", Action: "GET", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 506, MenuName: "", Title: "根据id获取分类", Icon: "bug", Path: "/api/v1/syscategory/:id", Paths: "/0/63/504/506", MenuType: "A", Action: "GET", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 507, MenuName: "", Title: "创建分类", Icon: "bug", Path: "/api/v1/syscategory", Paths: "/0/63/504/507", MenuType: "A", Action: "POST", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 508, MenuName: "", Title: "修改分类", Icon: "bug", Path: "/api/v1/syscategory", Paths: "/0/63/504/508", MenuType: "A", Action: "PUT", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 509, MenuName: "", Title: "删除分类", Icon: "bug", Path: "/api/v1/syscategory/:id", Paths: "/0/63/504/509", MenuType: "A", Action: "DELETE", Permission: "", ParentId: 504, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 511, MenuName: "SysContent", Title: "内容管理", Icon: "pass", Path: "syscontent", Paths: "/0/498/511", MenuType: "C", Action: "无", Permission: "syscontent:syscontent:list", ParentId: 498, NoCache: true, Breadcrumb: "", Component: "/syscontent/index", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 512, MenuName: "", Title: "分页获取内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/512", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:query", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 513, MenuName: "", Title: "创建内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/513", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:add", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 514, MenuName: "", Title: "修改内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/514", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:edit", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 515, MenuName: "", Title: "删除内容管理", Icon: "pass", Path: "", Paths: "/0/510/511/515", MenuType: "F", Action: "无", Permission: "syscontent:syscontent:remove", ParentId: 511, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "0", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 516, MenuName: "Content", Title: "内容管理", Icon: "bug", Path: "content", Paths: "/0/63/516", MenuType: "M", Action: "无", Permission: "", ParentId: 63, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 517, MenuName: "", Title: "分页获取内容管理", Icon: "bug", Path: "/api/v1/syscontentList", Paths: "/0/63/516/517", MenuType: "A", Action: "GET", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 518, MenuName: "", Title: "根据id获取内容管理", Icon: "bug", Path: "/api/v1/syscontent/:id", Paths: "/0/63/516/518", MenuType: "A", Action: "GET", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 519, MenuName: "", Title: "创建内容管理", Icon: "bug", Path: "/api/v1/syscontent", Paths: "/0/63/516/519", MenuType: "A", Action: "POST", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 520, MenuName: "", Title: "修改内容管理", Icon: "bug", Path: "/api/v1/syscontent", Paths: "/0/63/516/520", MenuType: "A", Action: "PUT", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
{MenuId: 521, MenuName: "", Title: "删除内容管理", Icon: "bug", Path: "/api/v1/syscontent/:id", Paths: "/0/63/516/521", MenuType: "A", Action: "DELETE", Permission: "", ParentId: 516, NoCache: true, Breadcrumb: "", Component: "", Sort: 0, Visible: "1", ControlBy: models.ControlBy{CreateBy: 1, UpdateBy: 1}, IsFrame: "0"},
|
||||
}
|
||||
|
||||
err = tx.Create(list).Error
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ func _1600089797118Migrate(db *gorm.DB, version string) error {
|
||||
PId: 0,
|
||||
Sort: "0",
|
||||
Path: "",
|
||||
ControlBy: common.ControlBy{
|
||||
ControlBy: models.ControlBy{
|
||||
CreateBy: 1,
|
||||
UpdateBy: 1,
|
||||
},
|
||||
|
||||
@@ -5,9 +5,8 @@ import (
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/models/system"
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -18,13 +17,13 @@ func init() {
|
||||
|
||||
func _1602644950000Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
if tx.Migrator().HasColumn(&system.SysConfig{}, "config_id") {
|
||||
err := tx.Migrator().RenameColumn(&system.SysConfig{}, "config_id", "id")
|
||||
if tx.Migrator().HasColumn(&models.SysConfig{}, "config_id") {
|
||||
err := tx.Migrator().RenameColumn(&models.SysConfig{}, "config_id", "id")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
list2 := []system.CasbinRule{
|
||||
list2 := []models.CasbinRule{
|
||||
{PType: "p", V0: "admin", V1: "/api/v1/config", V2: "GET"},
|
||||
}
|
||||
err := tx.Create(list2).Error
|
||||
@@ -32,7 +31,7 @@ func _1602644950000Test(db *gorm.DB, version string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
menu := models.Menu{MenuId: 86, Path: "/api/v1/config"}
|
||||
menu := models.SysMenu{MenuId: 86, Path: "/api/v1/config"}
|
||||
err = tx.Model(&menu).Where("menu_id = ?", 86).Update("Path", "/api/v1/config").Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
|
||||
func _1603465014697Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
err := tx.Debug().Model(&models.Menu{}).Where("path = ?", "/api/v1/syscategoryList").Update("path", "/api/v1/syscategory").Error
|
||||
err := tx.Debug().Model(&models.SysMenu{}).Where("path = ?", "/api/v1/syscategoryList").Update("path", "/api/v1/syscategory").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models/system"
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -20,15 +20,15 @@ func _1603516925109Test(db *gorm.DB, version string) error {
|
||||
_ = tx.Migrator().RenameTable("sys_operlog", "sys_opera_log")
|
||||
_ = tx.Migrator().RenameTable("sys_loginlog", "sys_login_log")
|
||||
|
||||
if tx.Migrator().HasColumn(&system.SysLoginLog{}, "info_id") {
|
||||
err := tx.Migrator().RenameColumn(&system.SysLoginLog{}, "info_id", "id")
|
||||
if tx.Migrator().HasColumn(&models.SysLoginLog{}, "info_id") {
|
||||
err := tx.Migrator().RenameColumn(&models.SysLoginLog{}, "info_id", "id")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if tx.Migrator().HasColumn(&system.SysOperaLog{}, "oper_id") {
|
||||
err := tx.Migrator().RenameColumn(&system.SysOperaLog{}, "oper_id", "id")
|
||||
if tx.Migrator().HasColumn(&models.SysOperaLog{}, "oper_id") {
|
||||
err := tx.Migrator().RenameColumn(&models.SysOperaLog{}, "oper_id", "id")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -19,19 +18,19 @@ func init() {
|
||||
func _1606579402398Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
dicData := DictData{}
|
||||
dicData := models.DictData{}
|
||||
err := tx.Model(&dicData).Where("dict_code = ?", 1).Update("dict_value", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dicType := DictType{}
|
||||
dicType := models.DictType{}
|
||||
err = tx.Model(&dicType).Where("status = ?", 0).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
user := system.SysUser{}
|
||||
user := models.SysUser{}
|
||||
err = tx.Model(&user).Where("user_id = ?", 1).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -19,13 +18,13 @@ func init() {
|
||||
func _1606582844753Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
dept := system.SysDept{}
|
||||
dept := models.SysDept{}
|
||||
err := tx.Model(&dept).Where("status = ?", 0).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dictData := DictData{}
|
||||
dictData := models.DictData{}
|
||||
err = tx.Model(&dictData).Where("status = ?", 0).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,7 +19,7 @@ func _1610427732413Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
// TODO: 这里开始写入要变更的内容
|
||||
user := system.SysUser{}
|
||||
user := models.SysUser{}
|
||||
err := tx.Model(&user).Where("status = ?", 0).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,13 +19,13 @@ func _1610804233204Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
// TODO: 这里开始写入要变更的内容
|
||||
post := system.SysPost{}
|
||||
post := models.Post{}
|
||||
err := tx.Model(&post).Where("status = ?", 0).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
role := system.SysRole{}
|
||||
role := models.SysRole{}
|
||||
err = tx.Model(&role).Where("status = ?", 0).Update("status", 2).Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -22,20 +21,20 @@ func _1613638159444Test(db *gorm.DB, version string) error {
|
||||
// TODO: 这里开始写入要变更的内容
|
||||
|
||||
// TODO: 例如 修改表字段 使用过程中请删除此段代码
|
||||
err := tx.Migrator().AlterColumn(&system.SysRole{}, "create_by")
|
||||
err := tx.Migrator().AlterColumn(&models.SysRole{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysRole{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysRole{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Migrator().AlterColumn(&system.SysMenu{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysMenu{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysMenu{}, "create_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysMenu{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,20 +19,20 @@ func _1613697961697Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
//修改字段类型
|
||||
err := tx.Migrator().AlterColumn(&system.SysMenu{}, "create_by")
|
||||
err := tx.Migrator().AlterColumn(&models.SysMenu{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysMenu{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysMenu{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Migrator().AlterColumn(&system.SysRole{}, "create_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysRole{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysRole{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysRole{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -18,7 +19,7 @@ func _1613720892819Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
// TODO: 这里开始写入要变更的内容
|
||||
t := &DictType{
|
||||
t := &models.DictType{
|
||||
DictName: "内容状态",
|
||||
DictType: "sys_content_status",
|
||||
Status: "2",
|
||||
@@ -30,8 +31,8 @@ func _1613720892819Test(db *gorm.DB, version string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
data := make([]DictData, 2)
|
||||
data[0] = DictData{
|
||||
data := make([]models.DictData, 2)
|
||||
data[0] = models.DictData{
|
||||
DictSort: 0,
|
||||
DictLabel: "正常",
|
||||
DictValue: "1",
|
||||
@@ -40,7 +41,7 @@ func _1613720892819Test(db *gorm.DB, version string) error {
|
||||
CreateBy: "1",
|
||||
UpdateBy: "1",
|
||||
}
|
||||
data[1] = DictData{
|
||||
data[1] = models.DictData{
|
||||
DictSort: 1,
|
||||
DictLabel: "禁用",
|
||||
DictValue: "2",
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,36 +19,36 @@ func _1613783303115Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
//修改字段类型
|
||||
err := tx.Model(&system.SysDictType{}).Select("create_by").Not("create_by > 0").Update("create_by", "0").Error
|
||||
err := tx.Model(&models.DictType{}).Select("create_by").Not("create_by > 0").Update("create_by", "0").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&system.SysDictType{}).Select("update_by").Not("update_by > 0").Update("update_by", "0").Error
|
||||
err = tx.Model(&models.DictType{}).Select("update_by").Not("update_by > 0").Update("update_by", "0").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&system.SysDictData{}).Select("create_by").Not("create_by > 0").Update("create_by", "0").Error
|
||||
err = tx.Model(&models.DictType{}).Select("create_by").Not("create_by > 0").Update("create_by", "0").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&system.SysDictData{}).Select("update_by").Not("update_by > 0").Update("update_by", "0").Error
|
||||
err = tx.Model(&models.DictType{}).Select("update_by").Not("update_by > 0").Update("update_by", "0").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysDictType{}, "create_by")
|
||||
err = tx.Migrator().AlterColumn(&models.DictType{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysDictType{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.DictType{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Migrator().AlterColumn(&system.SysDictData{}, "create_by")
|
||||
err = tx.Migrator().AlterColumn(&models.DictType{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysDictData{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.DictType{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ func _1613978564961Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
// TODO: 这里开始写入要变更的内容
|
||||
menu := models.Menu{MenuId: 110, Path: "/api/v1/config"}
|
||||
menu := models.SysMenu{MenuId: 110, Path: "/api/v1/config"}
|
||||
err := tx.Model(&menu).Where("menu_id = ?", 110).Update("Path", "/api/v1/dict/data-all").Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -18,81 +18,81 @@ func init() {
|
||||
func _1613998164781Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
err := tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/deptList").Update("path", "/api/v1/dept").Error
|
||||
err := tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/deptList").Update("path", "/api/v1/dept").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/roleList").Update("path", "/api/v1/role").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/roleList").Update("path", "/api/v1/role").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/menuList").Update("path", "/api/v1/menu").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/menuList").Update("path", "/api/v1/menu").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/postList").Update("path", "/api/v1/post").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/postList").Update("path", "/api/v1/post").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/dict/typelist").Update("path", "/api/v1/dict/type").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/dict/typelist").Update("path", "/api/v1/dict/type").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/dict/datalist").Update("path", "/api/v1/dict/data").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/dict/datalist").Update("path", "/api/v1/dict/data").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path like ?", "/api/v1/dict/data").
|
||||
err = tx.Model(&models.SysMenu{}).Where("path like ?", "/api/v1/dict/data").
|
||||
Where("action = ?", "PUT").Update("path", "/api/v1/dict/data/:id").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path like ?", "/api/v1/dict/data/:id").
|
||||
err = tx.Model(&models.SysMenu{}).Where("path like ?", "/api/v1/dict/data/:id").
|
||||
Where("action = ?", "DELETE").Update("path", "/api/v1/dict/data").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path like ?", "/api/v1/dict/type").
|
||||
err = tx.Model(&models.SysMenu{}).Where("path like ?", "/api/v1/dict/type").
|
||||
Where("action = ?", "PUT").Update("path", "/api/v1/dict/type/:id").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path like ?", "/api/v1/dict/type/:id").
|
||||
err = tx.Model(&models.SysMenu{}).Where("path like ?", "/api/v1/dict/type/:id").
|
||||
Where("action = ?", "DELETE").Update("path", "/api/v1/dict/type").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/operloglist").Update("path", "/api/v1/sys-opera-log").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/operloglist").Update("path", "/api/v1/sys-opera-log").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/loginloglist").Update("path", "/api/v1/sys-login-log").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/loginloglist").Update("path", "/api/v1/sys-login-log").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/loginlog/:id").Where("action = ?", "DELETE").Update("path", "/api/v1/sys-opera-log").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/loginlog/:id").Where("action = ?", "DELETE").Update("path", "/api/v1/sys-opera-log").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path like ?", "/api/v1/operloglist%").Where("action = ?", "DELETE").Update("path", "/api/v1/sys-opera-log").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path like ?", "/api/v1/operloglist%").Where("action = ?", "DELETE").Update("path", "/api/v1/sys-opera-log").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("path like ?", "/api/v1/role/:id").Where("action = ?", "DELETE").Update("path", "/api/v1/role").Error
|
||||
err = tx.Model(&models.SysMenu{}).Where("path like ?", "/api/v1/role/:id").Where("action = ?", "DELETE").Update("path", "/api/v1/role").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ func _1614073723691Test(db *gorm.DB, version string) error {
|
||||
|
||||
// TODO: 这里开始写入要变更的内容
|
||||
|
||||
err := tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/syscontentList").Update("path", "/api/v1/syscontent").Error
|
||||
err := tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/syscontentList").Update("path", "/api/v1/syscontent").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/models/system"
|
||||
|
||||
//"go-admin/app/admin/models"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
"go-admin/cmd/migrate/migration/models"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -20,28 +18,28 @@ func init() {
|
||||
func _1614604763713Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
err := tx.Model(&models.Menu{}).Where("path = ?", "/api/v1/dict/typeoptionselect").Update("path", "/api/v1/dict/type-option-select").Error
|
||||
err := tx.Model(&models.SysMenu{}).Where("path = ?", "/api/v1/dict/typeoptionselect").Update("path", "/api/v1/dict/type-option-select").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("action = ?", "GET").
|
||||
err = tx.Model(&models.SysMenu{}).Where("action = ?", "GET").
|
||||
Where("path = ?", "/api/v1/sysUserList").Update("path", "/api/v1/sysUser").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("action = ?", "DELETE").
|
||||
err = tx.Model(&models.SysMenu{}).Where("action = ?", "DELETE").
|
||||
Where("path = ?", "/api/v1/sysUser/:id").Update("path", "/api/v1/sysUser").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Migrator().AlterColumn(&system.SysUser{}, "create_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysUser{}, "create_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Migrator().AlterColumn(&system.SysUser{}, "update_by")
|
||||
err = tx.Migrator().AlterColumn(&models.SysUser{}, "update_by")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -54,13 +52,13 @@ func _1614604763713Test(db *gorm.DB, version string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = tx.Model(&models.Menu{}).Where("action = ?", "PUT").
|
||||
err = tx.Model(&models.SysMenu{}).Where("action = ?", "PUT").
|
||||
Where("path = ?", "/api/v1/syscontent").Update("path", "/api/v1/syscontent/:id").Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Model(&models.Menu{}).Where("action = ?", "DELETE").
|
||||
err = tx.Model(&models.SysMenu{}).Where("action = ?", "DELETE").
|
||||
Where("path = ?", "/api/v1/syscontent/:id").Update("path", "/api/v1/syscontent").Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -2,9 +2,10 @@ package version
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
@@ -18,7 +19,7 @@ func _1615948084336Test(db *gorm.DB, version string) error {
|
||||
return db.Transaction(func(tx *gorm.DB) error {
|
||||
|
||||
err := tx.Exec("alter table sys_config add is_frontend int default 1 null comment '是否前台参数' after config_type").Error
|
||||
if err != nil && !strings.Contains(err.Error(),"Duplicate column name 'is_frontend'") {
|
||||
if err != nil && !strings.Contains(err.Error(), "Duplicate column name 'is_frontend'") {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -26,4 +27,4 @@ func _1615948084336Test(db *gorm.DB, version string) error {
|
||||
Version: version,
|
||||
}).Error
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"runtime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/cmd/migrate/migration"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
)
|
||||
|
||||
type DictData struct {
|
||||
DictCode int `gorm:"primaryKey;autoIncrement;" json:"dictCode" example:"1"` //字典编码
|
||||
DictSort int `gorm:"" json:"dictSort"` //显示顺序
|
||||
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
|
||||
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
|
||||
DictType string `gorm:"size:64;" json:"dictType"` //字典类型
|
||||
CssClass string `gorm:"size:128;" json:"cssClass"` //
|
||||
ListClass string `gorm:"size:128;" json:"listClass"` //
|
||||
IsDefault string `gorm:"size:8;" json:"isDefault"` //
|
||||
Status string `gorm:"size:4;" json:"status"` //状态
|
||||
Default string `gorm:"size:8;" json:"default"` //
|
||||
CreateBy string `gorm:"size:64;" json:"createBy"` //
|
||||
UpdateBy string `gorm:"size:64;" json:"updateBy"` //
|
||||
Remark string `gorm:"size:255;" json:"remark"` //备注
|
||||
models.BaseModel
|
||||
}
|
||||
|
||||
func (DictData) TableName() string {
|
||||
return "sys_dict_data"
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"go-admin/app/admin/models"
|
||||
)
|
||||
|
||||
type DictType struct {
|
||||
DictId int `gorm:"primaryKey;autoIncrement;" json:"dictId"`
|
||||
DictName string `gorm:"size:128;" json:"dictName"` //字典名称
|
||||
DictType string `gorm:"size:128;" json:"dictType"` //字典类型
|
||||
Status string `gorm:"size:4;" json:"status"` //状态
|
||||
CreateBy string `gorm:"size:11;" json:"createBy"` //创建者
|
||||
UpdateBy string `gorm:"size:11;" json:"updateBy"` //更新者
|
||||
Remark string `gorm:"size:255;" json:"remark"` //备注
|
||||
models.BaseModel
|
||||
}
|
||||
|
||||
func (DictType) TableName() string {
|
||||
return "sys_dict_type"
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Post struct {
|
||||
PostId int `gorm:"primaryKey;autoIncrement" json:"postId"` //岗位编号
|
||||
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
|
||||
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
|
||||
Sort int `gorm:"" json:"sort"` //岗位排序
|
||||
Status string `gorm:"size:4;" json:"status"` //状态
|
||||
Remark string `gorm:"size:255;" json:"remark"` //描述
|
||||
CreateBy string `gorm:"size:128;" json:"createBy"`
|
||||
UpdateBy string `gorm:"size:128;" json:"updateBy"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt *time.Time `json:"deletedAt"`
|
||||
}
|
||||
|
||||
func (Post) TableName() string {
|
||||
return "sys_post"
|
||||
}
|
||||
Reference in new issue
Block a user