Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Department ¶
type Department struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
// 父节点
Parent *primitive.ObjectID `bson:"parent" json:"parent"`
// 名称
Name string `bson:"name" json:"name"`
// 描述
Description string `bson:"description" json:"description"`
// 排序
Sort int64 `bson:"sort" json:"sort"`
// 创建时间
CreateTime time.Time `bson:"create_time" json:"-"`
// 更新时间
UpdateTime time.Time `bson:"update_time" json:"-"`
}
func NewDepartment ¶
func NewDepartment(name string) *Department
type Page ¶
type Page struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
// 父节点
Parent interface{} `bson:"parent" json:"parent"`
// 名称
Name string `bson:"name" json:"name"`
// 字体图标
Icon string `bson:"icon,omitempty" json:"icon,omitempty"`
// 种类
Kind string `bson:"kind" json:"kind"`
// 形式
Manifest string `bson:"manifest,omitempty" json:"manifest,omitempty"`
// Schema 模型,数据集时存在
Schema *Schema `bson:"schema,omitempty" json:"schema,omitempty"`
// 数据源,数据聚合时存在
Source *Source `bson:"source,omitempty" json:"source,omitempty"`
// 自定义,自定义种类时存在
Manual *Manual `bson:"manual,omitempty" json:"manual,omitempty"`
// 排序
Sort int64 `bson:"sort" json:"sort"`
// 状态
Status *bool `bson:"status" json:"status"`
// 创建时间
CreateTime time.Time `bson:"create_time" json:"create_time"`
// 更新时间
UpdateTime time.Time `bson:"update_time" json:"update_time"`
}
type Role ¶
type Role struct {
ID uint64 `json:"id"`
Name string `gorm:"type:varchar;uniqueIndex;not null;comment:名称" json:"name"`
Description string `gorm:"type:varchar;comment:描述" json:"description"`
Pages RolePages `gorm:"type:jsonb;default:'{}';not null;comment:授权页面" json:"pages"`
Status bool `gorm:"default:true;not null;comment:状态" json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Schema ¶
type Schema struct {
// 命名
Key string `bson:"key" json:"key"`
// 字段
Fields []*SchemaField `bson:"fields" json:"fields"`
// 显隐规则
Rules []*SchemaRule `bson:"rules,omitempty" json:"rules,omitempty"`
// 启用事务补偿
Event *bool `bson:"event,omitempty" json:"event,omitempty"`
// 启用详情
Detail *bool `bson:"detail,omitempty" json:"detail,omitempty"`
}
type SchemaField ¶
type SchemaField struct {
// 命名
Key string `bson:"key" json:"key"`
// 显示名称
Label string `bson:"label" json:"label"`
// 字段类型
Type string `bson:"type" json:"type"`
// 字段描述
Description string `bson:"description,omitempty" json:"description,omitempty"`
// 字段提示
Placeholder string `bson:"placeholder,omitempty" json:"placeholder,omitempty"`
// 默认值
Default interface{} `bson:"default,omitempty" json:"default,omitempty"`
// 关键词
Keyword *bool `bson:"keyword,omitempty" json:"keyword,omitempty"`
// 是否必须
Required *bool `bson:"required,omitempty" json:"required,omitempty"`
// 隐藏字段
Hide *bool `bson:"hide,omitempty" json:"hide,omitempty"`
// 只读
Readonly *bool `bson:"readonly,omitempty" json:"readonly,omitempty"`
// 投影
Projection *int64 `bson:"projection,omitempty" json:"projection,omitempty"`
// 排序
Sort *int64 `bson:"sort" json:"sort"`
// 配置
Option *SchemaFieldOption `bson:"option,omitempty" json:"option,omitempty"`
}
type SchemaFieldOption ¶
type SchemaFieldOption struct {
// 最大值
Max int64 `bson:"max,omitempty" json:"max,omitempty"`
// 最小值
Min int64 `bson:"min,omitempty" json:"min,omitempty"`
// 保留小数
Decimal int64 `bson:"decimal,omitempty" json:"decimal,omitempty"`
// 包含时间
Time *bool `bson:"time,omitempty" json:"time,omitempty"`
// 枚举数值
Values []Value `bson:"values,omitempty" json:"values,omitempty"`
// 引用类型,模型
Reference string `bson:"reference,omitempty" json:"reference,omitempty"`
// 引用类型,目标字段
Target string `bson:"target,omitempty" json:"target,omitempty"`
// 多选
Multiple *bool `bson:"multiple,omitempty" json:"multiple,omitempty"`
// 组件标识
Component string `bson:"component,omitempty" json:"component,omitempty"`
}
type SchemaRule ¶
type SchemaRule struct {
// 逻辑
Logic string `bson:"logic" json:"logic"`
// 条件
Conditions []*SchemaRuleCondition `bson:"conditions" json:"conditions"`
// 显示字段
Keys []string `bson:"keys" json:"keys"`
}
type SchemaRuleCondition ¶
type User ¶
type User struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
// 用户名
Username string `bson:"username" json:"username"`
// 密码
Password string `bson:"password" json:"password,omitempty"`
// 电子邮件
Email string `bson:"email" json:"email"`
// 所属部门
Department *primitive.ObjectID `bson:"department" json:"-"`
// 权限组
Roles []primitive.ObjectID `bson:"roles" json:"roles,omitempty"`
// 称呼
Name string `bson:"name" json:"name"`
// 头像
Avatar string `bson:"avatar" json:"avatar"`
// 登录次数
Sessions int64 `bson:"sessions" json:"sessions"`
// 最近登录记录
Last string `json:"last" bson:"last"`
// 飞书 OpenID
Feishu bson.M `json:"feishu" bson:"feishu"`
// 状态
Status bool `bson:"status" json:"status"`
// 标记
Labels []string `bson:"labels" json:"labels"`
// 创建时间
CreateTime time.Time `bson:"create_time" json:"-"`
// 更新时间
UpdateTime time.Time `bson:"update_time" json:"-"`
}
Click to show internal directories.
Click to hide internal directories.