refactor(api): 统一API响应格式规范
重构营养成分分析相关接口,统一使用base.dto.ts中定义的通用响应结构体ApiResponseDto,规范所有接口返回格式。更新AI模型prompt以返回标准化的code、msg、data结构,并添加相应的验证装饰器确保数据完整性。
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user