[集群] 修复BUG

dev/数据库统合
648540858 2025-01-03 16:29:35 +08:00
parent bfc77a1d11
commit 30ab315a15
2 changed files with 10 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.conf.redis.RedisRpcConfig;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
@ -67,11 +68,11 @@ public class RedisRpcPlatformController extends RpcController {
*/
@RedisRpcMapping("catalogEventPublish")
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
CatalogEvent event = JSONObject.parseObject(request.getParam().toString(), CatalogEvent.class);
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
CatalogEvent catalogEvent = new CatalogEvent(this);
catalogEvent.setPlatform(event.getPlatform());
catalogEvent.setChannels(event.getChannels());
catalogEvent.setType(event.getType());
catalogEvent.setPlatform(jsonObject.getObject("platform", Platform.class));
catalogEvent.setChannels(jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class));
catalogEvent.setType(jsonObject.getString("type"));
eventPublisher.catalogEventPublish(catalogEvent);
RedisRpcResponse response = request.getResponse();
response.setStatusCode(ErrorCode.SUCCESS.getCode());

View File

@ -25,8 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class RedisRpcServiceImpl implements IRedisRpcService {
@ -236,7 +234,11 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
@Override
public void catalogEventPublish(String serverId, CatalogEvent event) {
RedisRpcRequest request = buildRequest("platform/catalogEventPublish", event);
JSONObject jsonObject = new JSONObject();
jsonObject.put("platform", event.getPlatform());
jsonObject.put("channels", event.getChannels());
jsonObject.put("type", event.getType());
RedisRpcRequest request = buildRequest("platform/catalogEventPublish", jsonObject);
if (serverId != null) {
request.setToId(serverId);
}