Skip to content

Commit 2ddcb23

Browse files
committed
feat(0): [wcf-bmc]-修改配置文件及日志优化
1 parent 5c45604 commit 2ddcb23

File tree

6 files changed

+65
-50
lines changed

6 files changed

+65
-50
lines changed

clients/java/wcf-bmc/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ ___
6363

6464
v39.5.2版本目前会出现注入失败的情况,待排查修复,可先使用v39.5.1,只须替换dll版本即可
6565

66+
### 2025-05-19
67+
68+
- 1.配置文件位置变更,方便大家自行配置
69+
- 2.日志优化
70+
71+
<br/>
72+
6673
### 2025-05-04
6774

6875
- 1.更新拍一拍接口入参

clients/java/wcf-bmc/README.MD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
5151
### 修改配置文件
5252

53-
配置文件:src/main/resources/application.yml
53+
配置文件:
54+
- src/main/resources/application.yml
55+
- src/main/resources/config/application-dev.yml
5456

5557
根据自己的dll目录位置修改配置文件
5658

@@ -125,6 +127,7 @@ wcf-bmc
125127
126128
├─config 配置文件目录
127129
│ ├─application.yml 配置文件
130+
│ ├─application-dev.yml 开发环境配置文件
128131
│ └─logback-spring.xml 日志配置文件
129132
130133
├─wcf-bmc-xx.x.x.x.jar 打包后的源码包

clients/java/wcf-bmc/src/main/java/com/wechat/ferry/service/impl/WeChatMsgServiceImpl.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void receiveMsg(String jsonString) {
4343
receiveMsgCallback(jsonString);
4444
// 转为JSON对象
4545
WxPpMsgDTO dto = JSON.parseObject(jsonString, WxPpMsgDTO.class);
46-
log.debug("[收到消息]-[消息内容]-打印:{}", dto);
46+
log.debug("[接收消息]-[消息内容]-打印:{}", dto);
4747
// 有开启的群聊配置
4848
if (weChatFerryProperties.getOpenMsgGroupSwitch() && !weChatFerryProperties.getOpenMsgGroups().isEmpty()) {
4949
Map<String, List<String>> openMsgGroupMap = new LinkedHashMap<>();
@@ -80,7 +80,7 @@ public void receiveMsg(String jsonString) {
8080

8181
// 指定处理的群聊
8282
if (!openMsgGroupMap.isEmpty()) {
83-
log.debug("[收到消息后处理]-[汇总后的所有功能]-openMsgGroupMap:{}", openMsgGroupMap);
83+
log.debug("[接收消息]-[功能处理]-[汇总后的所有功能]-openMsgGroupMap:{}", openMsgGroupMap);
8484
List<String> fnNoList = new ArrayList<>();
8585
// 先执行所有群都需要执行的
8686
if (openMsgGroupMap.containsKey("ALL")) {
@@ -92,7 +92,7 @@ public void receiveMsg(String jsonString) {
9292
}
9393
// 需要执行的策略
9494
if (!CollectionUtils.isEmpty(fnNoList)) {
95-
log.debug("[收到消息后处理]-[汇总后的单群功能]-fnNoList:{},群号:{}", fnNoList, dto.getRoomId());
95+
log.debug("[接收消息]-[功能处理]-fnNoList:{},群号:{}", fnNoList, dto.getRoomId());
9696
for (String no : fnNoList) {
9797
// 根据功能号获取对应的策略
9898
ReceiveMsgStrategy receiveMsgStrategy = ReceiveMsgFactory.getStrategy(no);
@@ -103,7 +103,7 @@ public void receiveMsg(String jsonString) {
103103
}
104104
}
105105
}
106-
log.debug("[收到消息]-本条消息处理完毕!msgId:{}", dto.getId());
106+
log.debug("[接收消息]-msgId:[{}],本条消息处理完毕!", dto.getId());
107107
}
108108

109109
private void receiveMsgCallback(String jsonString) {
@@ -116,11 +116,11 @@ private void receiveMsgCallback(String jsonString) {
116116
try {
117117
String responseStr = HttpClientUtil.doPostJson(receiveMsgFwdUrl, jsonString);
118118
if (judgeSuccess(responseStr)) {
119-
log.error("[接收消息]-消息回调至外部接口,获取响应状态失败!-URL:{}", receiveMsgFwdUrl);
119+
log.error("[接收消息]-[消息回调]-消息回调至外部接口,获取响应状态失败!-URL:{}", receiveMsgFwdUrl);
120120
}
121-
log.debug("[接收消息]-[回调接收到的消息]-回调消息至:{}", receiveMsgFwdUrl);
121+
log.debug("[接收消息]-[消息回调]-[回调接收到的消息]-回调消息至:{}", receiveMsgFwdUrl);
122122
} catch (Exception e) {
123-
log.error("[接收消息]-消息回调接口[{}]服务异常:", receiveMsgFwdUrl, e);
123+
log.error("[接收消息]-[消息回调]-消息回调接口[{}]服务异常:", receiveMsgFwdUrl, e);
124124
}
125125
}
126126
}

clients/java/wcf-bmc/src/main/resources/application.yml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,16 @@ spring:
99
# 配置应用信息
1010
application:
1111
# 应用名
12-
name: wcf-bmc
12+
name: WCF-BMC
13+
# 激活的文件
14+
profiles:
15+
active: dev
1316
# swagger适配
1417
mvc:
1518
pathmatch:
1619
matching-strategy: ant_path_matcher
1720

1821
# 日志配置
1922
logging:
20-
config: classpath:logback-spring.xml
21-
22-
# 本服务参数
23-
wechat:
24-
ferry:
25-
# DLL文件位置
26-
dll-path: E:\WeChatFerry\clients\java\wcf-bmc\dll\sdk.dll
27-
# socket端口
28-
socket-port: 10086
29-
# SDK是否调试模式
30-
sdk-debug-switch: false
31-
# 文件下载保存位置
32-
file-save-path: E:\WeChatFerry\clients\java\wcf-bmc
33-
# 联系人类型-官方杂号,禁止与其他分类重复(格式:代码|名称)
34-
contacts-type-mixed:
35-
- filehelper|文件传输助手
36-
# 联系人类型-公众号,禁止与其他分类重复(格式:代码|名称)
37-
contacts-type-official:
38-
- weixinguanhaozhushou|微信公众平台
39-
# 接收消息回调开关
40-
open-msg-group-switch: false
41-
# 需要开启消息处理的群
42-
open-msg-groups:
43-
# key:"[群编号]" val:开启的功能号,对应ReceiveMsgChannelEnum枚举中的code
44-
"[ALL]": ''
45-
"[53257911730@chatroom]": '1,2,3'
46-
"[50501762866@chatroom]": '1'
47-
# 接收消息回调开关
48-
receive-msg-callback-switch: false
49-
# 接收消息回调地址
50-
receive-msg-callback-urls:
51-
- http://localhost:9001/msg
52-
# 发送消息回调标识 1-关闭 2-全部回调 3-发送成功才回调
53-
send-msg-callback-flag: '1'
54-
# 发送消息回调地址
55-
send-msg-callback-urls:
56-
- http://localhost:9001/msg
57-
# 调用第三方服务客户端成功状态码
58-
third-party-ok-codes:
59-
# key:状态码字段 val:状态码值
60-
code: '200'
23+
config: classpath:config/logback-spring.xml
6124

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# 配置文件
2+
3+
# 本服务参数
4+
wechat:
5+
ferry:
6+
# DLL文件位置
7+
dll-path: E:\WeChatFerry\clients\java\wcf-bmc\dll\sdk.dll
8+
# socket端口
9+
socket-port: 10086
10+
# SDK是否调试模式
11+
sdk-debug-switch: false
12+
# 文件下载保存位置
13+
file-save-path: E:\WeChatFerry\clients\java\wcf-bmc
14+
# 联系人类型-官方杂号,禁止与其他分类重复(格式:代码|名称)
15+
contacts-type-mixed:
16+
- filehelper|文件传输助手
17+
# 联系人类型-公众号,禁止与其他分类重复(格式:代码|名称)
18+
contacts-type-official:
19+
- weixinguanhaozhushou|微信公众平台
20+
# 接收消息回调开关
21+
open-msg-group-switch: false
22+
# 需要开启消息处理的群
23+
open-msg-groups:
24+
# key:"[群编号]" val:开启的功能号,对应ReceiveMsgChannelEnum枚举中的code
25+
"[ALL]": ''
26+
"[53257911730@chatroom]": '1,2,3'
27+
"[50501762866@chatroom]": '1'
28+
# 接收消息回调开关
29+
receive-msg-callback-switch: false
30+
# 接收消息回调地址
31+
receive-msg-callback-urls:
32+
- http://localhost:9001/msg
33+
# 发送消息回调标识 1-关闭 2-全部回调 3-发送成功才回调
34+
send-msg-callback-flag: '1'
35+
# 发送消息回调地址
36+
send-msg-callback-urls:
37+
- http://localhost:9001/msg
38+
# 调用第三方服务客户端成功状态码
39+
third-party-ok-codes:
40+
# key:状态码字段 val:状态码值
41+
code: '200'
42+

0 commit comments

Comments
 (0)