feat(reset): 以构造器模式重构
- 加了大文件传输自定义分片协议 BREAKING CHANGES: 0.1.0(latest)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user