cloudroam
2024-12-04 6c823dd44dbde79f008001a2a11e7bf9bc6bf8cc
src/main/java/com/mzl/flower/web/flower/FlowerTagController.java
@@ -4,10 +4,13 @@
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.FlowerTagCreateDTO;
import com.mzl.flower.dto.request.flower.FlowerTagQueryDTO;
import com.mzl.flower.dto.request.flower.FlowerTagUpdateDTO;
import com.mzl.flower.dto.response.flower.FlowerTagDTO;
import com.mzl.flower.entity.flower.FlowerTag;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.service.flower.FlowerTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -33,15 +36,21 @@
    private FlowerTagService tagService;
    @PostMapping("/list/new")
    @OperationLog(value = "新增商品标签", type = "tag_list")
    @ApiOperation(value = "新增商品标签")
    public ResponseEntity<ReturnDataDTO> addTag(@RequestBody FlowerTagCreateDTO dto) {
        return returnData(R.SUCCESS.getCode(), tagService.addTag(dto));
        String content = "新增商品标签标签名称:【" + dto.getName() + "】,标签说明:【" + dto.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), tagService.addTag(dto), operationRecord);
    }
    @PostMapping("/list/edit")
    @OperationLog(value = "编辑商品标签", type = "tag_list")
    @ApiOperation(value = "编辑商品标签")
    public ResponseEntity<ReturnDataDTO> updateTag(@RequestBody FlowerTagUpdateDTO dto) {
        return returnData(R.SUCCESS.getCode(), tagService.updateTag(dto));
        String content = "编辑商品标签id:【" + dto.getId() + "】标签名称:【" + dto.getName() + "】,标签说明:【" + dto.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), tagService.updateTag(dto), operationRecord);
    }
    @GetMapping("/list/view")
@@ -60,13 +69,17 @@
    }
    @GetMapping("/list/delete")
    @OperationLog(value = "删除商品标签", type = "tag_list")
    @ApiOperation(value = "删除商品标签")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "商品标签id", required = true, dataType = "String", paramType = "query")
    })
    public ResponseEntity<ReturnDataDTO<?>> deleteTag(Long id){
        FlowerTag flowerTag = tagService.selectFlowerTagById(id);
        tagService.deleteTag(id);
        return returnData(R.SUCCESS.getCode(), null);
        String content = "删除商品标签id:【" + id + "】标签名称:【" + flowerTag.getName() + "】,标签说明:【" + flowerTag.getRemarks() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
}