1、跟新banner

2、兼容微信3.9.10.27
3、打印日志
main
linlei 2 years ago
parent 8000b4c15c
commit 96ff7eedce

@ -2,9 +2,14 @@ package com.xcs.wx;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
/**
* @author xcs
* @date 20231221 1702
@ -14,7 +19,26 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableTransactionManagement
public class WxDumpApplication {
public static void main(String[] args) {
SpringApplication.run(WxDumpApplication.class, args);
public static void main(String[] args) throws UnknownHostException {
long startTime = System.currentTimeMillis();
ConfigurableApplicationContext context = SpringApplication.run(WxDumpApplication.class, args);
long endTime = System.currentTimeMillis();
String port = context.getEnvironment().getProperty("server.port", "8080");
String contextPath = context.getEnvironment().getProperty("server.servlet.context-path", "");
String localHostAddress = InetAddress.getLocalHost().getHostAddress();
String localUrl = "http://localhost:" + port + contextPath;
String networkUrl = "http://" + localHostAddress + ":" + port + contextPath;
System.out.println("DONE successfully in " + (endTime - startTime) + "ms");
System.out.println("Time: " + new Date());
System.out.println("╔════════════════════════════════════════════════════╗");
System.out.println("║ App listening at: ║");
System.out.println("║ > Local: " + localUrl + " ");
System.out.println("║ > Network: " + networkUrl + " ");
System.out.println("║ ║");
System.out.println("║ Now you can open browser with the above addresses↑ ║");
System.out.println("╚════════════════════════════════════════════════════╝");
}
}

@ -50,21 +50,21 @@ public class MsgRepositoryImpl extends ServiceImpl<MsgMapper, Msg> implements Ms
@Override
public List<Msg> queryMsgBySequence(String poolName, Long nextSequence) {
log.info("开始查询数据:[{}][{}]", poolName, nextSequence);
log.info("Start querying data:[{}][{}]", poolName, nextSequence);
// 切换数据源
DynamicDataSourceContextHolder.push(poolName);
// 根据数量与序列号获取消息
List<Msg> msgs = getBaseMapper().queryMsgBySequence(nextSequence);
// 清理动态数据源
DynamicDataSourceContextHolder.clear();
log.info("结束查询数据:[{}][{}]", poolName, nextSequence);
log.info("End querying data:[{}][{}]", poolName, nextSequence);
// 返回数据
return msgs;
}
@Override
public boolean saveBatch(String poolName, List<Msg> msg) {
log.info("开始新增数据:[{}][{}]", poolName, msg.size());
log.info("Start adding new data:[{}][{}]", poolName, msg.size());
// 切换数据源
DynamicDataSourceContextHolder.push(poolName);
// 批量执行
@ -74,7 +74,7 @@ public class MsgRepositoryImpl extends ServiceImpl<MsgMapper, Msg> implements Ms
});
// 清理动态数据源
DynamicDataSourceContextHolder.clear();
log.info("结束新增数据:[{}][{}]", poolName, msg.size());
log.info("End adding new data:[{}][{}]", poolName, msg.size());
// 返回数据
return true;
}

@ -157,7 +157,7 @@ public class ChatRoomServiceImpl implements ChatRoomService {
// 群成员
chatRoomDetailVo.setMembers(chatRoomMapping.convert(membersList, headImgUrlMap, contactNicknameMap));
} catch (InvalidProtocolBufferException e) {
log.error("解析RoomData失败,群聊名称:{},群聊标题:{},错误信息:{}", chatRoomDetailVo.getChatRoomName(), chatRoomDetailVo.getChatRoomTitle(), e);
log.error("Failed to parse RoomData", e);
}
}

@ -99,7 +99,7 @@ public class DatabaseServiceImpl implements DatabaseService, ApplicationRunner {
// 合并聊天记录
mergeMsg();
} catch (Exception e) {
log.error("Sqlite数据库解密失败", e);
log.error("Sqlite database decryption failed", e);
}
}

@ -139,7 +139,7 @@ public class MsgServiceImpl implements MsgService {
}
}
} catch (InvalidProtocolBufferException e) {
log.error("获取对话人Id失败", e);
log.error("Failed to obtain the conversationalist Id", e);
}
return talker;
}

@ -31,7 +31,7 @@ public class XmlUtil {
}
return MAPPER.readValue(content, valueType);
} catch (JsonProcessingException e) {
log.error("解析XML失败", e);
log.error("Parsing XML failed", e);
}
return null;
}

@ -33,4 +33,12 @@ wechat-offset:
"[3.9.10.19]":
nickname: 95129768
account: 95129544
mobile: 95129576
mobile: 95129576
"[3.9.10.27]":
nickname: 95125656
account: 95126992
mobile: 95125464
mybatis-plus:
global-config:
banner: off

@ -0,0 +1,9 @@
JDK Version: ${java.version}
Spring Boot Version: ${spring-boot.version}
## ## ## ## ######## ## ## ## ## ######## ## ##
## ## ## ## ## ## ## ## ## ### ### ## ## ## ## ##
## ## ## ## ## ## ## ## ## #### #### ## ## ## ## ##
## ## ## ### ####### ## ## ## ## ## ### ## ######## ####### ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ######### ## ##
## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
### ### ## ## ######## ####### ## ## ## ## ######
Loading…
Cancel
Save