Cui Zhi Feng
2024-09-02 e947fcb46dc87b2bcdf8f666b6def2c42e43a81a
src/main/java/com/mzl/flower/web/partner/FlowerMarkupSpController.java
@@ -6,6 +6,7 @@
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.config.exception.ValidationException;
import com.mzl.flower.dto.request.flower.FlowerMarkupSpQueryDTO;
import com.mzl.flower.dto.request.flower.FlowerMarkupSpSaveBatchDTO;
import com.mzl.flower.dto.request.flower.FlowerMarkupSpSaveDTO;
import com.mzl.flower.dto.response.flower.FlowerMarkupSpDTO;
import com.mzl.flower.dto.response.flower.FlowerMarkupSpListDTO;
@@ -65,7 +66,8 @@
    
    @GetMapping("/list")
    @ApiOperation(value = "获取商品加价列表")
    public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpList(Page page, FlowerMarkupSpQueryDTO dto){
    public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpList(Page page
            , FlowerMarkupSpQueryDTO dto){
        Partner s = spService.getCurrentPartner();
        if(s == null){
            throw new ValidationException("未找到当前合伙人信息");
@@ -93,4 +95,28 @@
        return returnData(R.SUCCESS.getCode(), null);
    }
    @GetMapping("/flower/list")
    @ApiOperation(value = "获取加价商品加列表")
    public ResponseEntity<ReturnDataDTO<Page<FlowerMarkupSpListDTO>>> selectMarkupSpFlowerList(Page page
            , FlowerMarkupSpQueryDTO dto){
        Partner s = spService.getCurrentPartner();
        if(s == null){
            throw new ValidationException("未找到当前合伙人信息");
        }
        dto.setPartnerId(s.getId());
        return returnData(R.SUCCESS.getCode(), spService.selectMarkupSpFlowerList(page, dto));
    }
    @PostMapping("/flower/list/save")
    @ApiOperation(value = "批量新增商品加价")
    public ResponseEntity<ReturnDataDTO> saveMarkupSpBatch(@RequestBody FlowerMarkupSpSaveBatchDTO dto) {
        Partner s = spService.getCurrentPartner();
        if(s == null){
            throw new ValidationException("未找到当前合伙人信息");
        }
        dto.setPartnerId(s.getId());
        spService.saveMarkupSpBatch(dto);
        return returnData(R.SUCCESS.getCode(), null);
    }
}