package com.ruoyi.vehicleInformationCollectionReview.controller;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
import com.ruoyi.vehicleInformationCollectionReview.dto.VehicleInformationCollectionReviewDTO;
|
import com.ruoyi.vehicleInformationCollectionReview.pojo.VehicleInformationCollectionReview;
|
import com.ruoyi.vehicleInformationCollectionReview.service.VehicleInformationCollectionReviewService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/environmentAccess")
|
public class VehicleInformationCollectionController {
|
|
@Autowired
|
private VehicleInformationCollectionReviewService vehicleInformationCollectionReviewService;
|
|
// 查询车辆信息分页列表
|
@GetMapping("/vehicleInfoPage")
|
public AjaxResult vehicleInfoPage(Page page, VehicleInformationCollectionReview vehicleInformationCollectionReview){
|
return AjaxResult.success(vehicleInformationCollectionReviewService.listPage(page,vehicleInformationCollectionReview));
|
}
|
// 新增车辆信息
|
@PostMapping("/vehicleInfoAdd")
|
public AjaxResult vehicleInfoAdd(@RequestBody VehicleInformationCollectionReview vehicleInformationCollectionReview){
|
return AjaxResult.success(vehicleInformationCollectionReviewService.insert(vehicleInformationCollectionReview));
|
}
|
// 修改车辆信息
|
@PutMapping("/vehicleInfoUpdate")
|
public AjaxResult updateRecord(VehicleInformationCollectionReview vehicleInformationCollectionReview){
|
return AjaxResult.success(vehicleInformationCollectionReviewService.updateById(vehicleInformationCollectionReview));
|
}
|
// 删除车辆信息(支持批量)
|
@DeleteMapping("/vehicleInfoDelete")
|
public AjaxResult removeRecords(@RequestBody List<Long> ids){
|
return AjaxResult.success(vehicleInformationCollectionReviewService.removeBatchByIds(ids));
|
}
|
// 审核车辆信息
|
@PostMapping("/vehicleInfoReview")
|
public AjaxResult vehicleInfoReview(@RequestBody VehicleInformationCollectionReviewDTO vehicleInformationCollectionReviewDTO){
|
return AjaxResult.success(vehicleInformationCollectionReviewService.update(Wrappers.<VehicleInformationCollectionReview>lambdaUpdate()
|
.set(VehicleInformationCollectionReview::getReviewStatus,vehicleInformationCollectionReviewDTO.getReviewStatus())
|
.eq(VehicleInformationCollectionReview::getId,vehicleInformationCollectionReviewDTO.getId())));
|
}
|
|
}
|