model

package
v0.0.0-...-db9179b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameAdmin = "admin"
View Source
const TableNameAdminRoleRelation = "admin_role_relation"
View Source
const TableNameMenu = "menu"
View Source
const TableNameRole = "role"

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	ID         int64                 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Username   string                `gorm:"column:username;not null" json:"username"`
	Password   string                `gorm:"column:password;not null" json:"-"`
	Icon       *string               `gorm:"column:icon;comment:头像" json:"icon"`                                        // 头像
	Email      *string               `gorm:"column:email;comment:邮箱" json:"email"`                                      // 邮箱
	Nickname   *string               `gorm:"column:nickname;comment:昵称" json:"nickname"`                                // 昵称
	Note       *string               `gorm:"column:note;comment:备注信息" json:"note"`                                      // 备注信息
	LoginTime  *time.Time            `gorm:"column:login_time;comment:最后登录时间" json:"loginTime"`                         // 最后登录时间
	Status     bool                  `gorm:"column:status;not null;default:1;comment:帐号启用状态:0->禁用;1->启用" json:"status"` // 帐号启用状态:0->禁用;1->启用
	IsDel      soft_delete.DeletedAt `gorm:"column:is_del;not null;softDelete:flag" json:"-"`
	CreateTime *time.Time            `gorm:"column:create_time;default:CURRENT_TIMESTAMP" json:"createTime"`
	UpdateTime *time.Time            `gorm:"column:update_time;default:CURRENT_TIMESTAMP" json:"updateTime"`
}

Admin 后台用户表

func (*Admin) TableName

func (*Admin) TableName() string

TableName Admin's table name

type AdminRoleRelation

type AdminRoleRelation struct {
	ID      int64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	AdminID int64 `gorm:"column:admin_id;not null;uniqueIndex:admin_role_relation_unique,priority:1" json:"adminId"`
	RoleID  int64 `gorm:"column:role_id;not null;uniqueIndex:admin_role_relation_unique,priority:2" json:"roleId"`
}

AdminRoleRelation 后台用户和角色关系表

func (*AdminRoleRelation) TableName

func (*AdminRoleRelation) TableName() string

TableName AdminRoleRelation's table name

type Menu struct {
	ID         int64      `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	ParentID   int64      `gorm:"column:parent_id;not null;comment:父级ID" json:"parentId"` // 父级ID
	Title      *string    `gorm:"column:title;comment:菜单名称" json:"title"`                 // 菜单名称
	Level      *int32     `gorm:"column:level;comment:菜单级数" json:"level"`                 // 菜单级数
	Sort       *int32     `gorm:"column:sort;comment:菜单排序" json:"sort"`                   // 菜单排序
	Name       string     `gorm:"column:name;not null;comment:前端名称" json:"name"`          // 前端名称
	Icon       *string    `gorm:"column:icon;comment:前端图标" json:"icon"`                   // 前端图标
	Hidden     bool       `gorm:"column:hidden;not null;comment:前端隐藏" json:"hidden"`      // 前端隐藏
	CreateTime *time.Time `gorm:"column:create_time;default:CURRENT_TIMESTAMP" json:"createTime"`
	UpdateTime *time.Time `gorm:"column:update_time;default:CURRENT_TIMESTAMP" json:"updateTime"`
}

Menu 后台菜单表

func (*Menu) TableName() string

TableName Menu's table name

type Role

type Role struct {
	ID          int64      `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name        string     `gorm:"column:name;not null;uniqueIndex:role_unique,priority:1;comment:名称" json:"name"` // 名称
	Description *string    `gorm:"column:description;comment:描述" json:"description"`                               // 描述
	AdminCount  int32      `gorm:"column:admin_count;not null;comment:后台用户数量" json:"adminCount"`                   // 后台用户数量
	CreateTime  *time.Time `gorm:"column:create_time;comment:创建时间" json:"createTime"`                              // 创建时间
	Status      bool       `gorm:"column:status;not null;default:1;comment:启用状态:0->禁用;1->启用" json:"status"`        // 启用状态:0->禁用;1->启用
	Sort        *int32     `gorm:"column:sort" json:"sort"`
}

Role 后台用户角色表

func (*Role) TableName

func (*Role) TableName() string

TableName Role's table name

Jump to

Keyboard shortcuts

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