mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 09:30:05 +08:00
modal 增加删除
This commit is contained in:
parent
faade05528
commit
f85c89a405
@ -59,4 +59,10 @@ public class AiChatModalController {
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@Operation(summary = "ai模型 - 删除")
|
||||
@DeleteMapping("/modal/{id}")
|
||||
public CommonResult delete(@PathVariable Long id) {
|
||||
aiChatModalService.delete(id);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,12 @@ public interface AiChatModalService {
|
||||
* @param req
|
||||
*/
|
||||
void update(Long id, AiChatModalAddReq req);
|
||||
|
||||
/**
|
||||
* ai modal - 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void delete(Long id);
|
||||
|
||||
}
|
||||
|
@ -72,6 +72,14 @@ public class AiChatModalServiceImpl implements AiChatModalService {
|
||||
aiChatModalMapper.updateById(updateChatModalDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
// 检查 modal 是否存在
|
||||
validateChatModalExists(id);
|
||||
// 删除 delete
|
||||
aiChatModalMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateChatModalExists(Long id) {
|
||||
AiChatModalDO aiChatModalDO = aiChatModalMapper.selectById(id);
|
||||
if (aiChatModalDO == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user