diff --git a/.gitignore b/.gitignore index 3dc6a526c86e674171870e5b2f35fd1ac8889f37..ab627c0d2d9591f9defe148dc6c25cc91fe4b83c 100644 --- a/.gitignore +++ b/.gitignore @@ -46,11 +46,11 @@ unpackage/ .hbuilderx/ # 环境变量和配置 -.env +# .env .env.local .env.development .env.test -.env.production +# .env.production *.local # 日志文件 @@ -98,8 +98,8 @@ coverage/ *.crt *.pfx -# AI和机器学习 -models/ -checkpoints/ -*.pkl -*.model \ No newline at end of file +# # AI和机器学习 +# models/ +# checkpoints/ +# *.pkl +# *.model \ No newline at end of file diff --git a/FlaskAPI/dockerfile b/FlaskAPI/dockerfile index e8671ed86fb0539b529d195bf885d0ce23a5b89c..fe49e763462574a0832b411601cd6fc4571bfde2 100644 --- a/FlaskAPI/dockerfile +++ b/FlaskAPI/dockerfile @@ -1,10 +1,12 @@ -FROM python:3.11-slim +FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.11-slim WORKDIR /app COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt \ - && python -m spacy download zh_core_web_sm +COPY zh_core_web_sm-3.7.0-py3-none-any.whl /tmp/ + +RUN pip install --no-cache-dir -r requirements.txt +RUN pip install /tmp/zh_core_web_sm-3.7.0-py3-none-any.whl COPY . . diff --git a/FlaskAPI/zh_core_web_sm-3.7.0-py3-none-any.whl b/FlaskAPI/zh_core_web_sm-3.7.0-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..c4b2bac7115319360cb5280657b3ae7fb6dbc753 Binary files /dev/null and b/FlaskAPI/zh_core_web_sm-3.7.0-py3-none-any.whl differ diff --git a/backend/src/UniversalAdminSystem.Infrastructure/RabbitMQ/Models/Jobs/FileProcessingJob.cs b/backend/src/UniversalAdminSystem.Infrastructure/RabbitMQ/Models/Jobs/FileProcessingJob.cs new file mode 100644 index 0000000000000000000000000000000000000000..c41aaf79f9ab047aa5b650d83099b8df2bb3f216 --- /dev/null +++ b/backend/src/UniversalAdminSystem.Infrastructure/RabbitMQ/Models/Jobs/FileProcessingJob.cs @@ -0,0 +1,14 @@ +namespace UniversalAdminSystem.Infrastructure.RabbitMQ.Jobs; + +public class FileProcessingJob +{ + public Guid Id { get; set; } = Guid.NewGuid(); + public Guid FileId { get; set; } + public string FilePath { get; set; } = default!; + public string ContentType { get; set; } = default!; + public long Size { get; set; } + public string Status { get; set; } = "Pending"; // Pending|Processing|Succeeded|Failed + public int RetryCount { get; set; } = 0; + public DateTime CreatedAt { get; set; } = DateTime.UtcNow; + public DateTime? NextAttemptAt { get; set; } +} \ No newline at end of file diff --git a/backend/src/UniversalAdminSystem.Infrastructure/RabbitMQ/Models/Messages/FileProcessingMessage.cs b/backend/src/UniversalAdminSystem.Infrastructure/RabbitMQ/Models/Messages/FileProcessingMessage.cs new file mode 100644 index 0000000000000000000000000000000000000000..47a265e09bc2b146f3b2592c2b897488544ae852 --- /dev/null +++ b/backend/src/UniversalAdminSystem.Infrastructure/RabbitMQ/Models/Messages/FileProcessingMessage.cs @@ -0,0 +1,13 @@ +namespace UniversalAdminSystem.Infrastructure.RabbitMQ.Models.Messages; + +public class FileProcessingMessage +{ + public Guid Id { get; set; } + public Guid FileId { get; set; } // 改成 Guid,而不是值对象 + public string FilePath { get; set; } + public string ContentType { get; set; } + public long Size { get; set; } + public int RetryCount { get; set; } + public DateTime? NextAttemptAt { get; set; } + public DateTime SentAt { get; set; } +} \ No newline at end of file diff --git a/backend/src/UniversalAdminSystem.Infrastructure/Services/SpaCyService.cs b/backend/src/UniversalAdminSystem.Infrastructure/Services/SpaCyService.cs index b6a5e567c8e53a7a418710bb5b28d84c2f38787b..db13e56c47515f8db99fdcf166900c0d320d095f 100644 --- a/backend/src/UniversalAdminSystem.Infrastructure/Services/SpaCyService.cs +++ b/backend/src/UniversalAdminSystem.Infrastructure/Services/SpaCyService.cs @@ -6,6 +6,8 @@ public class SpaCyService { private readonly HttpClient _httpClient; private readonly string _baseUrl = "http://flaskapi:5000"; + // private readonly string _baseUrl = "http://127.0.0.1:5000"; + // 构造函数,注入 IHttpClientFactory public SpaCyService(IHttpClientFactory httpClientFactory) diff --git a/frontend/vite-frontend/.env b/frontend/vite-frontend/.env new file mode 100644 index 0000000000000000000000000000000000000000..193d7556c76d49dc9a040f33ba0865f0b449eaa7 --- /dev/null +++ b/frontend/vite-frontend/.env @@ -0,0 +1 @@ +VITE_BASE_URL = http://localhost:5101/api \ No newline at end of file diff --git a/frontend/vite-frontend/.env.production b/frontend/vite-frontend/.env.production new file mode 100644 index 0000000000000000000000000000000000000000..8f0427e33e4470d396c6ecae6fd660fcc89ab942 --- /dev/null +++ b/frontend/vite-frontend/.env.production @@ -0,0 +1 @@ +VITE_BASE_URL = http://backend:5101/api \ No newline at end of file