package com.xiaopeng.map.controller;
|
|
import com.xiaopeng.common.core.domain.R;
|
import com.xiaopeng.map.service.AdcFencePushService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* ADC 围栏推送内部 API(供 vehicle-convoy 等服务通过 Feign 调用)
|
*/
|
@Slf4j
|
@RestController
|
@Api(tags = "ADC围栏推送-内部接口")
|
@RequestMapping("/logan/inner/adc")
|
public class AdcFencePushController {
|
|
@Autowired
|
private AdcFencePushService adcFencePushService;
|
|
@ApiOperation("单车推送:车辆绑定围栏后触发")
|
@PostMapping("/pushFenceToVehicle")
|
public R<?> pushFenceToVehicle(@RequestParam("vehicleVin") String vehicleVin,
|
@RequestParam("electronicId") Long electronicId) {
|
adcFencePushService.pushFenceToSingleVehicle(vehicleVin, electronicId);
|
return R.ok();
|
}
|
|
@ApiOperation("围栏维度推送:围栏变更后触发")
|
@PostMapping("/pushFenceToVehicles")
|
public R<?> pushFenceToVehicles(@RequestParam("electronicId") Long electronicId) {
|
adcFencePushService.pushFenceToVehicles(electronicId);
|
return R.ok();
|
}
|
|
@ApiOperation("查询车辆绑定围栏的最新XPU版本号")
|
@GetMapping("/getMapVersion")
|
public R<String> getMapVersion(@RequestParam("vin") String vin) {
|
String version = adcFencePushService.getLatestPushVersion(vin);
|
return R.ok(version);
|
}
|
|
@ApiOperation("手动推送:运维手动触发指定围栏向所有绑定车辆推送")
|
@PostMapping("/manualPush")
|
public R<?> manualPush(@RequestParam("electronicId") Long electronicId) {
|
log.info("[ADC推送] 手动触发围栏{}推送", electronicId);
|
adcFencePushService.pushFenceToVehicles(electronicId);
|
return R.ok();
|
}
|
|
@ApiOperation("手动推送:运维手动触发指定车辆推送")
|
@PostMapping("/manualPushToVehicle")
|
public R<?> manualPushToVehicle(@RequestParam("vehicleVin") String vehicleVin,
|
@RequestParam("electronicId") Long electronicId) {
|
log.info("[ADC推送] 手动触发车辆{}围栏{}推送", vehicleVin, electronicId);
|
adcFencePushService.pushFenceToSingleVehicle(vehicleVin, electronicId);
|
return R.ok();
|
}
|
}
|