revert对api参数的修改,需要保持SDK的兼容

This commit is contained in:
imhao183
2021-04-23 10:27:48 +08:00
parent d99e9a079d
commit 2ced517f70
3 changed files with 10 additions and 10 deletions
@@ -33,7 +33,7 @@ public class SubscriberChannelAction extends ChannelAction {
public boolean action(Request request) {
if (request.getNettyRequest() instanceof FullHttpRequest) {
InputChannelSubscribe input = getRequestBody(request.getNettyRequest(), InputChannelSubscribe.class);
if (input != null && !StringUtil.isNullOrEmpty(input.getUserId())) {
if (input != null && !StringUtil.isNullOrEmpty(input.getTarget())) {
if(input.getSubscribe() > 0 && (channelInfo.getStatus() & ProtoConstants.ChannelState.Channel_State_Mask_Active_Subscribe) == 0) {
response.setStatus(HttpResponseStatus.OK);
RestResult result = RestResult.resultOf(ErrorCode.ERROR_CODE_NOT_RIGHT);
@@ -41,7 +41,7 @@ public class SubscriberChannelAction extends ChannelAction {
return true;
}
WFCMessage.ListenChannel listenChannel = WFCMessage.ListenChannel.newBuilder().setChannelId(channelInfo.getTargetId()).setListen(input.getSubscribe()).build();
sendApiMessage(input.getUserId(), IMTopic.ChannelListenTopic, listenChannel.toByteArray(), result -> {
sendApiMessage(input.getTarget(), IMTopic.ChannelListenTopic, listenChannel.toByteArray(), result -> {
ByteBuf byteBuf = Unpooled.buffer();
byteBuf.writeBytes(result);
ErrorCode errorCode = ErrorCode.fromCode(byteBuf.readByte());