package com.fjhx.victoriatourist.controller.logistics;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.logistics.vo.LogisticsDetailsVo;
import com.fjhx.victoriatourist.entity.logistics.dto.LogisticsDetailsSelectDto;
import com.fjhx.victoriatourist.entity.logistics.dto.LogisticsDetailsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.victoriatourist.service.logistics.LogisticsDetailsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 物流明细 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-17
 */
@RestController
@RequestMapping("/logisticsDetails")
public class LogisticsDetailsController {

    @Autowired
    private LogisticsDetailsService logisticsDetailsService;

    /**
     * 物流明细分页
     */
    @PostMapping("/page")
    public Page<LogisticsDetailsVo> page(@RequestBody LogisticsDetailsSelectDto dto) {
        return logisticsDetailsService.getPage(dto);
    }

    /**
     * 物流明细明细
     */
    @PostMapping("/detail")
    public LogisticsDetailsVo detail(@RequestBody BaseSelectDto dto) {
        return logisticsDetailsService.detail(dto.getId());
    }

    /**
     * 物流明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody LogisticsDetailsDto logisticsDetailsDto) {
        logisticsDetailsService.add(logisticsDetailsDto);
    }

    /**
     * 物流明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody LogisticsDetailsDto logisticsDetailsDto) {
        logisticsDetailsService.edit(logisticsDetailsDto);
    }

    /**
     * 物流明细删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        logisticsDetailsService.delete(dto.getId());
    }

}
