Documentation ¶
Index ¶
- Constants
- type Account
- type AssignOrg
- type AssignRole
- type Association
- type Auth
- type AuthAssign
- type AuthItem
- type AuthItemChild
- type AuthOrg
- type BatchUpdateReasonState
- type BatchUpdateState
- type Business
- type BusinessAttr
- type BusinessList
- type BusinessListParams
- type BusinessRole
- type BusinessUserRole
- type BusinessUserRoleList
- type CateSecExt
- type DepartCustom
- type Department
- type DropList
- type FileInfo
- type FlowBusiness
- type LogChild
- type LogRes
- type Org
- type Permissions
- type RankAuth
- type RankGroup
- type RankUser
- type RankUserScores
- type Reason
- type Resource
- type ResourceFile
- type RespPerm
- type Role
- type RoleAss
- type RoleCustom
- type SearchReasonParams
- type SearchTagParams
- type StateUpdate
- type Tag
- type TagBusinessAttr
- type TagControl
- type TagControlParam
- type TagType
- type TagTypeDel
- type TagTypeList
- type TagTypeRole
- type User
- type UserCustom
- type UserDept
- type UserListParams
- type UserPager
- type UserRole
- type UserStateUp
Constants ¶
const ( // BusinessOpenState . BusinessOpenState = 1 // BusinessOpenType . BusinessOpenType = 1 // UserRoleDefaultVal . UserRoleDefaultVal = -1 // UserOnState . UserOnState = 1 // UserOffState . UserOffState = 0 )
const ( InvalidateState int64 = 0 ValidateState int64 = 1 AllState int64 = -1 AllType int64 = -1 CategoryCode int64 = 0 SecondeCode int64 = 1 ExtensionCode int64 = 2 )
State code const .
const ( // auth_item type TypePointer = 1 TypeCategory = 2 TypeRole = 3 TypeGroup = 4 // Admin super admin Admin = 1 // user state UserStateOn = 0 UserDepOn = 1 )
const rbac const
const (
// DefaultButton .
DefaultButton = 6
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Username string `json:"username"`
}
Account dashboard user account
type AssignOrg ¶
type AssignOrg struct { Name string `json:"name"` Assignable []*AuthItem `json:"children"` Items []int64 `json:"items"` }
AssignOrg auth assignment info.
type AssignRole ¶
type AssignRole struct { Parent string `json:"parent"` Name string `json:"name"` Assignable []*AuthItem `json:"children"` Items []int64 `json:"items"` }
AssignRole auth assignment info.
type Association ¶
type Association struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` BusinessID int64 `json:"bid" gorm:"column:bid" form:"bid"` RoleID int64 `json:"role_id" gorm:"column:rid" form:"role_id"` RoleName string `json:"role_name" gorm:"-"` CategoryID int64 `json:"cate_id" gorm:"column:cid" form:"cate_id"` CategoryName string `json:"cate_name" gorm:"-"` SecondIDs string `json:"second_ids" gorm:"column:sids" form:"sec_ids"` State int64 `json:"state" gorn:"column:state" form:"state" default:"1"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` Child []*CateSecExt `json:"child" gorm:"-"` }
Association .
type Auth ¶
type Auth struct { UID int64 `json:"uid"` Username string `json:"username"` Nickname string `json:"nickname"` Perms []string `json:"perms"` Admin bool `json:"admin"` Assignable bool `json:"assignable"` }
Auth .
type AuthAssign ¶
type AuthAssign struct { ID int64 `json:"id"` ItemID int64 `json:"item_id"` UserID int64 `json:"user_id"` Ctime time.Time `json:"ctime"` }
AuthAssign struct info of table auth_assignment
type AuthItem ¶
type AuthItem struct { ID int64 `json:"id"` Name string `json:"name"` Type int `json:"type"` Description string `json:"description"` RuleID int64 `json:"rule_id"` Data string `json:"data"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
AuthItem struct info of table auth_item
type AuthItemChild ¶
type AuthItemChild struct { ID int64 `json:"id"` Parent int64 `json:"parent"` Child int64 `json:"child"` }
AuthItemChild stuct info of table auth_item_child
func (AuthItemChild) TableName ¶
func (a AuthItemChild) TableName() string
TableName return table name
type AuthOrg ¶
type AuthOrg struct { ID int64 `json:"id"` Name string `json:"name"` Type int `json:"-"` // group or role, ignore it when transform to json }
AuthOrg org info.
type BatchUpdateReasonState ¶
type BatchUpdateReasonState struct { IDs []int64 `json:"ids" form:"ids,split" validate:"required"` State int64 `json:"state" form:"state"` }
BatchUpdateReasonState .
type BatchUpdateState ¶
type BatchUpdateState struct { IDs []int64 `json:"ids" form:"ids,split" validate:"required"` State int64 `json:"state" form:"state"` }
BatchUpdateState .
type Business ¶
type Business struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` PID int64 `json:"pid" gorm:"column:pid" form:"pid"` BID int64 `json:"bid" gorm:"column:bid" form:"bid"` Name string `json:"name" gorm:"column:name" form:"name"` Names []string `json:"names" gorm:"-" form:"names,split"` Flow int64 `json:"flow" gorm:"column:flow" form:"flow" default:"0"` FlowState int64 `json:"flow_state" gorm:"column:flow_state" form:"flow_state"` State int64 `json:"state" gorm:"column:state" form:"state" default:"1"` Ctime xtime.Time `json:"ctime" gorm:"-"` Mtime xtime.Time `json:"mtime" gorm:"-"` }
Business .
type BusinessAttr ¶
type BusinessAttr struct {
BID int64 `json:"bid" form:"bid" validate:"required"`
}
BusinessAttr .
type BusinessList ¶
type BusinessList struct { ID int64 `json:"id" gorm:"primary_key"` PID int64 `json:"pid" gorm:"column:pid"` BID int64 `json:"bid" gorm:"column:bid"` Name string `json:"name" gorm:"column:name"` Flow int64 `json:"flow" gorm:"column:flow"` FlowState int64 `json:"flow_state" gorm:"column:flow_state"` State int64 `json:"state" gorm:"column:state"` Ctime xtime.Time `json:"ctime" gorm:"-"` Mtime xtime.Time `json:"mtime" gorm:"-"` FlowChild []*FlowBusiness `json:"flowchild" gorm:"-"` }
BusinessList .
type BusinessListParams ¶
type BusinessListParams struct { State int64 `json:"state" form:"state" default:"-1"` Check int64 `json:"check" form:"check" default:"0"` Flow int64 `json:"flow" form:"flow"` UID int64 `json:"uid"` Auth int64 `json:"auth" form:"auth"` }
BusinessListParams .
type BusinessRole ¶
type BusinessRole struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` BID int64 `json:"bid" gorm:"column:bid" form:"bid"` RID int64 `json:"rid" gorm:"column:rid" form:"rid"` Name string `json:"name" gorm:"column:name" form:"name"` Type int64 `json:"type" gorm:"column:type" form:"type" default:"-1"` State int64 `json:"state" gorm:"column:state" form:"state" default:"1"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` Auth int64 `json:"auth" gorm:"-" form:"auth"` UID int64 `json:"uid" gorm:"-"` }
BusinessRole .
type BusinessUserRole ¶
type BusinessUserRole struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` UID int64 `json:"uid" gorm:"column:uid" form:"uid"` UIDs []int64 `json:"uids" gorm:"-" form:"uids,split"` CUID int64 `json:"cuid" gorm:"column:cuid" form:"cuid"` BID int64 `json:"bid" gorm:"column:bid" form:"bid"` Role string `json:"role" gorm:"column:role" form:"role"` Ctime xtime.Time `json:"ctime" gorm:"-"` Mtime xtime.Time `json:"mtime" gorm:"-"` }
BusinessUserRole .
type BusinessUserRoleList ¶
type BusinessUserRoleList struct { ID int64 `json:"id" gorm:"primary_key"` UID int64 `json:"uid" gorm:"column:uid" form:"uid"` UName string `json:"uname" gorm:"-"` UNickname string `json:"unickname" gorm:"-"` CUID int64 `json:"cuid" gorm:"column:cuid" form:"cuid"` CUName string `json:"cuname" gorm:"-"` BID int64 `json:"bid" gorm:"column:bid" form:"bid"` Role string `json:"role" gorm:"column:role" form:"role"` RoleName []string `json:"rolename" gorm:"-"` Ctime xtime.Time `json:"ctime" gorm:"-"` Mtime xtime.Time `json:"mtime" gorm:"-"` }
BusinessUserRoleList .
type CateSecExt ¶
type CateSecExt struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` BusinessID int64 `json:"bid" gorm:"column:bid" form:"bid"` Name string `json:"name" gorm:"column:name" form:"name"` Type int64 `json:"type" gorm:"column:type" form:"type"` State int64 `json:"state" gorm:"column:state" form:"state" default:"-1"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` }
CateSecExt .
type DepartCustom ¶
type DepartCustom struct { ID int64 `json:"id" gorm:"column:id"` Name string `json:"name" gorm:"column:name"` Status int `json:"-" gorm:"column:status"` Ctime time.Time `json:"-" gorm:"-"` Mtime time.Time `json:"-" gorm:"-"` }
DepartCustom struct info of table user_department
type Department ¶
type Department struct { ID int64 `json:"id"` Name string `json:"name"` Status int `json:"status"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
Department struct info of table user_department
type DropList ¶
type DropList struct { ID int64 `json:"id"` Name string `json:"name"` Child []*DropList `json:"child"` }
DropList .
type FileInfo ¶
type FileInfo struct { Name string `json:"name"` Size int64 `json:"size"` Type string `json:"type"` Md5 string `json:"md5"` URL string `json:"url"` }
FileInfo : the uploaded file information
type FlowBusiness ¶
type FlowBusiness struct { FlowState int64 `json:"flow_state"` Child []*BusinessList `json:"child"` }
FlowBusiness .
type Org ¶
type Org struct { ID int64 `json:"id"` Name string `json:"name"` Users []string `json:"users"` Description string `json:"description"` }
Org org info.
type Permissions ¶
type Permissions struct { UID int64 `json:"uid"` Perms []string `json:"perms"` Admin bool `json:"admin"` Orgs []*AuthOrg `json:"orgs"` Roles []*AuthOrg `json:"roles"` }
Permissions .
type RankAuth ¶
type RankAuth struct { ID int64 `json:"id"` GroupID int64 `json:"group_id"` AuthID int64 `json:"auth_id"` Isdel int `json:"isdel"` }
RankAuth rank auths
type RankGroup ¶
type RankGroup struct { ID int64 `json:"id"` Name string `json:"name"` Desc string `json:"desc"` Isdel int `json:"isdel"` Auths []*AuthItem `json:"auths"` }
RankGroup rank permission group
type RankUser ¶
type RankUser struct { ID int64 `json:"id"` GroupID int64 `json:"group_id"` UID int64 `json:"uid" gorm:"column:uid"` Rank int `json:"rank"` Isdel int `json:"isdel"` }
RankUser user-group-rank info.
type RankUserScores ¶
type RankUserScores struct { UID int64 `json:"uid"` Username string `json:"username"` Nickname string `json:"nickname"` Ranks map[int64]int `json:"ranks"` }
RankUserScores rank user scores.
type Reason ¶
type Reason struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` BusinessID int64 `json:"bid" gorm:"column:bid" form:"bid"` RoleID int64 `json:"role_id" gorm:"column:rid" form:"role_id" validate:"required"` RoleName string `json:"role_name" gorm:"-"` CategoryID int64 `json:"cate_id" gorm:"column:cid" form:"cate_id" validate:"required"` CategoryName string `json:"category_name" gorm:"-"` SecondID int64 `json:"sec_id" gorm:"column:sid" form:"sec_id" validate:"required"` SecondName string `json:"sec_name" gorm:"-"` State int64 `json:"state" gorm:"column:state" form:"state" default:"1"` Common int64 `json:"common" gorm:"column:common" form:"common" default:"0"` UID int64 `json:"uid" gorm:"column:uid" form:"uid"` UName string `json:"uname" gorm:"-"` Description string `json:"description" gorm:"column:description" form:"description" validate:"required"` Weight int64 `json:"weight" gorm:"column:weight" form:"weight" default:"1" validate:"required"` Flag int64 `json:"flag" gorm:"column:flag" form:"flag" default:"0"` LinkID int64 `json:"link_id" gorm:"column:lid" form:"link_id" default:"0"` TypeID int64 `json:"type_id" gorm:"column:type_id" form:"type_id" default:"0"` TagID int64 `json:"tag_id" gorm:"column:tid" form:"tag_id" default:"0"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` }
Reason .
type Resource ¶
type Resource struct { ID int64 `json:"id" params:"id"` Name string `json:"name" params:"name"` Version int64 `json:"version" params:"version"` PoolID int64 `json:"pool_id" params:"pool_id"` Ctime time.Time `json:"ctime" params:"ctime"` Mtime time.Time `json:"mtime" params:"mtime"` }
Resource reprensents the resource table
type ResourceFile ¶
type ResourceFile struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Md5 string `json:"md5"` Size int `json:"size"` URL string `json:"url"` ResourceID int `json:"resource_id"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
ResourceFile represents the table structure
func (*ResourceFile) TableName ¶
func (*ResourceFile) TableName() string
TableName gives the table name of the model
type Role ¶
type Role struct { ID int64 `json:"id"` OrgName string `json:"org_name"` RoleName string `json:"name"` Users []string `json:"users"` Description string `json:"description"` }
Role role info.
type RoleAss ¶
type RoleAss struct { ID int64 `json:"id" gorm:"column:id"` RoleID int64 `json:"role_id" gorm:"column:role_id"` UserID int64 `json:"user_id" gorm:"column:user_id"` Ctime time.Time `json:"ctime" gorm:"-"` }
RoleAss .
type RoleCustom ¶
type RoleCustom struct { ID int64 `json:"id" gorm:"column:id"` Name string `json:"name" gorm:"column:name"` Type int64 `json:"-" gorm:"column:type"` Description string `json:"-" gorm:"column:description"` RuleID int64 `json:"-" gorm:"column:rule_id"` Data string `json:"-" gorm:"column:data"` Ctime time.Time `json:"-" gorm:"-"` Mtime time.Time `json:"-" gorm:"-"` }
RoleCustom .
type SearchReasonParams ¶
type SearchReasonParams struct { BusinessID int64 `form:"bid" default:"-1"` KeyWord string `json:"keyword" form:"keyword"` RoleID int64 `json:"role_id" form:"role_id" default:"0"` CategoryID int64 `json:"cate_id" form:"cate_id" default:"0"` SecondID int64 `json:"sec_id" form:"sec_id" default:"0"` State int64 `json:"state" form:"state" default:"-1"` UID int64 `json:"uid"` UName string `json:"uname" form:"uname"` Order string `json:"order" form:"order" default:"ctime"` Sort string `json:"sort" form:"sort" default:"desc"` PS int64 `form:"ps" default:"20"` PN int64 `form:"pn" default:"1"` }
SearchReasonParams .
type SearchTagParams ¶
type SearchTagParams struct { Bid int64 `form:"bid" default:"-1"` KeyWord string `form:"keyword"` Tid int64 `form:"tid" default:"-1"` Rid int64 `form:"rid" default:"-1"` State int64 `form:"state" default:"-1"` UID int64 `form:"uid" ` UName string `form:"uname"` Order string `form:"order"` Sort string `form:"sort" default:"desc"` PS int64 `form:"ps" default:"20"` PN int64 `form:"pn" default:"1"` }
SearchTagParams .
type StateUpdate ¶
type StateUpdate struct { ID int64 `json:"id" form:"id" validate:"required"` Type int64 `json:"type" form:"type" validate:"required"` // 1:业务 2:角色 State int64 `json:"state" form:"state"` }
StateUpdate .
type Tag ¶
type Tag struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` Bid int64 `json:"bid" gorm:"column:bid" form:"bid" validate:"required"` Tid int64 `json:"tid" gorm:"column:tid" form:"tid" validate:"required"` TagID int64 `json:"tag_id" gorm:"column:tag_id"` TName string `json:"tname" gorm:"-"` Rid int64 `json:"rid" gorm:"column:rid" form:"rid" validate:"required"` RName string `json:"rname" gorm:"-"` Name string `json:"name" gorm:"column:name" form:"name" validate:"required"` Weight int64 `json:"weight" gorm:"column:weight" form:"weight" validate:"required"` State int64 `json:"state" gorm:"column:state" form:"state" default:"1"` UID int64 `json:"uid" gorm:"column:uid" form:"uid"` UName string `json:"uname" gorm:"-"` Description string `json:"description" gorm:"column:description" form:"description"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` }
Tag .
type TagBusinessAttr ¶
type TagBusinessAttr struct { ID int64 `json:"id" gorm:"primary_key"` Bid int64 `json:"bid" gorm:"column:bid" form:"bid" validate:"required"` Button int64 `json:"button" form:"button" gorm:"column:button" default:"6"` Extra int64 `json:"extra" gorm:"column:extra"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` }
TagBusinessAttr .
type TagControl ¶
type TagControl struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` Tid int64 `json:"tid" gorm:"column:tid" form:"tid" validate:"required"` Name string `json:"name" gorm:"column:name" form:"name" validate:"required"` Title string `json:"title" gorm:"column:title" form:"title" validate:"required"` Weight int64 `json:"weight" gorm:"column:weight" form:"weight" validate:"required"` Component string `json:"component" gorm:"column:component" form:"component" validate:"required"` Placeholder string `json:"placeholder" gorm:"column:placeholder" form:"placeholder" validate:"required"` Required int64 `json:"required" gorm:"column:required" form:"required" default:"0"` Ctime xtime.Time `json:"ctime" gorm:"-"` Mtime xtime.Time `json:"mtime" gorm:"-"` BID int64 `json:"bid" gorm:"column:bid" form:"bid"` }
TagControl .
type TagControlParam ¶
TagControlParam .
type TagType ¶
type TagType struct { ID int64 `json:"id" gorm:"primary_key" form:"id"` Bid int64 `json:"bid" gorm:"column:bid" form:"bid" validate:"required"` Name string `json:"name" gorm:"column:name" form:"name" validate:"required"` State int64 `json:"state" gorm:"column:state" form:"state"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` Rids []int64 `json:"rids" gorm:"-" form:"rids,split" validate:"required"` Roles []*BusinessRole `json:"roles" gorm:"-"` }
TagType .
type TagTypeDel ¶
type TagTypeDel struct {
ID int64 `json:"id" form:"id" validate:"required"`
}
TagTypeDel .
type TagTypeList ¶
type TagTypeList struct {
BID int64 `json:"bid" form:"bid" validate:"required"`
}
TagTypeList .
type TagTypeRole ¶
type TagTypeRole struct { ID int64 `json:"id" gorm:"primary_key"` Tid int64 `json:"tid" gorm:"column:tid"` Rid int64 `json:"rid" gorm:"column:rid"` Ctime xtime.Time `json:"ctime" gorm:"column:ctime"` Mtime xtime.Time `json:"mtime" gorm:"column:mtime"` }
TagTypeRole .
type User ¶
type User struct { ID int64 `json:"id"` Username string `json:"username"` Nickname string `json:"nickname"` Email string `json:"email"` Phone string `json:"phone"` DepartmentID int `json:"department_id"` State int `json:"state"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
User struct info of table user
type UserCustom ¶
type UserCustom struct { ID int64 `json:"id" gorm:"column:id"` Username string `json:"username" gorm:"column:username"` Nickname string `json:"nickname" gorm:"column:nickname"` Email string `json:"-" gorm:"column:email"` Phone string `json:"-" gorm:"column:phone"` DepartmentID int `json:"-" gorm:"column:department_id"` State int `json:"-" gorm:"column:state"` Ctime time.Time `json:"-" gorm:"-"` Mtime time.Time `json:"-" gorm:"-"` }
UserCustom .
type UserDept ¶
type UserDept struct { ID int64 `json:"id" gorm:"column:id"` Department string `json:"department" gorm:"column:department"` }
UserDept .
type UserListParams ¶
type UserListParams struct { BID int64 `form:"bid" validate:"required"` Role int64 `form:"role" default:"-1"` UName string `form:"uname"` UID int64 `form:"uid"` PS int64 `form:"ps" default:"50"` PN int64 `form:"pn" default:"1"` }
UserListParams .
type UserRole ¶
type UserRole struct { ID int64 `json:"id"` BID int64 `json:"bid"` RID int64 `json:"rid"` Type int64 `json:"type"` Name string `json:"name"` }
UserRole .
type UserStateUp ¶
type UserStateUp struct { BID int64 `json:"bid" form:"bid" validate:"required"` AdminID int64 `json:"adminid" form:"adminid" validate:"required"` State int `json:"state" form:"state" validate:"state"` }
UserStateUp .