init project

This commit is contained in:
Timi
2026-09-10 14:55:02 +08:00
parent 5fdcb7a160
commit 7fc24008cd
44 changed files with 2875 additions and 1 deletions
+98
View File
@@ -0,0 +1,98 @@
import { ImageType } from "./Model";
import type { Model } from "./Model";
import type { Attachment } from "./Attachment";
import type { Setting } from "./Setting";
import type { Role } from "./Role";
export type Gender = "MALE" | "FEMALE";
export type User = {
name: string;
nick?: string;
password?: string;
email?: string;
emailVerifyAt?: number;
phoneNo?: string;
phoneNoVerifyAt?: number;
wrapperType?: ImageType;
avatarType?: ImageType;
exp?: number;
gender?: Gender;
birthdate?: number;
qq?: string;
description?: string;
lastLoginIP?: string;
lastLoginAt?: number;
unmuteAt?: number;
unbanAt?: number;
roleList?: string[];
roleEntityList?: Role[];
permissionList?: string[];
attachmentList?: Attachment[];
settingList?: Setting[];
tempFileIdList?: string[];
muting?: boolean;
banning?: boolean;
emailVerified?: boolean;
phoneNoVerified?: boolean;
} & Model;
/** 用户资料组件使用的用户视图。 */
export type UserView = {
id?: string;
name: string;
profile: {
wrapperType?: ImageType;
avatarType?: ImageType;
exp?: number;
sex?: number;
description?: string;
attachmentList?: Attachment[];
};
};
export type UserAttachType = "AVATAR" | "WRAPPER";
export type RegisterRequest = {
name: string;
password: string;
email?: string;
};
export type LoginRequest = {
user: string;
password: string;
};
export type SmsLoginRequest = {
detailId: string;
captcha: string;
};
export type UpdatePasswordRequest = {
oldValue: string;
newValue: string;
};
// 登录返回
export type LoginResponse = {
id: string;
token: string;
expireAt: number;
user?: User;
};
export type LoginUser = {
id?: string;
token?: string;
expireAt?: number;
user?: User;
};
export type UserLevelType = {
exp: number; // 经验数值,和 UserData.exp 一样
value: number; // 经验对应等级,[0, 8]
percent: number; // 该经验在该等级的百分比 [0, 1]
nextLevelUp: number; // 下一级经验值
}