【优化】处理 CommonResult Void 情况

This commit is contained in:
cherishsince 2024-04-28 17:41:49 +08:00
parent 99d477ac0a
commit 198dae62c0
1 changed files with 4 additions and 4 deletions

View File

@ -38,14 +38,14 @@ public class AiChatModalController {
@Operation(summary = "ai模型 - 添加") @Operation(summary = "ai模型 - 添加")
@PutMapping("/modal") @PutMapping("/modal")
public CommonResult add(@RequestBody @Validated AiChatModalAddReq req) { public CommonResult<Void> add(@RequestBody @Validated AiChatModalAddReq req) {
aiChatModalService.add(req); aiChatModalService.add(req);
return CommonResult.success(null); return CommonResult.success(null);
} }
@Operation(summary = "ai模型 - 模型照片上传") @Operation(summary = "ai模型 - 模型照片上传")
@PostMapping("/modal/{id}/updateImage") @PostMapping("/modal/{id}/updateImage")
public CommonResult updateImage(@PathVariable("id") Long id, public CommonResult<Void> updateImage(@PathVariable("id") Long id,
MultipartFile file) { MultipartFile file) {
// todo yunai 文件上传这里放哪里 // todo yunai 文件上传这里放哪里
return CommonResult.success(null); return CommonResult.success(null);
@ -53,7 +53,7 @@ public class AiChatModalController {
@Operation(summary = "ai模型 - 修改") @Operation(summary = "ai模型 - 修改")
@PostMapping("/modal/{id}") @PostMapping("/modal/{id}")
public CommonResult update(@PathVariable Long id, public CommonResult<Void> update(@PathVariable Long id,
@RequestBody @Validated AiChatModalAddReq req) { @RequestBody @Validated AiChatModalAddReq req) {
aiChatModalService.update(id, req); aiChatModalService.update(id, req);
return CommonResult.success(null); return CommonResult.success(null);
@ -61,7 +61,7 @@ public class AiChatModalController {
@Operation(summary = "ai模型 - 删除") @Operation(summary = "ai模型 - 删除")
@DeleteMapping("/modal/{id}") @DeleteMapping("/modal/{id}")
public CommonResult delete(@PathVariable Long id) { public CommonResult<Void> delete(@PathVariable Long id) {
aiChatModalService.delete(id); aiChatModalService.delete(id);
return CommonResult.success(null); return CommonResult.success(null);
} }