Impl getSelfWxid

This commit is contained in:
Changhua 2023-03-19 10:00:06 +08:00
parent 856b07de37
commit 468d6f2405
2 changed files with 12 additions and 1 deletions

View File

@ -12,9 +12,9 @@ import java.nio.ByteBuffer;
import java.util.Arrays;
public class Client {
private static final Logger logger = LoggerFactory.getLogger(Client.class);
private final int BUFFER_SIZE = 16 * 1024 * 1024; // 16M
private Socket socket = null;
private static Logger logger = LoggerFactory.getLogger(Client.class);
public Client(String hostPort) {
connectRPC(hostPort);
@ -43,6 +43,16 @@ public class Client {
return false;
}
public String getSelfWxid() {
Request req = new Request.Builder().setFuncValue(Functions.FUNC_GET_SELF_WXID_VALUE).build();
Response rsp = sendCmd(req);
if (rsp != null) {
return rsp.getStr();
}
return "";
}
public void waitMs(int ms) {
try {
Thread.sleep(ms);

View File

@ -11,5 +11,6 @@ public class Main {
Client client = new Client(url);
logger.info("isLogin: {}", client.isLogin());
logger.info("wxid: {}", client.getSelfWxid());
}
}