Documentation
¶
Index ¶
- Constants
- type AddClassReq
- type CheckClassIdIsInRecycledBinReq
- type CheckSCIdsExistReq
- type Class
- type ClassInfo
- type DeleteClassReq
- type GetAllClassesReq
- type GetAllClassesResp
- type GetAllSchoolClassInfosReq
- type GetAllSchoolClassInfosResp
- type GetClassInfoForGraduateStudentReq
- type GetClassInfoForGraduateStudentResp
- type GetClassInfosForUndergraduateReq
- type GetClassInfosForUndergraduateResp
- type GetRecycledIdsReq
- type GetRecycledIdsResp
- type GetSpecificClassInfoReq
- type GetSpecificClassInfoResp
- type Jxb
- type RecoverClassFromRecycleBinReq
- type SaveClassReq
- type StudentCourse
- type UpdateClassReq
- type WrapClassInfo
Constants ¶
View Source
const ( ClassInfoTableName string = "class_info" StudentCourseTableName string = "student_course" JxbTableName string = "jxb" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddClassReq ¶
type AddClassReq struct {
StuID string
Year string
Semester string
ClassInfo *ClassInfo
Sc *StudentCourse
}
type CheckSCIdsExistReq ¶
type ClassInfo ¶
type ClassInfo struct {
ID string `gorm:"type:varchar(150);primaryKey;column:id" json:"id"` //集合了课程信息的字符串,便于标识(课程ID)
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
//ClassId string `gorm:"column:class_id" json:"class_id"` //课程编号
JxbId string `gorm:"type:varchar(100);column:jxb_id" json:"jxb_id"` //教学班ID
Day int64 `gorm:"column:day;not null" json:"day"` //星期几
Teacher string `gorm:"type:varchar(50);;column:teacher;not null" json:"teacher"` //任课教师
Where string `gorm:"type:varchar(50);column:where;not null" json:"where"` //上课地点
ClassWhen string `gorm:"type:varchar(10);column:class_when;not null" json:"class_when"` //上课是第几节(如1-2,3-4)
WeekDuration string `gorm:"type:varchar(20);column:week_duration;not null" json:"week_duration"` //上课的周数
Classname string `gorm:"type:varchar(20);column:class_name;not null" json:"classname"` //课程名称
Credit float64 `gorm:"column:credit;default:1.0" json:"credit"` //学分
Weeks int64 `gorm:"column:weeks;not null" json:"weeks"` //哪些周
Semester string `gorm:"type:varchar(1);column:semester;not null" json:"semester"` //学期
Year string `gorm:"type:varchar(5);column:year;not null" json:"year"` //学年
}
func (*ClassInfo) SearchWeek ¶
type DeleteClassReq ¶
type GetAllClassesReq ¶
type GetAllClassesResp ¶
type GetAllClassesResp struct {
ClassInfos []*ClassInfo
}
type GetAllSchoolClassInfosResp ¶
type GetAllSchoolClassInfosResp struct {
ClassInfos []*ClassInfo
}
type GetClassInfoForGraduateStudentResp ¶
type GetClassInfoForGraduateStudentResp struct {
ClassInfos []*ClassInfo
StudentCourses []*StudentCourse
}
type GetClassInfosForUndergraduateResp ¶
type GetClassInfosForUndergraduateResp struct {
ClassInfos []*ClassInfo
StudentCourses []*StudentCourse
}
type GetRecycledIdsReq ¶
type GetRecycledIdsResp ¶
type GetRecycledIdsResp struct {
Ids []string
}
type GetSpecificClassInfoReq ¶
type GetSpecificClassInfoResp ¶
type GetSpecificClassInfoResp struct {
ClassInfo *ClassInfo
}
type Jxb ¶
type Jxb struct {
JxbId string `gorm:"type:varchar(100);column:jxb_id;uniqueIndex:idx_jxb,priority:1" json:"jxb_id"` // 教学班ID
StuId string `gorm:"type:varchar(20);column:stu_id;uniqueIndex:idx_jxb,priority:2" json:"stu_id"` // 学号
}
Jxb 用来存取教学班
type SaveClassReq ¶
type SaveClassReq struct {
StuID string
Year string
Semester string
ClassInfos []*ClassInfo
Scs []*StudentCourse
}
type StudentCourse ¶
type StudentCourse struct {
StuID string `gorm:"type:varchar(20);column:stu_id;not null;uniqueIndex:idx_sc,priority:3" json:"stu_id"` //学号
ClaID string `gorm:"type:varchar(120);column:cla_id;not null;uniqueIndex:idx_sc,priority:4" json:"cla_id"` //课程ID
Year string `gorm:"type:varchar(5);column:year;not null;uniqueIndex:idx_sc,priority:1" json:"year"` //学年
Semester string `gorm:"type:varchar(1);column:semester;not null;uniqueIndex:idx_sc,priority:2" json:"semester"` //学期
IsManuallyAdded bool `gorm:"column:is_manually_added;default:false" json:"is_manually_added"` //是否为手动添加
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
}
func (*StudentCourse) BeforeCreate ¶
func (sc *StudentCourse) BeforeCreate(tx *gorm.DB) (err error)
func (*StudentCourse) BeforeUpdate ¶
func (sc *StudentCourse) BeforeUpdate(tx *gorm.DB) (err error)
func (*StudentCourse) TableName ¶
func (sc *StudentCourse) TableName() string
type UpdateClassReq ¶
type WrapClassInfo ¶
type WrapClassInfo []*ClassInfo
func (*WrapClassInfo) ConvertToClass ¶
func (w *WrapClassInfo) ConvertToClass(week int64) ([]*Class, []string)
Click to show internal directories.
Click to hide internal directories.