(#28)Add a api frame (incomplete file) #51

Merged
MrKBear merged 10 commits from dev-tamako into master 2022-01-20 23:52:35 +08:00
Showing only changes of commit 75adb97abb - Show all commits

View File

@ -0,0 +1,75 @@
import { API, HTTPMethod, IParamSetting, GeneralCallbackResult} from "../core/Api";
interface IScheduleInput {
/**
* session
*/
cookie: string;
/**
*
*/
semester: string;
}
interface IScheduleOutput {
}
interface IScheduleEvent {
/**
* session
*/
expire: GeneralCallbackResult;
/**
*
*/
unauthorized: GeneralCallbackResult;
/**
*
*/
error: GeneralCallbackResult;
/**
*
*/
badData: GeneralCallbackResult;
}
/**
* Schedule API
* session与semester
* API
* JSON文件
*/
class Schedlue extends API<IScheduleInput, IScheduleOutput, IScheduleEvent> {
public override baseUrl: string = "jwc.2333.pub/course_timetable";
public override url = "?semester=" + IScheduleInput.semester;
public override method: HTTPMethod = HTTPMethod.GET;
public override params: IParamSetting<IScheduleInput> = {
cookie: {
mapKey: "cookie",
isHeader: true
},
semester: {
mapKey: "semester",
}
};
public constructor() {
super();
this.initDebugLabel("Schedule");
this.addFailedCallBack();
}
}