fix: 使用@Autowired替代@Resource(Java 17兼容性)

This commit is contained in:
k kfluous
2026-03-12 12:32:56 +08:00
parent 997e492800
commit a242735de8
2 changed files with 7 additions and 7 deletions

View File

@@ -8,13 +8,13 @@ import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleSimpleRe
import cn.iocoder.yudao.module.asset.service.vehicle.VehicleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
@@ -26,7 +26,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated
public class VehicleController {
@Resource
@Autowired
private VehicleService vehicleService;
@GetMapping("/page")

View File

@@ -16,10 +16,10 @@ import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleBusinessMapper;
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleLocationMapper;
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleStatusMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -34,13 +34,13 @@ import java.util.stream.Collectors;
@Slf4j
public class VehicleServiceImpl implements VehicleService {
@Resource
@Autowired
private VehicleBaseMapper vehicleBaseMapper;
@Resource
@Autowired
private VehicleLocationMapper vehicleLocationMapper;
@Resource
@Autowired
private VehicleBusinessMapper vehicleBusinessMapper;
@Resource
@Autowired
private VehicleStatusMapper vehicleStatusMapper;
@Override