master
冯凯 2023-12-05 09:00:37 +08:00
parent f251581efb
commit b04bd0ce13
1 changed files with 11 additions and 0 deletions

View File

@ -1,16 +1,23 @@
package com.vehicle.controller;
import com.dragon.common.redis.service.RedisService;
import com.vehicle.domain.common.req.VehicleOnlineReq;
import com.vehicle.service.VehicleService;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* @author
* @version 1.0
@ -19,11 +26,14 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/vehicle")
@Log4j2
public class VehicleOnlineController {
@Autowired
private VehicleService vehicleService;
@Autowired
private RedisService redisService;
/**
* 线线
@ -34,6 +44,7 @@ public class VehicleOnlineController {
public String vehicleOnline(@RequestBody @Validated VehicleOnlineReq vehicleOnlineReq) {
String topic = vehicleService.vehicleOnline(vehicleOnlineReq);
//返回该车辆的主题
log.info("topic:{}", topic);
return topic;
}