package org.springblade.modules.app.web.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.dto.TransportDTO;
import org.springblade.modules.app.common.query.AdminWaybillQuery;
import org.springblade.modules.app.manager.TransportManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: AdminUserController
 * @Description:
 * @author: fxs
 * @createTime: 2021-11-22-16:11
 */
@RestController
@RequestMapping("app/admin/transport")
@Api(value = "运输单管理-管理端", tags = "运输单管理-管理端")
public class AdminTransportController extends BaseController {

    @Autowired
    private TransportManager transportManager;

    //@ApiOperation(value = "分页查询运输单")
    @GetMapping("/page")
    public ResponseEntity<ResultDTO<Page<TransportDTO>>> pageTransport(AdminWaybillQuery transportQuery) {
        return success(transportManager.pageTransport(transportQuery));
    }

    //@ApiOperation(value = "查询运输单详情", notes = "返回运输单阶段信息")
    @GetMapping("/{id}")
    public ResponseEntity<ResultDTO<TransportDTO>> getTransportStageDetail(@PathVariable Long id) {
        return success(transportManager.getAdminTransportDetail(id));
    }

}
