| | |
| | | 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.dto.request.flower.*; |
| | | import com.mzl.flower.dto.response.flower.FlowerParamDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerParamItemDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerParamListDTO; |
| | | import com.mzl.flower.entity.flower.FlowerParam; |
| | | import com.mzl.flower.entity.flower.FlowerParamItem; |
| | | import com.mzl.flower.entity.log.OperationRecord; |
| | | import com.mzl.flower.service.flower.FlowerParamService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | } |
| | | |
| | | @PostMapping("/list/edit") |
| | | @OperationLog(value = "编辑商品参数集", type = "flower_param") |
| | | @ApiOperation(value = "编辑商品参数集") |
| | | public ResponseEntity<ReturnDataDTO> updateParam(@RequestBody FlowerParamUpdateDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), paramService.updateParam(dto)); |
| | | String content = ""; |
| | | content = "编辑商品参数集id:【" + dto.getId() + "】参数模板名称:【" + dto.getName() + "】,排序:【" + dto.getSortBy() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), paramService.updateParam(dto), operationRecord); |
| | | |
| | | } |
| | | |
| | | @GetMapping("/list/view") |
| | |
| | | } |
| | | |
| | | @GetMapping("/list/delete") |
| | | @OperationLog(value = "删除商品参数集", type = "flower_param") |
| | | @ApiOperation(value = "删除商品参数集") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "商品参数集id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<?>> deleteParam(Long id){ |
| | | FlowerParam flowerParam = paramService.selectFlowerParamById(id); |
| | | paramService.deleteParam(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "删除商品参数集:参数id:【" + id + "】,参数模板名称【" + flowerParam.getName() + "】,排序:【" + flowerParam.getSortBy() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @GetMapping("/list/items") |
| | |
| | | } |
| | | |
| | | @GetMapping("/list/items/delete") |
| | | @OperationLog(value = "删除参数", type = "flower_param") |
| | | @ApiOperation(value = "删除参数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "参数id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<?>> deleteParamItem(Long id){ |
| | | FlowerParamItem flowerParamItem = paramService.selectFlowerParamItemById(id); |
| | | paramService.deleteParamItem(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | String content = "删除参数:参数id:【" + flowerParamItem.getParamId() + "】,参数名称【" + flowerParamItem.getName() + "】,参数值:【" + flowerParamItem.getContent() + "】,排序:【" + flowerParamItem.getSortBy() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), null, operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/items/new") |
| | | @OperationLog(value = "新增参数", type = "flower_param") |
| | | @ApiOperation(value = "新增参数") |
| | | public ResponseEntity<ReturnDataDTO> addParamItem(@RequestBody FlowerParamItemCreateDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), paramService.addParamItem(dto)); |
| | | String content = "新增参数:参数id:【" + dto.getParamId() + "】,参数名称【" + dto.getName() + "】,参数值:【" + dto.getContent() + "】,排序:【" + dto.getSortBy() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), paramService.addParamItem(dto), operationRecord); |
| | | } |
| | | |
| | | @PostMapping("/list/items/edit") |
| | | @OperationLog(value = "编辑参数", type = "flower_param") |
| | | @ApiOperation(value = "编辑参数") |
| | | public ResponseEntity<ReturnDataDTO> updateParamItem(@RequestBody FlowerParamItemUpdateDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), paramService.updateParamItem(dto)); |
| | | String content = "编辑参数:参数id:【" + dto.getParamId() + "】,参数名称【" + dto.getName() + "】,参数值:【" + dto.getContent() + "】,排序:【" + dto.getSortBy() + "】"; |
| | | OperationRecord operationRecord = getOperationRecord(content); |
| | | return returnData(R.SUCCESS.getCode(), paramService.updateParamItem(dto), operationRecord); |
| | | } |
| | | } |