mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-16 20:27:50 +00:00
update modules/core: mod 10 files
This commit is contained in:
@@ -203,7 +203,7 @@ public class IpAccessRestService extends BaseRestService<IpAccessEntity, IpAcces
|
||||
|
||||
public Boolean isIpBlocked(String ip) {
|
||||
// 检查是否在白名单中
|
||||
if (ipWhitelistRepository.existsByIp(ip)) {
|
||||
if (ipWhitelistRepository.existsByIpAndDeletedFalse(ip)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-12-24 17:49:18
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-01-17 16:09:56
|
||||
* @LastEditTime: 2025-07-24 11:44:28
|
||||
* @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.
|
||||
@@ -20,9 +20,9 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface IpWhitelistRepository extends JpaRepository<IpWhitelistEntity, Long>, JpaSpecificationExecutor<IpWhitelistEntity> {
|
||||
|
||||
boolean existsByIp(String ip);
|
||||
boolean existsByIpAndDeletedFalse(String ip);
|
||||
|
||||
Optional<IpWhitelistEntity> findByIp(String ip);
|
||||
Optional<IpWhitelistEntity> findByIpAndDeletedFalse(String ip);
|
||||
|
||||
Optional<IpWhitelistEntity> findByUid(String uid);
|
||||
}
|
||||
|
||||
@@ -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<IpWhitelistEntity, I
|
||||
|
||||
@Cacheable(value = "ipWhitelist", key = "#ip", unless = "#result == null")
|
||||
public Optional<IpWhitelistEntity> findByIp(String ip) {
|
||||
return ipWhitelistRepository.findByIp(ip);
|
||||
return ipWhitelistRepository.findByIpAndDeletedFalse(ip);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,14 +77,14 @@ public class IpWhitelistRestService extends BaseRestService<IpWhitelistEntity, I
|
||||
public IpWhitelistResponse create(IpWhitelistRequest request) {
|
||||
Optional<IpWhitelistEntity> 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<IpWhitelistEntity, I
|
||||
throw new RuntimeException("ipWhitelist is not present");
|
||||
}
|
||||
IpWhitelistEntity ipWhitelistEntity = modelMapper.map(request, IpWhitelistEntity.class);
|
||||
return convertToResponse(ipWhitelistRepository.save(ipWhitelistEntity));
|
||||
IpWhitelistEntity savedIpWhitelistEntity = ipWhitelistRepository.save(ipWhitelistEntity);
|
||||
if (savedIpWhitelistEntity == null) {
|
||||
throw new RuntimeException("ipWhitelist save failed");
|
||||
}
|
||||
return convertToResponse(savedIpWhitelistEntity);
|
||||
}
|
||||
|
||||
public long count() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-10 10:38:19
|
||||
* @LastEditTime: 2025-07-24 11:49:23
|
||||
* @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.
|
||||
@@ -75,7 +75,8 @@ public class ThreadEntity extends AbstractThreadEntity {
|
||||
|
||||
// ROBOTING
|
||||
public Boolean isRoboting() {
|
||||
return ThreadProcessStatusEnum.ROBOTING.name().equals(getStatus());
|
||||
// return ThreadProcessStatusEnum.ROBOTING.name().equals(getStatus());
|
||||
return isRobotType() && isChatting();
|
||||
}
|
||||
|
||||
// LLMING
|
||||
@@ -140,10 +141,10 @@ public class ThreadEntity extends AbstractThreadEntity {
|
||||
|
||||
// ---------------------------
|
||||
|
||||
public ThreadEntity setRoboting() {
|
||||
setStatus(ThreadProcessStatusEnum.ROBOTING.name());
|
||||
return this;
|
||||
}
|
||||
// public ThreadEntity setRoboting() {
|
||||
// setStatus(ThreadProcessStatusEnum.ROBOTING.name());
|
||||
// return this;
|
||||
// }
|
||||
|
||||
// public ThreadEntity setLlmIng() {
|
||||
// setStatus(ThreadProcessStatusEnum.LLMING.name());
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-25 10:43:58
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-24 11:30:05
|
||||
* @LastEditTime: 2025-07-24 11:49:43
|
||||
* @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.
|
||||
@@ -19,8 +19,8 @@ package com.bytedesk.core.thread;
|
||||
// Chatting结束后,直接Closed
|
||||
public enum ThreadProcessStatusEnum {
|
||||
NEW, // 新会话,待处理
|
||||
ROBOTING, // 机器人接待中,外部访客跟大模型机器人会话
|
||||
LLMING, // 大模型对话中,内部成员跟大模型对话
|
||||
// ROBOTING, // 机器人接待中,外部访客跟大模型机器人会话
|
||||
// LLMING, // 大模型对话中,内部成员跟大模型对话
|
||||
OFFLINE, // 客服离线
|
||||
QUEUING, // 排队中
|
||||
CHATTING, // 对话中
|
||||
@@ -60,8 +60,8 @@ public enum ThreadProcessStatusEnum {
|
||||
switch (this) {
|
||||
case NEW:
|
||||
return "新会话";
|
||||
case ROBOTING:
|
||||
return "机器人接待中";
|
||||
// case ROBOTING:
|
||||
// return "机器人接待中";
|
||||
// case LLMING:
|
||||
// return "大模型对话中";
|
||||
case OFFLINE:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-02-21 10:01:27
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-10 10:38:44
|
||||
* @LastEditTime: 2025-07-24 11:49:50
|
||||
* @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.
|
||||
@@ -66,13 +66,14 @@ public class ThreadProtobuf implements Serializable {
|
||||
|
||||
// ROBOTING
|
||||
public Boolean isRoboting() {
|
||||
return ThreadProcessStatusEnum.ROBOTING.equals(getStatus());
|
||||
}
|
||||
// return ThreadProcessStatusEnum.ROBOTING.equals(getStatus());
|
||||
return isRobotType() && isChatting();
|
||||
}
|
||||
|
||||
// LLMING
|
||||
public Boolean isLlmIng() {
|
||||
return ThreadProcessStatusEnum.LLMING.equals(getStatus());
|
||||
}
|
||||
// public Boolean isLlmIng() {
|
||||
// return ThreadProcessStatusEnum.LLMING.equals(getStatus());
|
||||
// }
|
||||
|
||||
// queuing
|
||||
public Boolean isQueuing() {
|
||||
|
||||
Reference in New Issue
Block a user