system

package
v0.0.0-...-b35005d Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiModel

type ApiModel struct {
	global.KOP_MODEL
	Path        string `json:"path" gorm:"not null;comment:api路径" validate:"required"`             // api路径
	Description string `json:"description" gorm:"not null;comment:api中文描述" validate:"required"`    // api中文描述
	ApiGroup    string `json:"api_group" gorm:"not null;comment:api组" validate:"required"`         // api组
	Method      string `json:"method" gorm:"not null;default:POST;comment:方法" validate:"required"` // 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE
}

func (ApiModel) TableName

func (ApiModel) TableName() string

type ApiTree

type ApiTree struct {
	ApiGroup string     `json:"apiGroup"`
	Children []Children `json:"children"`
}

type Children

type Children struct {
	Key         string `json:"key"`      // for 前端el-tree node-key (path + method)
	ApiGroup    string `json:"apiGroup"` // for 前端el-tree label (path + description)
	Path        string `json:"path"`
	Method      string `json:"method"`
	Description string `json:"description"`
}

type JwtBlacklist

type JwtBlacklist struct {
	global.KOP_MODEL
	Jwt string `gorm:"type:text;comment:jwt"`
}
type MenuModel struct {
	ID        uint           `json:"id" gorm:"primarykey"`      // 主键ID
	CreatedAt time.Time      `json:"-"`                         // 创建时间
	UpdatedAt time.Time      `json:"-"`                         // 更新时间
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`            // 删除时间
	Pid       uint           `json:"pid"`                       // 父菜单ID
	Name      string         `json:"name,omitempty"`            // 路由名称
	Path      string         `json:"path" gorm:"unique"`        // 路由路径
	Redirect  string         `json:"redirect,omitempty"`        // 重定向
	Component string         `json:"component" gorm:"not null"` // 前端组件
	Meta      Meta           `json:"meta" gorm:"type:json"`     // 元数据
	Children  []MenuModel    `json:"children,omitempty" gorm:"-"`
	Roles     []*RoleModel   `json:"-" gorm:"many2many:role_menus;"`
}
func (MenuModel) TableName() string

type Meta

type Meta struct {
	Hidden    bool   `json:"hidden,omitempty"`  // 菜单是否隐藏
	Title     string `json:"title,omitempty"`   // 菜单名
	SvgIcon   string `json:"svgIcon,omitempty"` // svg图标
	ElIcon    string `json:"elIcon,omitempty"`  // element-plus图标
	Affix     bool   `json:"affix,omitempty"`   // 是否固定
	KeepAlive bool   `json:"keepAlive,omitempty"`
}

func (*Meta) Scan

func (m *Meta) Scan(input interface{}) error

func (Meta) Value

func (m Meta) Value() (driver.Value, error)

type RoleModel

type RoleModel struct {
	global.KOP_MODEL
	RoleName string `json:"roleName" gorm:"unique"`
	//Users    []*UserModel `json:"users"`
	Menus []*MenuModel `json:"menus" gorm:"many2many:role_menus;"`
}

func (RoleModel) TableName

func (RoleModel) TableName() string

type UserModel

type UserModel struct {
	global.KOP_MODEL
	Username    string `json:"username" gorm:"index;unique;comment:用户名"` // 用户名
	Password    string `json:"-"  gorm:"comment:密码"`
	Phone       string `json:"phone"  gorm:"comment:手机号"` // 手机号
	Email       string `json:"email"  gorm:"comment:邮箱"`  // 邮箱
	Active      bool   `json:"active"`                    // 是否活跃
	RoleModelID uint   `json:"roleId"`                    // 角色ID
}

func (UserModel) TableName

func (UserModel) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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