根据区域查询路线

This commit is contained in:
温文静WWW 2025-08-05 18:26:31 +08:00
parent a8191b93f6
commit 373be83307

View File

@ -214,16 +214,16 @@ public class CpRouteController {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}
@ApiOperation(value = "根据区id获取景区下的所有路线")
@ApiOperation(value = "根据id获取景区下的所有路线")
@RequestMapping(value = "getByAreaId", method = RequestMethod.GET)
public ResponseEntity<List<CpRoute>> getRouteByEmAreaId(
@ApiParam(value = "区ID", required = true)
@ApiParam(value = "ID", required = true)
@RequestParam("areaId") Long areaId) {
try {
// 1. 参数校验
if (areaId == null) {
LOG.warn("查询区路线失败:区ID为空");
LOG.warn("查询路线失败:区ID为空");
return ResponseEntity.badRequest().build();
}
@ -237,15 +237,15 @@ public class CpRouteController {
// 4. 返回结果
if (CollectionUtils.isEmpty(routes)) {
LOG.info("区ID={}下未找到路线数据", areaId);
LOG.info("ID={}下未找到路线数据", areaId);
return ResponseEntity.ok(Collections.emptyList());
}
LOG.info("查询区ID={}下的路线成功,共找到{}条路线", areaId, routes.size());
LOG.info("查询ID={}下的路线成功,共找到{}条路线", areaId, routes.size());
return ResponseEntity.ok(routes);
} catch (Exception e) {
LOG.error("查询区路线失败景区ID={}", areaId, e);
LOG.error("查询路线失败景区ID={}", areaId, e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}
}