Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminUser ¶ added in v0.3.0
type AdminUser struct { Model Username *string `gorm:"type:string;uniqueIndex;comment:用户名"` Password string `gorm:"type:string;comment:密码"` Email *string `gorm:"type:string;uniqueIndex;comment:邮箱"` Nickname *string `gorm:"type:string;default:'';comment:昵称"` Avatar *string `gorm:"type:string;default:'';comment:头像"` }
type TestArticle ¶
type TestArticle struct { Model Title string `gorm:"type:string;default:'';not null;commit:标题"` Content *string `gorm:"type:text;commit:内容"` CategoryID *uint Category *TestCategory `gorm:"foreignKey:CategoryID"` UserID *uint User *TestUser `gorm:"foreignKey:UserID"` Comments []TestComment `gorm:"foreignKey:ArticleID"` }
type TestCategory ¶
type TestCategory struct { Model Name string `gorm:"type:string;default:'';not null;comment:类别名称"` Order uint `gorm:"type:uint;default:0;not null;commit:排序"` ParentID *uint Parent *TestCategory `gorm:"foreignKey:ParentID"` Children []TestCategory `gorm:"foreignKey:ParentID"` UserID *uint User *TestUser `gorm:"foreignKey:UserID"` Articles []TestArticle `gorm:"foreignKey:CategoryID"` }
type TestComment ¶
type TestComment struct { Model Content *string `gorm:"type:text;comment:评论内容"` UserID *uint User *TestUser `gorm:"foreignKey:UserID"` ArticleID *uint Article *TestArticle `gorm:"foreignKey:ArticleID"` ParentID *uint Parent *TestComment `gorm:"foreignKey:ParentID"` Children []TestComment `gorm:"foreignKey:ParentID"` }
type TestUser ¶
type TestUser struct { Model Username *string `gorm:"type:string;uniqueIndex;comment:用户名"` Password string `gorm:"type:string;comment:密码"` Email *string `gorm:"type:string;uniqueIndex;comment:邮箱"` UserInfo TestUserInfo `gorm:"foreignKey:UserID"` Categories []TestCategory `gorm:"foreignKey:UserID"` Articles []TestArticle `gorm:"foreignKey:UserID"` Comments []TestComment `gorm:"foreignKey:UserID"` }
type TestUserInfo ¶
type User ¶
type User struct { Model Username *string `gorm:"type:string;uniqueIndex;comment:用户名"` Password string `gorm:"type:string;comment:密码"` Email *string `gorm:"type:string;uniqueIndex;comment:邮箱"` Nickname *string `gorm:"type:string;default:'';comment:昵称"` Avatar *string `gorm:"type:string;default:'';comment:头像"` }
Click to show internal directories.
Click to hide internal directories.