Documentation ¶
Overview ¶
用户模块
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { DB *gorm.DB AdditionalPropertyTable string // 附加属性表表名 AdditionalType map[uint]string // 附加属性类型 UserLinkTable string // 用户关系关联表表名 UserLinkMap map[uint8]string // 用户关联关系字典 }
此模块包含: 1. 附加属性功能(其中固定属性直接使用方进行固定即可,如昵称、头像、性别等直接固定到最外层用户表) 2. 用户关联功能
配置项信息
type UserAdditional ¶ added in v0.2.0
type UserAdditional struct { Id uint `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement;not null" form:"id" json:"id"` UserId uint `gorm:"column:user_id;type:int unsigned;comment:所属用户" form:"user_id" json:"user_id"` //所属用户 TypeId uint `gorm:"column:type_id;type:int unsigned;comment:附加属性类型" form:"type_id" json:"type_id"` //附加属性类型 Value string `gorm:"column:value;type:varchar(200);comment:附加属性值" form:"value" json:"value"` //附加属性值 IsDeleted uint8 `gorm:"column:is_deleted;type:tinyint unsigned;comment:是否删除" form:"is_deleted" json:"is_deleted"` //是否删除 CreatedAt string `gorm:"column:created_at;type:datetime;comment:添加时间" form:"created_at" json:"created_at"` //添加时间 }
用户附加属性表
func (*UserAdditional) TableName ¶ added in v0.2.0
func (c *UserAdditional) TableName() string
返回所属表名信息
Click to show internal directories.
Click to hide internal directories.