| | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.base.annotation.OperationLog; |
| | | import com.mzl.flower.constant.Constants; |
| | | import com.mzl.flower.dto.request.flower.*; |
| | | import com.mzl.flower.dto.request.flower.FlowerTagMultipleDTO; |
| | | import com.mzl.flower.dto.response.flower.*; |
| | | import com.mzl.flower.entity.flower.Flower; |
| | | import com.mzl.flower.entity.log.OperationRecord; |
| | | import com.mzl.flower.service.flower.FlowerParamService; |
| | | import com.mzl.flower.service.flower.FlowerService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | } |
| | | |
| | | @PostMapping("/list/pass") |
| | | @OperationLog(value = "审核通过", type = "flower_list") |
| | | @ApiOperation(value = "审核通过") |
| | | public ResponseEntity<ReturnDataDTO> passFlower(@RequestBody FlowerAuditDTO dto) { |
| | | flowerService.auditFlower(dto.getId(), dto.getAuditRemarks(), Constants.FLOWER_STATUS.UP.name()); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "审核通过id:【" + dto.getId() + "】,审核意见为【" + dto.getAuditRemarks() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/reject") |
| | | @OperationLog(value = "审核驳回", type = "flower_list") |
| | | @ApiOperation(value = "审核驳回") |
| | | public ResponseEntity<ReturnDataDTO> rejectFlower(@RequestBody FlowerAuditDTO dto) { |
| | | flowerService.auditFlower(dto.getId(), dto.getAuditRemarks(), Constants.FLOWER_STATUS.REJECT.name()); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "审核驳回id:【" + dto.getId() + "】,审核意见为:【" + dto.getAuditRemarks() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/pass/multi") |
| | | @OperationLog(value = "批量审核通过", type = "flower_list") |
| | | @ApiOperation(value = "批量审核通过") |
| | | public ResponseEntity<ReturnDataDTO> passFlowers(@RequestBody FlowerAuditMultipleDTO dto) { |
| | | flowerService.auditFlowers(dto, Constants.FLOWER_STATUS.UP.name()); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量审核通过id:【" + dto.getIds() + "】,审核意见为【" + dto.getAuditRemarks() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/reject/multi") |
| | | @OperationLog(value = "批量审核驳回", type = "flower_list") |
| | | @ApiOperation(value = "批量审核驳回") |
| | | public ResponseEntity<ReturnDataDTO> rejectFlowers(@RequestBody FlowerAuditMultipleDTO dto) { |
| | | flowerService.auditFlowers(dto, Constants.FLOWER_STATUS.REJECT.name()); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量审核驳回id:【" + dto.getIds() + "】,审核意见为:【" + dto.getAuditRemarks() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/tags") |
| | | @OperationLog(value = "批量设置标签", type = "flower_list") |
| | | @ApiOperation(value = "批量设置标签") |
| | | public ResponseEntity<ReturnDataDTO> setFlowersTags(@RequestBody FlowerTagMultipleDTO dto) { |
| | | flowerService.setFlowersTags(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量设置标签id:【" + dto.getIds() + "】,标签名称为:【" + dto.getTags() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/zones") |
| | | @OperationLog(value = "批量设置专区", type = "flower_list") |
| | | @ApiOperation(value = "批量设置专区") |
| | | public ResponseEntity<ReturnDataDTO> setFlowerZone(@RequestBody FlowerZoneBatchDTO dto) { |
| | | flowerService.setFlowerZone(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量设置专区id:【" + dto.getIds() + "】,专区id为:【" + dto.getZoneId() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/off") |
| | | @OperationLog(value = "批量强制下架", type = "flower_list") |
| | | @ApiOperation(value = "批量强制下架") |
| | | public ResponseEntity<ReturnDataDTO> setFlowersForceOff(@RequestBody FlowerOffDTO dto) { |
| | | flowerService.setFlowersForceOff(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量强制下架商品id:【" + dto.getIds() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @GetMapping("/list/delete") |
| | | @ApiOperation(value = "商品删除") |
| | | @OperationLog(value = "商品删除", type = "flower_list") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "商品id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<?>> deleteFlower(Long id) { |
| | | flowerService.deleteFlower(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | Flower flower = flowerService.selectFlowerById(id); |
| | | String content = "删除商品id:【" + id + "】,商品名称:【" + flower.getName() + "】,商品售价:【" + flower.getPrice() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/params") |
| | | @ApiOperation(value = "获取分类参数列表") |
| | |
| | | } |
| | | |
| | | @PostMapping("/list/recommend/set") |
| | | @OperationLog(value = "批量设置推荐", type = "flower_list") |
| | | @ApiOperation(value = "批量设置推荐") |
| | | public ResponseEntity<ReturnDataDTO> setFlowerRecommend(@RequestBody FlowerRecommendMultipleDTO dto) { |
| | | flowerService.setFlowerRecommend(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量设置推荐id:【" + dto.getIds() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/recommend/cancel") |
| | | @OperationLog(value = "批量取消推荐", type = "flower_list") |
| | | @ApiOperation(value = "批量取消推荐") |
| | | public ResponseEntity<ReturnDataDTO> cancelFlowerRecommend(@RequestBody FlowerRecommendMultipleDTO dto) { |
| | | flowerService.cancelFlowerRecommend(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "批量取消推荐id:【" + dto.getIds() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | |
| | |
| | | flowerService.setFlowerShown(id, false); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping("/list/limiteds") |
| | | @OperationLog(value = "批量设置每人限购", type = "flower_list") |
| | | @ApiOperation(value = "批量设置每人限购") |
| | | public ResponseEntity<ReturnDataDTO> setFlowersLimited(@RequestBody FlowerLimitedDTO dto) { |
| | | flowerService.setFlowersLimited(dto); |
| | | String content = "批量设置每人限购id:【" + dto.getIds() + "】,限购数量:【"+dto.getLimited()+"】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | } |