1,添加获取用户机器人列表ID的接口。

2,机器人回调消息中添加回调的机器人ID。
3,mesh服务添加加群申请相关接口
This commit is contained in:
heavyrian2012
2026-02-02 13:48:04 +08:00
parent d08d6f0c49
commit 4d60231c8c
10 changed files with 126 additions and 0 deletions
@@ -3177,6 +3177,34 @@ public class DatabaseStore {
return outList;
}
List<String> getUserRobotIds(String userId) {
Connection connection = null;
PreparedStatement statement = null;
ResultSet rs = null;
List<String> outList = new ArrayList<>();
try {
connection = DBUtil.getConnection();
String sql = "select _uid from t_robot where _owner = ? and _state = 0";
statement = connection.prepareStatement(sql);
int index = 1;
statement.setString(1, userId);
rs = statement.executeQuery();
while (rs.next()) {
outList.add(rs.getString(1));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Utility.printExecption(LOG, e, RDBS_Exception);
} finally {
DBUtil.closeDB(connection, statement, rs);
}
return outList;
}
Set<String> getAllEnds(boolean fromUserTable) {
Connection connection = null;
PreparedStatement statement = null;
@@ -3249,6 +3249,11 @@ public class MemoryMessagesStore implements IMessagesStore {
return databaseStore.getAllUsers(count, offset);
}
@Override
public List<String> getUserRobotIds(String userId) {
return databaseStore.getUserRobotIds(userId);
}
// 电话号码校验正则表达式(支持中国大陆手机号和固话)
private static final String PHONE_REGEX = "^\\s*" + // 允许开头空白
"(?:" +
@@ -157,6 +157,7 @@ public interface IMessagesStore {
ErrorCode searchUser(String userId, String keyword, int searchType, int userType, int page, List<WFCMessage.User> users);
List<WFCMessage.User> getUserInfoList(int count, int offset);
List<String> getUserRobotIds(String userId);
boolean updateSystemSetting(int id, String value, String desc);
SystemSettingPojo getSystemSetting(int id);
@@ -179,6 +179,7 @@ public class MessagesPublisher {
message = m_messagesStore.getMessage(messageId);
}
OutputMessageData outputMessageData = getOutputMessageWithExtraInfo(message, exceptClientId, m_messagesStore.isRobotCallbackWithClientInfo() , m_messagesStore.isRobotCallbackWithSenderInfo(), m_messagesStore.isRobotCallbackWithTargetInfo());
outputMessageData.setToRobotId(robot.getUid());
Server.getServer().getCallbackScheduler().execute(() -> {
try {
HttpUtils.httpJsonPost(robot.getCallback(), GsonUtil.gson.toJson(outputMessageData, OutputMessageData.class), HttpUtils.HttpPostType.POST_TYPE_Robot_Message_Callback);