Pu Zhibing
2025-04-04 3d4eeb82dd61f8951616dece2425e870116bc23d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.ruoyi.system.controller;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.system.api.model.Driver;
import com.ruoyi.system.query.DriverListReq;
import com.ruoyi.system.query.DriverListResp;
import com.ruoyi.system.service.IDriverService;
import io.swagger.annotations.ApiOperation;
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;
 
import javax.annotation.Resource;
 
/**
 * @author zhibing.pu
 * @Date 2025/3/27 16:20
 */
@RestController
@RequestMapping("/driver")
public class DriverController {
    
    @Resource
    private IDriverService driverService;
    
    @GetMapping("/getDriverList")
    @ApiOperation(value = "获取司机列表", tags = {"司机管理"})
    public R<PageInfo<DriverListResp>> getDriverList(DriverListReq driverListReq) {
        PageInfo<DriverListResp> page = driverService.getDriverList(driverListReq);
        return R.ok(page);
    }
    
    
    @GetMapping("/getDriverInfo/{id}")
    @ApiOperation(value = "获取司机详情", tags = {"司机管理"})
    public R<Driver> getDriverInfo(@PathVariable("id") Integer id) {
        Driver driver = driverService.getById(id);
        return R.ok(driver);
    }
}