package com.fjhx.sale.controller.documents;

import com.fjhx.sale.entity.documents.dto.DocumentsTransportDto;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.documents.vo.DocumentsTransportVo;
import com.fjhx.sale.entity.documents.dto.DocumentsTransportSelectDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.sale.service.documents.DocumentsTransportService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 单证-货运表 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-20
 */
@RestController
@RequestMapping("/documentsTransport")
public class DocumentsTransportController {

    @Autowired
    private DocumentsTransportService documentsTransportService;

    /**
     * 单证-货运表分页
     */
    @PostMapping("/page")
    public Page<DocumentsTransportVo> page(@RequestBody DocumentsTransportSelectDto dto) {
        return documentsTransportService.getPage(dto);
    }

    /**
     * 单证-货运表明细
     */
    @PostMapping("/detail")
    public DocumentsTransportVo detail(@RequestBody BaseSelectDto dto) {
        return documentsTransportService.detail(dto.getId());
    }


    /**
     * 单证-货运添加
     */
    @PostMapping("/add")
    public void add(@RequestBody DocumentsTransportDto dto) {
        documentsTransportService.add(dto);
    }
}
