package com.ruoyi.web.controller.system; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.service.IVehicleSyncDataService; import com.ruoyi.system.service.IVehicleSyncService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 车辆同步Controller * * @author ruoyi * @date 2025-10-20 */ @RestController @RequestMapping("/system/vehicle/sync") public class VehicleSyncController extends BaseController { @Autowired private IVehicleSyncService vehicleSyncService; @Autowired private IVehicleSyncDataService vehicleSyncDataService; /** * 手动同步旧系统车辆数据 */ @PreAuthorize("@ss.hasPermi('system:vehicle:sync')") @PostMapping("/legacy") public AjaxResult syncLegacyVehicles() { return vehicleSyncService.syncVehicles(this.vehicleSyncDataService.getVehiclesFromSqlServer()); } }