[集群] 修复BUG
parent
30ab315a15
commit
a9a4c7a4e5
|
@ -109,10 +109,6 @@ public class EventPublisher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void catalogEventPublish(CatalogEvent event) {
|
|
||||||
applicationEventPublisher.publishEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void mobilePositionEventPublish(MobilePosition mobilePosition) {
|
public void mobilePositionEventPublish(MobilePosition mobilePosition) {
|
||||||
MobilePositionEvent event = new MobilePositionEvent(this);
|
MobilePositionEvent event = new MobilePositionEvent(this);
|
||||||
event.setMobilePosition(mobilePosition);
|
event.setMobilePosition(mobilePosition);
|
||||||
|
|
|
@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RedisRpcController("platform")
|
@RedisRpcController("platform")
|
||||||
|
@ -69,11 +71,10 @@ public class RedisRpcPlatformController extends RpcController {
|
||||||
@RedisRpcMapping("catalogEventPublish")
|
@RedisRpcMapping("catalogEventPublish")
|
||||||
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
|
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
|
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
|
||||||
CatalogEvent catalogEvent = new CatalogEvent(this);
|
Platform platform = jsonObject.getObject("platform", Platform.class);
|
||||||
catalogEvent.setPlatform(jsonObject.getObject("platform", Platform.class));
|
List<CommonGBChannel> channels = jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class);
|
||||||
catalogEvent.setChannels(jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class));
|
String type = jsonObject.getString("type");
|
||||||
catalogEvent.setType(jsonObject.getString("type"));
|
eventPublisher.catalogEventPublish(platform, channels, type);
|
||||||
eventPublisher.catalogEventPublish(catalogEvent);
|
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||||
return response;
|
return response;
|
||||||
|
|
Loading…
Reference in New Issue