project-car/cloud-modules/cloud-modules-template/src/main/java/com/template/controller/CarController.java

47 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.template.controller;
import com.muyu.common.core.domain.Result;
import com.template.domain.CarType;
import com.template.domain.SysCar;
import com.template.service.CarService;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @Authorliuxinyue
* @Packagecom.template.controller
* @Projectcloud-server
* @nameCarController
* @Date2024/9/21 9:25
*/
@RestController
@RequestMapping("/car")
public class CarController {
@Autowired
private CarService carService;
/**
* 根据VIN码查询车信息
* @param carVin
* @return
*/
@PostMapping("/findCarByVin")
public Result<SysCar> findCarByVin(@RequestParam String carVin){
return Result.success(carService.findCarByVin(carVin));
}
/**
* 根据类型ID获取车辆类型
* @param carTypeId
* @return
*/
@PostMapping("/findCarTypeById")
public Result<CarType> findCarTypeById(@RequestParam Long carTypeId) {
return Result.success(carService.findCarTypeById(carTypeId));
}
}