Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comment ¶
type Comment struct { ID int64 `gorm:"primaryKey;column:id;type:bigint;not null"` // 评论自增 ID PostID int64 `gorm:"index:idx_fk_post_id;column:post_id;type:bigint;not null"` // 文本自增 ID Post Post `gorm:"joinForeignKey:post_id;foreignKey:id"` Content string `gorm:"column:content;type:text;not null"` // 评论内容 Nickname string `gorm:"column:nickname;type:varchar(20);not null"` // 评论人昵称 CreateTime time.Time `gorm:"column:create_time;type:timestamp"` // 创建时间 UpdateTime time.Time `gorm:"column:update_time;type:timestamp"` // 更新时间 }
Comment [...]
func (*Comment) ConvertFromDTO ¶
type Comments ¶
type Comments []*Comment
func (Comments) ConvertToDTO ¶
func (po Comments) ConvertToDTO(password string) ([]*core.CommentInfo, error)
type Condetion ¶
type Condetion struct {
// contains filtered or unexported fields
}
自定义sql查询
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option overrides behavior of Connect.
type Post ¶
type Post struct { ID int64 `gorm:"primaryKey;column:id;type:bigint;not null"` // 文本自增 ID Content string `gorm:"column:content;type:text;not null"` // 文本内容 Lang int16 `gorm:"column:lang;type:smallint;not null;default:0"` // 文本语言 Passwd string `gorm:"column:passwd;type:varchar(255)"` // 密码 Nickname string `gorm:"column:nickname;type:varchar(20);not null"` // 文本作者昵称 IsDisposable bool `gorm:"column:is_disposable;type:tinyint(1);not null;default:0"` // 是否阅后即焚 CreateTime time.Time `gorm:"column:create_time;type:timestamp"` // 创建时间 UpdateTime time.Time `gorm:"column:update_time;type:timestamp"` // 更新时间 }
Post [...]
func (*Post) ConvertFromDTO ¶
Click to show internal directories.
Click to hide internal directories.