liujie
2026-05-12 0bcfca6b2561d096a2ce26e2e7200cd0768b2b6d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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();
    }
}