[集群] 修复BUG
parent
bfc77a1d11
commit
30ab315a15
|
@ -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.RedisRpcMessage;
|
||||||
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
|
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
|
||||||
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
|
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.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
|
@ -67,11 +68,11 @@ public class RedisRpcPlatformController extends RpcController {
|
||||||
*/
|
*/
|
||||||
@RedisRpcMapping("catalogEventPublish")
|
@RedisRpcMapping("catalogEventPublish")
|
||||||
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
|
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 catalogEvent = new CatalogEvent(this);
|
||||||
catalogEvent.setPlatform(event.getPlatform());
|
catalogEvent.setPlatform(jsonObject.getObject("platform", Platform.class));
|
||||||
catalogEvent.setChannels(event.getChannels());
|
catalogEvent.setChannels(jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class));
|
||||||
catalogEvent.setType(event.getType());
|
catalogEvent.setType(jsonObject.getString("type"));
|
||||||
eventPublisher.catalogEventPublish(catalogEvent);
|
eventPublisher.catalogEventPublish(catalogEvent);
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
response.setStatusCode(ErrorCode.SUCCESS.getCode());
|
||||||
|
|
|
@ -25,8 +25,6 @@ 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.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class RedisRpcServiceImpl implements IRedisRpcService {
|
public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||||
|
@ -236,7 +234,11 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void catalogEventPublish(String serverId, CatalogEvent event) {
|
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) {
|
if (serverId != null) {
|
||||||
request.setToId(serverId);
|
request.setToId(serverId);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue