dao

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTables

func InitTables(db *egorm.Component) error

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"`
}

func (Case) TableName

func (Case) TableName() string

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

func NewCaseDao(db *egorm.Component) CaseDAO

type PublishCase

type PublishCase Case

func (PublishCase) TableName

func (PublishCase) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL