package com.fjhx.sale.controller.serviceContract;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.serviceContract.vo.ServiceContractRecordVo;
import com.fjhx.sale.entity.serviceContract.dto.ServiceContractRecordSelectDto;
import com.fjhx.sale.entity.serviceContract.dto.ServiceContractRecordDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.serviceContract.ServiceContractRecordService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 服务合同记录表 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-18
 */
@RestController
@RequestMapping("/serviceContractRecord")
public class ServiceContractRecordController {

    @Autowired
    private ServiceContractRecordService serviceContractRecordService;

    /**
     * 服务合同记录表分页
     */
    @PostMapping("/page")
    public Page<ServiceContractRecordVo> page(@RequestBody ServiceContractRecordSelectDto dto) {
        return serviceContractRecordService.getPage(dto);
    }

    /**
     * 服务合同记录表明细
     */
    @PostMapping("/detail")
    public ServiceContractRecordVo detail(@RequestBody BaseSelectDto dto) {
        return serviceContractRecordService.detail(dto.getId());
    }

    /**
     * 服务合同记录表新增
     */
    @PostMapping("/add")
    public void add(@RequestBody ServiceContractRecordDto serviceContractRecordDto) {
        serviceContractRecordService.add(serviceContractRecordDto);
    }

}
