entity

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MenuTypeRoot   = "R"  // 应用根菜单
	MenuTypeApi    = "A"  // API接口
	MenuTypePage   = "M"  // 菜单页面
	MenuTypeGroup  = "G"  // 菜单分组
	MenuTypeBasic  = "BA" // 基础API
	MenuTypeButton = "B"  // 按钮权限
	MenuTypeLink   = "L"  // 外部链接
)
View Source
const (
	AdminUsername = "admin"
)
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 {
	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
}

func (App) TableName

func (a App) TableName() string

TableName 获取表名称

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:"-"`
}

func (*Dept) AppendChildren

func (m *Dept) AppendChildren(child *Dept)

AppendChildren 添加子节点

func (*Dept) ChildrenNode

func (m *Dept) ChildrenNode() []*Dept

ChildrenNode 获取子节点

func (*Dept) ID

func (m *Dept) ID() uint32

ID 获取树ID

func (*Dept) Parent

func (m *Dept) Parent() uint32

Parent 获取父ID

func (*Dept) TableName

func (m *Dept) TableName() string

TableName 获取表名称

type DeptClassify

type DeptClassify struct {
	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 DeptClosure

type DeptClosure struct {
	ID       uint32 `json:"id" gorm:"column:id"`
	Parent   uint32 `json:"parent" gorm:"column:parent"`
	Children uint32 `json:"children" gorm:"column:children"`
}

type DeptRole

type DeptRole struct {
	ID     uint32 `json:"id" gorm:"column:id"`
	DeptId uint32 `json:"deptId" gorm:"column:dept_id"`
	RoleId uint32 `json:"roleId"  gorm:"column:role_id"`
}

type Dictionary

type Dictionary struct {
	Keyword     string  `json:"keyword" gorm:"column:keyword"`
	Name        string  `json:"name" gorm:"column:name"`
	Type        string  `json:"type" gorm:"column:type"`
	Description *string `json:"description" gorm:"column:description"`
	model.BaseTenantModel
}

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 获取子节点

func (*DictionaryValue) ID

func (m *DictionaryValue) ID() uint32

ID 获取ID

func (*DictionaryValue) Parent

func (m *DictionaryValue) Parent() uint32

Parent 获取父ID

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 JobRole

type JobRole struct {
	ID     uint32 `json:"id" gorm:"column:id"`
	JobId  uint32 `json:"jobId" gorm:"column:job_id"`
	RoleId uint32 `json:"roleId"  gorm:"column:role_id"`
}

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 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
}
func (m *Menu) AppendChildren(child *Menu)

AppendChildren 添加子节点

func (m *Menu) ChildrenNode() []*Menu

ChildrenNode 获取子节点

func (m *Menu) GetApi() string
func (m *Menu) GetMethod() string
func (m *Menu) GormHook(db *gorm.DB)

GormHook 获取ID

func (m *Menu) ID() uint32

ID 获取ID

func (m *Menu) Parent() uint32

Parent 获取父ID

type MenuClosure struct {
	ID       uint32 `json:"id" gorm:"column:id"`
	Parent   uint32 `json:"parent" gorm:"column:parent"`
	Children uint32 `json:"children" gorm:"column:children"`
}

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

func (OAuth) TableName added in v1.2.2

func (c OAuth) TableName() string

type OAuthChannel

type OAuthChannel 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"`           // 启用状态
	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
}

func (*Role) AppendChildren

func (m *Role) AppendChildren(child *Role)

AppendChildren 添加子节点

func (*Role) ChildrenNode

func (m *Role) ChildrenNode() []*Role

ChildrenNode 获取子节点

func (*Role) ID

func (m *Role) ID() uint32

ID 获取树ID

func (*Role) Parent

func (m *Role) Parent() uint32

Parent 获取父ID

type RoleClosure

type RoleClosure struct {
	ID       uint32 `json:"id" gorm:"column:id"`
	Parent   uint32 `json:"parent" gorm:"column:parent"`
	Children uint32 `json:"children" gorm:"column:children"`
}

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 RoleMenu

type RoleMenu struct {
	ID     uint32 `json:"id" gorm:"column:id"`
	RoleId uint32 `json:"roleId" gorm:"column:role_id"`
	MenuId uint32 `json:"menuId" gorm:"column:menu_id"`
}

type Tenant

type Tenant struct {
	model.DeleteModel
	Keyword     string `gorm:"column:keyword" json:"keyword"`         // 租户标识
	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 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"` // 过期时间
	App       *App     `json:"app"`
	MenuIds   []uint32 `json:"menuIds" gorm:"-"`
}

type TenantAppMenu

type TenantAppMenu struct {
	ID       uint32 `json:"id" gorm:"column:id"`
	TenantId uint32 `json:"tenantId" gorm:"column:tenant_id"` // 租户ID
	AppId    uint32 `json:"appId" gorm:"column:app_id"`       // 应用ID
	MenuId   uint32 `json:"menuId"  gorm:"column:menu_id" `   // 菜单ID
}

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

type UserSetting struct {
	UserId  uint32 `json:"userId" gorm:"column:user_id"`
	AppId   uint32 `json:"appId" gorm:"column:app_id"`
	Setting string `json:"setting" gorm:"column:setting"`
	model.BaseModel
}

type Userinfo

type Userinfo struct {
	UserId uint32 `json:"userId" gorm:"column:user_id"`
	Field  string `json:"field" gorm:"column:field"`
	Value  string `json:"value" gorm:"column:value"`
	Index  *int   `json:"index" gorm:"-"`
	model.BaseModel
}

func (*Userinfo) TableName

func (u *Userinfo) TableName() string

Jump to

Keyboard shortcuts

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