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

This commit is contained in:
海洋201-胡昌宏 2022-01-20 20:17:32 +08:00
parent 1f24a59bd9
commit 75adb97abb

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();
}
}