Documentation
¶
Index ¶
- Constants
- type App
- type AppField
- type AppOAuther
- type AppSetting
- type AppSettingJWT
- type AppSettingTenant
- type AuthLog
- type Authorize
- 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 OAuther
- type OAutherSetting
- type Role
- type RoleClosure
- type RoleEntity
- type RoleMenu
- type Tenant
- type TenantAdmin
- type TenantApp
- type TenantAppMenu
- type TenantAppSetting
- type TenantSetting
- type User
- type UserDept
- type UserOAuther
- type UserOAutherExtra
- type UserSetting
- type Userinfo
Constants ¶
View Source
const ( FieldEmail = "email" FieldPhone = "phone" )
View Source
const ( MenuTypeRoot = "R" // 应用根菜单 MenuTypeApi = "A" // API接口 MenuTypePage = "M" // 菜单页面 MenuTypeGroup = "G" // 菜单分组 MenuTypeBasic = "BA" // 基础API MenuTypeButton = "B" // 按钮权限 MenuTypeLink = "L" // 外部链接 )
View Source
const ( ActionCreate = "create" ActionRead = "read" ActionUpdate = "update" ActionDelete = "delete" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Type string `json:"type" gorm:"column:type"`
Logo string `json:"logo" gorm:"column:logo"`
Keyword string `json:"keyword" gorm:"column:keyword"`
Favicon string `json:"favicon" gorm:"column:favicon"`
Secret string `json:"secret" gorm:"column:secret"`
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"`
Description *string `json:"description" gorm:"column:description"`
Comment *string `json:"comment" gorm:"column:comment"`
Setting string `json:"setting" gorm:"column:setting"`
model.BaseModel
}
func (*App) GetSetting ¶ added in v1.2.8
func (app *App) GetSetting() *AppSetting
type AppOAuther ¶ added in v1.2.8
type AppOAuther struct {
model.CreateTenantModel
AppId uint32 `json:"appId" gorm:"column:app_id"`
OAutherId uint32 `json:"oautherId" gorm:"column:oauther_id"`
Type string `json:"type" gorm:"column:type"`
OAuther *OAuther `json:"oauther" gorm:"foreignKey:oauther_id;references:id"`
}
func (AppOAuther) TableName ¶ added in v1.2.8
func (AppOAuther) TableName() string
type AppSetting ¶ added in v1.2.8
type AppSetting struct {
JWT AppSettingJWT `json:"jwt"`
Tenant AppSettingTenant `json:"tenant"`
}
type AppSettingJWT ¶ added in v1.2.8
type AppSettingTenant ¶ added in v1.2.8
type AppSettingTenant struct {
Mode string `json:"mode"`
}
type AuthLog ¶
type AuthLog struct {
model.CreateTenantUserModel
AppId uint32 `json:"appId" gorm:"column:app_id"`
MenuId uint32 `json:"menuId" gorm:"column:menu_id"`
App *App `json:"app" gorm:"foreignKey:app_id;references:id"`
User *User `json:"user" gorm:"foreignKey:user_id;references:id"`
Menu *Menu `json:"menu" gorm:"foreignKey:menu_id;references:id"`
}
type Authorize ¶ added in v1.2.8
type Authorize struct {
model.CreateTenantModel
AppId uint32 `json:"appId" gorm:"column:app_id"`
UserId uint32 `json:"userId" gorm:"column:user_id"`
Tokens string `json:"tokens" gorm:"column:tokens"`
LoggedAt int64 `json:"loggedAt" gorm:"column:logged_at"`
ExpiredAt int64 `json:"expiredAt" gorm:"column:expired_at"`
}
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"`
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"`
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"`
Status *bool `json:"status" gorm:"column:status"`
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"`
Required *bool `json:"required" gorm:"column:required"`
Unique *bool `json:"unique" gorm:"column:unique"`
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
AppId uint32 `json:"appId" gorm:"column:app_id"`
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"`
App *App `json:"app" gorm:"foreignKey:app_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"` // 重定向地址
Url *string `json:"url" gorm:"column:url"` // 站外url
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 OAuther ¶ added in v1.2.8
type OAuther 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
Setting string `json:"extra" gorm:"column:setting"` // 渠道设置
Description string `json:"description" gorm:"column:description"` // 描述信息
model.BaseTenantModel
}
func (*OAuther) GetSetting ¶ added in v1.2.8
func (c *OAuther) GetSetting() *OAutherSetting
type OAutherSetting ¶ added in v1.2.8
type OAutherSetting struct {
Callback string `json:"callback"`
Email struct {
Host string
Port int
Subject string
From string
Template string
}
}
func (OAutherSetting) ToString ¶ added in v1.2.8
func (extra OAutherSetting) 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 *uint32 `gorm:"column:weight" json:"weight"` // 权重
Setting string `gorm:"column:setting" json:"setting"` // 租户设置
}
Tenant 租户实体
func (*Tenant) GetSetting ¶ added in v1.2.8
func (t *Tenant) GetSetting() *TenantSetting
type TenantAdmin ¶ added in v1.2.8
type TenantAdmin struct {
model.CreateModel
TenantId uint32 `gorm:"column:tenant_id" json:"tenantId"` // 租户ID
UserId uint32 `gorm:"column:user_id" json:"userId"` // 应用ID
User *User `json:"user"`
}
type TenantApp ¶
type TenantApp struct {
model.BaseModel
TenantId uint32 `gorm:"column:tenant_id" json:"tenantId"` // 租户ID
AppId uint32 `gorm:"column:app_id" json:"appId"` // 应用ID
ExpiredAt uint32 `gorm:"column:expired_at" json:"expiredAt"` // 过期时间
Setting string `gorm:"column:setting" json:"setting"` // 应用配置
App *App `json:"app"`
MenuIds []uint32 `json:"menuIds" gorm:"-"`
}
func (*TenantApp) GetSetting ¶ added in v1.2.8
func (t *TenantApp) GetSetting() *TenantAppSetting
type TenantAppMenu ¶
type TenantAppSetting ¶ added in v1.2.8
type TenantSetting ¶ added in v1.2.8
type TenantSetting struct {
// QuickBind bool `json:"quickBind"` // 快速绑定开关
// QuickLogin bool `json:"quickLogin"` // 快速登录开关
DefaultUserAvatar string `json:"defaultUserAvatar"` // 默认用户头像
DefaultUserPassword string `json:"defaultUserPassword"` // 默认用户密码
DefaultUserNickname string `json:"defaultUserNickname"` // 默认用户昵称
}
func (*TenantSetting) String ¶ added in v1.2.8
func (ts *TenantSetting) String() string
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"` // 用户状态
Reason *string `json:"reason" gorm:"column:reason"` // 用户原因
LoggedAt int64 `json:"loggedAt" gorm:"column:logged_at"` // 最近登录时间
Setting string `json:"setting" gorm:"-"` // 用户设置
UserDepts []*UserDept `json:"userDepts" gorm:"foreignKey:user_id;references:id"` // 用户部门
Infos []*Userinfo `json:"infos" gorm:"-"` // 用户信息
Authorize *Authorize `json:"authorize" gorm:"foreignKey:user_id;references:id"` // 用户授权
model.BaseTenantModel
}
type UserDept ¶
type UserDept struct {
UserId uint32 `json:"userId" gorm:"column:user_id"`
DeptId uint32 `json:"deptId" gorm:"column:dept_id;hook:dept[dept]"`
JobId uint32 `json:"jobId" gorm:"column:job_id"`
Main *bool `json:"main" gorm:"column:main"`
Dept *Dept `json:"dept" gorm:"foreignKey:dept_id;references:id"`
Job *Job `json:"job" gorm:"foreignKey:job_id;references:id"`
model.BaseModel
}
type UserOAuther ¶ added in v1.2.8
type UserOAuther struct {
UserId uint32 `json:"userId" gorm:"column:user_id"`
OAutherId uint32 `json:"oautherId" gorm:"column:oauther_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"`
OAuther *OAuther `json:"oauther"`
model.BaseTenantModel
}
func (UserOAuther) GetExtra ¶ added in v1.2.8
func (o UserOAuther) GetExtra() *UserOAutherExtra
func (UserOAuther) TableName ¶ added in v1.2.8
func (c UserOAuther) TableName() string
type UserOAutherExtra ¶ added in v1.2.8
type UserOAutherExtra struct {
UnionID string `json:"unionId"`
}
type UserSetting ¶
type Userinfo ¶
type Userinfo struct {
TenantId uint32 `json:"tenantId" gorm:"column:tenant_id"`
UserId uint32 `json:"userId" gorm:"column:user_id"`
Field string `json:"field" gorm:"column:field"`
Value string `json:"value" gorm:"column:value"`
ValueMd5 string `json:"valueMd5" gorm:"column:value_md5"`
Index *int `json:"index" gorm:"-"`
model.CreateModel
}
func (*Userinfo) GetTableName ¶ added in v1.2.8
Click to show internal directories.
Click to hide internal directories.