Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTables ¶
Types ¶
type Case ¶
type Case struct { Id int64 `gorm:"primaryKey,autoIncrement"` // 作者 Uid int64 `gorm:"index"` Labels sqlx.JsonColumn[[]string] `gorm:"type:varchar(512)"` // Case 标题 Title string `gorm:"type=varchar(512)"` // Case 内容 Content string // 代码仓库地址 CodeRepo string // 关键字,辅助记忆,提取重点 Keywords string // 速记,口诀 Shorthand string // 亮点 Highlight string // 引导点 Guidance string Ctime int64 Utime int64 `gorm:"index"` }
type CaseDAO ¶
type CaseDAO interface { // 管理端操作 case表 Create(ctx context.Context, c Case) (int64, error) Update(ctx context.Context, c Case) error GetCaseByID(ctx context.Context, id int64) (Case, error) List(ctx context.Context, offset, limit int) ([]Case, error) Count(ctx context.Context) (int64, error) Sync(ctx context.Context, c Case) (int64, error) // 线上库 PublishCaseList(ctx context.Context, offset, limit int) ([]PublishCase, error) PublishCaseCount(ctx context.Context) (int64, error) GetPublishCase(ctx context.Context, caseId int64) (PublishCase, error) GetPubByIDs(ctx context.Context, ids []int64) ([]PublishCase, error) }
func NewCaseDao ¶
type PublishCase ¶
type PublishCase Case
func (PublishCase) TableName ¶
func (PublishCase) TableName() string
Click to show internal directories.
Click to hide internal directories.