feat(DOC): 完整地审查了代码,更完整的注释说明

- 无代码修改
This commit is contained in:
tobegold574
2025-11-23 22:26:39 +08:00
parent 4e741a0523
commit c5853847ae
27 changed files with 119 additions and 110 deletions

View File

@@ -3,11 +3,13 @@ import type { ChatMessageType } from './enum';
// 创建聊天会话请求接口
export interface CreateChatSessionRequest {
// 对方的ID因为当前用户的id可以在session里获取cookie自动带上)
participantId: string;
}
// 更新聊天会话请求接口
// 更新聊天会话请求接口(占位)
export interface UpdateChatSessionRequest {
// 只能用于处理后台逻辑
sessionId: string;
}
@@ -57,7 +59,7 @@ export interface MarkMessagesAsReadRequest {
messageIds: string[];
}
// 标记消息已读响应接口
// 标记消息已读响应接口(已读状态只面向接收方)
export interface MarkMessagesAsReadResponse {
success: boolean;
markedMessageIds: string[]; // 成功标记的消息ID

View File

@@ -4,6 +4,7 @@ import type { ChatMessageType, ChatMessageStatus } from './enum';
// 聊天消息接口
export interface ChatMessage {
id: string;
// 聊天会话id下面那个接口的id
sessionId: string;
sender: User;
receiver: User;
@@ -16,6 +17,7 @@ export interface ChatMessage {
fileName?: string;
fileSize?: number;
duration?: number;
// 小图预览
thumbnail?: string;
[key: string]: unknown;
};

View File

@@ -1,4 +1,4 @@
// 聊天消息类型枚举
// 聊天消息类型枚举(暂时用不到的)
export enum ChatMessageType {
TEXT = 'text',
IMAGE = 'image',
@@ -8,7 +8,7 @@ export enum ChatMessageType {
SYSTEM = 'system'
}
// 聊天消息状态枚举
// 聊天消息状态枚举(暂时用不到的)
export enum ChatMessageStatus {
SENDING = 'sending',
SENT = 'sent',

View File

@@ -15,6 +15,7 @@ export interface ModelComment extends BaseEntity {
author: BaseUser; // 作者信息
content: string; // 评论内容
parentId?: string; // 父评论ID用于嵌套评论
// 其实没必要
stats: ModelCommentStats; // 统计信息
}

View File

@@ -1,4 +1,5 @@
// AI模型评论排序枚举
// 和post的重复了而且字段还不一样
export enum CommentSortType {
LATEST = 'latest', // 最新
HOTTEST = 'hottest', // 最热

View File

@@ -10,10 +10,13 @@ export interface BaseEntity {
// 用户基础信息接口
export interface BaseUser {
// 其实应该用profile的
user: User;
}
export interface PostComment extends BaseEntity {
// 这里没带postId如果后台管理需要就要带
// 重复了,而且评论没有数据(点赞、收藏等等)
authorId: string; // 作者ID
author: BaseUser; // 作者信息
content: string; // 评论内容

View File

@@ -1,3 +1,4 @@
// 这里应该用type联合的现在有冗余和风格不统一的问题
// 排序方式枚举
export enum SortOrder {
ASC = 'asc',

View File

@@ -8,6 +8,7 @@ export interface GetHotAuthorsRequest {
// 获取热门作者响应接口
export interface GetHotAuthorsResponse {
// 其实应该用profile返回的
data: User[]; // 数据列表
total: number; // 总数
}
@@ -23,6 +24,7 @@ export interface GetAuthorRankingRequest {
export interface GetAuthorRankingResponse {
data: User[]; // 数据列表
total: number; // 总数
// 其实冗余了
period: 'day' | 'week' | 'month'; // 统计周期
type: 'posts' | 'views' | 'likes'; // 排序类型
}

View File

@@ -33,16 +33,17 @@ export interface ChangePasswordRequest { // 暂时用不到
newPassword: string;
}
export interface RefreshTokenRequest {
sessionId: string;
}
// 目前只用得到session
// export interface RefreshTokenRequest {
// sessionId: string;
// }
export interface RefreshTokenResponse {
sessionId: string;
}
// export interface RefreshTokenResponse {
// sessionId: string;
// }
// 用户通知
export interface UserNotification { // 暂时用不到
// 用户通知(暂时用不到)
export interface UserNotification {
id: string;
userId: string;
type: NotificationType;

View File

@@ -20,11 +20,13 @@ export interface UserProfileUpdateResponse {
// 用户关系
export interface UserRelation {
// 当前用户的id
id: string;
followerId: string[];
followingId: string[];
}
// 当前用户的id由cookie带上
export interface UserFollowRequest {
userId: string;
}

View File

@@ -6,6 +6,7 @@ export interface UserSearchRequest {
}
export interface UserSearchResponse {
// 这里逻辑是对的(可惜暂时不打算做)
users: Array<UserProfile>
total: number;
}