GateWayNode/src/main/java/com/guo/controller/GateWayController.java

40 lines
1.0 KiB
Java

package com.guo.controller;
import com.guo.common.domain.Result;
import com.guo.service.impl.GateWayLoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author gxb
* @description 网关控制层
* @date 2024-04-18 14:29
*/
@RestController
@RequestMapping("/gateway")
public class GateWayController {
@Autowired
private GateWayLoadService gateWayLoadService;
/**
* 车辆上线
* @param VehicleVIN 车辆VIN
* @return 返回公网IP
*/
@PostMapping("/load/node/{VehicleVIN}")
public Result<String> loadNode(@PathVariable("VehicleVIN") String VehicleVIN){
return Result.success(gateWayLoadService.loadNode(VehicleVIN));
}
/**
* 车辆下线
* @param VehicleVIN 车辆VIN
*/
@PostMapping("/vehicle/removal/{VehicleVIN}")
public void vehicleRemoval(@PathVariable("VehicleVIN") String VehicleVIN){
gateWayLoadService.vehicleRemoval(VehicleVIN);
}
}