refactor(api): 统一API响应格式规范

重构营养成分分析相关接口,统一使用base.dto.ts中定义的通用响应结构体ApiResponseDto,规范所有接口返回格式。更新AI模型prompt以返回标准化的code、msg、data结构,并添加相应的验证装饰器确保数据完整性。
This commit is contained in:
richarjiang
2025-10-16 11:16:33 +08:00
parent 2f2901a0bf
commit 91cac3134e
8 changed files with 138 additions and 66 deletions

View File

@@ -222,13 +222,6 @@ export class UsersController {
return { code: ResponseCode.ERROR, message: '请选择要上传的图片文件' };
}
this.winstonLogger.info(`receive file, fileSize: ${file.size}`, {
context: 'UsersController',
userId: user?.sub,
file,
})
const data = await this.cosService.uploadImage(user.sub, file);
return data;
} catch (error) {