Documentation ¶
Index ¶
- Variables
- func BuildSectionsStr(s []Section) string
- func BuildStyle() string
- func BuildWeeksStr(w []int) string
- type AIScheduleUser
- func (u *AIScheduleUser) AddCourses(id int64, courses []AppCourse) (err error)
- func (u *AIScheduleUser) CreateTable(name string, isCurrent bool) (id int64, err error)
- func (u *AIScheduleUser) DeleteTable(id int64) (err error)
- func (u *AIScheduleUser) EditTable(name string, id int64, setting TableSetting) (err error)
- func (u *AIScheduleUser) FeedbackTable(feedbackType int64, tbID int64) (err error)
- func (u *AIScheduleUser) GetTable(id int64) (courses []AppCourse, err error)
- func (u *AIScheduleUser) GetTables() (tables []Table, err error)
- func (u *AIScheduleUser) ParseTable(tbID int64, html string) (schedule Schedule, err error)
- func (u *AIScheduleUser) SetDeviceID(deviceID string) *AIScheduleUser
- func (u *AIScheduleUser) SetUserID(userID int64) *AIScheduleUser
- func (u *AIScheduleUser) ShareTable(ctId int64) (url string, duetime int64, err error)
- type AddRet
- type AppCourse
- type ChangeRet
- type Course
- type CreateRet
- type GetCourseRet
- type ParseRet
- type Ret
- type Schedule
- type ScheduleStyle
- type Section
- type ShareRet
- type Table
- type TableSetting
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AISchedulParserURL = "https://open-schedule.ai.xiaomi.com/api/schedule/parser" // AIScheduleTBID = "45625" AIScheduleTableURL = "https://i.ai.mi.com/course-multi/table" AIScheduleTablesURL = "https://i.ai.mi.com/course-multi/tables" AIScheduleFeedbackURL = "https://open-schedule.ai.xiaomi.com/api/feedback" AIScheduleCourseURL = "https://i.ai.mi.com/course-multi/courseInfos" AIScheduleImportURL = "https://i.ai.mi.com/h5/precache/ai-schedule" // 默认课表风格 StyleList = []ScheduleStyle{{Color: "#00A6F2", Background: "#E5F4FF"}, {Color: "#FC6B50", Background: "#FDEBDE"}, {Color: "#3CB3C8", Background: "#DEFBF8"}, {Color: "#7D7AEA", Background: "#EDEDFF"}, {Color: "#FF9900", Background: "#FCEBCD"}, {Color: "#EF5B75", Background: "#FFEFF0"}, {Color: "#5B8EFF", Background: "#EAF1FF"}, {Color: "#F067BB", Background: "#FFEDF8"}, {Color: "#29BBAA", Background: "#E2F8F3"}, {Color: "#CBA713", Background: "#FFF8C8"}, {Color: "#B967E3", Background: "#F9EDFF"}, {Color: "#6E8ADA", Background: "#F3F2FD"}, {Color: "#00A6F2", Background: "#E5F4FF"}, {Color: "#FC6B50", Background: "#FDEBDE"}, {Color: "#3CB3C8", Background: "#DEFBF8"}} )
Functions ¶
func BuildSectionsStr ¶
func BuildStyle ¶
func BuildStyle() string
func BuildWeeksStr ¶
Types ¶
type AIScheduleUser ¶
func (*AIScheduleUser) AddCourses ¶
func (u *AIScheduleUser) AddCourses(id int64, courses []AppCourse) (err error)
AddCourses 课表添加课程
func (*AIScheduleUser) CreateTable ¶
func (u *AIScheduleUser) CreateTable(name string, isCurrent bool) (id int64, err error)
CreateTable 创建课表
func (*AIScheduleUser) DeleteTable ¶
func (u *AIScheduleUser) DeleteTable(id int64) (err error)
DeleteTable 删除课表
func (*AIScheduleUser) EditTable ¶
func (u *AIScheduleUser) EditTable(name string, id int64, setting TableSetting) (err error)
EditTable 修改课表
func (*AIScheduleUser) FeedbackTable ¶
func (u *AIScheduleUser) FeedbackTable(feedbackType int64, tbID int64) (err error)
FeedbackTable 分享课表导入功能 theType {1: "完美", 2: "部分错误", 3: "不可用"}
func (*AIScheduleUser) GetTable ¶
func (u *AIScheduleUser) GetTable(id int64) (courses []AppCourse, err error)
GetTables 获取课程列表
func (*AIScheduleUser) GetTables ¶
func (u *AIScheduleUser) GetTables() (tables []Table, err error)
GetTables 获取课程列表
func (*AIScheduleUser) ParseTable ¶
func (u *AIScheduleUser) ParseTable(tbID int64, html string) (schedule Schedule, err error)
ParseTable 解析课表
func (*AIScheduleUser) SetDeviceID ¶
func (u *AIScheduleUser) SetDeviceID(deviceID string) *AIScheduleUser
SetDeviceID 设置密码
func (*AIScheduleUser) SetUserID ¶
func (u *AIScheduleUser) SetUserID(userID int64) *AIScheduleUser
SetUserID 设置用户ID
func (*AIScheduleUser) ShareTable ¶
func (u *AIScheduleUser) ShareTable(ctId int64) (url string, duetime int64, err error)
ShareTable 分享课表
type AppCourse ¶
type AppCourse struct { AttendTime int64 `json:"attendTime"` CreateTime int64 `json:"createTime"` CtID int64 `json:"ctId"` Day int64 `json:"day"` Extend string `json:"extend"` ID int64 `json:"id"` Name string `json:"name"` Position string `json:"position"` SectionList []interface{} `json:"sectionList"` Sections string `json:"sections"` Style string `json:"style"` Teacher string `json:"teacher"` UpdateTime int64 `json:"updateTime"` Weeks string `json:"weeks"` }
func ScheduleConvertAppCourse ¶
ScheduleConvertAppCourse 解析出的课表格式转换为导入的格式
type GetCourseRet ¶
type Ret ¶
type Ret struct { Code int64 `json:"code"` Data interface{} `json:"data"` Desc string `json:"desc"` }
Ret 返回结构
type Schedule ¶
type Schedule struct { CourseInfos []struct { Day int `json:"day"` Name string `json:"name"` Position string `json:"position"` Sections []Section `json:"sections"` Teacher string `json:"teacher"` Weeks []int `json:"weeks"` } `json:"courseInfos"` SectionTimes []struct { EndTime string `json:"endTime"` Section int `json:"section"` StartTime string `json:"startTime"` } `json:"sectionTimes"` }
type ScheduleStyle ¶
ScheduleStyle 课表风格
type Table ¶
type Table struct { Courses []interface{} `json:"courses"` Current int64 `json:"current"` ID int64 `json:"id"` Name string `json:"name"` Setting struct { AfternoonNum int64 `json:"afternoonNum"` Confirm int64 `json:"confirm"` CreateTime int64 `json:"createTime"` Extend string `json:"extend"` ID int64 `json:"id"` IsWeekend int64 `json:"isWeekend"` MorningNum int64 `json:"morningNum"` NightNum int64 `json:"nightNum"` PresentWeek int64 `json:"presentWeek"` School string `json:"school"` SectionTimes string `json:"sectionTimes"` Speak int64 `json:"speak"` StartSemester string `json:"startSemester"` TotalWeek int64 `json:"totalWeek"` UpdateTime int64 `json:"updateTime"` WeekStart int64 `json:"weekStart"` } `json:"setting"` }
type TableSetting ¶
type TableSetting struct { AfternoonNum int64 `json:"afternoonNum"` Extend string `json:"extend"` ID int64 `json:"id"` IsWeekend int64 `json:"isWeekend"` MorningNum int64 `json:"morningNum"` NightNum int64 `json:"nightNum"` PresentWeek int64 `json:"presentWeek"` School string `json:"school"` Sections string `json:"sections"` Speak int64 `json:"speak"` StartSemester string `json:"startSemester"` TotalWeek int64 `json:"totalWeek"` WeekStart int64 `json:"weekStart"` }
Click to show internal directories.
Click to hide internal directories.