| | |
| | | import com.xiaopeng.operation.service.XpPointService; |
| | | import com.xiaopeng.operation.vo.NearestVo; |
| | | import com.xiaopeng.operation.vo.OrderDistanceVo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @RequestMapping("") |
| | | @Api(tags = "点位模块") |
| | | public class XpPointController extends BaseController { |
| | | |
| | |
| | | * 获取附近上车站点 |
| | | */ |
| | | @ApiOperation(value = "获取附近上车站点",tags = {"小程序-附近上车站点"},response = XpPoint.class) |
| | | @PostMapping("/pickup/nearest") |
| | | public R<NearestVo> nearest(@RequestBody @Valid NearestDto dto) { |
| | | return R.ok(xpPointService.nearest(dto)); |
| | | @PostMapping("/base/v1/mini-program/pickup/nearest") |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<NearestVo> nearest(@RequestBody @Valid NearestDto dto, HttpServletRequest request) { |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpPointService.nearest(dto, uid)); |
| | | } |
| | | |
| | | |
| | |
| | | * @param historyStartPointsDto |
| | | * @return |
| | | */ |
| | | @PostMapping("/xp-point/getHistoryStartPoints") |
| | | @PostMapping("/base/v1/xp-point/getHistoryStartPoints") |
| | | public R<List<XpHistoryStartPointsVo>> getHistoryStartPoints(@RequestBody HistoryStartPointsDto historyStartPointsDto){ |
| | | List<XpHistoryStartPointsVo> xpPoints = xpPointService.getHistoryStartPoints(historyStartPointsDto); |
| | | return R.ok(xpPoints); |
| | |
| | | * @param historyEndPointsDto |
| | | * @return |
| | | */ |
| | | @PostMapping("/xp-point/getHistoryEndPoints") |
| | | @PostMapping("/base/v1/xp-point/getHistoryEndPoints") |
| | | public R<List<XpHistoryEndPointsVo>> getHistoryEndPoints(@RequestBody HistoryEndPointsDto historyEndPointsDto){ |
| | | List<XpHistoryEndPointsVo> xpPoints = xpPointService.getHistoryEndPoints(historyEndPointsDto); |
| | | return R.ok(xpPoints); |
| | |
| | | * 根据名称获取点位列表 |
| | | */ |
| | | @ApiOperation(value = "根据名称poi获取点位列表",tags = {"小程序-根据名称获取点位列表"},response = XpPoint.class) |
| | | @PostMapping("/xp-point/queryPointByName") |
| | | public R<XpPointsSearchVo> listAll(@RequestBody @Valid PointByNameQuery query) { |
| | | XpPointsSearchVo vo = xpPointService.queryPointByName(query); |
| | | @PostMapping("/base/v1/mini-program/xp-point/queryPointByName") |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<XpPointsSearchVo> listAll(@RequestBody @Valid PointByNameQuery query, HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | | XpPointsSearchVo vo = xpPointService.queryPointByName(query, uid); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/inner/point/getPointsInfo") |
| | | @PostMapping("/logan/inner/v1/point/getPointsInfo") |
| | | public R<List<XpPoint>> getPointsInfo(@RequestBody Set<Long> points){ |
| | | List<XpPoint> xpPoints = xpPointService.listByIds(points); |
| | | return R.ok(xpPoints); |
| | |
| | | * 获取下单最大距离 最小距离 |
| | | */ |
| | | @ApiOperation(value = "获取可下单最大距离 最小距离",tags = {"小程序-获取可下单最大距离 最小距离"},response = XpPoint.class) |
| | | @GetMapping("/xp-point/getOrderDistance") |
| | | @GetMapping("/base/v1/mini-program/xp-point/getOrderDistance") |
| | | public R<OrderDistanceVo> getOrderDistance() { |
| | | OrderDistanceVo vo = xpPointService.getOrderDistance(); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断点位是在有效期内 |
| | | * @param pointId |
| | | * @return |
| | | */ |
| | | @GetMapping("/logan/inner/v1/point/nowInTimePoint") |
| | | public R<Boolean> nowInTimePoint(@RequestParam Long pointId){ |
| | | return R.ok(xpPointService.nowInTimePoint(pointId)); |
| | | } |
| | | |
| | | |
| | | |
| | | |