Optimize the project structure and introduce DDD design (#394)

This commit is contained in:
Archer
2023-10-12 17:46:37 +08:00
committed by GitHub
parent 76ac5238b6
commit ad7a17bf40
193 changed files with 1169 additions and 1084 deletions

View File

@@ -1,6 +1,6 @@
import React, { useMemo } from 'react';
import { Flex, useTheme, Box } from '@chakra-ui/react';
import { useGlobalStore } from '@/store/global';
import { useGlobalStore } from '@/web/common/store/global';
import MyIcon from '@/components/Icon';
import Tag from '@/components/Tag';
import Avatar from '@/components/Avatar';

View File

@@ -10,16 +10,16 @@ import {
MenuItem,
IconButton
} from '@chakra-ui/react';
import { useGlobalStore } from '@/store/global';
import { useEditTitle } from '@/hooks/useEditTitle';
import { useGlobalStore } from '@/web/common/store/global';
import { useEditTitle } from '@/web/common/hooks/useEditTitle';
import { useRouter } from 'next/router';
import Avatar from '@/components/Avatar';
import MyTooltip from '@/components/MyTooltip';
import MyIcon from '@/components/Icon';
import { useTranslation } from 'react-i18next';
import { useConfirm } from '@/hooks/useConfirm';
import { useConfirm } from '@/web/common/hooks/useConfirm';
import Tabs from '@/components/Tabs';
import { useUserStore } from '@/store/user';
import { useUserStore } from '@/web/support/store/user';
import { useQuery } from '@tanstack/react-query';
type HistoryItemType = {

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { Card, Box, Flex } from '@chakra-ui/react';
import { useMarkdown } from '@/hooks/useMarkdown';
import { useMarkdown } from '@/web/common/hooks/useMarkdown';
import Markdown from '@/components/Markdown';
import Avatar from '@/components/Avatar';

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { Flex, Box, IconButton } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import { useUserStore } from '@/store/user';
import { useUserStore } from '@/web/support/store/user';
import { useQuery } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next';
import MyIcon from '@/components/Icon';

View File

@@ -1,7 +1,7 @@
import React, { useCallback, useRef } from 'react';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { getInitChatSiteInfo, delChatRecordById, putChatHistory } from '@/api/chat';
import { getInitChatSiteInfo, delChatRecordById, putChatHistory } from '@/web/core/api/chat';
import {
Box,
Flex,
@@ -11,12 +11,12 @@ import {
DrawerContent,
useTheme
} from '@chakra-ui/react';
import { useGlobalStore } from '@/store/global';
import { useGlobalStore } from '@/web/common/store/global';
import { useQuery } from '@tanstack/react-query';
import { streamFetch } from '@/api/fetch';
import { useChatStore } from '@/store/chat';
import { useLoading } from '@/hooks/useLoading';
import { useToast } from '@/hooks/useToast';
import { streamFetch } from '@/web/common/api/fetch';
import { useChatStore } from '@/web/core/store/chat';
import { useLoading } from '@/web/common/hooks/useLoading';
import { useToast } from '@/web/common/hooks/useToast';
import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12);
import type { ChatHistoryItemType } from '@/types/chat';
@@ -29,8 +29,8 @@ import ChatHistorySlider from './components/ChatHistorySlider';
import SliderApps from './components/SliderApps';
import ChatHeader from './components/ChatHeader';
import { getErrText } from '@/utils/tools';
import { useUserStore } from '@/store/user';
import { serviceSideProps } from '@/utils/web/i18n';
import { useUserStore } from '@/web/support/store/user';
import { serviceSideProps } from '@/web/common/utils/i18n';
const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
const router = useRouter();

View File

@@ -1,13 +1,13 @@
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { initShareChatInfo } from '@/api/support/outLink';
import { initShareChatInfo } from '@/web/support/api/outLink';
import { Box, Flex, useDisclosure, Drawer, DrawerOverlay, DrawerContent } from '@chakra-ui/react';
import { useToast } from '@/hooks/useToast';
import { useGlobalStore } from '@/store/global';
import { useToast } from '@/web/common/hooks/useToast';
import { useGlobalStore } from '@/web/common/store/global';
import { useQuery } from '@tanstack/react-query';
import { streamFetch } from '@/api/fetch';
import { useShareChatStore, defaultHistory } from '@/store/shareChat';
import { streamFetch } from '@/web/common/api/fetch';
import { useShareChatStore, defaultHistory } from '@/web/core/store/shareChat';
import SideBar from '@/components/SideBar';
import { gptMessage2ChatType } from '@/utils/adapt';
import { getErrText } from '@/utils/tools';
@@ -19,7 +19,7 @@ import ChatBox, { type ComponentRef, type StartChatFnProps } from '@/components/
import PageContainer from '@/components/PageContainer';
import ChatHeader from './components/ChatHeader';
import ChatHistorySlider from './components/ChatHistorySlider';
import { serviceSideProps } from '@/utils/web/i18n';
import { serviceSideProps } from '@/web/common/utils/i18n';
const OutLink = ({
shareId,