cloudroam
2024-12-04 2432594a4d11b47a503795349defa31872f85789
src/main/java/com/mzl/flower/web/flower/FlowerZoneController.java
@@ -4,11 +4,14 @@
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.config.exception.ValidationException;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.flower.*;
import com.mzl.flower.dto.response.flower.FlowerListDTO;
import com.mzl.flower.dto.response.flower.FlowerZoneDTO;
import com.mzl.flower.entity.flower.FlowerZone;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerService;
import com.mzl.flower.service.flower.FlowerZoneService;
import io.swagger.annotations.Api;
@@ -39,17 +42,23 @@
    }
    @PostMapping("/page/new")
    @OperationLog(value = "新增专区", type = "flower_zone")
    @ApiOperation(value = "新增专区")
    public ResponseEntity<ReturnDataDTO> addTag(@RequestBody FlowerZoneCreateDTO dto) {
        flowerZoneService.addZone(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "新增专区:专区标题:【" + dto.getName() + "】,专区图片:【" + dto.getBgUrl() + "】,排序:【" + dto.getSeq() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/page/edit")
    @OperationLog(value = "编辑专区", type = "flower_zone")
    @ApiOperation(value = "编辑专区")
    public ResponseEntity<ReturnDataDTO> updateZone(@RequestBody FlowerZoneUpdateDTO dto) {
        flowerZoneService.updateZone(dto);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "编辑专区:专区id:【"+dto.getId()+"】,专区标题:【" + dto.getName() + "】,专区图片:【" + dto.getBgUrl() + "】,排序:【" + dto.getSeq() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/page/view")
@@ -68,13 +77,17 @@
    }
    @GetMapping("/page/delete")
    @OperationLog(value = "删除专区", type = "flower_zone")
    @ApiOperation(value = "删除专区")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "专区id", required = true, dataType = "Long", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteZone(@NotNull(message = "id不能为空") Long id){
        FlowerZone flowerZone = flowerZoneService.selectFlowerZoneById(id);
        flowerZoneService.deleteZone(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除专区:专区id:【" + id + "】,专区标题:【" + flowerZone.getName() + "】,专区图片:【" + flowerZone.getBgUrl() + "】,排序:【" + flowerZone.getSeq() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list")