feat():删除远程调用方法
parent
846a03f75c
commit
3b35565404
|
@ -1,40 +0,0 @@
|
||||||
package com.muyu.cloud.protocol.parsing.feign;
|
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.domain.resp.MessageValueListResp;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiDongJia
|
|
||||||
* @Package: com.muyu.cloud.protocol.parsing.feign
|
|
||||||
* @Project: 2112-car-cloud-server
|
|
||||||
* @name: RemoteServiceClient
|
|
||||||
* @Date: 2024/9/28 14:49
|
|
||||||
* @Description: 远程调用接口
|
|
||||||
*/
|
|
||||||
@FeignClient(name = "cloud-car")
|
|
||||||
public interface RemoteServiceClient {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过车辆vin码查询模板id
|
|
||||||
* @param vehicleVin
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/vehicleManage/findByVehicleVin/{vehicleVin}")
|
|
||||||
@Operation(description = "通过车辆vin码查询模板id")
|
|
||||||
public Result<Long> findByVehicleVin(@PathVariable("vehicleVin") String vehicleVin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据报文模版id查询报文数据
|
|
||||||
* @param templateId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/messageValue/findByTemplateId/{templateId}")
|
|
||||||
@Operation(summary = "根据报文模版id查询报文数据", description = "根据报文模版id查询报文数据")
|
|
||||||
public Result<List<MessageValueListResp>> findByTemplateId(@PathVariable("templateId") Long templateId);
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package com.muyu.cloud.protocol.parsing.feign.factory;
|
|
||||||
|
|
||||||
import com.muyu.cloud.protocol.parsing.feign.RemoteServiceClient;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.domain.resp.MessageValueListResp;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报文模版对象服务降级处理
|
|
||||||
* @Author:李庆帅
|
|
||||||
* @Package:com.muyu.analysis.parsing.remote.factory
|
|
||||||
* @Project:cloud-server
|
|
||||||
* @name:RemoteServiceClientFactory
|
|
||||||
* @Date:2024/9/28 21:16
|
|
||||||
*/
|
|
||||||
public class RemoteServiceClientFactory implements FallbackFactory<RemoteServiceClient>
|
|
||||||
{
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(com.muyu.cloud.protocol.parsing.feign.factory.RemoteServiceClientFactory.class);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RemoteServiceClient create(Throwable throwable) {
|
|
||||||
log.error("报文模版传参调用失败:{}", throwable.getMessage());
|
|
||||||
return new RemoteServiceClient() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<Long> findByVehicleVin(String vehicleVin) {
|
|
||||||
return Result.success(Long.valueOf(vehicleVin));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result<List<MessageValueListResp>> findByTemplateId(Long templateId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +1,10 @@
|
||||||
package com.muyu.cloud.protocol.parsing.test;
|
package com.muyu.cloud.protocol.parsing.test;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.muyu.cloud.protocol.parsing.feign.RemoteServiceClient;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.domain.Vehicle;
|
import com.muyu.domain.Vehicle;
|
||||||
import com.muyu.domain.VehicleType;
|
import com.muyu.domain.VehicleType;
|
||||||
import com.muyu.domain.resp.MessageValueListResp;
|
import com.muyu.domain.resp.MessageValueListResp;
|
||||||
import com.muyu.domain.resp.VehicleManageResp;
|
|
||||||
import com.muyu.enterprise.cache.AllMessageValueCacheService;
|
import com.muyu.enterprise.cache.AllMessageValueCacheService;
|
||||||
import com.muyu.enterprise.cache.AllVehicleCacheService;
|
|
||||||
import com.muyu.enterprise.cache.VehicleCacheService;
|
import com.muyu.enterprise.cache.VehicleCacheService;
|
||||||
import com.muyu.enterprise.cache.VehicleTypeCacheService;
|
import com.muyu.enterprise.cache.VehicleTypeCacheService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
@ -17,7 +12,6 @@ import org.apache.kafka.clients.producer.KafkaProducer;
|
||||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
import org.apache.kafka.clients.producer.ProducerRecord;
|
||||||
import org.eclipse.paho.client.mqttv3.*;
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
@ -34,13 +28,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Component
|
@Component
|
||||||
public class ParsingTest {
|
public class ParsingMessage {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private RedisTemplate<String, Object> redisTemplate;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RemoteServiceClient remoteServiceClient;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private KafkaProducer<String, String> kafkaProducer;
|
private KafkaProducer<String, String> kafkaProducer;
|
Loading…
Reference in New Issue