Impl getSelfWxid
This commit is contained in:
parent
856b07de37
commit
468d6f2405
@ -12,9 +12,9 @@ import java.nio.ByteBuffer;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class Client {
|
public class Client {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(Client.class);
|
||||||
private final int BUFFER_SIZE = 16 * 1024 * 1024; // 16M
|
private final int BUFFER_SIZE = 16 * 1024 * 1024; // 16M
|
||||||
private Socket socket = null;
|
private Socket socket = null;
|
||||||
private static Logger logger = LoggerFactory.getLogger(Client.class);
|
|
||||||
|
|
||||||
public Client(String hostPort) {
|
public Client(String hostPort) {
|
||||||
connectRPC(hostPort);
|
connectRPC(hostPort);
|
||||||
@ -43,6 +43,16 @@ public class Client {
|
|||||||
return false;
|
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) {
|
public void waitMs(int ms) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(ms);
|
Thread.sleep(ms);
|
||||||
|
@ -11,5 +11,6 @@ public class Main {
|
|||||||
Client client = new Client(url);
|
Client client = new Client(url);
|
||||||
|
|
||||||
logger.info("isLogin: {}", client.isLogin());
|
logger.info("isLogin: {}", client.isLogin());
|
||||||
|
logger.info("wxid: {}", client.getSelfWxid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user