|
|
@@ -2,20 +2,35 @@ package com.ydtech.modules.ser.controller;
|
|
|
|
|
|
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
+import com.ydtech.modules.ser.dao.SerCarInfoMapper;
|
|
|
import com.ydtech.modules.ser.model.SerCarInfo;
|
|
|
import com.ydtech.modules.ser.service.SerCarInfoService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
@RestController
|
|
|
@RequestMapping("/ser/carInfo")
|
|
|
@Api(tags = "车辆信息")
|
|
|
public class SerCarInfoController {
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private SerCarInfoService serCarInfoService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private SerCarInfoMapper serCarInfoMapper;
|
|
|
+
|
|
|
+ @ApiOperation("车辆信息通过id查询")
|
|
|
+ @PostMapping("queryById")
|
|
|
+ public HttpResult queryById(@RequestBody SerCarInfo SerCarInfo) {
|
|
|
+ SerCarInfo serCarInfo = serCarInfoMapper.selectById(SerCarInfo);
|
|
|
+ if (serCarInfo == null) {
|
|
|
+ return HttpResult.error("未找到对应的车辆信息");
|
|
|
+ }
|
|
|
+ return HttpResult.ok("查询成功", serCarInfo);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("车辆信息根据userid查询")
|
|
|
@PostMapping("queryByUserId")
|
|
|
public HttpResult queryCarInfoByUserId(){
|