From e4cb7124f9fe6830d33ad90f0f1fc41d8a7712ac Mon Sep 17 00:00:00 2001 From: jack ning Date: Thu, 24 Jul 2025 12:14:06 +0800 Subject: [PATCH] update modules/core: mod 10 files --- .../core/ip/access/IpAccessRestService.java | 2 +- .../core/ip/white/IpWhitelistRepository.java | 6 +-- .../core/ip/white/IpWhitelistRestService.java | 14 ++++-- .../bytedesk/core/thread/ThreadEntity.java | 13 ++--- .../core/thread/ThreadProcessStatusEnum.java | 10 ++-- .../bytedesk/core/thread/ThreadProtobuf.java | 13 ++--- .../RobotThreadRoutingStrategy.java | 4 +- .../WorkflowThreadRoutingStrategy.java | 2 +- .../WorkgroupThreadRoutingStrategy.java | 4 +- .../visitor_thread/VisitorThreadService.java | 48 ++++++++++++++++++- 10 files changed, 84 insertions(+), 32 deletions(-) diff --git a/modules/core/src/main/java/com/bytedesk/core/ip/access/IpAccessRestService.java b/modules/core/src/main/java/com/bytedesk/core/ip/access/IpAccessRestService.java index c28f034552..fa1f3ca23f 100644 --- a/modules/core/src/main/java/com/bytedesk/core/ip/access/IpAccessRestService.java +++ b/modules/core/src/main/java/com/bytedesk/core/ip/access/IpAccessRestService.java @@ -203,7 +203,7 @@ public class IpAccessRestService extends BaseRestService, JpaSpecificationExecutor { - boolean existsByIp(String ip); + boolean existsByIpAndDeletedFalse(String ip); - Optional findByIp(String ip); + Optional findByIpAndDeletedFalse(String ip); Optional findByUid(String uid); } diff --git a/modules/core/src/main/java/com/bytedesk/core/ip/white/IpWhitelistRestService.java b/modules/core/src/main/java/com/bytedesk/core/ip/white/IpWhitelistRestService.java index 13e9e7bdfb..886b985d0a 100644 --- a/modules/core/src/main/java/com/bytedesk/core/ip/white/IpWhitelistRestService.java +++ b/modules/core/src/main/java/com/bytedesk/core/ip/white/IpWhitelistRestService.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-12-24 22:18:54 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-07-04 12:59:53 + * @LastEditTime: 2025-07-24 11:45:22 * @Description: bytedesk.com https://github.com/Bytedesk/bytedesk * Please be aware of the BSL license restrictions before installing Bytedesk IM – * selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license. @@ -53,7 +53,7 @@ public class IpWhitelistRestService extends BaseRestService findByIp(String ip) { - return ipWhitelistRepository.findByIp(ip); + return ipWhitelistRepository.findByIpAndDeletedFalse(ip); } @Override @@ -77,14 +77,14 @@ public class IpWhitelistRestService extends BaseRestService ipWhitelist = findByIp(request.getIp()); if (ipWhitelist.isPresent()) { - throw new RuntimeException("ipWhitelist is present"); + throw new RuntimeException("ipWhitelist already exists"); } IpWhitelistEntity ipWhitelistEntity = modelMapper.map(request, IpWhitelistEntity.class); ipWhitelistEntity.setUid(uidUtils.getUid()); // 保存 IpWhitelistEntity savedIpWhitelistEntity = ipWhitelistRepository.save(ipWhitelistEntity); if (savedIpWhitelistEntity == null) { - throw new RuntimeException("ipWhitelist is null"); + throw new RuntimeException("ipWhitelist save failed"); } return convertToResponse(savedIpWhitelistEntity); } @@ -96,7 +96,11 @@ public class IpWhitelistRestService extends BaseRestService visitorThreadOpt = findByUid(thread.getUid()); if (visitorThreadOpt.isPresent()) {