mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-18 05:08:02 +00:00
update modules/kbase: mod 6 files
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:37:01
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-04-08 15:51:23
|
||||
* @LastEditTime: 2025-04-19 10:34:18
|
||||
* @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.
|
||||
@@ -150,6 +150,17 @@ public class RobotRestController extends BaseRestController<RobotRequest> {
|
||||
return ResponseEntity.ok(JsonResult.success(robotResponse));
|
||||
}
|
||||
|
||||
// update kbUid
|
||||
@PreAuthorize("hasAuthority('ROBOT_UPDATE')")
|
||||
@ActionAnnotation(title = "机器人", action = "更新", description = "update robot kbUid")
|
||||
@PostMapping("/update/kbUid")
|
||||
public ResponseEntity<?> updateKbUid(@RequestBody RobotRequest request) {
|
||||
|
||||
RobotResponse robotResponse = robotService.updateKbUid(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(robotResponse));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('ROBOT_DELETE')")
|
||||
@ActionAnnotation(title = "机器人", action = "删除", description = "delete robot")
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 16:44:41
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-04-16 13:55:33
|
||||
* @LastEditTime: 2025-04-19 10:28: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.
|
||||
@@ -742,6 +742,24 @@ public class RobotRestService extends BaseRestService<RobotEntity, RobotRequest,
|
||||
return convertToResponse(savedRobot);
|
||||
}
|
||||
|
||||
// update kbUid
|
||||
public RobotResponse updateKbUid(RobotRequest request) {
|
||||
Optional<RobotEntity> robotOptional = findByUid(request.getUid());
|
||||
if (!robotOptional.isPresent()) {
|
||||
throw new RuntimeException("robot " + request.getUid() + " not found");
|
||||
}
|
||||
//
|
||||
RobotEntity robot = robotOptional.get();
|
||||
robot.setKbEnabled(request.getIsKbEnabled());
|
||||
robot.setKbUid(request.getKbUid());
|
||||
//
|
||||
RobotEntity savedRobot = save(robot);
|
||||
if (savedRobot == null) {
|
||||
throw new RuntimeException("update robot " + request.getUid() + " failed");
|
||||
}
|
||||
return convertToResponse(savedRobot);
|
||||
}
|
||||
|
||||
public void initDemoBytedesk() {
|
||||
String orgUid = BytedeskConsts.DEFAULT_ORGANIZATION_UID;
|
||||
// 首先redis中是否已经初始化此数据,如果没有,继续执行演示数据初始化
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-06-12 09:07:53
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-03-24 18:17:10
|
||||
* @LastEditTime: 2025-04-19 10:16:37
|
||||
* @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.
|
||||
@@ -61,6 +61,10 @@ public class RobotSpecification extends BaseSpecification {
|
||||
if (StringUtils.hasText(request.getCategoryUid())) {
|
||||
predicates.add(criteriaBuilder.equal(root.get("categoryUid"), request.getCategoryUid()));
|
||||
}
|
||||
// kbUid
|
||||
if (StringUtils.hasText(request.getKbUid())) {
|
||||
predicates.add(criteriaBuilder.equal(root.get("kbUid"), request.getKbUid()));
|
||||
}
|
||||
if (StringUtils.hasText(request.getType())) {
|
||||
predicates.add(criteriaBuilder.equal(root.get("type"), request.getType()));
|
||||
}
|
||||
|
||||
@@ -169,9 +169,6 @@ public class KbaseEntity extends BaseEntity {
|
||||
// 某人工客服快捷回复知识库
|
||||
private String agentUid;
|
||||
|
||||
// 机器人模拟测试知识库
|
||||
private String robotUid;
|
||||
|
||||
@Builder.Default
|
||||
@ManyToMany(fetch = FetchType.LAZY)
|
||||
private List<MemberEntity> members = new ArrayList<>();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 22:59:48
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-04-19 10:08:37
|
||||
* @LastEditTime: 2025-04-19 10:15:29
|
||||
* @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.
|
||||
@@ -151,9 +151,6 @@ public class KbaseRequest extends BaseRequest {
|
||||
|
||||
private String agentUid;
|
||||
|
||||
// 机器人模拟测试知识库
|
||||
private String robotUid;
|
||||
|
||||
// 从 notebase 查询, 同时查询 HELPCENTER 和 NOTEBASE 两种类型
|
||||
@Builder.Default
|
||||
private Boolean queryNotebase = false;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-03-22 23:00:00
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-04-19 10:08:54
|
||||
* @LastEditTime: 2025-04-19 10:15:32
|
||||
* @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.
|
||||
@@ -112,9 +112,6 @@ public class KbaseResponse extends BaseResponse {
|
||||
private String agentUid;
|
||||
|
||||
private String userUid;
|
||||
|
||||
// 机器人模拟测试知识库
|
||||
private String robotUid;
|
||||
|
||||
|
||||
private List<UserProtobuf> members;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user