feat(): 新增数据处理的实时数据订阅开关远程调用方法
parent
d8df22e0e5
commit
a51bb049f6
|
@ -32,4 +32,5 @@ public class ServiceNameConstants {
|
||||||
|
|
||||||
public static final String SAAS_SERVICE = "cloud-system-saas";
|
public static final String SAAS_SERVICE = "cloud-system-saas";
|
||||||
|
|
||||||
|
public static final String DATA_SERVICE = "cloud-data-processing";
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.muyu.common.system.remote;
|
||||||
|
|
||||||
|
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.system.remote.factory.RemoteDataFallbackFactory;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据处理服务
|
||||||
|
*
|
||||||
|
* @Author: 胡杨
|
||||||
|
* @Name: RemoteDataService
|
||||||
|
* @Description: 数据处理服务
|
||||||
|
* @CreatedDate: 2024/10/10 下午6:25
|
||||||
|
* @FilePath: com.muyu.common.system.remote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteDataService", value = ServiceNameConstants.DATA_SERVICE, fallbackFactory = RemoteDataFallbackFactory.class)
|
||||||
|
public interface RemoteDataService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆实时数据订阅开关
|
||||||
|
* @param vin 车辆vin码
|
||||||
|
* @param status 开关状态
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/DataProcessing/carRealTimeStatus")
|
||||||
|
public Result<String> carRealTimeStatus(@RequestParam("vin") @NonNull String vin, @RequestParam("status") @NonNull Boolean status);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.common.system.remote.factory;
|
||||||
|
|
||||||
|
import com.muyu.common.system.remote.RemoteDataService;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据处理访问熔断器
|
||||||
|
*
|
||||||
|
* @Author: 胡杨
|
||||||
|
* @Name: RemoteDataFallbackFactory
|
||||||
|
* @Description: 数据处理访问熔断器
|
||||||
|
* @CreatedDate: 2024/10/10 下午6:26
|
||||||
|
* @FilePath: com.muyu.common.system.remote.factory
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class RemoteDataFallbackFactory implements FallbackFactory<RemoteDataService> {
|
||||||
|
@Override
|
||||||
|
public RemoteDataService create(Throwable cause) {
|
||||||
|
return new RemoteDataService() {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
||||||
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
||||||
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
||||||
|
com.muyu.common.system.remote.factory.RemoteDataFallbackFactory
|
||||||
com.muyu.common.system.remote.factory.RemoteSaasFallbackFactory
|
com.muyu.common.system.remote.factory.RemoteSaasFallbackFactory
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue