package com.fjhx.sale.controller.purchase;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.purchase.dto.EhsdPurchaseProjectDto;
import com.fjhx.sale.entity.purchase.dto.EhsdPurchaseProjectSelectDto;
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProjectVo;
import com.fjhx.sale.service.purchase.EhsdPurchaseProjectService;
import com.ruoyi.common.core.domain.BaseSelectDto;
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 2023-05-17
 */
@RestController
@RequestMapping("/ehsdPurchaseProject")
public class EhsdPurchaseProjectController {

    @Autowired
    private EhsdPurchaseProjectService ehsdPurchaseProjectService;

    /**
     * 采购合同-收费项目分页
     */
    @PostMapping("/page")
    public Page<EhsdPurchaseProjectVo> page(@RequestBody EhsdPurchaseProjectSelectDto dto) {
        return ehsdPurchaseProjectService.getPage(dto);
    }

    /**
     * 采购合同-收费项目明细
     */
    @PostMapping("/detail")
    public EhsdPurchaseProjectVo detail(@RequestBody BaseSelectDto dto) {
        return ehsdPurchaseProjectService.detail(dto.getId());
    }

    /**
     * 采购合同-收费项目新增
     */
    @PostMapping("/add")
    public void add(@RequestBody EhsdPurchaseProjectDto ehsdPurchaseProjectDto) {
        ehsdPurchaseProjectService.add(ehsdPurchaseProjectDto);
    }

    /**
     * 采购合同-收费项目编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody EhsdPurchaseProjectDto ehsdPurchaseProjectDto) {
        ehsdPurchaseProjectService.edit(ehsdPurchaseProjectDto);
    }

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

}
