| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | 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.map.dto.XpPointSpecialDto; |
| | | import com.xiaopeng.map.service.*; |
| | | import com.xiaopeng.map.vo.SpecialPointListVo; |
| | |
| | | @PostMapping("/api/v1/testPoint/addPoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "新增点位") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.TEST_POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "新增测试demo点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R add(@Validated @RequestBody PointAddDto pointAddDto) { |
| | | XpTestPoint xpPoint = new XpTestPoint(); |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | |
| | | @GetMapping("/api/v1/testPoint/deletePoint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "删除点位") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.TEST_POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'删除测试demo点位,ids=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R deletePoint(@RequestParam("ids") String ids) { |
| | | xpTestPointService.removeBatchByIds(Arrays.stream(ids.split(",")) |
| | | .map(Long::parseLong).collect(Collectors.toList())); |
| | |
| | | */ |
| | | @PostMapping("/api/v1/testPoint/editPoint") |
| | | @ApiOperation(value = "编辑点位") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.TEST_POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "编辑测试demo点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) { |
| | | XpTestPoint xpPoint = new XpTestPoint(); |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | |
| | | */ |
| | | @PostMapping("/api/v1/testPoint/enableDisablePoint") |
| | | @ApiOperation(value = "启用/禁用") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.TEST_POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.SWITCH_STATUS, |
| | | content = "启用/禁用测试demo点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R enableDisable(@RequestBody XpPointEnableDisableDto dto) { |
| | | XpTestPoint xpPoint = xpTestPointService.getById(dto.getId()); |
| | | xpPoint.setOperationStatus(dto.getOperationStatus()); |
| | |
| | | */ |
| | | @PostMapping("/api/v1/testPoint/setSpecialPoint") |
| | | @ApiOperation(value = "设置特殊点位", tags = "后台管理-特殊点位") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.TEST_POINT_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "设置测试demo特殊点位", |
| | | appendRequestData = true |
| | | ) |
| | | public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) { |
| | | xpTestPointService.update(new LambdaUpdateWrapper<XpTestPoint>().set(XpTestPoint::getChargePoint, 0) |
| | | .set(XpTestPoint::getParkingPoint, 0)); |