Documentation
¶
Index ¶
- Constants
- type App
- type AppField
- type AppOAuthChannel
- type AuthLog
- type ChannelExtra
- type Dept
- type DeptClassify
- type DeptClosure
- type DeptRole
- type Dictionary
- type DictionaryValue
- type Entity
- type EntityField
- type EntityRule
- type Feedback
- type FeedbackCategory
- type Field
- type Job
- type JobRole
- type LoginLog
- type Menu
- type MenuClosure
- type OAuth
- type OAuthChannel
- type OAuthExtra
- type Role
- type RoleClosure
- type RoleEntity
- type RoleMenu
- type Tenant
- type TenantApp
- type TenantAppMenu
- type User
- type UserDept
- type UserSetting
- type Userinfo
Constants ¶
View Source
const ( MenuTypeRoot = "R" // 应用根菜单 MenuTypeApi = "A" // API接口 MenuTypePage = "M" // 菜单页面 MenuTypeGroup = "G" // 菜单分组 MenuTypeBasic = "BA" // 基础API MenuTypeButton = "B" // 按钮权限 MenuTypeLink = "L" // 外部链接 )
View Source
const (
AppEntityName = "app"
)
View Source
const (
DeptEntityName = "dept"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Logo string `json:"logo" gorm:"column:logo"`
Keyword string `json:"keyword" gorm:"column:keyword"`
Name string `json:"name" gorm:"column:name"`
Status *bool `json:"status" gorm:"column:status"`
Reason *string `json:"reason" gorm:"column:reason"`
Private *bool `json:"private" gorm:"column:private"`
Extra *string `json:"extra" gorm:"column:extra"`
Description *string `json:"description" gorm:"column:description"`
model.BaseModel
}
type AppField ¶
type AppField struct {
model.CreateTenantModel
AppId uint32 `json:"appId" gorm:"column:app_id"`
FieldId uint32 `json:"fieldId" gorm:"column:field_id"`
Field *Field `json:"field" gorm:"foreignKey:field_id;references:id"`
}
type AppOAuthChannel ¶
type AppOAuthChannel struct {
model.CreateTenantModel
AppId uint32 `json:"appId" gorm:"column:app_id"`
ChannelId uint32 `json:"channelId" gorm:"column:channel_id"`
Channel *OAuthChannel `json:"channel" gorm:"foreignKey:channel_id;references:id"`
}
func (AppOAuthChannel) TableName ¶
func (AppOAuthChannel) TableName() string
type AuthLog ¶
type AuthLog struct {
model.CreateTenantUserModel
MenuId uint32 `json:"menuId" gorm:"column:menu_id"`
User *User `json:"user" gorm:"foreignKey:user_id;references:id"`
Menu *Menu `json:"menu" gorm:"foreignKey:menu_id;references:id"`
}
type ChannelExtra ¶
type ChannelExtra struct {
CallBack string `json:"callback"`
Captcha string `json:"captcha"`
Host string `json:"host"`
Port int `json:"port"`
Name string `json:"name"`
Subject string `json:"subject"`
}
func (ChannelExtra) ToString ¶
func (extra ChannelExtra) ToString() string
type Dept ¶
type Dept struct {
Id uint32 `json:"id" gorm:"column:id;hook:dept[rud:w]"`
ParentId uint32 `json:"parentId" gorm:"column:parent_id;hook:dept[cu:c]"`
ClassifyId uint32 `json:"classifyId" gorm:"column:classify_id"`
Name string `json:"name" gorm:"column:name"`
Status *bool `json:"status" gorm:"column:status"`
Description *string `json:"description" gorm:"column:description"`
TenantId uint32 `json:"tenantId" gorm:"column:tenant_id;hook:tenant"`
CreatedAt int64 `json:"createdAt,omitempty" gorm:"column:created_at;"`
UpdatedAt int64 `json:"updatedAt,omitempty" gorm:"column:updated_at;"`
Classify *DeptClassify `json:"classify"`
Children []*Dept `json:"children" gorm:"-"`
}
type DeptClassify ¶
type DeptClosure ¶
type Dictionary ¶
type DictionaryValue ¶
type DictionaryValue struct {
DictionaryId uint32 `json:"dictionaryId" gorm:"column:dictionary_id"`
ParentId uint32 `json:"parentId" gorm:"column:parent_id"`
Label string `json:"label" gorm:"column:label"`
Value string `json:"value" gorm:"column:value"`
Status *bool `json:"status" gorm:"column:status"`
Weight *int32 `json:"weight" gorm:"column:weight"`
Type *string `json:"type" gorm:"column:type"`
Extra *string `json:"extra" gorm:"column:extra"`
Description *string `json:"description" gorm:"column:description"`
Dictionary *Dictionary `json:"dictionary"`
Children []*DictionaryValue `json:"children" gorm:"-"`
model.BaseModel
}
func (*DictionaryValue) AppendChildren ¶
func (m *DictionaryValue) AppendChildren(child *DictionaryValue)
AppendChildren 添加子节点
func (*DictionaryValue) ChildrenNode ¶
func (m *DictionaryValue) ChildrenNode() []*DictionaryValue
ChildrenNode 获取子节点
type Entity ¶
type Entity struct {
AppId uint32 `json:"appId" gorm:"column:app_id"`
Database string `json:"database" gorm:"column:database"`
Name string `json:"name" gorm:"column:name"`
Comment string `json:"comment" gorm:"column:comment"`
Fields []*EntityField `json:"fields" gorm:"foreignKey:entity_id;references:Id"`
App *App `json:"app" gorm:"foreignKey:AppId;references:Id"`
model.BaseModel
}
type EntityField ¶
type EntityField struct {
EntityId uint32 `json:"entityId" gorm:"column:entity_id"`
Name string `json:"name" gorm:"column:name"`
Comment string `json:"comment" gorm:"column:comment"`
Index int `json:"index" gorm:"column:index"`
Entity Entity `gorm:"foreignKey:EntityId;references:Id"`
model.BaseModel
}
type EntityRule ¶
type EntityRule struct {
EntityId uint32 `json:"entityId" gorm:"column:entity_id"`
Name string `json:"name" gorm:"column:name"`
Expression string `json:"expression" gorm:"column:expression"`
Description string `json:"description" gorm:"column:description"`
Entity Entity `gorm:"foreignKey:EntityId;references:Id"`
model.BaseTenantModel
}
type Feedback ¶
type Feedback struct {
AppId uint32 `json:"appId" gorm:"column:app_id"`
CategoryId uint32 `json:"categoryId" gorm:"column:category_id"`
Title string `json:"title" gorm:"column:title"`
Content string `json:"content" gorm:"column:content"`
Status string `json:"status" gorm:"column:status"`
Images *string `json:"images" gorm:"column:images"`
Contact *string `json:"contact" gorm:"column:contact"`
Device string `json:"device" gorm:"column:device"`
Platform string `json:"platform" gorm:"column:platform"`
Version string `json:"version" gorm:"column:version"`
Md5 string `json:"md5" gorm:"column:md5"`
ProcessedBy *uint32 `json:"processedBy" gorm:"column:processed_by"`
ProcessedResult *string `json:"processedResult" gorm:"column:processed_result"`
App *App `json:"app"`
User *User `json:"user"`
Category *FeedbackCategory `json:"category" gorm:"foreignKey:category_id;references:id"`
ImageUrls []string `json:"imageUrls" gorm:"-"`
model.BaseTenantUserModel
}
type FeedbackCategory ¶
type FeedbackCategory struct {
Name string `json:"name" gorm:"column:name"`
model.BaseTenantModel
}
type Field ¶
type Field struct {
Keyword string `json:"keyword" gorm:"column:keyword"`
Type string `json:"type" gorm:"column:type"`
Name string `json:"name" gorm:"column:name"`
Status *bool `json:"status" gorm:"column:status"`
Description *string `json:"description" gorm:"column:description"`
model.BaseTenantModel
}
type Job ¶
type Job struct {
Keyword string `json:"keyword" gorm:"column:keyword"`
Name string `json:"name" gorm:"column:name"`
Description *string `json:"description" gorm:"column:description"`
Status *bool `json:"status" gorm:"column:status"`
Weight uint32 `json:"weight" gorm:"column:weight"`
model.BaseTenantModel
}
type LoginLog ¶
type LoginLog struct {
model.CreateTenantUserModel
Type string `json:"type" gorm:"column:type"`
IP string `json:"ip" gorm:"column:ip"`
Address string `json:"address" gorm:"column:address"`
Browser string `json:"browser" gorm:"column:browser"`
Device string `json:"device" gorm:"column:device"`
Code int `json:"code" gorm:"column:code"`
Description string `json:"description" gorm:"column:description"`
User *User `json:"user" gorm:"foreignKey:user_id;references:id"`
Tenant *User `json:"tenant" gorm:"foreignKey:user_id;references:id"`
}
type Menu ¶
type Menu struct {
AppId uint32 `json:"appId" gorm:"column:app_id"` // 应用ID
ParentId uint32 `json:"parentId" gorm:"column:parent_id"` // 父节点ID
Title string `json:"title" gorm:"column:title"` // 菜单标题
Type string `json:"type" gorm:"column:type"` // 菜单类型
Keyword *string `json:"keyword" gorm:"column:keyword"` // 菜单标识
Icon *string `json:"icon" gorm:"column:icon"` // 菜单图标
Api *string `json:"api" gorm:"column:api"` // API接口信息
Method *string `json:"method" gorm:"column:method"` // API请求方法
Path *string `json:"path" gorm:"column:path"` // 路由路径
Permission *string `json:"permission" gorm:"column:permission"` // 权限标识
Component *string `json:"component" gorm:"column:component"` // 组件路径
Redirect *string `json:"redirect" gorm:"column:redirect"` // 重定向路径
Weight *int32 `json:"weight" gorm:"column:weight"` // 菜单权重
IsIframe *bool `json:"isIframe" gorm:"column:is_iframe"` // 是否外链打开
IsHidden *bool `json:"isHidden" gorm:"column:is_hidden"` // 是否隐藏菜单
IsCache *bool `json:"isCache" gorm:"column:is_cache"` // 是否缓存页面
IsHome *bool `json:"isHome" gorm:"column:is_home"` // 是否首页
IsAffix *bool `json:"isAffix" gorm:"column:is_affix"` // 是否固定在标签页
Children []*Menu `json:"children" gorm:"-"` // 子节点列表
RoleMenus []*RoleMenu `json:"roleMenus" gorm:"foreignKey:menu_id;references:id"`
model.BaseModel
}
type MenuClosure ¶
type OAuth ¶
type OAuth struct {
UserId uint32 `json:"userId" gorm:"column:user_id"`
ChannelId uint32 `json:"channelId" gorm:"column:channel_id"`
OID string `json:"oid" gorm:"column:oid"`
Token string `json:"token" gorm:"column:token"`
LoggedAt int64 `json:"loggedAt" gorm:"column:logged_at"`
ExpiredAt int64 `json:"expiredAt" gorm:"column:expired_at"`
Extra string `json:"extra" gorm:"column:extra"`
Channel *OAuthChannel `json:"channel"`
model.BaseTenantModel
}
func (OAuth) GetExtra ¶
func (o OAuth) GetExtra() *OAuthExtra
type OAuthChannel ¶
type OAuthChannel struct {
Logo string `json:"logo" gorm:"column:logo"` // 渠道logo
Keyword string `json:"keyword" gorm:"column:keyword"` // 渠道标识
Type string `json:"type" gorm:"column:type"` // 渠道类型
Name string `json:"name" gorm:"column:name"` // 渠道名称
Status *bool `json:"status" gorm:"column:status"` // 启用状态
Ak string `json:"ak" gorm:"column:ak"` // 渠道AK
Sk string `json:"sk" gorm:"column:sk"` // 渠道SK
Extra string `json:"extra" gorm:"column:extra"` // 扩展信息
Description string `json:"description" gorm:"column:description"` // 描述信息
model.BaseTenantModel
}
func (OAuthChannel) GetExtra ¶
func (c OAuthChannel) GetExtra() *ChannelExtra
func (OAuthChannel) TableName ¶
func (c OAuthChannel) TableName() string
type OAuthExtra ¶
type OAuthExtra struct {
UnionID string `json:"unionId"`
}
func (OAuthExtra) ToString ¶
func (extra OAuthExtra) ToString() string
type Role ¶
type Role struct {
ParentId uint32 `json:"parentId" gorm:"column:parent_id"`
Keyword string `json:"keyword" gorm:"column:keyword"`
Name string `json:"name" gorm:"column:name"`
Status *bool `json:"status" gorm:"column:status"`
Description *string `json:"description" gorm:"column:description"`
Children []*Role `json:"children" gorm:"-"`
RoleMenus []*RoleMenu `json:"roleMenus" gorm:"foreignKey:role_id;references:id"`
DeptRoles []*DeptRole
model.BaseTenantModel
}
type RoleClosure ¶
type RoleEntity ¶
type RoleEntity struct {
RoleId uint32 `json:"roleId" gorm:"column:role_id"`
EntityId uint32 `json:"entityId" gorm:"column:entity_id"`
Action string `json:"action" gorm:"column:action"`
Scope string `json:"scope" gorm:"column:scope"`
Depts string `json:"depts" gorm:"column:depts"`
Fields string `json:"fields" gorm:"column:fields"`
Rules string `json:"rules" gorm:"column:rules"`
Entity *Entity `json:"entity" gorm:"foreignKey:EntityId;references:Id"`
model.BaseModel
}
type Tenant ¶
type Tenant struct {
model.DeleteModel
Keyword string `gorm:"column:keyword" json:"keyword"` // 租户标识
Logo string `gorm:"column:logo" json:"logo"` // 租户头像
Name string `gorm:"column:name" json:"name"` // 租户名称
Status *bool `gorm:"column:status" json:"status"` // 租户状态
Description string `gorm:"column:description" json:"description"` // 租户简介
Weight *int32 `gorm:"column:weight" json:"weight"` // 权重
}
type TenantAppMenu ¶
type User ¶
type User struct {
Avatar string `json:"avatar" gorm:"column:avatar"` // 用户头像
Nickname string `json:"nickname" gorm:"column:nickname"` // 用户昵称
Username string `json:"username" gorm:"column:username"` // 用户账户
Password string `json:"password" gorm:"column:password"` // 用户密码
Status *bool `json:"status" gorm:"column:status"` // 用户状态
Token *string `json:"token" gorm:"column:token"` // 认证令牌
LoggedAt int64 `json:"loggedAt" gorm:"column:logged_at"` // 登录时间
ExpireAt int64 `json:"expireAt" gorm:"column:expire_at"` // 过期时间
DeptId uint32 `json:"deptId" gorm:"column:dept_id"` // 所属部门
JobId uint32 `json:"jobId" gorm:"column:job_id"` // 所属岗位
Setting string `json:"setting" gorm:"-"` // 用户设置
Infos []*Userinfo `json:"infos" gorm:"-"` // 用户信息
Dept *Dept `json:"dept" gorm:"foreignKey:dept_id;references:id"`
Job *Job `json:"job" gorm:"foreignKey:job_id;references:id"`
model.BaseTenantDeptModel
}
type UserDept ¶
type UserDept struct {
UserId uint32 `json:"userId" gorm:"column:user_id"`
DeptId uint32 `json:"deptId" gorm:"column:dept_id"`
JobId uint32 `json:"jobId" gorm:"column:job_id"`
Dept *Dept `json:"dept" gorm:"foreignKey:dept_id;references:id"`
Job *Job `json:"job" gorm:"foreignKey:job_id;references:id"`
model.BaseModel
}
type UserSetting ¶
Click to show internal directories.
Click to hide internal directories.