package com.fjhx.ehsd.controller.freight;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.ehsd.entity.freight.vo.FreightForwarderVo;
import com.fjhx.ehsd.entity.freight.dto.FreightForwarderSelectDto;
import com.fjhx.ehsd.entity.freight.dto.FreightForwarderDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.ehsd.service.freight.FreightForwarderService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 货代公司管理 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-05-05
 */
@RestController
@RequestMapping("/freightForwarder")
public class FreightForwarderController {

    @Autowired
    private FreightForwarderService freightForwarderService;

    /**
     * 货代公司管理分页
     */
    @PostMapping("/page")
    public Page<FreightForwarderVo> page(@RequestBody FreightForwarderSelectDto dto) {
        return freightForwarderService.getPage(dto);
    }

    /**
     * 货代公司管理明细
     */
    @PostMapping("/detail")
    public FreightForwarderVo detail(@RequestBody BaseSelectDto dto) {
        return freightForwarderService.detail(dto.getId());
    }

    /**
     * 货代公司管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody FreightForwarderDto freightForwarderDto) {
        freightForwarderService.add(freightForwarderDto);
    }

    /**
     * 货代公司管理编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody FreightForwarderDto freightForwarderDto) {
        freightForwarderService.edit(freightForwarderDto);
    }

    /**
     * 货代公司管理删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        freightForwarderService.delete(dto.getId());
    }

}
