package com.fjhx.sale.controller.ext;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.item.entity.product.dto.ProductInfoDto;
import com.fjhx.sale.entity.ext.dto.ExtQuotationProductSelectDto;
import com.fjhx.sale.entity.ext.vo.ExtQuotationProductVo;
import com.fjhx.sale.service.ext.ExtQuotationProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 对外报价单产品 前端控制器
 * </p>
 *
 * @author
 * @since 2024-01-14
 */
@RestController
@RequestMapping("/extQuotationProduct")
public class ExtQuotationProductController {

    private final ExtQuotationProductService extQuotationProductService;

    @Autowired
    public ExtQuotationProductController(ExtQuotationProductService extQuotationProductService) {
        this.extQuotationProductService = extQuotationProductService;
    }

    /**
     * 待创建产品分页
     *
     * @return
     */
    @PostMapping("/waitCreateProductPage")
    public Page<ExtQuotationProductVo> waitCreateProductPage(@RequestBody ExtQuotationProductSelectDto dto) {
        return extQuotationProductService.waitCreateProductPage(dto);
    }

    /**
     * 创建产品
     */
    @PostMapping("/createProduct")
    public void createProduct(@RequestBody ProductInfoDto dto) {
        extQuotationProductService.createProduct(dto);
    }


}
