Merge pull request #228 from PathfinderAx/master
feat(0): [java]-[wcferry-mvn]-集成插件及模块规范化
This commit is contained in:
commit
f2e467663b
73
clients/java/wcferry-mvn/README.MD
vendored
73
clients/java/wcferry-mvn/README.MD
vendored
@ -47,7 +47,7 @@ wcferry:
|
||||
|
||||
### 编译运行
|
||||
|
||||
找到 src/main/java/com/iamteer/Main.java 类
|
||||
找到 src/main/java/com/iamteer/WcferryApplication.java 类
|
||||
|
||||
直接启动即可
|
||||
|
||||
@ -55,8 +55,6 @@ wcferry:
|
||||
|
||||
启动后springboot自身的端口为 9201 socket的端口为 10086
|
||||
|
||||
|
||||
|
||||
## 参与开发
|
||||
|
||||
### 核心依赖
|
||||
@ -68,5 +66,74 @@ wcferry:
|
||||
| jna | 5.6.0 | 态访问系统本地库 |
|
||||
| nng-java | 1.4.0 | 本地包 |
|
||||
|
||||
### 模块结构
|
||||
|
||||
```
|
||||
wcferry-mvn
|
||||
├─dll 核心dll
|
||||
│ ├─sdk.dll sdk文件
|
||||
│ └─readme.txt 本目录说明文件
|
||||
│
|
||||
├─src 源
|
||||
│ ├─main 重启命令
|
||||
│ │ ├─java(com.iamteer) java代码目录
|
||||
│ │ │ ├─config 配置
|
||||
│ │ │ ├─entity 实体
|
||||
│ │ │ ├─runner 运行(程序启动中与启动后的自动化任务都放置于此)
|
||||
│ │ │ ├─service 业务接口
|
||||
│ │ │ │ └─impl 业务实现类
|
||||
│ │ │ ├─Client.java socket客户端
|
||||
│ │ │ └─WcferryApplication.java 启动类
|
||||
│ │ │resources 数据库脚本
|
||||
│ │ │ ├─libs 本程序内置依赖包
|
||||
│ │ │ ├─proto proto文件
|
||||
│ │ │ ├─win32-x86-64 依赖程序
|
||||
│ │ │ ├─application.yml 本程序主配置文件
|
||||
│ │ │ └─logback-spring.xml 日志配置文件
|
||||
│
|
||||
├─pom.xml POM文件
|
||||
├─README.MD 说明文件
|
||||
│
|
||||
|
||||
```
|
||||
|
||||
### 配置说明
|
||||
|
||||
本程序主配置文件为 application.yml
|
||||
|
||||
#### 配置参数
|
||||
|
||||
本程序内置参数统一前缀:wcferry 所有自定义本服务的参数请都放置在此前缀下,如:
|
||||
|
||||
```ymal
|
||||
wcferry:
|
||||
# DLL文件位置
|
||||
dll-path: /dll/sdk.dll
|
||||
```
|
||||
|
||||
#### 生成proto文件
|
||||
|
||||
本程序已经集成了生成proto文件的maven插件,直接install即可生成proto文件,且会在打包程序中去除 src/main/resources/proto
|
||||
下面的内容,只保留实体类中的文件
|
||||
|
||||
默认install会重新根据 生成实体,如果不想被替换,请删除 src/main/resources/proto 下对应的文件即可
|
||||
|
||||
### 提交规范
|
||||
|
||||
本模块希望大家使用统一提交格式,便于区分
|
||||
|
||||
格式:类型(任务号/缺陷号/没有使用0替代): [模块名称]-[子模块名称]-本次修改的说明
|
||||
|
||||
如:
|
||||
|
||||
```cmd
|
||||
feat(0): [java]-[wcferry-mvn]-基础类目录划分迁移及代码格式
|
||||
```
|
||||
|
||||
| 名称 | 版本 |
|
||||
|------|--------------|
|
||||
| feat | 新功能 |
|
||||
| fix | 缺陷 |
|
||||
| ... | 其他等git规范中的均可 |
|
||||
|
||||
|
||||
|
3
clients/java/wcferry-mvn/dll/.gitkeep
vendored
Normal file
3
clients/java/wcferry-mvn/dll/.gitkeep
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file !.gitkeep
|
6
clients/java/wcferry-mvn/dll/readme.txt
vendored
Normal file
6
clients/java/wcferry-mvn/dll/readme.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
说明:
|
||||
由于项目规范限制,本目录保留,但最新的DLL还需要各位自行去下载解压
|
||||
请把最新的 https://github.com/lich0821/WeChatFerry/releases/latest 下载的文件解压后放到该目录下
|
||||
sdk.dll
|
||||
spy.dll
|
||||
spy_debug.dll
|
50
clients/java/wcferry-mvn/pom.xml
vendored
50
clients/java/wcferry-mvn/pom.xml
vendored
@ -61,4 +61,54 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>kr.motd.maven</groupId>
|
||||
<artifactId>os-maven-plugin</artifactId>
|
||||
<version>1.5.0.Final</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
|
||||
<!-- 同时添加maven插件,用于编译protobuf生成java文件 -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.xolstice.maven.plugins</groupId>
|
||||
<artifactId>protobuf-maven-plugin</artifactId>
|
||||
<version>0.5.0</version>
|
||||
<configuration>
|
||||
<!-- 注意,需要与 com.google.protobuf:protobuf-java 一致 -->
|
||||
<protocArtifact>
|
||||
com.google.protobuf:protoc:3.22.2:exe:${os.detected.classifier}
|
||||
</protocArtifact>
|
||||
<!-- 默认值,proto源文件路径 -->
|
||||
<protoSourceRoot>${project.basedir}/src/main/resources/proto</protoSourceRoot>
|
||||
<!-- 默认值,proto目标java文件路径,如果不指定则只在jar与编译中生成 -->
|
||||
<outputDirectory>src/main/java</outputDirectory>
|
||||
<pluginId>grpc-java</pluginId>
|
||||
<!-- 设置是否在生成java文件之前清空outputDirectory的文件,默认值为true,设置为false时也会覆盖同名文件 -->
|
||||
<clearOutputDirectory>false</clearOutputDirectory>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/*.proto</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
@ -8,11 +8,24 @@ import java.util.Map;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.iamteer.service.SDK;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.iamteer.Wcf.*;
|
||||
import com.iamteer.entity.Wcf;
|
||||
import com.iamteer.entity.Wcf.DbQuery;
|
||||
import com.iamteer.entity.Wcf.DbRow;
|
||||
import com.iamteer.entity.Wcf.DbTable;
|
||||
import com.iamteer.entity.Wcf.DecPath;
|
||||
import com.iamteer.entity.Wcf.Functions;
|
||||
import com.iamteer.entity.Wcf.MemberMgmt;
|
||||
import com.iamteer.entity.Wcf.Request;
|
||||
import com.iamteer.entity.Wcf.Response;
|
||||
import com.iamteer.entity.Wcf.RpcContact;
|
||||
import com.iamteer.entity.Wcf.UserInfo;
|
||||
import com.iamteer.entity.Wcf.Verification;
|
||||
import com.iamteer.entity.Wcf.WxMsg;
|
||||
import com.sun.jna.Native;
|
||||
|
||||
import io.sisu.nng.Socket;
|
||||
import io.sisu.nng.pair.Pair1Socket;
|
||||
@ -60,12 +73,11 @@ public class Client {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void connectRPC(String url, SDK INSTANCE) {
|
||||
try {
|
||||
cmdSocket = new Pair1Socket();
|
||||
cmdSocket.dial(url);
|
||||
//logger.info("请点击登录微信");
|
||||
// logger.info("请点击登录微信");
|
||||
while (!isLogin()) { // 直到登录成功
|
||||
waitMs(1000);
|
||||
}
|
||||
@ -88,7 +100,7 @@ public class Client {
|
||||
cmdSocket.send(bb);
|
||||
ByteBuffer ret = ByteBuffer.allocate(BUFFER_SIZE);
|
||||
long size = cmdSocket.receive(ret, true);
|
||||
return Response.parseFrom(Arrays.copyOfRange(ret.array(), 0, (int) size));
|
||||
return Response.parseFrom(Arrays.copyOfRange(ret.array(), 0, (int)size));
|
||||
} catch (Exception e) {
|
||||
logger.error("命令调用失败: ", e);
|
||||
return null;
|
||||
@ -168,8 +180,7 @@ public class Client {
|
||||
*/
|
||||
public List<DbRow> querySql(String db, String sql) {
|
||||
DbQuery dbQuery = DbQuery.newBuilder().setSql(sql).setDb(db).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_EXEC_DB_QUERY_VALUE)
|
||||
.setQuery(dbQuery).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_EXEC_DB_QUERY_VALUE).setQuery(dbQuery).build();
|
||||
Response rsp = sendCmd(req);
|
||||
if (rsp != null) {
|
||||
return rsp.getRows().getRowsList();
|
||||
@ -199,8 +210,7 @@ public class Client {
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getDbTables(String db) {
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_GET_DB_TABLES_VALUE).setStr(db)
|
||||
.build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_GET_DB_TABLES_VALUE).setStr(db).build();
|
||||
Response rsp = sendCmd(req);
|
||||
Map<String, String> tables = new HashMap<>();
|
||||
if (rsp != null) {
|
||||
@ -225,10 +235,8 @@ public class Client {
|
||||
* "wxid_xxxxxxxxxxxxx1,wxid_xxxxxxxxxxxxx2");
|
||||
**/
|
||||
public int sendText(String msg, String receiver, String aters) {
|
||||
Wcf.TextMsg textMsg = Wcf.TextMsg.newBuilder().setMsg(msg).setReceiver(receiver).setAters(aters)
|
||||
.build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_TXT_VALUE).setTxt(textMsg)
|
||||
.build();
|
||||
Wcf.TextMsg textMsg = Wcf.TextMsg.newBuilder().setMsg(msg).setReceiver(receiver).setAters(aters).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_TXT_VALUE).setTxt(textMsg).build();
|
||||
logger.debug("sendText: {}", bytesToHex(req.toByteArray()));
|
||||
Response rsp = sendCmd(req);
|
||||
int ret = -1;
|
||||
@ -248,8 +256,7 @@ public class Client {
|
||||
*/
|
||||
public int sendImage(String path, String receiver) {
|
||||
Wcf.PathMsg pathMsg = Wcf.PathMsg.newBuilder().setPath(path).setReceiver(receiver).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_IMG_VALUE).setFile(pathMsg)
|
||||
.build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_IMG_VALUE).setFile(pathMsg).build();
|
||||
logger.debug("sendImage: {}", bytesToHex(req.toByteArray()));
|
||||
Response rsp = sendCmd(req);
|
||||
int ret = -1;
|
||||
@ -269,8 +276,7 @@ public class Client {
|
||||
*/
|
||||
public int sendFile(String path, String receiver) {
|
||||
Wcf.PathMsg pathMsg = Wcf.PathMsg.newBuilder().setPath(path).setReceiver(receiver).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_FILE_VALUE).setFile(pathMsg)
|
||||
.build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_FILE_VALUE).setFile(pathMsg).build();
|
||||
logger.debug("sendFile: {}", bytesToHex(req.toByteArray()));
|
||||
Response rsp = sendCmd(req);
|
||||
int ret = -1;
|
||||
@ -291,10 +297,8 @@ public class Client {
|
||||
* @return 发送结果状态码
|
||||
*/
|
||||
public int sendXml(String receiver, String xml, String path, int type) {
|
||||
Wcf.XmlMsg xmlMsg = Wcf.XmlMsg.newBuilder().setContent(xml).setReceiver(receiver).setPath(path)
|
||||
.setType(type).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_XML_VALUE).setXml(xmlMsg)
|
||||
.build();
|
||||
Wcf.XmlMsg xmlMsg = Wcf.XmlMsg.newBuilder().setContent(xml).setReceiver(receiver).setPath(path).setType(type).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_XML_VALUE).setXml(xmlMsg).build();
|
||||
logger.debug("sendXml: {}", bytesToHex(req.toByteArray()));
|
||||
Response rsp = sendCmd(req);
|
||||
int ret = -1;
|
||||
@ -314,8 +318,7 @@ public class Client {
|
||||
*/
|
||||
public int sendEmotion(String path, String receiver) {
|
||||
Wcf.PathMsg pathMsg = Wcf.PathMsg.newBuilder().setPath(path).setReceiver(receiver).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_EMOTION_VALUE)
|
||||
.setFile(pathMsg).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_SEND_EMOTION_VALUE).setFile(pathMsg).build();
|
||||
logger.debug("sendEmotion: {}", bytesToHex(req.toByteArray()));
|
||||
Response rsp = sendCmd(req);
|
||||
int ret = -1;
|
||||
@ -336,8 +339,7 @@ public class Client {
|
||||
public int acceptNewFriend(String v3, String v4) {
|
||||
int ret = -1;
|
||||
Verification verification = Verification.newBuilder().setV3(v3).setV4(v4).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_ACCEPT_FRIEND_VALUE)
|
||||
.setV(verification).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_ACCEPT_FRIEND_VALUE).setV(verification).build();
|
||||
Response rsp = sendCmd(req);
|
||||
if (rsp != null) {
|
||||
ret = rsp.getStatus();
|
||||
@ -355,8 +357,7 @@ public class Client {
|
||||
public int addChatroomMembers(String roomID, String wxIds) {
|
||||
int ret = -1;
|
||||
MemberMgmt memberMgmt = MemberMgmt.newBuilder().setRoomid(roomID).setWxids(wxIds).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_ADD_ROOM_MEMBERS_VALUE)
|
||||
.setM(memberMgmt).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_ADD_ROOM_MEMBERS_VALUE).setM(memberMgmt).build();
|
||||
Response rsp = sendCmd(req);
|
||||
if (rsp != null) {
|
||||
ret = rsp.getStatus();
|
||||
@ -374,8 +375,7 @@ public class Client {
|
||||
public boolean decryptImage(String srcPath, String dstPath) {
|
||||
int ret = -1;
|
||||
DecPath build = DecPath.newBuilder().setSrc(srcPath).setDst(dstPath).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_DECRYPT_IMAGE_VALUE)
|
||||
.setDec(build).build();
|
||||
Request req = Request.newBuilder().setFuncValue(Functions.FUNC_DECRYPT_IMAGE_VALUE).setDec(build).build();
|
||||
Response rsp = sendCmd(req);
|
||||
if (rsp != null) {
|
||||
ret = rsp.getStatus();
|
||||
@ -439,7 +439,7 @@ public class Client {
|
||||
while (isReceivingMsg) {
|
||||
try {
|
||||
long size = msgSocket.receive(bb, true);
|
||||
WxMsg wxMsg = Response.parseFrom(Arrays.copyOfRange(bb.array(), 0, (int) size)).getWxmsg();
|
||||
WxMsg wxMsg = Response.parseFrom(Arrays.copyOfRange(bb.array(), 0, (int)size)).getWxmsg();
|
||||
msgQ.put(wxMsg);
|
||||
} catch (Exception e) {
|
||||
// 多半是超时,忽略吧
|
||||
@ -509,8 +509,7 @@ public class Client {
|
||||
gender = "未知";
|
||||
}
|
||||
|
||||
logger.info("{}, {}, {}, {}, {}, {}, {}", c.getWxid(), c.getName(), c.getCode(),
|
||||
c.getCountry(), c.getProvince(), c.getCity(), gender);
|
||||
logger.info("{}, {}, {}, {}, {}, {}, {}", c.getWxid(), c.getName(), c.getCode(), c.getCountry(), c.getProvince(), c.getCity(), gender);
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,5 +531,5 @@ public class Client {
|
||||
waitMs(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
35
clients/java/wcferry-mvn/src/main/java/com/iamteer/config/ProtobufConfig.java
vendored
Normal file
35
clients/java/wcferry-mvn/src/main/java/com/iamteer/config/ProtobufConfig.java
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
package com.iamteer.config;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* 配置类-protobuf
|
||||
*
|
||||
* @author chandler
|
||||
* @date 2024-09-26 21:35
|
||||
*/
|
||||
@Configuration
|
||||
public class ProtobufConfig {
|
||||
|
||||
/**
|
||||
* protobuf 序列化
|
||||
*/
|
||||
@Bean
|
||||
ProtobufHttpMessageConverter protobufHttpMessageConverter() {
|
||||
return new ProtobufHttpMessageConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* protobuf 反序列化
|
||||
*/
|
||||
@Bean
|
||||
RestTemplate restTemplate(ProtobufHttpMessageConverter protobufHttpMessageConverter) {
|
||||
return new RestTemplate(Collections.singletonList(protobufHttpMessageConverter));
|
||||
}
|
||||
|
||||
}
|
@ -6,10 +6,10 @@ import org.springframework.stereotype.Component;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 配置文件-UAM模块的外部接口
|
||||
* 配置文件-wcferry的配置文件
|
||||
*
|
||||
* @author chandler
|
||||
* @date 2024-04-26 21:35
|
||||
* @date 2024-09-21 21:35
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ -22,7 +22,7 @@ public class WcferryProperties {
|
||||
private String dllPath;
|
||||
|
||||
/**
|
||||
* 端口
|
||||
* socket端口
|
||||
*/
|
||||
private Integer socketPort;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,6 @@ package com.iamteer.runner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.iamteer;
|
||||
package com.iamteer.service;
|
||||
|
||||
import com.sun.jna.Library;
|
||||
|
3
clients/java/wcferry-mvn/src/main/java/com/iamteer/service/impl/.gitkeep
vendored
Normal file
3
clients/java/wcferry-mvn/src/main/java/com/iamteer/service/impl/.gitkeep
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file !.gitkeep
|
3
clients/java/wcferry-mvn/src/main/resources/proto/.gitkeep
vendored
Normal file
3
clients/java/wcferry-mvn/src/main/resources/proto/.gitkeep
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file !.gitkeep
|
236
clients/java/wcferry-mvn/src/main/resources/proto/wcf.proto
vendored
Normal file
236
clients/java/wcferry-mvn/src/main/resources/proto/wcf.proto
vendored
Normal file
@ -0,0 +1,236 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wcf;
|
||||
option java_package = "com.iamteer.entity";
|
||||
|
||||
enum Functions {
|
||||
FUNC_RESERVED = 0x00;
|
||||
FUNC_IS_LOGIN = 0x01;
|
||||
FUNC_GET_SELF_WXID = 0x10;
|
||||
FUNC_GET_MSG_TYPES = 0x11;
|
||||
FUNC_GET_CONTACTS = 0x12;
|
||||
FUNC_GET_DB_NAMES = 0x13;
|
||||
FUNC_GET_DB_TABLES = 0x14;
|
||||
FUNC_GET_USER_INFO = 0x15;
|
||||
FUNC_GET_AUDIO_MSG = 0x16;
|
||||
FUNC_SEND_TXT = 0x20;
|
||||
FUNC_SEND_IMG = 0x21;
|
||||
FUNC_SEND_FILE = 0x22;
|
||||
FUNC_SEND_XML = 0x23;
|
||||
FUNC_SEND_EMOTION = 0x24;
|
||||
FUNC_SEND_RICH_TXT = 0x25;
|
||||
FUNC_SEND_PAT_MSG = 0x26;
|
||||
FUNC_FORWARD_MSG = 0x27;
|
||||
FUNC_ENABLE_RECV_TXT = 0x30;
|
||||
FUNC_DISABLE_RECV_TXT = 0x40;
|
||||
FUNC_EXEC_DB_QUERY = 0x50;
|
||||
FUNC_ACCEPT_FRIEND = 0x51;
|
||||
FUNC_RECV_TRANSFER = 0x52;
|
||||
FUNC_REFRESH_PYQ = 0x53;
|
||||
FUNC_DOWNLOAD_ATTACH = 0x54;
|
||||
FUNC_GET_CONTACT_INFO = 0x55;
|
||||
FUNC_REVOKE_MSG = 0x56;
|
||||
FUNC_REFRESH_QRCODE = 0x57;
|
||||
FUNC_DECRYPT_IMAGE = 0x60;
|
||||
FUNC_EXEC_OCR = 0x61;
|
||||
FUNC_ADD_ROOM_MEMBERS = 0x70;
|
||||
FUNC_DEL_ROOM_MEMBERS = 0x71;
|
||||
FUNC_INV_ROOM_MEMBERS = 0x72;
|
||||
}
|
||||
|
||||
message Request
|
||||
{
|
||||
Functions func = 1;
|
||||
oneof msg
|
||||
{
|
||||
Empty empty = 2; // 无参数
|
||||
string str = 3; // 字符串
|
||||
TextMsg txt = 4; // 发送文本消息结构
|
||||
PathMsg file = 5; // 发送图片、文件消息结构
|
||||
DbQuery query = 6; // 数据库查询参数结构
|
||||
Verification v = 7; // 通过好友验证参数结构
|
||||
MemberMgmt m = 8; // 群成员管理,添加、删除、邀请
|
||||
XmlMsg xml = 9; // XML参数结构
|
||||
DecPath dec = 10; // 解密图片参数结构
|
||||
Transfer tf = 11; // 接收转账参数结构
|
||||
uint64 ui64 = 12 [ jstype = JS_STRING ]; // 64 位整数,通用
|
||||
bool flag = 13; // 布尔值
|
||||
AttachMsg att = 14; // 下载图片、视频、文件参数结构
|
||||
AudioMsg am = 15; // 保存语音参数结构
|
||||
RichText rt = 16; // 发送卡片消息结构
|
||||
PatMsg pm = 17; // 发送拍一拍参数结构
|
||||
ForwardMsg fm = 18; // 转发消息参数结构
|
||||
}
|
||||
}
|
||||
|
||||
message Response
|
||||
{
|
||||
Functions func = 1;
|
||||
oneof msg
|
||||
{
|
||||
int32 status = 2; // Int 状态,通用
|
||||
string str = 3; // 字符串
|
||||
WxMsg wxmsg = 4; // 微信消息
|
||||
MsgTypes types = 5; // 消息类型
|
||||
RpcContacts contacts = 6; // 联系人
|
||||
DbNames dbs = 7; // 数据库列表
|
||||
DbTables tables = 8; // 表列表
|
||||
DbRows rows = 9; // 行列表
|
||||
UserInfo ui = 10; // 个人信息
|
||||
OcrMsg ocr = 11; // OCR 结果
|
||||
};
|
||||
}
|
||||
|
||||
message Empty { }
|
||||
|
||||
message WxMsg
|
||||
{
|
||||
bool is_self = 1; // 是否自己发送的
|
||||
bool is_group = 2; // 是否群消息
|
||||
uint64 id = 3 [ jstype = JS_STRING ]; // 消息 id
|
||||
uint32 type = 4; // 消息类型
|
||||
uint32 ts = 5; // 消息类型
|
||||
string roomid = 6; // 群 id(如果是群消息的话)
|
||||
string content = 7; // 消息内容
|
||||
string sender = 8; // 消息发送者
|
||||
string sign = 9; // Sign
|
||||
string thumb = 10; // 缩略图
|
||||
string extra = 11; // 附加内容
|
||||
string xml = 12; // 消息 xml
|
||||
}
|
||||
|
||||
message TextMsg
|
||||
{
|
||||
string msg = 1; // 要发送的消息内容
|
||||
string receiver = 2; // 消息接收人,当为群时可@
|
||||
string aters = 3; // 要@的人列表,逗号分隔
|
||||
}
|
||||
|
||||
message PathMsg
|
||||
{
|
||||
string path = 1; // 要发送的图片的路径
|
||||
string receiver = 2; // 消息接收人
|
||||
}
|
||||
|
||||
message XmlMsg
|
||||
{
|
||||
string receiver = 1; // 消息接收人
|
||||
string content = 2; // xml 内容
|
||||
string path = 3; // 图片路径
|
||||
int32 type = 4; // 消息类型
|
||||
}
|
||||
|
||||
message MsgTypes { map<int32, string> types = 1; }
|
||||
|
||||
message RpcContact
|
||||
{
|
||||
string wxid = 1; // 微信 id
|
||||
string code = 2; // 微信号
|
||||
string remark = 3; // 备注
|
||||
string name = 4; // 微信昵称
|
||||
string country = 5; // 国家
|
||||
string province = 6; // 省/州
|
||||
string city = 7; // 城市
|
||||
int32 gender = 8; // 性别
|
||||
}
|
||||
message RpcContacts { repeated RpcContact contacts = 1; }
|
||||
|
||||
message DbNames { repeated string names = 1; }
|
||||
|
||||
message DbTable
|
||||
{
|
||||
string name = 1; // 表名
|
||||
string sql = 2; // 建表 SQL
|
||||
}
|
||||
message DbTables { repeated DbTable tables = 1; }
|
||||
|
||||
message DbQuery
|
||||
{
|
||||
string db = 1; // 目标数据库
|
||||
string sql = 2; // 查询 SQL
|
||||
}
|
||||
|
||||
message DbField
|
||||
{
|
||||
int32 type = 1; // 字段类型
|
||||
string column = 2; // 字段名称
|
||||
bytes content = 3; // 字段内容
|
||||
}
|
||||
message DbRow { repeated DbField fields = 1; }
|
||||
message DbRows { repeated DbRow rows = 1; }
|
||||
|
||||
message Verification
|
||||
{
|
||||
string v3 = 1; // 加密的用户名
|
||||
string v4 = 2; // Ticket
|
||||
int32 scene = 3; // 添加方式:17 名片,30 扫码
|
||||
}
|
||||
|
||||
message MemberMgmt
|
||||
{
|
||||
string roomid = 1; // 要加的群ID
|
||||
string wxids = 2; // 要加群的人列表,逗号分隔
|
||||
}
|
||||
|
||||
message UserInfo
|
||||
{
|
||||
string wxid = 1; // 微信ID
|
||||
string name = 2; // 昵称
|
||||
string mobile = 3; // 手机号
|
||||
string home = 4; // 文件/图片等父路径
|
||||
}
|
||||
|
||||
message DecPath
|
||||
{
|
||||
string src = 1; // 源路径
|
||||
string dst = 2; // 目标路径
|
||||
}
|
||||
|
||||
message Transfer
|
||||
{
|
||||
string wxid = 1; // 转账人
|
||||
string tfid = 2; // 转账id transferid
|
||||
string taid = 3; // Transaction id
|
||||
}
|
||||
|
||||
message AttachMsg
|
||||
{
|
||||
uint64 id = 1 [ jstype = JS_STRING ]; // 消息 id
|
||||
string thumb = 2; // 消息中的 thumb
|
||||
string extra = 3; // 消息中的 extra
|
||||
}
|
||||
|
||||
message AudioMsg
|
||||
{
|
||||
uint64 id = 1 [ jstype = JS_STRING ]; // 语音消息 id
|
||||
string dir = 2; // 存放目录
|
||||
}
|
||||
|
||||
message RichText
|
||||
{
|
||||
string name = 1; // 显示名字
|
||||
string account = 2; // 公众号 id
|
||||
string title = 3; // 标题
|
||||
string digest = 4; // 摘要
|
||||
string url = 5; // 链接
|
||||
string thumburl = 6; // 缩略图
|
||||
string receiver = 7; // 接收人
|
||||
}
|
||||
|
||||
message PatMsg
|
||||
{
|
||||
string roomid = 1; // 群 id
|
||||
string wxid = 2; // wxid
|
||||
}
|
||||
|
||||
message OcrMsg
|
||||
{
|
||||
int32 status = 1; // 状态
|
||||
string result = 2; // 结果
|
||||
}
|
||||
|
||||
message ForwardMsg
|
||||
{
|
||||
uint64 id = 1 [ jstype = JS_STRING ]; // 待转发消息 ID
|
||||
string receiver = 2; // 转发接收目标,群为 roomId,个人为 wxid
|
||||
}
|
3
clients/java/wcferry-mvn/src/main/resources/win32-x86-64/.gitkeep
vendored
Normal file
3
clients/java/wcferry-mvn/src/main/resources/win32-x86-64/.gitkeep
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file !.gitkeep
|
BIN
clients/java/wcferry-mvn/src/main/resources/win32-x86-64/nng.dll
vendored
Normal file
BIN
clients/java/wcferry-mvn/src/main/resources/win32-x86-64/nng.dll
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user