refactor(Post, PostMapper, PostRepository, CreatePostScreen, HomeScreen): update communityId to channelId for improved clarity
- Renamed communityId to channelId across Post entity, PostMapper, and PostRepository for consistency and clarity. - Updated CreatePostScreen to include channel selection functionality, enhancing user experience when creating posts. - Adjusted HomeScreen to support filtering posts by channel, improving content organization. - Refactored related interfaces and services to align with the new channelId terminology, ensuring a cohesive codebase.
This commit is contained in:
@@ -75,8 +75,8 @@ export interface Post {
|
||||
isPinned: boolean;
|
||||
/** 帖子状态 */
|
||||
status: PostStatus;
|
||||
/** 所属社区ID */
|
||||
communityId?: string;
|
||||
/** 所属频道ID */
|
||||
channelId?: string;
|
||||
/** 标签列表 */
|
||||
tags: string[];
|
||||
/** 创建时间 */
|
||||
@@ -113,8 +113,8 @@ export interface Post {
|
||||
updated_at?: string;
|
||||
/** @deprecated 请使用 contentEditedAt */
|
||||
content_edited_at?: string;
|
||||
/** @deprecated 请使用 communityId */
|
||||
community_id?: string;
|
||||
/** @deprecated 请使用 channelId */
|
||||
channel_id?: string;
|
||||
/** @deprecated 请使用 status */
|
||||
status_str?: string;
|
||||
/** 投票帖子标识 (部分旧代码使用) */
|
||||
@@ -168,7 +168,7 @@ export const createPost = (data: Partial<Post>): Post => ({
|
||||
isFavorited: data.isFavorited || false,
|
||||
isPinned: data.isPinned || false,
|
||||
status: data.status || 'published',
|
||||
communityId: data.communityId,
|
||||
channelId: data.channelId,
|
||||
tags: data.tags || [],
|
||||
createdAt: data.createdAt || new Date().toISOString(),
|
||||
updatedAt: data.updatedAt || new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user