package com.dsh.course.controller; import com.dsh.course.model.vo.ServerCarModelListRes; import com.dsh.course.model.vo.ServerCarModelRes; import com.dsh.course.service.IServerCarModelService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("/serverCarModel") public class ServerCarModelController { @Autowired private IServerCarModelService serverCarModelService; /** * 根据类型获取服务车型 * @param type * @return */ @PostMapping("/queryServerCarModel") public ServerCarModelListRes queryServerCarModel(Integer type){ try { List list = serverCarModelService.queryServerCarModel(type); ServerCarModelListRes listRes = new ServerCarModelListRes(); listRes.setList(list); return listRes; }catch (Exception e){ e.printStackTrace(); return null; } } }