package com.fjhx.jxst.controller.sales;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.jxst.entity.sales.vo.SalesContractVo;
import com.fjhx.jxst.entity.sales.dto.SalesContractSelectDto;
import com.fjhx.jxst.entity.sales.dto.SalesContractDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.jxst.service.sales.SalesContractService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 销售合同 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-16
 */
@RestController
@RequestMapping("/salesContract")
public class SalesContractController {

    @Autowired
    private SalesContractService salesContractService;

    /**
     * 销售合同分页
     */
    @PostMapping("/page")
    public Page<SalesContractVo> page(@RequestBody SalesContractSelectDto dto) {
        return salesContractService.getPage(dto);
    }

    /**
     * 销售合同明细
     */
    @PostMapping("/detail")
    public SalesContractVo detail(@RequestBody BaseSelectDto dto) {
        return salesContractService.detail(dto.getId());
    }

    /**
     * 销售合同新增
     */
    @PostMapping("/add")
    public void add(@RequestBody SalesContractDto salesContractDto) {
        salesContractService.add(salesContractDto);
    }

}
