Documentation
¶
Overview ¶
Package model 模型层只定义数据库表对应的模型,不实现相关操作
数据库相关操作放到 service 层完成
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { ID string `gorm:"primaryKey;type:varchar(25)" json:"id"` // 在创建时,如果该字段值为零值,则使用当前时间填充 CreatedAt time.Time `json:"created_at" ` // 可为空 UpdatedAt *time.Time `json:"updated_at"` // 软删除标识 RemoveFlag bool `json:"remove_flag"` CreatedBy string `json:"created_by" gorm:"type:varchar(25)"` UpdatedBy string `json:"updated_by" gorm:"type:varchar(25)"` }
Base 数据模型的公共字段
type CasbinRule ¶
type CasbinRule struct { PType string `json:"p_type" gorm:"size:100;"` V0 string `json:"v0" gorm:"size:100;"` V1 string `json:"v1" gorm:"size:100;"` V2 string `json:"v2" gorm:"size:100;"` V3 string `json:"v3" gorm:"size:100;"` V4 string `json:"v4" gorm:"size:100;"` V5 string `json:"v5" gorm:"size:100;"` }
CasbinRule casbin规则表 因为有适配器中间件,尽量不对这张表的数据进行操作 这里写出来以备额外需求
type Role ¶
type Role struct { Base // RoleName 角色代号,全英文。用在系统内逻辑判断 RoleName string `json:"role_name" gorm:"type:varchar(100)"` // DisplayName 显示名。给用户看的。 DisplayName string `json:"display_name" gorm:"type:varchar(100)"` // Remark 备注 Remark string `json:"remark" gorm:"type:varchar(200)"` }
Role 角色
Click to show internal directories.
Click to hide internal directories.