1
This commit is contained in:
@@ -99,7 +99,14 @@ public class WXUtil {
|
|||||||
// 发送文本消息 msgType 1:私聊 2:群发
|
// 发送文本消息 msgType 1:私聊 2:群发
|
||||||
public synchronized void sendTextMessage(String wxid, String content, Integer msgType, String fromwxid) {
|
public synchronized void sendTextMessage(String wxid, String content, Integer msgType, String fromwxid) {
|
||||||
// 全部打印
|
// 全部打印
|
||||||
logger.info("发送文本消息 msgType: {} wxid: {} fromwxid: {} content: {}", msgType, wxid, fromwxid, content);
|
//logger.info("发送文本消息 msgType: {} wxid: {} fromwxid: {} content: {}", msgType, wxid, fromwxid, content);
|
||||||
|
// 先在content顶部插入时间戳
|
||||||
|
content = "[" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "] \r" + content;
|
||||||
|
|
||||||
|
// 如果是自己的微信,所有信息都加上少爷
|
||||||
|
if (wxid.equals(super_admin_wxid) || fromwxid.equals(super_admin_wxid)) {
|
||||||
|
content = "超管: 凡神 !\r\n" + content;
|
||||||
|
}
|
||||||
List<String> strings = splitStringByLength(content, 3072);
|
List<String> strings = splitStringByLength(content, 3072);
|
||||||
int count = 1;
|
int count = 1;
|
||||||
for (String string : strings) {
|
for (String string : strings) {
|
||||||
@@ -109,10 +116,7 @@ public class WXUtil {
|
|||||||
string = "---长消息---第:" + count + "条 " + "\r" + string;
|
string = "---长消息---第:" + count + "条 " + "\r" + string;
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
// 如果是自己的微信,所有信息都加上少爷
|
|
||||||
if (wxid.equals(super_admin_wxid) || fromwxid.equals(super_admin_wxid)) {
|
|
||||||
string = "超管: 凡神 !\r\n" + string;
|
|
||||||
}
|
|
||||||
//JSONObject wxList = getWxList();
|
//JSONObject wxList = getWxList();
|
||||||
//JSONObject wxBotInfo = (JSONObject) wxList.getJSONArray("result").get(0);
|
//JSONObject wxBotInfo = (JSONObject) wxList.getJSONArray("result").get(0);
|
||||||
//botWxid = wxBotInfo.getString("wxid");
|
//botWxid = wxBotInfo.getString("wxid");
|
||||||
|
|||||||
Reference in New Issue
Block a user