根据区域查询路线
This commit is contained in:
parent
a8191b93f6
commit
373be83307
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user