This commit is contained in:
Timi
2026-07-30 18:28:25 +08:00
parent 8b24804b22
commit f0d1090932
21 changed files with 915 additions and 268 deletions
+48 -47
View File
@@ -1,79 +1,80 @@
import { ImageType, Model } from "./Model";
import { AttachmentView } from "./Attachment";
import { Attachment } from "./Attachment";
import type { Setting } from "./Setting";
export type User = {
name: string;
nick?: string;
password?: string;
email?: string;
emailVerifyAt: number;
unmuteAt?: number;
unbanAt?: number;
} & Model;
export type UserView = {
profile: UserProfileView
} & User;
export enum UserAttachType {
AVATAR,
WRAPPER,
DEFAULT_AVATAR,
DEFAULT_WRAPPER,
}
export type UserProfile = {
userId: number;
avatarType: ImageType;
wrapperType: ImageType;
exp: number;
emailVerifyAt?: number;
phoneNo?: string;
phoneNoVerifyAt?: number;
wrapperType?: ImageType;
avatarType?: ImageType;
exp?: number;
sex?: number;
birthdate?: number;
qq?: string;
description: string;
description?: string;
lastLoginIP?: string;
lastLoginAt?: number;
updatedAt?: number;
}
unmuteAt?: number;
unbanAt?: number;
roleList?: string[];
permissionList?: string[];
attachmentList?: Attachment[];
settingList?: Setting[];
tempFileIdList?: string[];
muting?: boolean;
banning?: boolean;
emailVerified?: boolean;
phoneNoVerified?: boolean;
} & Model;
export type UserProfileView = {
attachmentList?: AttachmentView[]
} & UserProfile
export enum UserAttachType {
export type UserToken = {
value: string;
expireAt: number;
AVATAR = "AVATAR",
WRAPPER = "WRAPPER",
LICENSE = "LICENSE",
DEFAULT_AVATAR = "DEFAULT_AVATAR",
DEFAULT_WRAPPER = "DEFAULT_WRAPPER"
}
export type RegisterRequest = {
name: string;
password: string;
email?: string;
}
};
export type LoginRequest = {
user: string;
password: string;
}
};
export type UpdatePasswordRequest = {
oldValue: string;
newValue: string;
};
// 登录返回
export type LoginResponse = {
id: number;
id: string;
token: string;
expireAt: number;
}
user?: User;
};
export type LoginUser = {
token?: LoginToken;
user?: UserView
}
export type LoginToken = {
id?: number;
} & UserToken;
id?: string;
token?: string;
expireAt?: number;
user?: User;
};
export enum LoginType {
ALERT,