提交
This commit is contained in:
39
modules/base/model/base_eps_admin.go
Normal file
39
modules/base/model/base_eps_admin.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/cool-team-official/cool-admin-go/cool"
|
||||
)
|
||||
|
||||
const TableNameBaseEpsAdmin = "base_eps_admin"
|
||||
|
||||
// BaseEpsAdmin mapped from table <base_eps_admin>
|
||||
type BaseEpsAdmin struct {
|
||||
Id int `json:"id"`
|
||||
Module string `json:"module" field:"module"`
|
||||
Method string // 请求方法 例如:GET
|
||||
Path string // 请求路径 例如:/welcome
|
||||
Prefix string // 路由前缀 例如:/admin/base/open
|
||||
Summary string // 描述 例如:欢迎页面
|
||||
Tag string // 标签 例如:base 好像暂时不用
|
||||
Dts string // 未知 例如:{} 好像暂时不用
|
||||
}
|
||||
|
||||
// TableName BaseEpsAdmin's table name
|
||||
func (*BaseEpsAdmin) TableName() string {
|
||||
return TableNameBaseEpsAdmin
|
||||
}
|
||||
|
||||
// GroupName BaseEpsAdmin's table group
|
||||
func (*BaseEpsAdmin) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewBaseEpsAdmin create a new BaseEpsAdmin
|
||||
func NewBaseEpsAdmin() *BaseEpsAdmin {
|
||||
return &BaseEpsAdmin{}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseEpsAdmin{})
|
||||
}
|
||||
39
modules/base/model/base_eps_app.go
Normal file
39
modules/base/model/base_eps_app.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/cool-team-official/cool-admin-go/cool"
|
||||
)
|
||||
|
||||
const TableNameBaseEpsApp = "base_eps_app"
|
||||
|
||||
// BaseEpsApp mapped from table <base_eps_app>
|
||||
type BaseEpsApp struct {
|
||||
Id int `json:"id"`
|
||||
Module string `json:"module" field:"module"`
|
||||
Method string // 请求方法 例如:GET
|
||||
Path string // 请求路径 例如:/welcome
|
||||
Prefix string // 路由前缀 例如:/admin/base/open
|
||||
Summary string // 描述 例如:欢迎页面
|
||||
Tag string // 标签 例如:base 好像暂时不用
|
||||
Dts string // 未知 例如:{} 好像暂时不用
|
||||
}
|
||||
|
||||
// TableName BaseEpsApp's table name
|
||||
func (*BaseEpsApp) TableName() string {
|
||||
return TableNameBaseEpsApp
|
||||
}
|
||||
|
||||
// GroupName BaseEpsApp's table group
|
||||
func (*BaseEpsApp) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// NewBaseEpsApp create a new BaseEpsApp
|
||||
func NewBaseEpsApp() *BaseEpsApp {
|
||||
return &BaseEpsApp{}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseEpsApp{})
|
||||
}
|
||||
29
modules/base/model/base_sys_conf.go
Normal file
29
modules/base/model/base_sys_conf.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysConf = "base_sys_conf"
|
||||
|
||||
// BaseSysConf mapped from table <base_sys_conf>
|
||||
type BaseSysConf struct {
|
||||
*cool.Model
|
||||
CKey string `gorm:"column:cKey;type:varchar(255);not null;index" json:"cKey"` // 配置键
|
||||
CValue string `gorm:"column:cValue;type:varchar(255);not null" json:"cValue"` // 配置值
|
||||
}
|
||||
|
||||
// TableName BaseSysConf's table name
|
||||
func (*BaseSysConf) TableName() string {
|
||||
return TableNameBaseSysConf
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysConf{})
|
||||
}
|
||||
|
||||
// NewBaseSysConf 创建实例
|
||||
func NewBaseSysConf() *BaseSysConf {
|
||||
return &BaseSysConf{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
30
modules/base/model/base_sys_department.go
Normal file
30
modules/base/model/base_sys_department.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysDepartment = "base_sys_department"
|
||||
|
||||
// BaseSysDepartment mapped from table <base_sys_department>
|
||||
type BaseSysDepartment struct {
|
||||
*cool.Model
|
||||
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 部门名称
|
||||
ParentID uint `gorm:"column:parentId;type:bigint" json:"parentId"` // 上级部门ID
|
||||
OrderNum int32 `gorm:"column:orderNum;type:int;not null" json:"orderNum"` // 排序
|
||||
}
|
||||
|
||||
// TableName BaseSysDepartment's table name
|
||||
func (*BaseSysDepartment) TableName() string {
|
||||
return TableNameBaseSysDepartment
|
||||
}
|
||||
|
||||
// NewBaseSysDepartment 创建一个BaseSysDepartment实例
|
||||
func NewBaseSysDepartment() *BaseSysDepartment {
|
||||
return &BaseSysDepartment{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysDepartment{})
|
||||
}
|
||||
34
modules/base/model/base_sys_init.go
Normal file
34
modules/base/model/base_sys_init.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/cool-team-official/cool-admin-go/cool"
|
||||
)
|
||||
|
||||
const TableNameBaseSysInit = "base_sys_init"
|
||||
|
||||
// BaseSysInit mapped from table <base_sys_init>
|
||||
type BaseSysInit struct {
|
||||
Id uint `gorm:"primaryKey" json:"id"`
|
||||
Table string `gorm:"index;not null" json:"table"`
|
||||
Group string `gorm:"index;not null" json:"group"`
|
||||
}
|
||||
|
||||
// TableName BaseSysInit's table namer
|
||||
func (*BaseSysInit) TableName() string {
|
||||
return TableNameBaseSysInit
|
||||
}
|
||||
|
||||
// TableGroup BaseSysInit's table group
|
||||
func (*BaseSysInit) GroupName() string {
|
||||
return "default"
|
||||
}
|
||||
|
||||
// GetStruct BaseSysInit's struct
|
||||
func (m *BaseSysInit) GetStruct() interface{} {
|
||||
return m
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysInit{})
|
||||
}
|
||||
32
modules/base/model/base_sys_log.go
Normal file
32
modules/base/model/base_sys_log.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysLog = "base_sys_log"
|
||||
|
||||
// BaseSysLog mapped from table <base_sys_log>
|
||||
type BaseSysLog struct {
|
||||
*cool.Model
|
||||
UserID uint `gorm:"column:userId;index:IDX_51a2caeb5713efdfcb343a8772,priority:1" json:"userId"` // 用户ID
|
||||
Action string `gorm:"column:action;not null;index:IDX_938f886fb40e163db174b7f6c3,priority:1" json:"action"` // 行为
|
||||
IP string `gorm:"column:ip;index:IDX_24e18767659f8c7142580893f2,priority:1" json:"ip"` // ip
|
||||
IPAddr string `gorm:"column:ipAddr;index:IDX_a03a27f75cf8d502b3060823e1,priority:1" json:"ipAddr"` // ip地址
|
||||
Params string `gorm:"column:params" json:"params"` // 参数
|
||||
}
|
||||
|
||||
// TableName BaseSysLog's table name
|
||||
func (*BaseSysLog) TableName() string {
|
||||
return TableNameBaseSysLog
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysLog{})
|
||||
}
|
||||
|
||||
// NewBaseSysLog 创建实例
|
||||
func NewBaseSysLog() *BaseSysLog {
|
||||
return &BaseSysLog{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
37
modules/base/model/base_sys_menu.go
Normal file
37
modules/base/model/base_sys_menu.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysMenu = "base_sys_menu"
|
||||
|
||||
// BaseSysMenu mapped from table <base_sys_menu>
|
||||
type BaseSysMenu struct {
|
||||
*cool.Model
|
||||
ParentID uint `gorm:"column:parentId;type:bigint" json:"parentId"` // 父菜单ID
|
||||
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 菜单名称
|
||||
Router *string `gorm:"column:router;type:varchar(255)" json:"router"` // 菜单地址
|
||||
Perms *string `gorm:"column:perms;type:varchar(255)" json:"perms"` // 权限标识
|
||||
Type int32 `gorm:"column:type;not null" json:"type"` // 类型 0:目录 1:菜单 2:按钮
|
||||
Icon *string `gorm:"column:icon;type:varchar(255)" json:"icon"` // 图标
|
||||
OrderNum int32 `gorm:"column:orderNum;type:int;not null;default:0" json:"orderNum"` // 排序
|
||||
ViewPath *string `gorm:"column:viewPath;type:varchar(255)" json:"viewPath"` // 视图地址
|
||||
KeepAlive *int32 `gorm:"column:keepAlive;not null;default:1" json:"keepAlive"` // 路由缓存
|
||||
IsShow *int32 `gorm:"column:isShow;not null;default:1" json:"isShow"` // 是否显示
|
||||
}
|
||||
|
||||
// TableName BaseSysMenu's table name
|
||||
func (*BaseSysMenu) TableName() string {
|
||||
return TableNameBaseSysMenu
|
||||
}
|
||||
|
||||
// NewBaseSysMenu create a new BaseSysMenu
|
||||
func NewBaseSysMenu() *BaseSysMenu {
|
||||
return &BaseSysMenu{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysMenu{})
|
||||
}
|
||||
32
modules/base/model/base_sys_param.go
Normal file
32
modules/base/model/base_sys_param.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysParam = "base_sys_param"
|
||||
|
||||
// BaseSysParam mapped from table <base_sys_param>
|
||||
type BaseSysParam struct {
|
||||
*cool.Model
|
||||
KeyName string `gorm:"column:keyName;type:varchar(255);not null;index:IDX_cf19b5e52d8c71caa9c4534454,priority:1" json:"keyName"` // 键位
|
||||
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"` // 名称
|
||||
Data string `gorm:"column:data;type:text;not null" json:"data"` // 数据
|
||||
DataType int32 `gorm:"column:dataType;not null;default:0" json:"dataType"` // 数据类型 0:字符串 1:数组 2:键值对
|
||||
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
|
||||
}
|
||||
|
||||
// TableName BaseSysParam's table name
|
||||
func (*BaseSysParam) TableName() string {
|
||||
return TableNameBaseSysParam
|
||||
}
|
||||
|
||||
// NewBaseSysParam 创建一个新的BaseSysParam
|
||||
func NewBaseSysParam() *BaseSysParam {
|
||||
return &BaseSysParam{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysParam{})
|
||||
}
|
||||
32
modules/base/model/base_sys_role.go
Normal file
32
modules/base/model/base_sys_role.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysRole = "base_sys_role"
|
||||
|
||||
// BaseSysRole mapped from table <base_sys_role>
|
||||
type BaseSysRole struct {
|
||||
*cool.Model
|
||||
UserID string `gorm:"column:userId;type:varchar(255);not null" json:"userId"` // 用户ID
|
||||
Name string `gorm:"column:name;type:varchar(255);not null;index:IDX_469d49a5998170e9550cf113da,priority:1" json:"name"` // 名称
|
||||
Label *string `gorm:"column:label;type:varchar(50);index:IDX_f3f24fbbccf00192b076e549a7,priority:1" json:"label"` // 角色标签
|
||||
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
|
||||
Relevance *int32 `gorm:"column:relevance;type:int;not null;default:1" json:"relevance"` // 数据权限是否关联上下级
|
||||
}
|
||||
|
||||
// TableName BaseSysRole's table name
|
||||
func (*BaseSysRole) TableName() string {
|
||||
return TableNameBaseSysRole
|
||||
}
|
||||
|
||||
// NewBaseSysRole create a new BaseSysRole
|
||||
func NewBaseSysRole() *BaseSysRole {
|
||||
return &BaseSysRole{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysRole{})
|
||||
}
|
||||
29
modules/base/model/base_sys_role_department.go
Normal file
29
modules/base/model/base_sys_role_department.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysRoleDepartment = "base_sys_role_department"
|
||||
|
||||
// BaseSysRoleDepartment mapped from table <base_sys_role_department>
|
||||
type BaseSysRoleDepartment struct {
|
||||
*cool.Model
|
||||
RoleID uint `gorm:"column:roleId;type:bigint;not null" json:"roleId"` // 角色ID
|
||||
DepartmentID uint `gorm:"column:departmentId;type:bigint;not null" json:"departmentId"` // 部门ID
|
||||
}
|
||||
|
||||
// TableName BaseSysRoleDepartment's table name
|
||||
func (*BaseSysRoleDepartment) TableName() string {
|
||||
return TableNameBaseSysRoleDepartment
|
||||
}
|
||||
|
||||
// NewBaseSysRoleDepartment create a new BaseSysRoleDepartment
|
||||
func NewBaseSysRoleDepartment() *BaseSysRoleDepartment {
|
||||
return &BaseSysRoleDepartment{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysRoleDepartment{})
|
||||
}
|
||||
29
modules/base/model/base_sys_role_menu.go
Normal file
29
modules/base/model/base_sys_role_menu.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysRoleMenu = "base_sys_role_menu"
|
||||
|
||||
// BaseSysRoleMenu mapped from table <base_sys_role_menu>
|
||||
type BaseSysRoleMenu struct {
|
||||
*cool.Model
|
||||
RoleID uint `gorm:"column:roleId;type:bigint;not null" json:"roleId"` // 角色ID
|
||||
MenuID uint `gorm:"column:menuId;type:bigint;not null" json:"menuId"` // 菜单ID
|
||||
}
|
||||
|
||||
// TableName BaseSysRoleMenu's table name
|
||||
func (*BaseSysRoleMenu) TableName() string {
|
||||
return TableNameBaseSysRoleMenu
|
||||
}
|
||||
|
||||
// NewBaseSysRoleMenu create a new BaseSysRoleMenu
|
||||
func NewBaseSysRoleMenu() *BaseSysRoleMenu {
|
||||
return &BaseSysRoleMenu{
|
||||
Model: &cool.Model{},
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysRoleMenu{})
|
||||
}
|
||||
39
modules/base/model/base_sys_user.go
Normal file
39
modules/base/model/base_sys_user.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysUser = "base_sys_user"
|
||||
|
||||
// BaseSysUser mapped from table <base_sys_user>
|
||||
type BaseSysUser struct {
|
||||
*cool.Model
|
||||
DepartmentID uint `gorm:"column:departmentId;type:bigint;index" json:"departmentId"` // 部门ID
|
||||
Name *string `gorm:"column:name;type:varchar(255)" json:"name"` // 姓名
|
||||
Username string `gorm:"column:username;type:varchar(100);not null;Index" json:"username"` // 用户名
|
||||
Password string `gorm:"column:password;type:varchar(255);not null" json:"password"` // 密码
|
||||
PasswordV *int32 `gorm:"column:passwordV;type:int;not null;default:1" json:"passwordV"` // 密码版本, 作用是改完密码,让原来的token失效
|
||||
NickName *string `gorm:"column:nickName;type:varchar(255)" json:"nickName"` // 昵称
|
||||
HeadImg *string `gorm:"column:headImg;type:varchar(255)" json:"headImg"` // 头像
|
||||
Phone *string `gorm:"column:phone;type:varchar(20);index" json:"phone"` // 手机
|
||||
Email *string `gorm:"column:email;type:varchar(255)" json:"email"` // 邮箱
|
||||
Status *int32 `gorm:"column:status;not null;default:1" json:"status"` // 状态 0:禁用 1:启用
|
||||
Remark *string `gorm:"column:remark;type:varchar(255)" json:"remark"` // 备注
|
||||
SocketID *string `gorm:"column:socketId;type:varchar(255)" json:"socketId"` // socketId
|
||||
}
|
||||
|
||||
// TableName BaseSysUser's table name
|
||||
func (*BaseSysUser) TableName() string {
|
||||
return TableNameBaseSysUser
|
||||
}
|
||||
|
||||
// NewBaseSysUser 创建一个新的BaseSysUser
|
||||
func NewBaseSysUser() *BaseSysUser {
|
||||
return &BaseSysUser{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysUser{})
|
||||
}
|
||||
29
modules/base/model/base_sys_user_role.go
Normal file
29
modules/base/model/base_sys_user_role.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package model
|
||||
|
||||
import "github.com/cool-team-official/cool-admin-go/cool"
|
||||
|
||||
const TableNameBaseSysUserRole = "base_sys_user_role"
|
||||
|
||||
// BaseSysUserRole mapped from table <base_sys_user_role>
|
||||
type BaseSysUserRole struct {
|
||||
*cool.Model
|
||||
UserID uint `gorm:"column:userId;type:bigint;not null" json:"userId"` // 用户ID
|
||||
RoleID uint `gorm:"column:roleId;type:bigint;not null" json:"roleId"` // 角色ID
|
||||
}
|
||||
|
||||
// TableName BaseSysUserRole's table name
|
||||
func (*BaseSysUserRole) TableName() string {
|
||||
return TableNameBaseSysUserRole
|
||||
}
|
||||
|
||||
// NewBaseSysUserRole create a new BaseSysUserRole
|
||||
func NewBaseSysUserRole() *BaseSysUserRole {
|
||||
return &BaseSysUserRole{
|
||||
Model: cool.NewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
// init 创建表
|
||||
func init() {
|
||||
cool.CreateTable(&BaseSysUserRole{})
|
||||
}
|
||||
Reference in New Issue
Block a user