mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	modal 增加删除
This commit is contained in:
		| @@ -59,4 +59,10 @@ public class AiChatModalController { | |||||||
|         return CommonResult.success(null); |         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 |      * @param req | ||||||
|      */ |      */ | ||||||
|     void update(Long id, AiChatModalAddReq 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); |         aiChatModalMapper.updateById(updateChatModalDO); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public void delete(Long id) { | ||||||
|  |         // 检查 modal 是否存在 | ||||||
|  |         validateChatModalExists(id); | ||||||
|  |         // 删除 delete | ||||||
|  |         aiChatModalMapper.deleteById(id); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     private void validateChatModalExists(Long id) { |     private void validateChatModalExists(Long id) { | ||||||
|         AiChatModalDO aiChatModalDO = aiChatModalMapper.selectById(id); |         AiChatModalDO aiChatModalDO = aiChatModalMapper.selectById(id); | ||||||
|         if (aiChatModalDO == null) { |         if (aiChatModalDO == null) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 cherishsince
					cherishsince