model

package
v0.0.1-beta-2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	gorm.Model
	Path        string `json:"path" gorm:"comment:API path"`                    // API path | API 路径
	Description string `json:"description" gorm:"comment:API description"`      // API description | API 描述
	ApiGroup    string `json:"apiGroup" gorm:"comment:API group"`               // API group | API 分组
	Method      string `json:"method" gorm:"default:POST;comment: HTTP method"` // HTTP method | HTTP 请求类型
}

type Dictionary

type Dictionary struct {
	gorm.Model
	Title  string             `json:"title,omitempty" yaml:"title" gorm:"comment:the title shown in the UI"`                                // the title shown in the ui | 展示名称 (建议配合i18n)
	Name   string             `json:"name,omitempty" yaml:"name" gorm:"index,unique,comment:the name of dictionary for search"`             // the name of dictionary for search | 字典搜索名称
	Status bool               `json:"status,omitempty" yaml:"status" gorm:"comment:the status of dictionary (true enable | false disable)"` // the status of dictionary (true enable | false disable) | 字典状态
	Desc   string             `json:"desc,omitempty" yaml:"desc" gorm:"comment:the descriptions of dictionary"`                             // the descriptions of dictionary | 字典描述
	Detail []DictionaryDetail `json:"detail" yaml:"detail"`
}

Dictionary table struct 字典表结构

type DictionaryDetail

type DictionaryDetail struct {
	gorm.Model
	Title        string `json:"title,omitempty" yaml:"title" gorm:"comment:the title shown in the UI"` // the title shown in the UI | 展示名
	Key          string `json:"key,omitempty" yaml:"key" gorm:"comment:key"`                           // key | 键
	Value        string `json:"value,omitempty" yaml:"value" gorm:"comment:value"`                     // value | 值
	Status       bool   `json:"status,omitempty" yaml:"status" gorm:"comment:status"`                  // status | 状态
	DictionaryID uint
}

DictionaryDetail table struct 字典键值表结构

type Menu struct {
	gorm.Model
	MenuLevel uint32      `json:"level" gorm:"comment:menu level"`                         // menu level | 菜单层级
	MenuType  uint32      `json:"type" gorm:"comment:menu type: 0. group 1. menu"`         // menu type | 菜单类型 (菜单或目录)0 目录 1 菜单
	ParentId  uint        `json:"parentId" gorm:"comment:parent menu id"`                  // parent menu ID | 父菜单ID
	Path      string      `json:"path" gorm:"comment:index path"`                          // index path | 菜单路由路径
	Name      string      `json:"name" gorm:"comment:index name"`                          // index name | 菜单名称
	Redirect  string      `json:"redirect" gorm:"comment: redirect path"`                  // redirect path | 跳转路径 (外链)
	Component string      `json:"component" gorm:"comment:the path of vue file"`           // the path of vue file | 组件路径
	OrderNo   uint32      `json:"orderNo" gorm:"default:0;comment:numbers for sorting"`    // sorting numbers | 排序编号
	Disabled  bool        `json:"disabled" gorm:"default:false;comment:if true, disable;"` // disable status | 是否停用
	Meta      Meta        `json:"meta" gorm:"embedded;comment:extra parameters"`           // extra parameters | 额外参数
	Roles     []Role      `json:"roles" gorm:"many2many:role_menus;"`
	Children  []Menu      `json:"children" gorm:"foreignKey:ParentId;references:id"`
	Param     []MenuParam `json:"parameters"`
}
type MenuParam struct {
	gorm.Model
	MenuId uint
	Type   string `json:"type" gorm:"comment:pass parameters via params or query "` // pass parameters via params or query | 参数类型
	Key    string `json:"key" gorm:"comment:the key of parameters"`                 // the key of parameters | 参数键
	Value  string `json:"value" gorm:"comment:the value of parameters"`             // the value of parameters | 参数值
}

type Meta

type Meta struct {
	Title              string `json:"title" gorm:"comment:menu name"`                                          // menu name | 菜单显示标题
	Icon               string `json:"icon" gorm:"comment:menu icon"`                                           // menu icon | 菜单图标
	HideMenu           bool   `json:"hideMenu" gorm:"default:false;comment:hide the menu"`                     // hide menu | 是否隐藏菜单
	HideBreadcrumb     bool   `json:"hideBreadcrumb" gorm:"default:true;comment: hide the breadcrumb"`         // hide the breadcrumb | 隐藏面包屑
	CurrentActiveMenu  string `json:"currentActiveMenu" gorm:"comment:set the active menu"`                    // set the active menu | 激活菜单
	IgnoreKeepAlive    bool   `json:"ignoreKeepAlive" gorm:"comment: do not keep alive the tab"`               // do not keep alive the tab | 取消页面缓存
	HideTab            bool   `json:"hideTab" gorm:"comment: hide the tab header"`                             // hide the tab header | 隐藏页头
	FrameSrc           string `json:"frameSrc" gorm:"comment:iframe path"`                                     // show iframe | 内嵌 iframe
	CarryParam         bool   `json:"carryParam" gorm:"comment:the route carries parameters or not"`           // the route carries parameters or not | 携带参数
	HideChildrenInMenu bool   `json:"hideChildrenInMenu" gorm:"comment:hide children menu or not"`             // hide children menu or not | 隐藏所有子菜单
	Affix              bool   `json:"affix" gorm:"comment: affix tab"`                                         // affix tab | Tab 固定
	DynamicLevel       uint32 `json:"dynamicLevel" gorm:"the maximum number of pages the router can open"`     // the maximum number of pages the router can open | 能打开的子TAB数
	RealPath           string `json:"realPath" gorm:"comment:the real path of the route without dynamic part"` // the real path of the route without dynamic part | 菜单路由不包含参数部分
}

type OauthProvider

type OauthProvider struct {
	gorm.Model
	Name         string `json:"name,omitempty" gorm:"comment:the provider's name'"`
	ClientID     string `json:"clientID,omitempty"  gorm:"comment:the client id"`
	ClientSecret string `json:"clientSecret,omitempty" gorm:"comment:the client secret"`
	RedirectURL  string `json:"redirectURL,omitempty" gorm:"the redirect url"`
	Scopes       string `json:"scopes,omitempty" gorm:"comment:the scopes"`
	AuthURL      string `json:"authURL" gorm:"the auth url of the provider"`
	TokenURL     string `json:"tokenURL" gorm:"comment:he token url of the provider"`
	AuthStyle    int    `json:"authStyle" gorm:"comment:the auth style - 0 auto detect 1 third party log in 2 log in with username and password"`
	InfoURL      string `json:"infoURL" gorm:"comment:the URL to request user information by token"`
}

type Role

type Role struct {
	gorm.Model
	Name          string `json:"name" gorm:"comment:role name"`                                                        // role name | 角色名
	Value         string `json:"value" gorm:"unique;not null;comment: role value for permission control in front end"` // role value for permission control in front end | 角色值,用于前端权限控制
	DefaultRouter string `json:"defaultRouter" gorm:"comment:default menu;default:dashboard"`                          // default menu : dashboard | 默认登录页面
	Status        uint32 `json:"status" gorm:"default:0;comment:role status:0 normal, 1 ban"`                          // status | 状态
	Remark        string `json:"remark" gorm:"comment:remark"`                                                         // remark | 备注
	OrderNo       uint32 `json:"orderNo" gorm:"default:0;comment:number for sorting"`                                  // order number | 排序编号
	Menus         []Menu `json:"menus" gorm:"many2many:role_menus"`
}

type Token

type Token struct {
	gorm.Model
	UUID      string    `json:"UUID" gorm:"index,comment:user's UUID"`              // User's UUID | 用户的UUID
	Token     string    `json:"Token" gorm:"comment: token string"`                 // Token string | Token 字符串
	Source    string    `json:"Source" gorm:"comment:log in source such as github"` // Log in source such as GitHub | Token 来源 (本地为core, 第三方如github等)
	Status    uint32    `json:"Status" gorm:"comment: JWT status 0 ban 1 active"`   // JWT status 0 ban 1 active | JWT状态, 0 禁止 1 正常
	ExpiredAt time.Time `json:"ExpiredAt" gorm:"index,comment:expire time"`         // Expire time | 过期时间
}

type User

type User struct {
	gorm.Model
	UUID        string `json:"uuid" gorm:"comment:user's UUID"`                                     // UUID | 用户 UUID
	Username    string `json:"username" gorm:"unique;comment:user's login name'"`                   // user's login name | 登录名
	Password    string `json:"password"  gorm:"comment:password"`                                   // password | 密码
	Nickname    string `json:"nickName" gorm:"unique;comment:nickname"`                             // nickname | 昵称
	SideMode    string `json:"sideMode" gorm:"default:dark;comment:template mode"`                  // template mode | 布局方式
	Avatar      string `json:"Avatar" gorm:"comment:avatar"`                                        // avatar | 头像路径
	BaseColor   string `json:"baseColor" gorm:"default:#fff;comment:base color of template"`        // base color of template | 后台页面色调
	ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:active color of template"` // active color of template | 当前激活的颜色设定
	RoleId      uint32 `json:"roleId" gorm:"default:2;comment:user's role id for access control"`   // role id | 角色ID
	Mobile      string `json:"mobile"  gorm:"comment:mobile number"`                                // mobile number | 手机号
	Email       string `json:"email"  gorm:"comment:email address"`                                 // email | 邮箱号
	Status      int32  `json:"status" gorm:"default:1;comment:user status 1: normal 2: ban"`        // status | 用户状态 1 正常 2 禁用
}

Jump to

Keyboard shortcuts

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