dao

package
v0.0.0-...-def10c2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *config.Config)

Types

type AdminAccount

type AdminAccount struct{}

func (*AdminAccount) GetUserPwd

func (a *AdminAccount) GetUserPwd(ctx context.Context, username string) (*model.AdminAccountTable, error)

type Dao

type Dao struct {
	User        *User
	Account     *AdminAccount
	Subject     *Subject
	Knowledge   *Knowledge
	StudyRecord *StudyRecord
	// contains filtered or unexported fields
}
var D *Dao

type Knowledge

type Knowledge struct{}

func (*Knowledge) Del

func (k *Knowledge) Del(ctx context.Context, filters ...*mysqlstore.Filter) error

func (*Knowledge) ListBySubjectID

func (k *Knowledge) ListBySubjectID(ctx context.Context, subjectID int64, start, limit int) ([]*model.KnowledgeTable, error)

func (*Knowledge) Update

func (k *Knowledge) Update(ctx context.Context, m map[string]interface{}, filters ...*mysqlstore.Filter) error

func (*Knowledge) WillStudiedList

func (k *Knowledge) WillStudiedList(ctx context.Context, subjectID int64, kids []int64) ([]*model.KnowledgeTable, error)

type StudyRecord

type StudyRecord struct{}

func (*StudyRecord) Del

func (s *StudyRecord) Del(ctx context.Context, filters ...*mysqlstore.Filter) error

func (*StudyRecord) GetDateCount

func (s *StudyRecord) GetDateCount(ctx context.Context, uid int64, startTime string) ([]*model.DateCountItem, error)

func (*StudyRecord) GetMineStudyRank

func (s *StudyRecord) GetMineStudyRank(ctx context.Context, uid int64, startTime time.Time) (*model.UserStudyRank, error)

todo

func (*StudyRecord) GetStateNum

func (s *StudyRecord) GetStateNum(ctx context.Context, uid, subjectId int64) (int, int, error)

func (*StudyRecord) GetUserStudyTank

func (s *StudyRecord) GetUserStudyTank(ctx context.Context, startTime time.Time) ([]*model.UserStudyRank, error)

todo

func (*StudyRecord) HasStudiedKids

func (s *StudyRecord) HasStudiedKids(ctx context.Context, uid, subjectID int64) ([]int64, error)

func (*StudyRecord) ListByUid

func (s *StudyRecord) ListByUid(ctx context.Context, uid int64, start, limit int) ([]*model.StudyRecord, error)

func (*StudyRecord) TodayStudyNum

func (s *StudyRecord) TodayStudyNum(ctx context.Context, uid int64) (int64, error)

func (*StudyRecord) Update

func (s *StudyRecord) Update(ctx context.Context, m map[string]interface{}, filters ...*mysqlstore.Filter) error

func (*StudyRecord) Upsert

type Subject

type Subject struct{}

func (*Subject) Create

func (s *Subject) Create(ctx context.Context, m *model.SubjectTable) error

func (*Subject) Del

func (s *Subject) Del(ctx context.Context, id int64) error

func (*Subject) GetById

func (s *Subject) GetById(ctx context.Context, id int64, filters ...*mysqlstore.Filter) (*model.SubjectTable, error)

func (*Subject) List

func (s *Subject) List(ctx context.Context) ([]*model.SubjectTable, error)

func (*Subject) ListOps

func (s *Subject) ListOps(ctx context.Context, filter *model.SubjectOpsListReqFilter, sortStr string, offset, limit int) ([]*model.SubjectTable, int64, error)

func (*Subject) MapByIds

func (s *Subject) MapByIds(ctx context.Context, ids []int64) (map[int64]*model.SubjectTable, error)

func (*Subject) Update

func (s *Subject) Update(ctx context.Context, id int64, m map[string]interface{}) error

type User

type User struct{}

func (*User) GetByOpenid

func (u *User) GetByOpenid(ctx context.Context, openid string) (*model.UserProfileTable, error)

func (*User) GetOne

func (u *User) GetOne(ctx context.Context, uid int64) (*model.UserProfileTable, error)

func (*User) GetUserMap

func (u *User) GetUserMap(ctx context.Context, uids []int64) (map[int64]*model.UserProfileTable, error)

func (*User) Save

func (u *User) Save(ctx context.Context, models []*model.UserProfileTable) error

func (*User) StudyLastTime

func (u *User) StudyLastTime(ctx context.Context, uid int64) (time.Time, error)

func (*User) Update

func (u *User) Update(ctx context.Context, m map[string]interface{}, filters ...*mysqlstore.Filter) error

Jump to

Keyboard shortcuts

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