42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
package com.hivekion.scenario.controller;
|
|
|
|
import com.hivekion.scenario.entity.Vehicle;
|
|
import com.hivekion.scenario.service.IResourceService;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* <p>
|
|
* 建筑资源表 前端控制器
|
|
* </p>
|
|
*
|
|
* @author wangWenHua
|
|
* @since 2025-09-14
|
|
*/
|
|
@Controller
|
|
@RequestMapping("/scenario/resource")
|
|
public class ResourceController {
|
|
|
|
@Resource
|
|
private IResourceService resourceService;
|
|
|
|
|
|
@GetMapping("/listVehiclesByType")
|
|
public List<Vehicle> listVehiclesByType(@RequestParam("type") Integer type, @RequestParam("resourceId") Integer resourceId){
|
|
List<Vehicle> vehicleList = new ArrayList<>();
|
|
try{
|
|
vehicleList = this.resourceService.listAllVehiclesByType(type,resourceId);
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return vehicleList;
|
|
}
|
|
|
|
}
|