fix(frontend): 修复 TypeScript 类型错误,与后端 API 响应结构对齐
- 修复 UserDTO 类型定义,字段改为非 nullable 类型 - 修复 PostMapper 使用正确的 snake_case 字段名 - 修复 UserMapper 移除不存在的 is_blocked 和 updated_at 字段 - 修复 MessageMapper 使用 segments 替代已移除的字段 - 修复 MessageSyncService 正确处理 API 响应类型 - 修复 LocalDataSource SQLite 参数类型问题 - 修复导航相关类型错误 - 修复 PostDetailScreen 和 EditProfileScreen 的 null/undefined 类型不匹配
This commit is contained in:
@@ -9,21 +9,20 @@ export interface UserDTO {
|
||||
id: string;
|
||||
username: string;
|
||||
nickname: string;
|
||||
avatar: string | null;
|
||||
cover_url: string | null; // 头图URL
|
||||
bio: string | null;
|
||||
website: string | null;
|
||||
location: string | null;
|
||||
phone: string | null;
|
||||
email: string | null;
|
||||
avatar: string;
|
||||
cover_url: string;
|
||||
bio: string;
|
||||
website: string;
|
||||
location: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
email_verified?: boolean;
|
||||
posts_count: number;
|
||||
followers_count: number;
|
||||
following_count: number;
|
||||
created_at: string;
|
||||
// 额外字段
|
||||
is_following?: boolean; // 当前用户是否关注了该用户
|
||||
is_following_me?: boolean; // 该用户是否关注了当前用户
|
||||
is_following?: boolean;
|
||||
is_following_me?: boolean;
|
||||
}
|
||||
|
||||
export interface UserDetailDTO {
|
||||
@@ -246,6 +245,8 @@ export interface ConversationResponse {
|
||||
participants?: UserDTO[]; // 私聊时使用
|
||||
member_count?: number; // 群聊时使用
|
||||
group?: GroupResponse; // 群聊会话的群组信息
|
||||
my_last_read_seq?: number; // 当前用户的已读位置
|
||||
other_last_read_seq?: number; // 对方用户的已读位置
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
@@ -269,6 +270,7 @@ export interface ConversationDetailResponse {
|
||||
participants: UserDTO[];
|
||||
my_last_read_seq: number; // 当前用户的已读位置
|
||||
other_last_read_seq: number; // 对方用户的已读位置
|
||||
group?: GroupResponse; // 群聊会话的群组信息
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user