Documentation
¶
Index ¶
- Constants
- Variables
- func NewDB(c *conf.Data, logfile *os.File) *gorm.DB
- func NewRedisDB(c *conf.Data) *redis.Client
- func NewTransaction(d *Data) biz.Transaction
- type ClassInfoCacheRepo
- func (c ClassInfoCacheRepo) AddClaInfosToCache(ctx context.Context, key string, classInfos []*model.ClassInfo) error
- func (c ClassInfoCacheRepo) DeleteClassInfoFromCache(ctx context.Context, classInfosKey ...string) error
- func (c ClassInfoCacheRepo) GetClassInfosFromCache(ctx context.Context, key string) ([]*model.ClassInfo, error)
- type ClassInfoDBRepo
- func (c ClassInfoDBRepo) AddClassInfoToDB(ctx context.Context, classInfo *model.ClassInfo) error
- func (c ClassInfoDBRepo) DeleteClassInfoInDB(ctx context.Context, ID string) error
- func (c ClassInfoDBRepo) GetClassInfoFromDB(ctx context.Context, ID string) (*model.ClassInfo, error)
- func (c ClassInfoDBRepo) GetClassInfos(ctx context.Context, stuId, xnm, xqm string) ([]*model.ClassInfo, error)
- func (c ClassInfoDBRepo) SaveClassInfosToDB(ctx context.Context, classInfos []*model.ClassInfo) error
- func (c ClassInfoDBRepo) UpdateClassInfoInDB(ctx context.Context, classInfo *model.ClassInfo) error
- type Data
- type JxbDBRepo
- type StudentAndCourseCacheRepo
- func (s StudentAndCourseCacheRepo) CheckRecycleIdIsExist(ctx context.Context, RecycledBinKey, classId string) bool
- func (s StudentAndCourseCacheRepo) GetRecycledClassIds(ctx context.Context, key string) ([]string, error)
- func (s StudentAndCourseCacheRepo) RecycleClassId(ctx context.Context, recycleBinKey string, classId ...string) error
- func (s StudentAndCourseCacheRepo) RemoveClassFromRecycledBin(ctx context.Context, RecycledBinKey, classId string) error
- type StudentAndCourseDBRepo
- func (s StudentAndCourseDBRepo) CheckExists(ctx context.Context, xnm, xqm, stuId, classId string) bool
- func (s StudentAndCourseDBRepo) DeleteStudentAndCourseInDB(ctx context.Context, stuID, year, semester string, claID []string) error
- func (s StudentAndCourseDBRepo) GetClassNum(ctx context.Context, stuID, year, semester string, isManuallyAdded bool) (num int64, err error)
- func (s StudentAndCourseDBRepo) SaveManyStudentAndCourseToDB(ctx context.Context, scs []*model.StudentCourse) error
- func (s StudentAndCourseDBRepo) SaveStudentAndCourseToDB(ctx context.Context, sc *model.StudentCourse) error
Constants ¶
View Source
const ( Expiration = 5 * 24 * time.Hour RecycleExpiration = 2 * 30 * 24 * time.Hour BlackListExpiration = 1 * time.Minute )
View Source
const RedisNull = "redis_Null"
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewData, NewDB, NewRedisDB, NewStudentAndCourseDBRepo, NewStudentAndCourseCacheRepo, NewClassInfoDBRepo, NewClassInfoCacheRepo, NewTransaction, NewJxbDBRepo, )
ProviderSet is data providers.
Functions ¶
Types ¶
type ClassInfoCacheRepo ¶
type ClassInfoCacheRepo struct {
// contains filtered or unexported fields
}
func NewClassInfoCacheRepo ¶
func NewClassInfoCacheRepo(rdb *redis.Client, logger classLog.Clogger) *ClassInfoCacheRepo
func (ClassInfoCacheRepo) AddClaInfosToCache ¶
func (c ClassInfoCacheRepo) AddClaInfosToCache(ctx context.Context, key string, classInfos []*model.ClassInfo) error
AddClaInfosToCache 将整个课表转换成json格式,然后存到缓存中去
func (ClassInfoCacheRepo) DeleteClassInfoFromCache ¶
func (c ClassInfoCacheRepo) DeleteClassInfoFromCache(ctx context.Context, classInfosKey ...string) error
func (ClassInfoCacheRepo) GetClassInfosFromCache ¶
type ClassInfoDBRepo ¶
type ClassInfoDBRepo struct {
// contains filtered or unexported fields
}
func NewClassInfoDBRepo ¶
func NewClassInfoDBRepo(data *Data, logger classLog.Clogger) *ClassInfoDBRepo
func (ClassInfoDBRepo) AddClassInfoToDB ¶
func (ClassInfoDBRepo) DeleteClassInfoInDB ¶
func (c ClassInfoDBRepo) DeleteClassInfoInDB(ctx context.Context, ID string) error
func (ClassInfoDBRepo) GetClassInfoFromDB ¶
func (ClassInfoDBRepo) GetClassInfos ¶
func (ClassInfoDBRepo) SaveClassInfosToDB ¶
func (ClassInfoDBRepo) UpdateClassInfoInDB ¶
type JxbDBRepo ¶
type JxbDBRepo struct {
// contains filtered or unexported fields
}
func (*JxbDBRepo) FindStuIdsByJxbId ¶
type StudentAndCourseCacheRepo ¶
type StudentAndCourseCacheRepo struct {
// contains filtered or unexported fields
}
func NewStudentAndCourseCacheRepo ¶
func NewStudentAndCourseCacheRepo(rdb *redis.Client, logger classLog.Clogger) *StudentAndCourseCacheRepo
func (StudentAndCourseCacheRepo) CheckRecycleIdIsExist ¶
func (s StudentAndCourseCacheRepo) CheckRecycleIdIsExist(ctx context.Context, RecycledBinKey, classId string) bool
func (StudentAndCourseCacheRepo) GetRecycledClassIds ¶
func (StudentAndCourseCacheRepo) RecycleClassId ¶
func (StudentAndCourseCacheRepo) RemoveClassFromRecycledBin ¶
func (s StudentAndCourseCacheRepo) RemoveClassFromRecycledBin(ctx context.Context, RecycledBinKey, classId string) error
type StudentAndCourseDBRepo ¶
type StudentAndCourseDBRepo struct {
// contains filtered or unexported fields
}
func NewStudentAndCourseDBRepo ¶
func NewStudentAndCourseDBRepo(data *Data, logger classLog.Clogger) *StudentAndCourseDBRepo
func (StudentAndCourseDBRepo) CheckExists ¶
func (s StudentAndCourseDBRepo) CheckExists(ctx context.Context, xnm, xqm, stuId, classId string) bool
func (StudentAndCourseDBRepo) DeleteStudentAndCourseInDB ¶
func (StudentAndCourseDBRepo) GetClassNum ¶
func (StudentAndCourseDBRepo) SaveManyStudentAndCourseToDB ¶
func (s StudentAndCourseDBRepo) SaveManyStudentAndCourseToDB(ctx context.Context, scs []*model.StudentCourse) error
func (StudentAndCourseDBRepo) SaveStudentAndCourseToDB ¶
func (s StudentAndCourseDBRepo) SaveStudentAndCourseToDB(ctx context.Context, sc *model.StudentCourse) error
Click to show internal directories.
Click to hide internal directories.