dao

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 8 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 GORMProjectAdminDAO

type GORMProjectAdminDAO struct {
	// contains filtered or unexported fields
}

func NewGORMProjectAdminDAO

func NewGORMProjectAdminDAO(db *egorm.Component) *GORMProjectAdminDAO

func (*GORMProjectAdminDAO) ComboById added in v0.1.2

func (dao *GORMProjectAdminDAO) ComboById(ctx context.Context, cid int64) (ProjectCombo, error)

func (*GORMProjectAdminDAO) ComboSave added in v0.1.2

func (dao *GORMProjectAdminDAO) ComboSave(ctx context.Context, c ProjectCombo) (int64, error)

func (*GORMProjectAdminDAO) ComboSync added in v0.1.2

func (dao *GORMProjectAdminDAO) ComboSync(ctx context.Context, c ProjectCombo) (int64, error)

func (*GORMProjectAdminDAO) Combos added in v0.1.2

func (dao *GORMProjectAdminDAO) Combos(ctx context.Context, pid int64) ([]ProjectCombo, error)

func (*GORMProjectAdminDAO) Count

func (dao *GORMProjectAdminDAO) Count(ctx context.Context) (int64, error)

func (*GORMProjectAdminDAO) Delete added in v0.1.3

func (dao *GORMProjectAdminDAO) Delete(ctx context.Context, id int64) error

func (*GORMProjectAdminDAO) Difficulties

func (dao *GORMProjectAdminDAO) Difficulties(ctx context.Context, pid int64) ([]ProjectDifficulty, error)

func (*GORMProjectAdminDAO) DifficultyById

func (dao *GORMProjectAdminDAO) DifficultyById(ctx context.Context, id int64) (ProjectDifficulty, error)

func (*GORMProjectAdminDAO) DifficultySave

func (dao *GORMProjectAdminDAO) DifficultySave(ctx context.Context, diff ProjectDifficulty) (int64, error)

func (*GORMProjectAdminDAO) DifficultySync

func (dao *GORMProjectAdminDAO) DifficultySync(ctx context.Context, diff ProjectDifficulty) (int64, error)

func (*GORMProjectAdminDAO) GetById

func (dao *GORMProjectAdminDAO) GetById(ctx context.Context, id int64) (Project, error)

func (*GORMProjectAdminDAO) IntroductionById

func (dao *GORMProjectAdminDAO) IntroductionById(ctx context.Context, id int64) (ProjectIntroduction, error)

func (*GORMProjectAdminDAO) IntroductionSave

func (dao *GORMProjectAdminDAO) IntroductionSave(ctx context.Context, intr ProjectIntroduction) (int64, error)

func (*GORMProjectAdminDAO) IntroductionSync

func (dao *GORMProjectAdminDAO) IntroductionSync(ctx context.Context, intr ProjectIntroduction) (int64, error)

func (*GORMProjectAdminDAO) Introductions

func (dao *GORMProjectAdminDAO) Introductions(ctx context.Context, pid int64) ([]ProjectIntroduction, error)

func (*GORMProjectAdminDAO) List

func (dao *GORMProjectAdminDAO) List(ctx context.Context, offset int, limit int) ([]Project, error)

func (*GORMProjectAdminDAO) QuestionById

func (dao *GORMProjectAdminDAO) QuestionById(ctx context.Context, id int64) (ProjectQuestion, error)

func (*GORMProjectAdminDAO) QuestionSave

func (dao *GORMProjectAdminDAO) QuestionSave(ctx context.Context, que ProjectQuestion) (int64, error)

func (*GORMProjectAdminDAO) QuestionSync

func (dao *GORMProjectAdminDAO) QuestionSync(ctx context.Context, que ProjectQuestion) (int64, error)

func (*GORMProjectAdminDAO) Questions

func (dao *GORMProjectAdminDAO) Questions(ctx context.Context, pid int64) ([]ProjectQuestion, error)

func (*GORMProjectAdminDAO) ResumeById

func (dao *GORMProjectAdminDAO) ResumeById(ctx context.Context, id int64) (ProjectResume, error)

func (*GORMProjectAdminDAO) ResumeSave

func (dao *GORMProjectAdminDAO) ResumeSave(ctx context.Context, resume ProjectResume) (int64, error)

func (*GORMProjectAdminDAO) ResumeSync

func (dao *GORMProjectAdminDAO) ResumeSync(ctx context.Context, rsm ProjectResume) (int64, error)

func (*GORMProjectAdminDAO) Resumes

func (dao *GORMProjectAdminDAO) Resumes(ctx context.Context, pid int64) ([]ProjectResume, error)

func (*GORMProjectAdminDAO) Save

func (dao *GORMProjectAdminDAO) Save(ctx context.Context, prj Project) (int64, error)

func (*GORMProjectAdminDAO) Sync

func (dao *GORMProjectAdminDAO) Sync(ctx context.Context, entity Project) (int64, error)

type GORMProjectDAO

type GORMProjectDAO struct {
	// contains filtered or unexported fields
}

func (*GORMProjectDAO) BriefById added in v0.1.1

func (dao *GORMProjectDAO) BriefById(ctx context.Context, id int64) (PubProject, error)

func (*GORMProjectDAO) Combos added in v0.1.2

func (dao *GORMProjectDAO) Combos(ctx context.Context, pid int64) ([]PubProjectCombo, error)

func (*GORMProjectDAO) Difficulties

func (dao *GORMProjectDAO) Difficulties(ctx context.Context, pid int64) ([]PubProjectDifficulty, error)

func (*GORMProjectDAO) GetById

func (dao *GORMProjectDAO) GetById(ctx context.Context, id int64) (PubProject, error)

func (*GORMProjectDAO) Introductions

func (dao *GORMProjectDAO) Introductions(ctx context.Context, pid int64) ([]PubProjectIntroduction, error)

func (*GORMProjectDAO) List

func (dao *GORMProjectDAO) List(ctx context.Context, offset int, limit int) ([]PubProject, error)

func (*GORMProjectDAO) Questions

func (dao *GORMProjectDAO) Questions(ctx context.Context, pid int64) ([]PubProjectQuestion, error)

func (*GORMProjectDAO) Resumes

func (dao *GORMProjectDAO) Resumes(ctx context.Context, pid int64) ([]PubProjectResume, error)

type Project

type Project struct {
	Id           int64  `gorm:"primaryKey,autoIncrement"`
	Title        string `gorm:"type:varchar(256)"`
	Overview     string
	SystemDesign string
	GithubRepo   string `gorm:"type:varchar(512)"`
	GiteeRepo    string `gorm:"type:varchar(512)"`
	// 目前来说项目关联的八股文题集,并不需要额外的信息
	RefQuestionSet int64
	Status         uint8
	SN             string                    `gorm:"column:sn;type:varchar(255)"`
	Labels         sqlx.JsonColumn[[]string] `gorm:"type:varchar(512)"`
	ProductSPU     sql.NullString            `gorm:"type:varchar(255);comment:商品的SPU SN"`
	CodeSPU        sql.NullString            `gorm:"type:varchar(255);comment:作为兑换码的SPU SN"`
	Desc           string
	Utime          int64
	Ctime          int64
}

type ProjectAdminDAO

type ProjectAdminDAO interface {
	Save(ctx context.Context, prj Project) (int64, error)
	List(ctx context.Context, offset int, limit int) ([]Project, error)
	Count(ctx context.Context) (int64, error)
	GetById(ctx context.Context, id int64) (Project, error)
	// Sync 制作库同步到线上库
	Sync(ctx context.Context, entity Project) (int64, error)

	ResumeSave(ctx context.Context, resume ProjectResume) (int64, error)
	Resumes(ctx context.Context, pid int64) ([]ProjectResume, error)
	ResumeById(ctx context.Context, id int64) (ProjectResume, error)
	ResumeSync(ctx context.Context, rsm ProjectResume) (int64, error)

	DifficultySave(ctx context.Context, diff ProjectDifficulty) (int64, error)
	DifficultySync(ctx context.Context, diff ProjectDifficulty) (int64, error)
	Difficulties(ctx context.Context, pid int64) ([]ProjectDifficulty, error)
	DifficultyById(ctx context.Context, id int64) (ProjectDifficulty, error)

	QuestionSave(ctx context.Context, entity ProjectQuestion) (int64, error)
	QuestionById(ctx context.Context, id int64) (ProjectQuestion, error)
	Questions(ctx context.Context, pid int64) ([]ProjectQuestion, error)
	QuestionSync(ctx context.Context, que ProjectQuestion) (int64, error)

	IntroductionSave(ctx context.Context, intr ProjectIntroduction) (int64, error)
	IntroductionById(ctx context.Context, id int64) (ProjectIntroduction, error)
	IntroductionSync(ctx context.Context, intr ProjectIntroduction) (int64, error)
	Introductions(ctx context.Context, pid int64) ([]ProjectIntroduction, error)
	ComboSave(ctx context.Context, c ProjectCombo) (int64, error)
	ComboById(ctx context.Context, cid int64) (ProjectCombo, error)
	ComboSync(ctx context.Context, c ProjectCombo) (int64, error)
	Combos(ctx context.Context, pid int64) ([]ProjectCombo, error)
	Delete(ctx context.Context, id int64) error
}

type ProjectCombo added in v0.1.2

type ProjectCombo struct {
	Id      int64  `gorm:"primaryKey,autoIncrement"`
	Pid     int64  `gorm:"index"`
	Title   string `gorm:"type:varchar(256)"`
	Content string
	Status  uint8
	Utime   int64
	Ctime   int64
}

type ProjectDAO

type ProjectDAO interface {
	List(ctx context.Context, offset int, limit int) ([]PubProject, error)
	GetById(ctx context.Context, id int64) (PubProject, error)
	BriefById(ctx context.Context, id int64) (PubProject, error)
	Resumes(ctx context.Context, pid int64) ([]PubProjectResume, error)
	Difficulties(ctx context.Context, pid int64) ([]PubProjectDifficulty, error)
	Questions(ctx context.Context, pid int64) ([]PubProjectQuestion, error)
	Introductions(ctx context.Context, pid int64) ([]PubProjectIntroduction, error)
	Combos(ctx context.Context, pid int64) ([]PubProjectCombo, error)
}

func NewGORMProjectDAO

func NewGORMProjectDAO(db *egorm.Component) ProjectDAO

type ProjectDifficulty

type ProjectDifficulty struct {
	Id    int64  `gorm:"primaryKey,autoIncrement"`
	Pid   int64  `gorm:"index"`
	Title string `gorm:"type:varchar(256)"`
	// 这是面试时候的介绍这个项目难点
	Content  string `json:"content,omitempty"`
	Analysis string
	Status   uint8
	Utime    int64
	Ctime    int64
}

type ProjectIntroduction

type ProjectIntroduction struct {
	Id       int64 `gorm:"primaryKey,autoIncrement"`
	Pid      int64 `gorm:"index"`
	Role     uint8
	Content  string
	Analysis string
	Status   uint8
	Utime    int64
	Ctime    int64
}

type ProjectQuestion

type ProjectQuestion struct {
	Id       int64 `gorm:"primaryKey,autoIncrement"`
	Pid      int64 `gorm:"index"`
	Title    string
	Analysis string
	Answer   string
	Status   uint8
	Utime    int64
	Ctime    int64
}

type ProjectResume

type ProjectResume struct {
	Id       int64 `gorm:"primaryKey,autoIncrement"`
	Pid      int64 `gorm:"index"`
	Role     uint8
	Content  string
	Analysis string
	Status   uint8
	Utime    int64
	Ctime    int64
}

type PubProject

type PubProject Project

type PubProjectCombo added in v0.1.2

type PubProjectCombo ProjectCombo

type PubProjectDifficulty

type PubProjectDifficulty ProjectDifficulty

type PubProjectIntroduction

type PubProjectIntroduction ProjectIntroduction

type PubProjectQuestion

type PubProjectQuestion ProjectQuestion

type PubProjectResume

type PubProjectResume ProjectResume

Jump to

Keyboard shortcuts

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