feat: 增加清空所有icd配置

dev
huangfeng 1 year ago
parent 76291ecf07
commit 4d6cf728e0

@ -98,4 +98,11 @@ public class IcdConfigController extends BasicController {
return Response.success(result); return Response.success(result);
} }
@PostMapping("clearAll")
@ApiOperation("清空所有配置")
public Response<String> clearAll() throws Exception {
configService.clearAll();
return Response.success("OK");
}
} }

@ -29,7 +29,7 @@ public class GlobalExceptionHandler {
return Response.fail(message); return Response.fail(message);
} }
@ExceptionHandler(Exception.class) @ExceptionHandler(BusinessException.class)
public Response<String> handleBusinessException(BusinessException ex) { public Response<String> handleBusinessException(BusinessException ex) {
String message = ex.getMessage(); String message = ex.getMessage();
log.error(message); log.error(message);

@ -20,4 +20,6 @@ public interface IcdFileConfigService {
void delete(Integer id); void delete(Integer id);
void deleteAtt(Integer attid); void deleteAtt(Integer attid);
void clearAll();
} }

@ -135,4 +135,11 @@ public class IcdFileConfigServiceImpl implements IcdFileConfigService {
attRepository.deleteById(attid); attRepository.deleteById(attid);
} }
@Override
public void clearAll() {
instRepository.deleteAll();
attRepository.deleteAll();
repository.deleteAll();
}
} }

Loading…
Cancel
Save