feat: 优化架构
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 2m39s
Frontend CI / ota-android (push) Successful in 10m22s
Frontend CI / build-android-apk (push) Has been cancelled

This commit is contained in:
lafay
2026-04-13 01:30:37 +08:00
parent 2adc9360a5
commit fe6a03da5d
93 changed files with 386 additions and 211 deletions

View File

@@ -14,7 +14,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import { create } from 'zustand';
import { User } from '../types';
import { authService, resolveAuthApiError, LoginRequest, RegisterRequest } from '../services';
import { wsService } from '../services/wsService';
import { wsService } from '@/services/core';
import { callStore } from './callStore';
import { useSessionStore } from './sessionStore';
import {

View File

@@ -6,8 +6,8 @@ import {
WSCallSDPMessage,
WSCallICEMessage,
WSErrorMessage,
} from '../services/wsService';
import { webrtcManager, ICEServer } from '../services/webrtc';
} from '@/services/core';
import { webrtcManager, ICEServer } from '@/services/webrtc';
import { getCurrentUserId } from './sessionStore';
import { useUserStore } from './userStore';
import { userManager } from './userManager';

View File

@@ -3,7 +3,7 @@
*/
import { ConversationResponse } from '../types/dto';
import { messageService } from '../services/messageService';
import { messageService } from '@/services/message';
import { conversationRepository } from '@/database';
export const CONVERSATION_LIST_PAGE_SIZE = 20;

View File

@@ -4,7 +4,7 @@ import type {
GroupMemberResponse,
GroupResponse,
} from '../../types/dto';
import { groupService } from '../../services/groupService';
import { groupService } from '@/services/message';
import { groupCacheRepository, userCacheRepository } from '@/database';
import { useGroupManagerStore } from './groupStore';
import { createCacheEntry, isCacheExpired, DEFAULT_TTL } from '../utils/cache';

View File

@@ -9,7 +9,7 @@ import {
GroupMemberListResponse,
CursorPaginationRequest,
} from '../types/dto';
import { groupService } from '../services/groupService';
import { groupService } from '@/services/message';
import { groupCacheRepository } from '@/database';
export const GROUP_LIST_PAGE_SIZE = 20;

View File

@@ -1,4 +1,4 @@
import { groupService } from '../services/groupService';
import { groupService } from '@/services/message';
import { CursorPaginationResponse, GroupMemberResponse } from '../types/dto';
export const GROUP_MEMBER_LIST_PAGE_SIZE = 50;

View File

@@ -8,7 +8,7 @@
*/
import type { ConversationResponse } from '../../../types/dto';
import { messageService } from '../../../services/messageService';
import { messageService } from '@/services/message';
import { conversationRepository } from '@/database';
import type { IConversationOperations } from '../types';
import { useMessageStore, normalizeConversationId } from '../store';

View File

@@ -8,7 +8,7 @@
*/
import type { MessageResponse, MessageSegment, ConversationResponse } from '../../../types/dto';
import { messageService } from '../../../services/messageService';
import { messageService } from '@/services/message';
import { messageRepository } from '@/database';
import type { IMessageSendService } from '../types';
import { useMessageStore, mergeMessagesById } from '../store';

View File

@@ -8,7 +8,7 @@
*/
import type { ConversationResponse, MessageResponse } from '../../../types/dto';
import { messageService } from '../../../services/messageService';
import { messageService } from '@/services/message';
import { messageRepository, conversationRepository } from '@/database';
import { MessageMapper } from '@/data/mappers';
import {

View File

@@ -8,7 +8,7 @@
*/
import type { ConversationResponse } from '../../../types/dto';
import { messageService } from '../../../services/messageService';
import { messageService } from '@/services/message';
import { messageRepository, conversationRepository } from '@/database';
import type { ReadStateRecord, IReadReceiptManager } from '../types';
import { READ_STATE_PROTECTION_DELAY } from '../constants';

View File

@@ -4,7 +4,7 @@
*/
import type { MessageResponse, UserDTO } from '../../../types/dto';
import { api } from '../../../services/api';
import { api } from '@/services/core';
import { userCacheRepository } from '@/database';
import type { IUserCacheService } from '../types';

View File

@@ -16,8 +16,8 @@ import type {
WSGroupRecallMessage,
WSGroupTypingMessage,
WSGroupNoticeMessage,
} from '../../../services/wsService';
import { wsService, GroupNoticeType } from '../../../services/wsService';
} from '@/services/core';
import { wsService, GroupNoticeType } from '@/services/core';
import { eventBus } from '@/core/events/EventBus';
import { messageRepository } from '@/database';
import type { MessageResponse, ConversationResponse } from '../../../types/dto';

View File

@@ -6,7 +6,7 @@
*/
import type { Post } from '../../types';
import { postService } from '../../services/postService';
import { postService } from '@/services/post';
import { usePostManagerStore } from './postStore';
import { createCacheEntry, isCacheExpired, DEFAULT_TTL } from '../utils/cache';
import { createDedupe } from '../utils/requestDedupe';

View File

@@ -3,7 +3,7 @@
*/
import { Post } from '../types';
import { postService } from '../services/postService';
import { postService } from '@/services/post';
import type { CursorPaginationRequest } from '../types/dto';
export const POST_LIST_PAGE_SIZE = 20;

View File

@@ -6,7 +6,7 @@
*/
import type { UserDTO } from '../../types/dto';
import { authService } from '../../services/authService';
import { authService } from '@/services/auth';
import { userCacheRepository } from '@/database';
import { useUserManagerStore } from './userStore';
import { createCacheEntry, isCacheExpired, DEFAULT_TTL } from '../utils/cache';

View File

@@ -6,7 +6,7 @@
import { create } from 'zustand';
import { User, Post, Notification, NotificationBadge } from '../types';
import { PaginatedData } from '../services/api';
import { PaginatedData } from '@/services/core';
import {
authService,
postService,

View File

@@ -4,7 +4,7 @@
*/
import { create } from 'zustand';
import { verificationService } from '../services/verificationService';
import { verificationService } from '@/services/auth';
import {
VerificationStatusDTO,
VerificationRecordDTO,