Documentation ¶
Index ¶
Constants ¶
View Source
const ( UserStatusNormal int = iota + 1 UserStatusClosed )
Variables ¶
This section is empty.
Functions ¶
func NewDBEngine ¶
func NewDBEngine(databaseSetting *setting.DatabaseSettingS) (*gorm.DB, error)
Types ¶
type Attachment ¶
type Attachment struct { *Model UserID int64 `json:"user_id"` FileSize int64 `json:"file_size"` ImgWidth int `json:"img_width"` ImgHeight int `json:"img_height"` Type AttachmentType `json:"type"` Content string `json:"content"` }
func (*Attachment) Create ¶
func (a *Attachment) Create(db *gorm.DB) (*Attachment, error)
type AttachmentType ¶
type AttachmentType int
const ( ATTACHMENT_TYPE_IMAGE AttachmentType = iota + 1 ATTACHMENT_TYPE_VIDEO ATTACHMENT_TYPE_OTHER )
type ConditionsT ¶
type ConditionsT map[string]interface{}
type Model ¶
type Model struct { ID int64 `gorm:"primary_key" json:"id"` CreatedOn int64 `json:"created_on"` ModifiedOn int64 `json:"modified_on"` DeletedOn int64 `json:"deleted_on"` IsDel soft_delete.DeletedAt `gorm:"softDelete:flag" json:"is_del"` }
公共Model
type User ¶
type User struct { *Model Nickname string `json:"nickname"` Username string `json:"username"` Phone string `json:"phone"` Password string `json:"password"` Salt string `json:"salt"` Status int `json:"status"` Avatar string `json:"avatar"` IsAdmin bool `json:"is_admin"` }
func (*User) Format ¶
func (u *User) Format() *UserFormated
Click to show internal directories.
Click to hide internal directories.