add mock data upload

This commit is contained in:
zhongchao
2021-06-15 11:55:05 +08:00
parent 9b4277ec99
commit 38da4123f8
9 changed files with 28 additions and 34 deletions

View File

@@ -108,10 +108,11 @@ public class SocketManager implements IMogoCloudSocketManager {
@Override
public void sendMsg(String appId, int headerType, MsgBody body, IMogoCloudSocketMsgAckListener listener) {
Logger.d(TAG, "sendMsg msgId : " + body.getMsgId());
final byte[] pb = convertToPBBytes(body.getMsgType(), body.getContent());
if (cloudClientConfig.isThirdLogin()) {
ThirdSocketManager.getInstance().sendMsg(appId, body.getContent(), headerType, true, body.getMsgId());
ThirdSocketManager.getInstance().sendMsg(appId, pb, headerType, true, body.getMsgId());
} else {
InternalSocketManager.getInstance().sendMsg(body.getContent(), headerType, true, body.getMsgId());
InternalSocketManager.getInstance().sendMsg(pb, headerType, true, body.getMsgId());
}
mAckListeners.put(body.getMsgId(), listener);
}

View File

@@ -15,6 +15,7 @@ import com.zhidao.socket.CallbackManager;
import com.zhidao.socket.SocketClient;
import com.zhidao.socket.SocketConfig;
import static com.mogo.cloud.socket.SocketServicesConstants.SOCKET_CHANNEL_ID;
import static com.mogo.cloud.socket.SocketServicesConstants.TAG;
import static com.mogo.cloud.socket.SocketServicesConstants.getEnvironment;
@@ -71,7 +72,7 @@ public class ThirdSocketManager implements Callback {
int headerType,
boolean ack,
long msgId) {
SocketClient.getInstance().sendData(appId, MogoCommon.Product.mogoBussiness.getNumber(), payload, headerType, ack, msgId);
SocketClient.getInstance().sendData(SOCKET_CHANNEL_ID, MogoCommon.Product.mogoBussiness.getNumber(), payload, headerType, ack, msgId);
}