4 Commits

Author SHA1 Message Date
82fcaa1f2f fix: replace RateLimitService with global RateLimitGuard
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 59s
RateLimitService could not be injected into feature modules due to
NestJS DI module isolation. Replaced with a global Guard that uses
@RateLimit() decorator metadata to apply per-endpoint limits.

- RateLimitGuard: checks Redis counters, throws 429 on exceed
- Decorators: LoginRateLimit, FeedbackRateLimit, AiAnalysisRateLimit,
  FileUploadRateLimit
- Applied to: auth (login), feedback, ai-analysis, files endpoints

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:23:19 +08:00
3137d58a5d fix: 移除 FilesService 中的 RateLimitService 注入
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 56s
RateLimitService 未在 @Global Module 中,feature module 无法注入。
限流后续通过 Guard/Interceptor 统一处理。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:52:27 +08:00
ca90d34b22 fix: 将 RateLimitService 注入从 StorageService 移到 FilesService
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 56s
StorageService 在 @Global StorageModule 中,无法注入 AppModule 的 RateLimitService。
将限流调用上移到 FilesService.requestUploadUrl 中。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:50:31 +08:00
6d7cbffc3b feat: COS 对象存储接入 — CosStorageProvider + FilesModule
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 3m0s
- 安装 cos-nodejs-sdk-v5,封装 CosStorageProvider(upload/download/delete/healthCheck)
- 重写 StorageService,新增 createUploadUrl/verifyUpload/getDownloadUrl/deleteObject
- 创建 FilesModule:POST /files/upload-url, POST /files/complete, GET /files/:id, DELETE /files/:id
- UploadedFile 新增 objectKey/bucket 字段
- 对象键格式 {userId}/{YYYYMM}/{sanitizedName}.{ext}
- 接入文件类型校验(ALLOWED_FILE_TYPES)+ 上传限流(10次/小时/用户)
- 配置文件 cos.longde.cloud → zhixi-1259685406 / ap-guangzhou

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:30:14 +08:00