package com.yh.saas.plugin.yiliangyiyun.controller;


import com.yh.saas.plugin.yiliangyiyun.entity.DriverCarInfo;
import com.yh.saas.plugin.yiliangyiyun.service.IDriverCarInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 记录货车信息 前端控制器
 * </p>
 *
 * @author Gongdc
 * @since 2021-05-29
 */
@RestController
@RequestMapping("/driverCarInfo")
public class DriverCarInfoController {

    @Autowired
    private IDriverCarInfoService driverCarInfoService;

    /**
     * 删除货车信息
     * @param example
     */
    @PostMapping("/api/deleteDriverCar")
    public void deleteDriverCar(@RequestBody DriverCarInfo example){
        driverCarInfoService.deleteDriverCar(example.getId());
    }

    /**
     * 车牌号下拉列表
     * @return
     */
    @GetMapping("/selectCarNumber")
    public List<DriverCarInfo> selectCarNumber(@RequestBody String driverId){
        return driverCarInfoService.selectCarNumber(driverId);
    }
}

