diff --git a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerEntity.java b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerEntity.java index b4e6660ecc..07d307bdd5 100644 --- a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerEntity.java +++ b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerEntity.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-02-22 16:52:52 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-06-24 21:25:16 + * @LastEditTime: 2025-06-25 08:32:12 * @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. @@ -121,4 +121,6 @@ public class CustomerEntity extends BaseEntity { // 备注信息 @Column(columnDefinition = TypeConsts.COLUMN_TYPE_TEXT) private String notes; // 备注信息 + + private String visitorUid; } diff --git a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRequest.java b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRequest.java index 8b67c1d469..c7bb7ccab3 100644 --- a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRequest.java +++ b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRequest.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-03-22 23:06:35 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-06-24 21:20:30 + * @LastEditTime: 2025-06-25 08:32:19 * @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. @@ -51,4 +51,5 @@ public class CustomerRequest extends BaseRequest { // 备注信息 private String notes; + private String visitorUid; } diff --git a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerResponse.java b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerResponse.java index 384933cf00..a78711a5b2 100644 --- a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerResponse.java +++ b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerResponse.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-03-22 23:06:47 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-06-24 20:54:32 + * @LastEditTime: 2025-06-25 08:32: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. @@ -50,4 +50,6 @@ public class CustomerResponse extends BaseResponse { // 备注信息 private String notes; + + private String visitorUid; } diff --git a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRestController.java b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRestController.java index 30003c3d0c..eb0d22e135 100644 --- a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRestController.java +++ b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerRestController.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-03-22 23:06:07 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-05-25 11:08:42 + * @LastEditTime: 2025-06-25 08:33:54 * @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. @@ -65,6 +65,17 @@ public class CustomerRestController extends BaseRestController return ResponseEntity.ok(JsonResult.success(response)); } + @Operation(summary = "查询指定客户", description = "根据UID查询客户详情") + @ApiResponse(responseCode = "200", description = "查询成功", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = CustomerResponse.class))) + @Override + public ResponseEntity queryByUid(CustomerRequest request) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'queryByUid'"); + } + + @Operation(summary = "创建客户", description = "创建新的客户") @ApiResponse(responseCode = "200", description = "创建成功", content = @Content(mediaType = "application/json", @@ -113,16 +124,7 @@ public class CustomerRestController extends BaseRestController ); } - @Operation(summary = "查询指定客户", description = "根据UID查询客户详情") - @ApiResponse(responseCode = "200", description = "查询成功", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = CustomerResponse.class))) - @Override - public ResponseEntity queryByUid(CustomerRequest request) { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'queryByUid'"); - } - + } diff --git a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerSpecification.java b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerSpecification.java index d99982e7fa..e94d9787cd 100644 --- a/modules/service/src/main/java/com/bytedesk/service/customer/CustomerSpecification.java +++ b/modules/service/src/main/java/com/bytedesk/service/customer/CustomerSpecification.java @@ -2,7 +2,7 @@ * @Author: jackning 270580156@qq.com * @Date: 2024-06-07 11:45:30 * @LastEditors: jackning 270580156@qq.com - * @LastEditTime: 2025-06-24 22:02:41 + * @LastEditTime: 2025-06-25 08:32: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. @@ -56,6 +56,10 @@ public class CustomerSpecification extends BaseSpecification { if (StringUtils.hasText(request.getNotes())) { predicates.add(criteriaBuilder.like(root.get("notes"), "%" + request.getNotes() + "%")); } + // visitorUid + if (StringUtils.hasText(request.getVisitorUid())) { + predicates.add(criteriaBuilder.equal(root.get("visitorUid"), request.getVisitorUid())); + } return criteriaBuilder.and(predicates.toArray(new Predicate[0])); }; }