(#22)(#56) Add student info data ware. #67

Merged
MrKBear merged 1 commits from dev-mrkbear into master 2022-01-25 17:13:12 +08:00
2 changed files with 81 additions and 6 deletions
Showing only changes of commit afae6b7903 - Show all commits
+6 -6
View File
@@ -13,22 +13,22 @@ interface IDataParamSettingItem {
/** /**
* 键值是否可以获取 * 键值是否可以获取
*/ */
get: (...P: any) => this["type"] | INone; get?: ((...P: any) => this["type"]) | INone;
/** /**
* 键值是否可以设置 * 键值是否可以设置
*/ */
set: (...P: [this["type"], ...any]) => any | INone; set?: ((...P: [this["type"], ...any]) => any) | INone;
/** /**
* 是否仅为异步获取 * 是否仅为异步获取
*/ */
getAsync?: (...P: any) => Promise<this["type"]> | INone; getAsync?: ((...P: any) => Promise<this["type"]>) | INone;
/** /**
* 是否仅为异步设置 * 是否仅为异步设置
*/ */
setAsync?: (...P: [this["type"], ...any]) => Promise<any> | INone; setAsync?: ((...P: [this["type"], ...any]) => Promise<any>) | INone;
} }
/** /**
@@ -54,7 +54,7 @@ type IRegistryItem<S extends IDataParamSettingItem> = {
* 异步获取方法 * 异步获取方法
*/ */
getAsync: S["getAsync"] extends Function ? S["getAsync"] : getAsync: S["getAsync"] extends Function ? S["getAsync"] :
S["get"] extends Function ? (...param: Parameters<S["get"]>) => Promise<S["type"]> : INone; S["get"] extends ((...P: any) => S["type"]) ? (...param: Parameters<S["get"]>) => Promise<S["type"]> : INone;
/** /**
* 设置方法 * 设置方法
@@ -65,7 +65,7 @@ type IRegistryItem<S extends IDataParamSettingItem> = {
* 异步设置方法 * 异步设置方法
*/ */
setAsync: S["setAsync"] extends Function ? S["setAsync"] : setAsync: S["setAsync"] extends Function ? S["setAsync"] :
S["set"] extends Function ? (...param: Parameters<S["set"]>) => Promise<ReturnType<S["set"]>> : INone; S["set"] extends ((...P: [S["type"], ...any]) => any) ? (...param: Parameters<S["set"]>) => Promise<ReturnType<S["set"]>> : INone;
} }
/** /**
+75
View File
@@ -0,0 +1,75 @@
import { Data } from "../core/Data";
/**
* 登录状态
*/
enum LoginStatus {
}
/**
* 学生信息数据结构
*/
type IStudentInfoData = {
/**
* 学号
*/
studentId: {
type: string,
};
/**
* 教务处密码
*/
password: {
type: string
};
/**
* 身份证后六位
* 用于尝试水卡登录
*/
idCardLast6: {
type: string
};
/**
* 使用的教务处链接
*/
eduService: {
type: string
};
/**
* 用户的真实姓名
*/
actualName: {
type: string
};
/**
* 用户是否关注了公共号
*/
isSubscribeWxAccount: {
type: boolean
};
/**
* 教务处的 session
*/
eduSession: {
type: string
};
}
/**
* 学生信息
*/
class StudentInfo extends Data<IStudentInfoData> {
public override onLoad() {
}
}