models

package
v0.0.0-...-775fab9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameLoginLog = "sys_login_log"
View Source
const TableNameMenu = "sys_menu"
View Source
const TableNameOperateLog = "sys_operate_log"
View Source
const TableNameRole = "sys_role"
View Source
const TableNameRoleMenu = "sys_role_menu"
View Source
const TableNameUser = "sys_user"
View Source
const TableNameUserRole = "sys_user_role"

Variables

View Source
var (
	DB *gorm.DB
)

Functions

func Init

func Init()

Types

type Dept

type Dept struct {
	Id         int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:编号" json:"id"` // 编号
	DeptName   string     `gorm:"column:dept_name;not null;comment:部门名称" json:"deptName"`
	ParentId   int64      `gorm:"column:parent_id;not null;comment:上级部门Id,一级部门为0" json:"parentId"`
	Sort       int32      `gorm:"column:sort;not null;comment:排序" json:"sort"`
	Remark     *string    `gorm:"column:remark;comment:备注" json:"remark"`
	CreateTime time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`
}

func (*Dept) TableName

func (*Dept) TableName() string

type Dict

type Dict struct {
	Id          int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:编号" json:"id"` // 编号
	Value       string     `gorm:"column:value;not null;comment:数据值" json:"value"`               //数据值
	Label       string     `gorm:"column:label;not null;comment:标签名" json:"label"`               //标签名
	Type        string     `gorm:"column:type;not null;comment:类型" json:"type"`                  //类型
	Description string     `gorm:"column:description;not null;comment:描述" json:"description"`    //描述
	Sort        int32      `gorm:"column:sort;not null;comment:排序" json:"sort"`
	Remark      *string    `gorm:"column:remark;comment:备注" json:"remark"`
	CreateTime  time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime  *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`
}

func (*Dict) TableName

func (*Dict) TableName() string

type LoginLog

type LoginLog struct {
	Id        int64     `gorm:"column:id;primaryKey;autoIncrement:true;comment:编号" json:"id"`                       // 编号
	UserName  string    `gorm:"column:user_name;not null;comment:用户名" json:"userName"`                              // 用户名
	Status    string    `gorm:"column:status;not null;comment:登录状态" json:"status"`                                  // 登录状态
	Ip        string    `gorm:"column:ip;not null;comment:Ip地址" json:"ip"`                                          // IP地址
	LoginTime time.Time `gorm:"column:login_time;not null;default:CURRENT_TIMESTAMP;comment:登陆时间" json:"loginTime"` // 登陆时间
}

LoginLog 系统登录日志

func (*LoginLog) TableName

func (*LoginLog) TableName() string

TableName LoginLog's table name

type Menu struct {
	Id         int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"`                         // 主键
	MenuName   string     `gorm:"column:menu_name;not null;comment:菜单名称" json:"menuName"`                               // 菜单名称
	MenuType   int32      `gorm:"column:menu_type;not null;default:1;comment:菜单类型(1:目录   2:菜单   3:按钮)" json:"menuType"` // 菜单类型(1:目录   2:菜单   3:按钮)
	StatusId   int32      `gorm:"column:status_id;not null;default:1;comment:状态(1:正常,0:禁用)" json:"statusId"`            // 状态(1:正常,0:禁用)
	Sort       int32      `gorm:"column:sort;not null;default:1;comment:排序" json:"sort"`                                // 排序
	ParentId   int64      `gorm:"column:parent_id;not null;comment:父Id" json:"parentId"`                                // 父Id
	MenuUrl    *string    `gorm:"column:menu_url;comment:路由路径" json:"menuUrl"`                                          // 路由路径
	ApiUrl     *string    `gorm:"column:api_url;comment:接口URL" json:"apiUrl"`                                           // 接口URL
	MenuIcon   *string    `gorm:"column:menu_icon;comment:菜单图标" json:"menuIcon"`                                        // 菜单图标
	Remark     *string    `gorm:"column:remark;comment:备注" json:"remark"`                                               // 备注
	CreateTime time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`                                    // 修改时间
}

Menu 菜单信息

func (*Menu) TableName() string

TableName Menu's table name

type OperateLog

type OperateLog struct {
	Id             int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:编号" json:"id"`                      // 编号
	UserName       string     `gorm:"column:user_name;not null;comment:用户名" json:"userName"`                             // 用户名
	Operation      string     `gorm:"column:operation;not null;comment:用户操作" json:"operation"`                           // 用户操作
	Method         string     `gorm:"column:method;not null;comment:请求方法" json:"method"`                                 // 请求方法
	RequestParams  string     `gorm:"column:request_params;not null;comment:请求参数" json:"requestParams"`                  // 请求参数
	ResponseParams *string    `gorm:"column:response_params;comment:响应参数" json:"responseParams"`                         // 响应参数
	Time           int64      `gorm:"column:time;not null;comment:执行时长(毫秒)" json:"time"`                                 // 执行时长(毫秒)
	Ip             *string    `gorm:"column:ip;comment:Ip地址" json:"ip"`                                                  // IP地址
	OperationTime  *time.Time `gorm:"column:operation_time;default:CURRENT_TIMESTAMP;comment:操作时间" json:"operationTime"` // 操作时间
}

OperateLog 系统操作日志

func (*OperateLog) TableName

func (*OperateLog) TableName() string

TableName OperateLog's table name

type Role

type Role struct {
	Id         int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"`                         // 主键
	RoleName   string     `gorm:"column:role_name;not null;comment:名称" json:"roleName"`                                 // 名称
	StatusId   int32      `gorm:"column:status_id;not null;default:1;comment:状态(1:正常,0:禁用)" json:"statusId"`            // 状态(1:正常,0:禁用)
	Sort       int32      `gorm:"column:sort;not null;default:1;comment:排序" json:"sort"`                                // 排序
	Remark     string     `gorm:"column:remark;not null;comment:备注" json:"remark"`                                      // 备注
	CreateTime time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`                                    // 修改时间
}

Role 角色信息

func (*Role) TableName

func (*Role) TableName() string

TableName Role's table name

type RoleMenu

type RoleMenu struct {
	Id         int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"`                         // 主键
	RoleId     int64      `gorm:"column:role_id;not null;comment:角色Id" json:"roleId"`                                   // 角色Id
	MenuId     int64      `gorm:"column:menu_id;not null;comment:菜单Id" json:"menuId"`                                   // 菜单Id
	CreateTime time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`                                    // 修改时间
}

RoleMenu 菜单角色关联表

func (*RoleMenu) TableName

func (*RoleMenu) TableName() string

TableName RoleMenu's table name

type User

type User struct {
	Id         int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"`                         // 主键
	Mobile     string     `gorm:"column:mobile;not null;comment:手机" json:"mobile"`                                      // 手机
	UserName   string     `gorm:"column:user_name;not null;comment:姓名" json:"userName"`                                 // 姓名
	Password   string     `gorm:"column:password;not null;comment:密码" json:"password"`                                  // 密码
	StatusId   int32      `gorm:"column:status_id;not null;default:1;comment:状态(1:正常,0:禁用)" json:"statusId"`            // 状态(1:正常,0:禁用)
	Sort       int32      `gorm:"column:sort;not null;default:1;comment:排序" json:"sort"`                                // 排序
	Remark     *string    `gorm:"column:remark;comment:备注" json:"remark"`                                               // 备注
	CreateTime time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`                                    // 修改时间
}

User 用户信息

func (*User) TableName

func (*User) TableName() string

TableName User's table name

type UserRole

type UserRole struct {
	Id         int64      `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"`                         // 主键
	UserId     int64      `gorm:"column:user_id;not null;comment:用户Id" json:"userId"`                                   // 用户Id
	RoleId     int64      `gorm:"column:role_id;not null;comment:角色Id" json:"roleId"`                                   // 角色Id
	CreateTime time.Time  `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"createTime"` // 创建时间
	UpdateTime *time.Time `gorm:"column:update_time;comment:修改时间" json:"updateTime"`                                    // 修改时间
}

UserRole 角色用户关联表

func (*UserRole) TableName

func (*UserRole) TableName() string

TableName UserRole's table name

type Writer

type Writer struct {
}

func (Writer) Printf

func (w Writer) Printf(format string, args ...interface{})

Jump to

Keyboard shortcuts

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