Impl getDbNames

This commit is contained in:
Changhua 2023-03-19 23:17:04 +08:00
parent 55d213692b
commit d20e070596
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package com.iamteer;
import com.iamteer.Wcf.DbNames;
import com.iamteer.Wcf.Functions;
import com.iamteer.Wcf.Request;
import com.iamteer.Wcf.Response;
@ -91,6 +92,16 @@ public class Client {
return Wcf.RpcContacts.newBuilder().build().getContactsList();
}
public List<String> getDbNames() {
Request req = new Request.Builder().setFuncValue(Functions.FUNC_GET_DB_NAMES_VALUE).build();
Response rsp = sendCmd(req);
if (rsp != null) {
return rsp.getDbs().getNamesList();
}
return Wcf.DbNames.newBuilder().build().getNamesList();
}
public void waitMs(int ms) {
try {
Thread.sleep(ms);

View File

@ -14,5 +14,6 @@ public class Main {
logger.info("wxid: {}", client.getSelfWxid());
logger.info("message types: {}", client.getMsgTypes());
client.printContacts(client.getContacts());
logger.info("dbs: {}", client.getDbNames());
}
}