[集群] 修复BUG

dev/数据库统合
648540858 2025-01-03 16:34:11 +08:00
parent 30ab315a15
commit a9a4c7a4e5
2 changed files with 6 additions and 9 deletions

View File

@ -109,10 +109,6 @@ public class EventPublisher {
}
}
public void catalogEventPublish(CatalogEvent event) {
applicationEventPublisher.publishEvent(event);
}
public void mobilePositionEventPublish(MobilePosition mobilePosition) {
MobilePositionEvent event = new MobilePositionEvent(this);
event.setMobilePosition(mobilePosition);

View File

@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Slf4j
@RedisRpcController("platform")
@ -69,11 +71,10 @@ public class RedisRpcPlatformController extends RpcController {
@RedisRpcMapping("catalogEventPublish")
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
CatalogEvent catalogEvent = new CatalogEvent(this);
catalogEvent.setPlatform(jsonObject.getObject("platform", Platform.class));
catalogEvent.setChannels(jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class));
catalogEvent.setType(jsonObject.getString("type"));
eventPublisher.catalogEventPublish(catalogEvent);
Platform platform = jsonObject.getObject("platform", Platform.class);
List<CommonGBChannel> channels = jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class);
String type = jsonObject.getString("type");
eventPublisher.catalogEventPublish(platform, channels, type);
RedisRpcResponse response = request.getResponse();
response.setStatusCode(ErrorCode.SUCCESS.getCode());
return response;