修改查询车型接口,增加车型图片

This commit is contained in:
2025-07-27 21:08:08 +08:00
parent 96716607d6
commit f9eeba6e5e
3 changed files with 12 additions and 6 deletions

View File

@ -1,16 +1,15 @@
package com.sczx.car.controller; package com.sczx.car.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sczx.car.common.Result; import com.sczx.car.common.Result;
import com.sczx.car.dto.CarModelSimpleDTO; import com.sczx.car.dto.CarModelSimpleDTO;
import com.sczx.car.dto.req.StoreCarModelReq;
import com.sczx.car.service.CarModelService; import com.sczx.car.service.CarModelService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
@ -28,6 +27,13 @@ public class CarModelController {
@Autowired @Autowired
private CarModelService carModelService; private CarModelService carModelService;
@ApiOperation(value = "分页查询门店车型列表")
@PostMapping("/pageStoreCarModel")
Result<IPage<CarModelSimpleDTO>> pageStoreCarModel(@RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize,
@RequestBody StoreCarModelReq storeCarModelReq){
return Result.ok(carModelService.pageCarModelSimpleDTO(storeCarModelReq, pageNo, pageSize));
}
@ApiOperation(value = "根据车型id查询车型") @ApiOperation(value = "根据车型id查询车型")
@GetMapping("/getCarModelByModelId") @GetMapping("/getCarModelByModelId")

View File

@ -24,7 +24,7 @@ public class CarModelSimpleDTO {
private String brandName; private String brandName;
@ApiModelProperty("租赁类型(时租/日租/按天数/以租代售),用逗号分隔") @ApiModelProperty("租赁类型(时租/日租/按天数/以租代售),用逗号分隔")
private String batteryTypes; private String rentalTypes;
@ApiModelProperty("是否支持免押(0不支持 1支持)") @ApiModelProperty("是否支持免押(0不支持 1支持)")
private String depositFree; private String depositFree;

View File

@ -12,7 +12,7 @@
s.store_number AS store_number, s.store_number AS store_number,
cm.model_name AS model_name, cm.model_name AS model_name,
cm.brand_name AS brand_name, cm.brand_name AS brand_name,
GROUP_CONCAT(DISTINCT r.rental_type SEPARATOR ',') AS battery_types, GROUP_CONCAT(DISTINCT r.rental_type SEPARATOR ',') AS rental_types,
MAX(r.deposit_free) AS deposit_free, MAX(r.deposit_free) AS deposit_free,
MAX(r.auto_deduct) AS auto_deduct MAX(r.auto_deduct) AS auto_deduct
FROM FROM