Documentation
¶
Index ¶
- Constants
- func CalculateSwapCandidates(config InputConfig) (*courseManager, error)
- func CourseSwapCli()
- func DeleteSwapHistory(storageType string, id int32) error
- func ExecuteSwap(config InputConfig, target *CourseInfo) error
- func GetSwapHistory(storageType string) ([]swagger.ApiCourseSwapRequestInfo, error)
- func GetTeacherList(path string) ([]string, error)
- func NewCourseParser(path string) *courseParser
- func SaveCache(cache InputConfig)
- type CloudRepo
- type CourseInfo
- type CourseSwapRepo
- type CourseSwapRequestModel
- type InputConfig
- type LocalRepo
Constants ¶
View Source
const ( WeekTypeAll = iota WeekTypeOdd WeekTypeEven )
--------------------------------------------------
View Source
const (
CourseNumMax = 8
)
Variables ¶
This section is empty.
Functions ¶
func CalculateSwapCandidates ¶ added in v0.0.6
func CalculateSwapCandidates(config InputConfig) (*courseManager, error)
计算换课候选列表
func CourseSwapCli ¶ added in v0.0.6
func CourseSwapCli()
func DeleteSwapHistory ¶ added in v0.0.6
删除换课记录
func ExecuteSwap ¶ added in v0.0.6
func ExecuteSwap(config InputConfig, target *CourseInfo) error
保存换课记录
func GetSwapHistory ¶ added in v0.0.6
func GetSwapHistory(storageType string) ([]swagger.ApiCourseSwapRequestInfo, error)
获取换课历史记录
func NewCourseParser ¶
func NewCourseParser(path string) *courseParser
func SaveCache ¶ added in v0.0.6
func SaveCache(cache InputConfig)
Types ¶
type CloudRepo ¶ added in v0.0.6
type CloudRepo struct {
// contains filtered or unexported fields
}
func NewCloudRepo ¶ added in v0.0.6
func NewCloudRepo() *CloudRepo
func (*CloudRepo) AddCourseSwapRequest ¶ added in v0.0.6
func (*CloudRepo) DeleteCourseSwapRequest ¶ added in v0.0.6
func (*CloudRepo) GetCourseSwapRequestList ¶ added in v0.0.6
type CourseInfo ¶ added in v0.0.6
type CourseInfo struct {
ClassName string //课名
ClassRoomName string //班级名
ClassNum int
Date time.Time
Teacher string
WeekType int // 0:All, 1:Odd, 2:Even
}
实在词穷,courseInfo表示课程安排,如20240101一年1班的第1节课 而classInfo表示课程表中的一节课,如周三一年1班的第1节课
func (*CourseInfo) String ¶ added in v0.0.6
func (c *CourseInfo) String() string
type CourseSwapRepo ¶ added in v0.0.6
type CourseSwapRequestModel ¶ added in v0.0.6
type CourseSwapRequestModel struct {
ID int32 `gorm:"primaryKey;autoIncrement"`
SrcTeacher string
SrcDate string
SrcCourseNum int32
SrcCourse string
SrcClass string
DstTeacher string
DstDate string
DstCourseNum int32
DstCourse string
DstClass string
CreateTime string
Status int32
}
func (CourseSwapRequestModel) TableName ¶ added in v0.0.6
func (CourseSwapRequestModel) TableName() string
type InputConfig ¶ added in v0.0.6
type InputConfig struct {
Path string `json:"path"`
Teacher string `json:"teacher"`
Date string `json:"date"`
CourseNum int `json:"courseNum"`
StorageType string `json:"storageType"`
IsOddWeek bool `json:"isOddWeek"`
}
func InputParams ¶ added in v0.0.6
func InputParams() (config InputConfig, err error)
func LoadCache ¶ added in v0.0.6
func LoadCache() InputConfig
type LocalRepo ¶ added in v0.0.6
type LocalRepo struct {
// contains filtered or unexported fields
}
func NewLocalRepo ¶ added in v0.0.6
func NewLocalRepo() *LocalRepo
func (*LocalRepo) AddCourseSwapRequest ¶ added in v0.0.6
func (*LocalRepo) DeleteCourseSwapRequest ¶ added in v0.0.6
func (*LocalRepo) GetCourseSwapRequestList ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.