format🥚 :调整主键key和自增长tag
This commit is contained in:
1 parent
561566f172
commit
f22f654c91
17 files changed
+21
-21
No files matched your search
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SysDepts struct {
|
type SysDepts struct {
|
||||||
DeptId int `json:"deptId" gorm:"primary_key;auto_increment;"` //部门编码
|
DeptId int `json:"deptId" gorm:"primaryKey;autoIncrement;"` //部门编码
|
||||||
ParentId int `json:"parentId" gorm:""` //上级部门
|
ParentId int `json:"parentId" gorm:""` //上级部门
|
||||||
DeptPath string `json:"deptPath" gorm:"size:255;"` //
|
DeptPath string `json:"deptPath" gorm:"size:255;"` //
|
||||||
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
|
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Menu struct {
|
type Menu struct {
|
||||||
MenuId int `json:"menuId" gorm:"primary_key;AUTO_INCREMENT"`
|
MenuId int `json:"menuId" gorm:"primaryKey;autoIncrement"`
|
||||||
MenuName string `json:"menuName" gorm:"size:128;"`
|
MenuName string `json:"menuName" gorm:"size:128;"`
|
||||||
Title string `json:"title" gorm:"size:128;"`
|
Title string `json:"title" gorm:"size:128;"`
|
||||||
Icon string `json:"icon" gorm:"size:128;"`
|
Icon string `json:"icon" gorm:"size:128;"`
|
||||||
@@ -46,7 +46,7 @@ type MenuLable struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Menus struct {
|
type Menus struct {
|
||||||
MenuId int `json:"menuId" gorm:"column:menu_id;primary_key;"`
|
MenuId int `json:"menuId" gorm:"column:menu_id;primaryKey;autoIncrement;"`
|
||||||
MenuName string `json:"menuName" gorm:"column:menu_name"`
|
MenuName string `json:"menuName" gorm:"column:menu_name"`
|
||||||
Title string `json:"title" gorm:"column:title"`
|
Title string `json:"title" gorm:"column:title"`
|
||||||
Icon string `json:"icon" gorm:"column:icon"`
|
Icon string `json:"icon" gorm:"column:icon"`
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Post struct {
|
type Post struct {
|
||||||
PostId int `gorm:"primary_key;AUTO_INCREMENT" json:"postId"` //岗位编号
|
PostId int `gorm:"primaryKey;autoIncrement" json:"postId"` //岗位编号
|
||||||
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
|
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
|
||||||
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
|
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
|
||||||
Sort int `gorm:"" json:"sort"` //岗位排序
|
Sort int `gorm:"" json:"sort"` //岗位排序
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SysRole struct {
|
type SysRole struct {
|
||||||
RoleId int `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"` // 角色编码
|
RoleId int `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码
|
||||||
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
|
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
|
||||||
Status string `json:"status" gorm:"size:4;"` //
|
Status string `json:"status" gorm:"size:4;"` //
|
||||||
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
|
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package models
|
|||||||
import "go-admin/common/models"
|
import "go-admin/common/models"
|
||||||
|
|
||||||
type SysDept struct {
|
type SysDept struct {
|
||||||
DeptId int `json:"deptId" gorm:"primary_key;auto_increment;"` //部门编码
|
DeptId int `json:"deptId" gorm:"primaryKey;autoIncrement;"` //部门编码
|
||||||
ParentId int `json:"parentId" gorm:""` //上级部门
|
ParentId int `json:"parentId" gorm:""` //上级部门
|
||||||
DeptPath string `json:"deptPath" gorm:"size:255;"` //
|
DeptPath string `json:"deptPath" gorm:"size:255;"` //
|
||||||
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
|
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package models
|
|||||||
import "go-admin/common/models"
|
import "go-admin/common/models"
|
||||||
|
|
||||||
type SysMenu struct {
|
type SysMenu struct {
|
||||||
MenuId int `json:"menuId" gorm:"primary_key;AUTO_INCREMENT"`
|
MenuId int `json:"menuId" gorm:"primaryKey;autoIncrement"`
|
||||||
MenuName string `json:"menuName" gorm:"size:128;"`
|
MenuName string `json:"menuName" gorm:"size:128;"`
|
||||||
Title string `json:"title" gorm:"size:128;"`
|
Title string `json:"title" gorm:"size:128;"`
|
||||||
Icon string `json:"icon" gorm:"size:128;"`
|
Icon string `json:"icon" gorm:"size:128;"`
|
||||||
@@ -29,7 +29,7 @@ type SysMenu struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SysMenus struct {
|
type SysMenus struct {
|
||||||
MenuId int `json:"menuId" gorm:"column:menu_id;primary_key;"`
|
MenuId int `json:"menuId" gorm:"column:menu_id;primaryKey;autoIncrement;"`
|
||||||
MenuName string `json:"menuName" gorm:"column:menu_name"`
|
MenuName string `json:"menuName" gorm:"column:menu_name"`
|
||||||
Title string `json:"title" gorm:"column:title"`
|
Title string `json:"title" gorm:"column:title"`
|
||||||
Icon string `json:"icon" gorm:"column:icon"`
|
Icon string `json:"icon" gorm:"column:icon"`
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SysContent struct {
|
type SysContent struct {
|
||||||
Id int `json:"id" gorm:"type:int(11);primary_key;auto_increment"` // id
|
Id int `json:"id" gorm:"type:int(11);primaryKey;autoIncrement"` // id
|
||||||
CateId string `json:"cateId" gorm:"type:int(11);"` // 分类id
|
CateId string `json:"cateId" gorm:"type:int(11);"` // 分类id
|
||||||
Name string `json:"name" gorm:"type:varchar(255);"` // 名称
|
Name string `json:"name" gorm:"type:varchar(255);"` // 名称
|
||||||
Status string `json:"status" gorm:"type:int(1);"` // 状态
|
Status string `json:"status" gorm:"type:int(1);"` // 状态
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SysJob struct {
|
type SysJob struct {
|
||||||
JobId int `json:"jobId" gorm:"primary_key;AUTO_INCREMENT"` // 编码
|
JobId int `json:"jobId" gorm:"primaryKey;autoIncrement"` // 编码
|
||||||
JobName string `json:"jobName" gorm:"size:255;"` // 名称
|
JobName string `json:"jobName" gorm:"size:255;"` // 名称
|
||||||
JobGroup string `json:"jobGroup" gorm:"size:255;"` // 任务分组
|
JobGroup string `json:"jobGroup" gorm:"size:255;"` // 任务分组
|
||||||
JobType int `json:"jobType" gorm:"size:1;"` // 任务类型
|
JobType int `json:"jobType" gorm:"size:1;"` // 任务类型
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
type RoleMenu struct {
|
type RoleMenu struct {
|
||||||
RoleId int `gorm:""`
|
RoleId int `gorm:""`
|
||||||
MenuId int `gorm:""`
|
MenuId int `gorm:""`
|
||||||
RoleName string `gorm:"size:128)"`
|
RoleName string `gorm:"size:128"`
|
||||||
CreateBy string `gorm:"size:128)"`
|
CreateBy string `gorm:"size:128"`
|
||||||
UpdateBy string `gorm:"size:128)"`
|
UpdateBy string `gorm:"size:128"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (RoleMenu) TableName() string {
|
func (RoleMenu) TableName() string {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package system
|
|||||||
import "go-admin/common/models"
|
import "go-admin/common/models"
|
||||||
|
|
||||||
type SysPost struct {
|
type SysPost struct {
|
||||||
PostId int `gorm:"primary_key;AUTO_INCREMENT" json:"postId"` //岗位编号
|
PostId int `gorm:"primaryKey;autoIncrement" json:"postId"` //岗位编号
|
||||||
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
|
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
|
||||||
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
|
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
|
||||||
Sort int `gorm:"" json:"sort"` //岗位排序
|
Sort int `gorm:"" json:"sort"` //岗位排序
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package system
|
|||||||
import "go-admin/common/models"
|
import "go-admin/common/models"
|
||||||
|
|
||||||
type SysRole struct {
|
type SysRole struct {
|
||||||
RoleId int `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"` // 角色编码
|
RoleId int `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码
|
||||||
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
|
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
|
||||||
Status string `json:"status" gorm:"size:4;"` //
|
Status string `json:"status" gorm:"size:4;"` //
|
||||||
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
|
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ type LoginM struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SysUserId struct {
|
type SysUserId struct {
|
||||||
UserId int `gorm:"primary_key;AUTO_INCREMENT" json:"userId"` // 编码
|
UserId int `gorm:"primaryKey;autoIncrement" json:"userId"` // 编码
|
||||||
}
|
}
|
||||||
|
|
||||||
type SysUserB struct {
|
type SysUserB struct {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SysColumns struct {
|
type SysColumns struct {
|
||||||
ColumnId int `gorm:"primary_key;auto_increment" json:"columnId"`
|
ColumnId int `gorm:"primaryKey;autoIncrement" json:"columnId"`
|
||||||
TableId int `gorm:"" json:"tableId"`
|
TableId int `gorm:"" json:"tableId"`
|
||||||
ColumnName string `gorm:"size:128;" json:"columnName"`
|
ColumnName string `gorm:"size:128;" json:"columnName"`
|
||||||
ColumnComment string `gorm:"column:column_comment;size:128;" json:"columnComment"`
|
ColumnComment string `gorm:"column:column_comment;size:128;" json:"columnComment"`
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SysTables struct {
|
type SysTables struct {
|
||||||
TableId int `gorm:"primary_key;auto_increment" json:"tableId"` //表编码
|
TableId int `gorm:"primaryKey;autoIncrement" json:"tableId"` //表编码
|
||||||
TBName string `gorm:"column:table_name;size:255;" json:"tableName"` //表名称
|
TBName string `gorm:"column:table_name;size:255;" json:"tableName"` //表名称
|
||||||
TableComment string `gorm:"size:255;" json:"tableComment"` //表备注
|
TableComment string `gorm:"size:255;" json:"tableComment"` //表备注
|
||||||
ClassName string `gorm:"size:255;" json:"className"` //类名
|
ClassName string `gorm:"size:255;" json:"className"` //类名
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type DictData struct {
|
type DictData struct {
|
||||||
DictCode int `gorm:"primary_key;auto_increment;" json:"dictCode" example:"1"` //字典编码
|
DictCode int `gorm:"primaryKey;autoIncrement;" json:"dictCode" example:"1"` //字典编码
|
||||||
DictSort int `gorm:"" json:"dictSort"` //显示顺序
|
DictSort int `gorm:"" json:"dictSort"` //显示顺序
|
||||||
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
|
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
|
||||||
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
|
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type DictType struct {
|
type DictType struct {
|
||||||
DictId int `gorm:"primary_key;auto_increment;" json:"dictId"`
|
DictId int `gorm:"primaryKey;autoIncrement;" json:"dictId"`
|
||||||
DictName string `gorm:"size:128;" json:"dictName"` //字典名称
|
DictName string `gorm:"size:128;" json:"dictName"` //字典名称
|
||||||
DictType string `gorm:"size:128;" json:"dictType"` //字典类型
|
DictType string `gorm:"size:128;" json:"dictType"` //字典类型
|
||||||
Status string `gorm:"size:4;" json:"status"` //状态
|
Status string `gorm:"size:4;" json:"status"` //状态
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package models
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type Migration struct {
|
type Migration struct {
|
||||||
Version string `gorm:"primary_key"`
|
Version string `gorm:"primaryKey"`
|
||||||
ApplyTime time.Time `gorm:"autoCreateTime"`
|
ApplyTime time.Time `gorm:"autoCreateTime"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user