修改删除台站信息的参数

This commit is contained in:
duwenyuan 2026-01-20 09:07:25 +08:00
parent c2204b21bf
commit 9a2cabb0c1
2 changed files with 8 additions and 2 deletions

View File

@ -50,7 +50,7 @@ public class GardsStationsController {
*/ */
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除台站信息") @Operation(summary = "删除台站信息")
public Result<?> deleteById(@RequestParam Integer stationId) { public Result<?> deleteById(@RequestParam(required = false) Integer stationId) {
gardsStationsService.deleteById(stationId); gardsStationsService.deleteById(stationId);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

View File

@ -42,7 +42,13 @@ public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, G
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
public void deleteById(Integer stationId) { public void deleteById(Integer stationId) {
this.removeById(stationId); try {
this.removeById(stationId);
} catch (RuntimeException e) {
throw new RuntimeException("");
}
} }
/** /**