schema

package
v0.3.9-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// URLRegex 验证 URL 格式的正则表达式,支持 http:// 和 https://
	// 匹配格式: http://example.com, https://example.com/path, example.com/path
	URLRegex = regexp.MustCompile(`^(https?://)?([\da-z\.-]+)\.([a-z\.]{2,6})([/\w \.-]*)*/?$`)
)

Functions

func FieldNameNormalize

func FieldNameNormalize(name string) string

FieldNameNormalize 移除字段名末尾的 "_encrypted", "_hash" 使其与 proto 等定义一致

Types

type AuditMixin

type AuditMixin struct {
	mixin.Schema
}

AuditMixin 创建或更新人员属性

func (AuditMixin) Fields

func (AuditMixin) Fields() []ent.Field

Fields xx

type AuthProviders

type AuthProviders struct {
	ent.Schema
}

AuthProviders holds the schema definition for the Demo entity.

func (AuthProviders) Annotations

func (AuthProviders) Annotations() []schema.Annotation

Annotations 自定义表名

func (AuthProviders) Edges

func (AuthProviders) Edges() []ent.Edge

Edges of the table.

func (AuthProviders) Fields

func (AuthProviders) Fields() []ent.Field

Fields of the table.

func (AuthProviders) Indexes

func (AuthProviders) Indexes() []ent.Index

Indexes of the table.

func (AuthProviders) Mixin

func (AuthProviders) Mixin() []ent.Mixin

Mixin of the table.

type Credentials

type Credentials struct {
	ent.Schema
}

Credentials holds the schema definition for the Credentials entity.

func (Credentials) Annotations

func (Credentials) Annotations() []schema.Annotation

Annotations 自定义表名

func (Credentials) Edges

func (Credentials) Edges() []ent.Edge

Edges of the table.

func (Credentials) Fields

func (Credentials) Fields() []ent.Field

Fields of the table.

func (Credentials) Mixin

func (Credentials) Mixin() []ent.Mixin

Mixin of the table.

type Demo

type Demo struct {
	ent.Schema
}

Demo holds the schema definition for the Demo entity.

func (Demo) Annotations

func (Demo) Annotations() []schema.Annotation

Annotations 自定义表名

func (Demo) Edges

func (Demo) Edges() []ent.Edge

Edges of the table.

func (Demo) Fields

func (Demo) Fields() []ent.Field

Fields of the table.

func (Demo) Mixin

func (Demo) Mixin() []ent.Mixin

Mixin of the table.

type DepartmentRoles

type DepartmentRoles struct {
	ent.Schema
}

DepartmentRoles 角色关联的菜单项

func (DepartmentRoles) Annotations

func (DepartmentRoles) Annotations() []schema.Annotation

Annotations 自定义表名

func (DepartmentRoles) Edges

func (DepartmentRoles) Edges() []ent.Edge

Edges of the table.

func (DepartmentRoles) Fields

func (DepartmentRoles) Fields() []ent.Field

Fields of the table.

func (DepartmentRoles) Indexes

func (DepartmentRoles) Indexes() []ent.Index

Indexes of the table.

func (DepartmentRoles) Mixin

func (DepartmentRoles) Mixin() []ent.Mixin

Mixin of the table.

type Departments

type Departments struct {
	ent.Schema
}

Departments 组织架构部门管理

func (Departments) Annotations

func (Departments) Annotations() []schema.Annotation

Annotations 自定义表名

func (Departments) Edges

func (Departments) Edges() []ent.Edge

Edges of the table.

func (Departments) Fields

func (Departments) Fields() []ent.Field

Fields of the table.

func (Departments) Mixin

func (Departments) Mixin() []ent.Mixin

Mixin of the table.

type GroupRoles

type GroupRoles struct {
	ent.Schema
}

GroupRoles 角色与用户组的关系

func (GroupRoles) Annotations

func (GroupRoles) Annotations() []schema.Annotation

Annotations 自定义表名

func (GroupRoles) Edges

func (GroupRoles) Edges() []ent.Edge

Edges of the table.

func (GroupRoles) Fields

func (GroupRoles) Fields() []ent.Field

Fields of the table.

func (GroupRoles) Indexes

func (GroupRoles) Indexes() []ent.Index

Indexes of the table.

func (GroupRoles) Mixin

func (GroupRoles) Mixin() []ent.Mixin

Mixin of the table.

type Groups

type Groups struct {
	ent.Schema
}

Groups 存储用户组信息,实现 RBAC 权限管理

func (Groups) Annotations

func (Groups) Annotations() []schema.Annotation

Annotations 自定义表名

func (Groups) Edges

func (Groups) Edges() []ent.Edge

Edges of the table.

func (Groups) Fields

func (Groups) Fields() []ent.Field

Fields of the table.

func (Groups) Indexes

func (Groups) Indexes() []ent.Index

Indexes 定义索引

func (Groups) Mixin

func (Groups) Mixin() []ent.Mixin

Mixin of the table.

type Permissions

type Permissions struct {
	ent.Schema
}

Permissions 组下关联的具体用户

func (Permissions) Annotations

func (Permissions) Annotations() []schema.Annotation

Annotations 自定义表名

func (Permissions) Edges

func (Permissions) Edges() []ent.Edge

Edges of the table.

func (Permissions) Fields

func (Permissions) Fields() []ent.Field

Fields of the table.

func (Permissions) Indexes

func (Permissions) Indexes() []ent.Index

Indexes of the table.

func (Permissions) Mixin

func (Permissions) Mixin() []ent.Mixin

Mixin of the table.

type Policies

type Policies struct {
	ent.Schema
}

Policies holds the schema definition for the Policies entity.

func (Policies) Annotations

func (Policies) Annotations() []schema.Annotation

Annotations 自定义表名

func (Policies) Edges

func (Policies) Edges() []ent.Edge

Edges of the table.

func (Policies) Fields

func (Policies) Fields() []ent.Field

Fields of the table.

func (Policies) Mixin

func (Policies) Mixin() []ent.Mixin

Mixin of the table.

type Resources

type Resources struct {
	ent.Schema
}

Resources holds the schema definition for the Demo entity.

func (Resources) Annotations

func (Resources) Annotations() []schema.Annotation

Annotations 自定义表名

func (Resources) Edges

func (Resources) Edges() []ent.Edge

Edges of the table.

func (Resources) Fields

func (Resources) Fields() []ent.Field

Fields of the table.

func (Resources) Indexes

func (Resources) Indexes() []ent.Index

Indexes 定义索引

func (Resources) Mixin

func (Resources) Mixin() []ent.Mixin

Mixin of the table.

type RolePermissions

type RolePermissions struct {
	ent.Schema
}

RolePermissions holds the schema definition for the RolePermissions entity.

func (RolePermissions) Annotations

func (RolePermissions) Annotations() []schema.Annotation

Annotations 自定义表名

func (RolePermissions) Edges

func (RolePermissions) Edges() []ent.Edge

Edges of the table.

func (RolePermissions) Fields

func (RolePermissions) Fields() []ent.Field

Fields of the table.

func (RolePermissions) Indexes

func (RolePermissions) Indexes() []ent.Index

Indexes of the table.

func (RolePermissions) Mixin

func (RolePermissions) Mixin() []ent.Mixin

Mixin of the table.

type Roles

type Roles struct {
	ent.Schema
}

Roles holds the schema definition for the Demo entity.

func (Roles) Annotations

func (Roles) Annotations() []schema.Annotation

Annotations 自定义表名

func (Roles) Edges

func (Roles) Edges() []ent.Edge

Edges of the table.

func (Roles) Fields

func (Roles) Fields() []ent.Field

Fields of the table.

func (Roles) Indexes

func (Roles) Indexes() []ent.Index

Indexes 定义索引

func (Roles) Mixin

func (Roles) Mixin() []ent.Mixin

Mixin of the table.

type TimeMixin

type TimeMixin struct {
	mixin.Schema
}

TimeMixin xx

func (TimeMixin) Fields

func (TimeMixin) Fields() []ent.Field

Fields xx

type TimeMixinWithoutDeleted

type TimeMixinWithoutDeleted struct {
	mixin.Schema
}

TimeMixinWithoutDeleted xx

func (TimeMixinWithoutDeleted) Fields

func (TimeMixinWithoutDeleted) Fields() []ent.Field

Fields xx

type UserDepartments

type UserDepartments struct {
	ent.Schema
}

UserDepartments holds the schema definition for the Demo entity.

func (UserDepartments) Annotations

func (UserDepartments) Annotations() []schema.Annotation

Annotations 自定义表名

func (UserDepartments) Edges

func (UserDepartments) Edges() []ent.Edge

Edges of the table.

func (UserDepartments) Fields

func (UserDepartments) Fields() []ent.Field

Fields of the table.

func (UserDepartments) Indexes

func (UserDepartments) Indexes() []ent.Index

Indexes of the table.

func (UserDepartments) Mixin

func (UserDepartments) Mixin() []ent.Mixin

Mixin of the table.

type UserGroups

type UserGroups struct {
	ent.Schema
}

UserGroups 组下关联的具体用户

func (UserGroups) Annotations

func (UserGroups) Annotations() []schema.Annotation

Annotations 自定义表名

func (UserGroups) Edges

func (UserGroups) Edges() []ent.Edge

Edges of the table.

func (UserGroups) Fields

func (UserGroups) Fields() []ent.Field

Fields of the table.

func (UserGroups) Indexes

func (UserGroups) Indexes() []ent.Index

Indexes of the table.

func (UserGroups) Mixin

func (UserGroups) Mixin() []ent.Mixin

Mixin of the table.

type UserIdentities

type UserIdentities struct {
	ent.Schema
}

UserIdentities 存储通过 OIDC 等社交登录的用户信息

func (UserIdentities) Annotations

func (UserIdentities) Annotations() []schema.Annotation

Annotations 自定义表名

func (UserIdentities) Edges

func (UserIdentities) Edges() []ent.Edge

Edges of the table.

func (UserIdentities) Fields

func (UserIdentities) Fields() []ent.Field

Fields of the table.

func (UserIdentities) Indexes

func (UserIdentities) Indexes() []ent.Index

Indexes of the table.

func (UserIdentities) Mixin

func (UserIdentities) Mixin() []ent.Mixin

Mixin of the table.

type UserProfiles

type UserProfiles struct {
	ent.Schema
}

UserProfiles 用于存储用户的扩展属性信息

func (UserProfiles) Annotations

func (UserProfiles) Annotations() []schema.Annotation

Annotations 自定义表名

func (UserProfiles) Edges

func (UserProfiles) Edges() []ent.Edge

Edges of the table.

func (UserProfiles) Fields

func (UserProfiles) Fields() []ent.Field

Fields of the table.

func (UserProfiles) Indexes

func (UserProfiles) Indexes() []ent.Index

Indexes of the table.

func (UserProfiles) Mixin

func (UserProfiles) Mixin() []ent.Mixin

Mixin of the table.

type UserRoles

type UserRoles struct {
	ent.Schema
}

UserRoles 角色与用户的关系

func (UserRoles) Annotations

func (UserRoles) Annotations() []schema.Annotation

Annotations 自定义表名

func (UserRoles) Edges

func (UserRoles) Edges() []ent.Edge

Edges of the table.

func (UserRoles) Fields

func (UserRoles) Fields() []ent.Field

Fields of the table.

func (UserRoles) Indexes

func (UserRoles) Indexes() []ent.Index

Indexes of the table.

func (UserRoles) Mixin

func (UserRoles) Mixin() []ent.Mixin

Mixin of the table.

type Users

type Users struct {
	ent.Schema
}

Users 用户实体表 | 存储用户基本信息和认证相关字段

func (Users) Annotations

func (Users) Annotations() []schema.Annotation

Annotations 自定义表名

func (Users) Edges

func (Users) Edges() []ent.Edge

Edges of the table.

func (Users) Fields

func (Users) Fields() []ent.Field

Fields of the table.

func (Users) Indexes

func (Users) Indexes() []ent.Index

Indexes 定义索引 索引策略说明: 1. 单字段索引:保留高频单独使用的字段(user_type, user_status) 2. 组合索引:根据实际查询模式优化,遵循最左前缀原则 3. 唯一索引:哈希字段使用条件唯一索引(仅非空值唯一) 4. 查询模式:通常过滤 deleted_at IS NULL + user_status/user_type + 按 created_at 排序

func (Users) Mixin

func (Users) Mixin() []ent.Mixin

Mixin of the table.

Jump to

Keyboard shortcuts

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