Files
knowai/types/user/api.ts
tobegold574 382e3aff21 feat(reset): 以构造器模式重构
- 加了大文件传输自定义分片协议

BREAKING CHANGES: 0.1.0(latest)
2025-11-30 20:27:53 +08:00

100 lines
2.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { UserProfile } from './base';
import type { PaginationRequest } from '../common';
// 获取当前用户个人资料相关接口不需要参数所以没有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 {
data: UserProfile[]; // 数据列表
total: number; // 总数
}
// 登录注册相关接口
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: UserProfile[]; // 数据列表
total: number; // 总数
}
// 用户搜索相关接口
export interface UserSearchRequest {
keyword: string;
}
export interface UserSearchResponse {
users: Array<UserProfile>;
total: number;
}