VehicleController.java 1.24 KB
package com.genersoft.iot.vmp.vehicle.controller;

import com.genersoft.iot.vmp.vehicle.pojo.vo.VehicleVo;
import com.genersoft.iot.vmp.vehicle.service.VehicleDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/vehicle")
public class VehicleController {

    @Autowired
    private VehicleDeviceService vehicleDeviceService;


    @GetMapping("/query")
    public VehicleVo queryVehicleList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize,
                                      @RequestParam(value = "online",required = false) String online,@RequestParam(value = "filterOld",required = false) Boolean filterOld) {
        return vehicleDeviceService.queryVehicleList(pageNo,pageSize,online, filterOld);
    }


    @GetMapping("/onPlay")
    public String onPlay(@RequestParam("deviceId") String deviceId,@RequestParam("channel")String channel) {
        return vehicleDeviceService.onPlay(deviceId,channel);
    }

}