| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.xiaopeng.api.model.operation.XpRoutePlan; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | import com.xiaopeng.operation.dto.RoutePlanAddDTO; |
| | | import com.xiaopeng.operation.dto.RoutePlanEditDTO; |
| | | import com.xiaopeng.operation.query.RoutePlanPageListQuery; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2026-02-03 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/v1/routePlan") |
| | | @RequestMapping("") |
| | | @Api(tags = "路线规划配置管理") |
| | | @Slf4j |
| | | public class XpRoutePlanController { |
| | |
| | | * 分页查询路线规划配置列表 |
| | | */ |
| | | @ApiOperation(value = "路线规划配置分页列表", tags = {"管理后台-交易管理-导航及路线规划"}, response = XpRoutePlan.class) |
| | | @PostMapping("/pageList") |
| | | @PostMapping("/api/v1/routePlan/pageList") |
| | | public R<PageInfo<XpRoutePlan>> pageList(@RequestBody RoutePlanPageListQuery query) { |
| | | PageInfo<XpRoutePlan> pageInfo = routePlanService.pageList(query); |
| | | return R.ok(pageInfo); |
| | |
| | | * 新增路线规划配置 |
| | | */ |
| | | @ApiOperation(value = "新增路线规划配置", tags = {"管理后台-交易管理-导航及路线规划"}) |
| | | @PostMapping("/add") |
| | | @PostMapping("/api/v1/routePlan/add") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ROUTE_PLAN_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "新增路线规划配置", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> add(@Validated @RequestBody RoutePlanAddDTO dto) { |
| | | routePlanService.add(dto); |
| | | return R.ok(); |
| | |
| | | * 编辑路线规划配置 |
| | | */ |
| | | @ApiOperation(value = "编辑路线规划配置", tags = {"管理后台-交易管理-导航及路线规划"}) |
| | | @PostMapping("/edit") |
| | | @PostMapping("/api/v1/routePlan/edit") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ROUTE_PLAN_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "编辑路线规划配置", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> edit(@Validated @RequestBody RoutePlanEditDTO dto) { |
| | | routePlanService.edit(dto); |
| | | return R.ok(); |
| | |
| | | * 删除路线规划配置 |
| | | */ |
| | | @ApiOperation(value = "删除路线规划配置", tags = {"管理后台-交易管理-导航及路线规划"}) |
| | | @DeleteMapping("/deleteById/{id}") |
| | | @DeleteMapping("/api/v1/routePlan/deleteById/{id}") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ROUTE_PLAN_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'删除路线规划配置,id=' + #p0" |
| | | ) |
| | | public R<?> deleteById(@ApiParam(name = "id", value = "线路ID") @PathVariable Long id) { |
| | | routePlanService.deleteById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据openCityId获取路线规划配置 |
| | | * @param openCityId |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/v1/routePlan/getXpRoutePlanOpenCityId") |
| | | public R<XpRoutePlan> getXpRoutePlanOpenCityId(@RequestParam Long openCityId) { |
| | | XpRoutePlan routePlan = routePlanService.getOne(new QueryWrapper<XpRoutePlan>().eq("open_city_id", openCityId).eq("audit_status", 2)); |
| | | return R.ok(routePlan); |
| | | } |
| | | } |