feat(): 新增数据处理的实时数据订阅开关远程调用方法

dev
面包骑士 2024-10-10 18:30:23 +08:00
parent d8df22e0e5
commit a51bb049f6
4 changed files with 59 additions and 1 deletions

View File

@ -32,4 +32,5 @@ public class ServiceNameConstants {
public static final String SAAS_SERVICE = "cloud-system-saas";
public static final String DATA_SERVICE = "cloud-data-processing";
}

View File

@ -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);
}

View File

@ -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() {
};
}
}

View File

@ -1,7 +1,7 @@
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
com.muyu.common.system.remote.factory.RemoteDataFallbackFactory
com.muyu.common.system.remote.factory.RemoteSaasFallbackFactory