feat(reset): 以构造器模式重构

- 加了大文件传输自定义分片协议

BREAKING CHANGES: 0.1.0(latest)
This commit is contained in:
tobegold574
2025-11-30 20:27:53 +08:00
parent c5853847ae
commit 382e3aff21
82 changed files with 1421 additions and 7010 deletions

View File

@@ -1,30 +1,99 @@
import type { User } from './base';
import type { UserProfile } from './base';
import type { PaginationRequest } from '../common';
// 获取热门作者请求接口
export interface GetHotAuthorsRequest {
limit?: number; // 每页数量
days?: number; // 统计天数默认30天
// 获取当前用户个人资料相关接口不需要参数所以没有request
export interface GetMyProfileResponse {
profile: UserProfile;
}
// 获取他人档案相关接口
export interface GetUserProfileRequest {
userId: string;
}
export interface GetUserProfileResponse {
profile: UserProfile;
}
// 热门作者相关接口
export interface GetHotAuthorsRequest extends PaginationRequest {
// 已继承limit字段page字段默认不用了
}
// 获取热门作者响应接口
export interface GetHotAuthorsResponse {
// 其实应该用profile返回的
data: User[]; // 数据列表
data: UserProfile[]; // 数据列表
total: number; // 总数
}
// 获取作者榜单请求接口
export interface GetAuthorRankingRequest {
limit?: number; // 每页数量
period?: 'day' | 'week' | 'month'; // 统计周期
type?: 'posts' | 'views' | 'likes'; // 排序类型
// 登录注册相关接口
export interface LoginRequest {
username: string;
password: string;
}
export interface LoginResponse {
user: UserProfile;
sessionId: string;
}
export interface RegisterRequest {
username: string;
password: string;
}
export interface RegisterResponse {
user: UserProfile;
sessionId: string;
}
export interface ChangePasswordRequest {
oldPassword: string;
newPassword: string;
}
export interface ChangePasswordResponse {
user: UserProfile;
sessionId: string;
}
// 通知相关接口
export type NotificationType = 'like' | 'comment' | 'follow' | 'mention';
export interface UserNotification {
id: string;
type: NotificationType;
content: string;
isRead: boolean;
createdAt: Date;
}
// 个人资料更新相关接口
export interface UserProfileUpdateRequest {
avatar?: string;
introduction?: string;
level?: string;
}
export interface UserProfileUpdateResponse {
profile: UserProfile;
}
// 作者榜单相关接口
export interface GetAuthorRankingRequest extends PaginationRequest {
// 已继承limit字段page字段默认不用了
}
// 获取作者榜单响应接口
export interface GetAuthorRankingResponse {
data: User[]; // 数据列表
data: UserProfile[]; // 数据列表
total: number; // 总数
// 其实冗余了
period: 'day' | 'week' | 'month'; // 统计周期
type: 'posts' | 'views' | 'likes'; // 排序类型
}
// 用户搜索相关接口
export interface UserSearchRequest {
keyword: string;
}
export interface UserSearchResponse {
users: Array<UserProfile>;
total: number;
}