model

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserStatusNormal  int8 = 0
	UserStatusDisable int8 = 1
)
View Source
const (
	UserSexMan   int8 = 0
	UserSexWoman int8 = 1
)

Variables

This section is empty.

Functions

func ExistsUserStatus

func ExistsUserStatus(status int8) bool

Types

type Base

type Base struct {
	Id         int64     `json:"id" gorm:"type:bigint(20);primaryKey;autoIncrement;comment:主键ID"`
	CreateTime time.Time `json:"createTime" gorm:"type:datetime;not null;comment:创建时间"`
	UpdateTime time.Time `json:"updateTime" gorm:"type:datetime;default:CURRENT_TIMESTAMP;autoUpdateTime;comment:更新时间"`
}

type Dept

type Dept struct {
	Base
	Name     string `json:"name" gorm:"type:varchar(50);not null;index:idx_name;comment:部门名称"`
	SortNum  int32  `json:"sortNum" gorm:"type:int;default:0;comment:部门顺序"`
	ParentId int64  `json:"parentId" gorm:"type:bigint(20);default:0;index:idx_pid;comment:父级部门ID"`
}

func (*Dept) TableName

func (*Dept) TableName() string

type ExceptionLog

type ExceptionLog struct {
	Base
	UserId    int64  `json:"userId" gorm:"type:bigint(20);comment:登录用户的ID"`
	Nickname  string `json:"nickname" gorm:"type:varchar(50);not null;index:idx_uname;comment:用户昵称"`
	Ip        string `json:"ip" gorm:"type:varchar(50);comment:登录IP"`
	UserAgent string `json:"userAgent" gorm:"type:varchar(255);comment:浏览器的userAgent"`
	Path      string `json:"path" gorm:"type:varchar(255);comment:请求url"`
	Query     string `json:"query" gorm:"type:varchar(255);comment:请求url"`
	Body      string `json:"body" gorm:"type:varchar(500);comment:body参数信息"`
	Error     string `json:"error" gorm:"type:varchar(5000);comment:错误内容"`
}

func (*ExceptionLog) TableName

func (*ExceptionLog) TableName() string

type Icon

type Icon struct {
	Id    int64  `json:"id" gorm:"primaryKey;type:bigint(20);autoIncrement;comment:主键ID"`
	Value string `json:"value" gorm:"type:varchar(255);not null;comment:图标"`
}

func (*Icon) TableName

func (*Icon) TableName() string

type Job

type Job struct {
	Base
	Name        string `json:"name" gorm:"type:varchar(50);not null;index:idx_name;comment:岗位名称"`
	SortNum     int    `json:"sortNum" gorm:"type:int;default:0;comment:排序"`
	Description string `json:"description" gorm:"type:varchar(255);comment:岗位描述"`
}

func (*Job) TableName

func (*Job) TableName() string

type LoginLog

type LoginLog struct {
	Base
	UserId    int64  `json:"userId" gorm:"type:bigint(20);comment:登录用户的ID"`
	Nickname  string `json:"nickname" gorm:"type:varchar(50);not null;index:idx_uname;comment:用户昵称"`
	RealName  string `json:"realName" gorm:"type:varchar(50);comment:用户真名"`
	DeptName  string `json:"deptName" gorm:"type:varchar(50);comment:部门名称"`
	Ip        string `json:"ip" gorm:"type:varchar(50);comment:登录IP"`
	Address   string `json:"address" gorm:"type:varchar(255);comment:登录地点"`
	UserAgent string `json:"userAgent" gorm:"type:varchar(255);comment:浏览器的userAgent"`
}

func (*LoginLog) TableName

func (*LoginLog) TableName() string
type Menu struct {
	Base
	Symbol      string `json:"symbol" gorm:"type:varchar(100);index:idx_symbol;comment:权限标识"`
	Name        string `json:"name" gorm:"type:varchar(50);not null;index:idx_name;comment:菜单名称"`
	Icon        string `json:"icon" gorm:"type:varchar(255);comment:菜单图标"`
	SortNum     int32  `json:"sortNum" gorm:"type:int;default:0;comment:菜单顺序"`
	Url         string `json:"url" gorm:"type:varchar(255);comment:路由路径"`
	Display     int8   `json:"display" gorm:"type:tinyint(4);default:0;comment:是否显示,0-否,1-是"`
	External    int8   `json:"external" gorm:"type:tinyint(4);default:0;comment:是否外链,0-否,1-是"`
	ExternalWay int8   `json:"externalWay" gorm:"type:tinyint(4);default:0;comment:外链打开方式(仅外链有效),0-外联,1-内嵌"`
	ParentId    int64  `json:"parentId" gorm:"type:bigint(20);default:0;index:idx_pid;comment:父菜单ID"`
}
func (*Menu) TableName() string

type OpLog

type OpLog struct {
	Base
	UserId    int64  `json:"userId" gorm:"type:bigint(20);comment:登录用户的ID"`
	Nickname  string `json:"nickname" gorm:"type:varchar(50);not null;index:idx_uname;comment:用户昵称"`
	RealName  string `json:"realName" gorm:"type:varchar(50);comment:用户真名"`
	DeptName  string `json:"deptName" gorm:"type:varchar(50);comment:部门名称"`
	Ip        string `json:"ip" gorm:"type:varchar(50);comment:登录IP"`
	Address   string `json:"address" gorm:"type:varchar(255);comment:登录地点"`
	UserAgent string `json:"userAgent" gorm:"type:varchar(255);comment:浏览器的userAgent"`
	Action    string `json:"action" gorm:"type:varchar(50);comment:操作名称"`
	Target    string `json:"target" gorm:"type:varchar(50);comment:操作对象"`
	Path      string `json:"path" gorm:"type:varchar(255);comment:请求url"`
	Query     string `json:"query" gorm:"type:varchar(255);comment:请求url"`
	Body      string `json:"body" gorm:"type:varchar(500);comment:body参数信息"`
}

func (*OpLog) TableName

func (*OpLog) TableName() string

type Role

type Role struct {
	Base
	Name     string  `json:"name" gorm:"type:varchar(50);not null;index:idx_name;comment:角色名称"`
	SortNum  int     `json:"sortNum" gorm:"type:int;default:0;comment:排序"`
	MenuList []*Menu `json:"menuList" gorm:"-:migration;many2many:ops_role_menu"`
}

func (*Role) TableName

func (*Role) TableName() string

type RoleMenu

type RoleMenu struct {
	Id     int64 `json:"id" gorm:"primaryKey;type:bigint(20);autoIncrement;comment:主键ID"`
	RoleId int64 `json:"roleId" gorm:"type:bigint(20);not null;index:idx_r_m_id,unique,priority:1;comment:角色ID"`
	MenuId int64 `json:"menuId" gorm:"type:bigint(20);not null;index:idx_r_m_id,unique,priority:2;index:idx_m_id;comment:菜单ID"`
}

func (*RoleMenu) TableName

func (*RoleMenu) TableName() string

type RoleUser

type RoleUser struct {
	Id     int64 `json:"id" gorm:"primaryKey;type:bigint(20);autoIncrement;comment:主键ID"`
	RoleId int64 `json:"roleId" gorm:"type:bigint(20);not null;index:idx_r_u_id,unique,priority:1;comment:角色ID"`
	UserId int64 `json:"userId" gorm:"type:bigint(20);not null;index:idx_r_u_id,unique,priority:2;index:idx_uid;comment:用户ID"`
}

func (*RoleUser) TableName

func (*RoleUser) TableName() string

type Settings

type Settings struct {
	Id     int64  `json:"id" gorm:"type:bigint(20);primaryKey;autoIncrement;comment:主键ID"`
	UserId int64  `json:"userId" gorm:"type:bigint(20);not null;index:idx_uid_key,unique,priority:1;comment:用户ID"`
	Key    string `json:"key" gorm:"type:varchar(50);not null;index:idx_uid_key,unique,priority:2;comment:键名"`
	Value  string `json:"value" gorm:"type:varchar(2048);comment:值"`
}

func (*Settings) TableName

func (*Settings) TableName() string

type User

type User struct {
	Base
	Name      string  `json:"name" gorm:"type:varchar(50);index:idx_name;comment:真实姓名"`
	Nickname  string  `json:"nickname" gorm:"type:varchar(50);index:idx_nickname;comment:昵称"`
	Cellphone string  `json:"cellphone" gorm:"type:varchar(50);index:idx_cellphone;comment:手机号"`
	Email     string  `json:"email" gorm:"type:varchar(100);index:idx_email,unique;comment:邮箱"`
	Sex       int8    `json:"sex" gorm:"type:tinyint(4);default:0;comment:性别,0-男,1-女"`
	Birthday  string  `json:"birthday" gorm:"type:varchar(50);comment:生日"`
	Status    int8    `json:"status" gorm:"type:tinyint(4);default:0;comment:账号状态,0-正常,1-禁用"`
	Root      bool    `json:"root" gorm:"<-:create;type:tinyint(4);default:0;comment:是否超级用户,0-否,1-是"`
	DeptId    int64   `json:"deptId" gorm:"type:bigint(20);default:0;comment:部门ID"`
	Dept      *Dept   `json:"dept" gorm:"-:migration;foreignKey:DeptId"`
	RoleList  []*Role `json:"roleList" gorm:"-:migration;many2many:ops_role_user"`
	MenuList  []*Menu `json:"menuList" gorm:"-:migration;many2many:ops_user_menu"`
	JobList   []*Job  `json:"jobList" gorm:"-:migration;many2many:ops_user_job"`
}

func (*User) TableName

func (*User) TableName() string

type UserJob

type UserJob struct {
	Id     int64 `json:"id" gorm:"primaryKey;type:bigint(20);autoIncrement;comment:主键ID"`
	UserId int64 `json:"userId" gorm:"type:bigint(20);not null;index:idx_u_j_id,unique,priority:1;comment:用户ID"`
	JobId  int64 `json:"jobId" gorm:"type:bigint(20);not null;index:idx_u_j_id,unique,priority:2;index:idx_j_id;comment:岗位ID"`
}

func (*UserJob) TableName

func (*UserJob) TableName() string

type UserMenu

type UserMenu struct {
	Id     int64 `json:"id" gorm:"primaryKey;type:bigint(20);autoIncrement;comment:主键ID"`
	UserId int64 `json:"userId" gorm:"type:bigint(20);not null;index:idx_u_m_id,unique,priority:1;comment:用户ID"`
	MenuId int64 `json:"menuId" gorm:"type:bigint(20);not null;index:idx_u_m_id,unique,priority:2;index:idx_m_id;comment:菜单ID"`
}

func (*UserMenu) TableName

func (*UserMenu) TableName() string

type UserPassword

type UserPassword struct {
	Id       int64  `json:"id" gorm:"primaryKey;type:bigint(20);autoIncrement;comment:主键ID"`
	UserId   int64  `json:"userId" gorm:"type:bigint(20);not null;index:idx_uid,unique;comment:用户ID"`
	Password string `json:"password" gorm:"type:varchar(255);not null;comment:用户密码"`
}

func (*UserPassword) TableName

func (*UserPassword) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL