package com.fjhx.sale.controller.contract;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.contract.vo.ContractProjectVo;
import com.fjhx.sale.entity.contract.dto.ContractProjectSelectDto;
import com.fjhx.sale.entity.contract.dto.ContractProjectDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.contract.ContractProjectService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 外销合同-收费项目 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-17
 */
@RestController
@RequestMapping("/contractProject")
public class ContractProjectController {

    @Autowired
    private ContractProjectService contractProjectService;

    /**
     * 外销合同-收费项目分页
     */
    @PostMapping("/page")
    public Page<ContractProjectVo> page(@RequestBody ContractProjectSelectDto dto) {
        return contractProjectService.getPage(dto);
    }

    /**
     * 外销合同-收费项目明细
     */
    @PostMapping("/detail")
    public ContractProjectVo detail(@RequestBody BaseSelectDto dto) {
        return contractProjectService.detail(dto.getId());
    }

    /**
     * 外销合同-收费项目新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ContractProjectDto contractProjectDto) {
        contractProjectService.add(contractProjectDto);
    }

    /**
     * 外销合同-收费项目编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody ContractProjectDto contractProjectDto) {
        contractProjectService.edit(contractProjectDto);
    }

    /**
     * 外销合同-收费项目删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        contractProjectService.delete(dto.getId());
    }

}
