mirror of
https://gitee.com/270580156/weiyu.git
synced 2025-12-30 10:52:26 +00:00
update
This commit is contained in:
@@ -34,7 +34,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Booking Management", description = "Booking management APIs for organizing and categorizing content with bookings")
|
||||
@Description("Booking Management Controller - Content booking and categorization APIs")
|
||||
public class BookingRestController extends BaseRestController<BookingRequest> {
|
||||
public class BookingRestController extends BaseRestController<BookingRequest, BookingRestService> {
|
||||
|
||||
private final BookingRestService bookingRestService;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.enums.LevelEnum;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
@@ -46,7 +46,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class BookingRestService extends BaseRestServiceWithExcel<BookingEntity, BookingRequest, BookingResponse, BookingExcel> {
|
||||
public class BookingRestService extends BaseRestServiceWithExport<BookingEntity, BookingRequest, BookingResponse, BookingExcel> {
|
||||
|
||||
private final BookingRepository bookingRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-21 12:49:17
|
||||
* @LastEditTime: 2025-08-20 17:31:01
|
||||
* @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.
|
||||
@@ -35,7 +35,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Consumer Management", description = "Consumer management APIs for organizing and categorizing content with consumers")
|
||||
@Description("Consumer Management Controller - Content consumer and categorization APIs")
|
||||
public class ConsumerRestController extends BaseRestController<ConsumerRequest> {
|
||||
public class ConsumerRestController extends BaseRestController<ConsumerRequest, ConsumerRestService> {
|
||||
|
||||
private final ConsumerRestService consumerRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -33,7 +33,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ConsumerRestService extends BaseRestServiceWithExcel<ConsumerEntity, ConsumerRequest, ConsumerResponse, ConsumerExcel> {
|
||||
public class ConsumerRestService extends BaseRestServiceWithExport<ConsumerEntity, ConsumerRequest, ConsumerResponse, ConsumerExcel> {
|
||||
|
||||
private final ConsumerRepository consumerRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-21 12:50:18
|
||||
* @LastEditTime: 2025-08-20 17:31:09
|
||||
* @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.
|
||||
@@ -35,7 +35,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Shopping Management", description = "Shopping management APIs for organizing and categorizing content with shoppings")
|
||||
@Description("Shopping Management Controller - Content shopping and categorization APIs")
|
||||
public class ShoppingRestController extends BaseRestController<ShoppingRequest> {
|
||||
public class ShoppingRestController extends BaseRestController<ShoppingRequest, ShoppingRestService> {
|
||||
|
||||
private final ShoppingRestService shoppingRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -33,7 +33,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ShoppingRestService extends BaseRestServiceWithExcel<ShoppingEntity, ShoppingRequest, ShoppingResponse, ShoppingExcel> {
|
||||
public class ShoppingRestService extends BaseRestServiceWithExport<ShoppingEntity, ShoppingRequest, ShoppingResponse, ShoppingExcel> {
|
||||
|
||||
private final ShoppingRepository shoppingRepository;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RequestMapping("/api/v1/model")
|
||||
@AllArgsConstructor
|
||||
@Description("LLM Model Controller - Large Language Model management and configuration APIs")
|
||||
public class LlmModelRestController extends BaseRestController<LlmModelRequest> {
|
||||
public class LlmModelRestController extends BaseRestController<LlmModelRequest, LlmModelRestService> {
|
||||
|
||||
private final LlmModelRestService llmModelRestService;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RequestMapping("/api/v1/provider")
|
||||
@AllArgsConstructor
|
||||
@Description("LLM Provider Controller - Large Language Model provider management and configuration APIs")
|
||||
public class LlmProviderRestController extends BaseRestController<LlmProviderRequest> {
|
||||
public class LlmProviderRestController extends BaseRestController<LlmProviderRequest, LlmProviderRestService> {
|
||||
|
||||
private final LlmProviderRestService llmProviderRestService;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.context.annotation.Description;
|
||||
@RequestMapping("/api/v1/robot")
|
||||
@RequiredArgsConstructor
|
||||
@Description("Robot Management Controller - AI robot and chatbot management APIs")
|
||||
public class RobotRestController extends BaseRestController<RobotRequest> {
|
||||
public class RobotRestController extends BaseRestController<RobotRequest, RobotRestService> {
|
||||
|
||||
private final RobotRestService robotRestService;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.bytedesk.ai.provider.LlmProviderRestService;
|
||||
import com.bytedesk.ai.robot.RobotJsonLoader.Robot;
|
||||
import com.bytedesk.ai.robot.RobotJsonLoader.RobotConfiguration;
|
||||
import com.bytedesk.ai.utils.ConvertAiUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.base.LlmProviderConfigDefault;
|
||||
import com.bytedesk.core.category.CategoryTypeEnum;
|
||||
import com.bytedesk.core.category.CategoryEntity;
|
||||
@@ -63,7 +63,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@Description("Robot Management Service - AI robot and chatbot management service")
|
||||
public class RobotRestService extends BaseRestServiceWithExcel<RobotEntity, RobotRequest, RobotResponse, RobotExcel> {
|
||||
public class RobotRestService extends BaseRestServiceWithExport<RobotEntity, RobotRequest, RobotResponse, RobotExcel> {
|
||||
|
||||
private final RobotRepository robotRepository;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/robot/message")
|
||||
@AllArgsConstructor
|
||||
@Description("Robot Message Controller - AI robot message and conversation management APIs")
|
||||
public class RobotMessageRestController extends BaseRestController<RobotMessageRequest> {
|
||||
public class RobotMessageRestController extends BaseRestController<RobotMessageRequest, RobotMessageRestService> {
|
||||
|
||||
private final RobotMessageRestService robotMessageRestService;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.util.StringUtils;
|
||||
import org.springframework.context.annotation.Description;
|
||||
|
||||
import com.bytedesk.ai.utils.ConvertAiUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import com.bytedesk.core.utils.BdDateUtils;
|
||||
@@ -39,7 +39,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Description("Robot Message Service - AI robot message and conversation management service")
|
||||
public class RobotMessageRestService extends BaseRestServiceWithExcel<RobotMessageEntity, RobotMessageRequest, RobotMessageResponse, RobotMessageExcel> {
|
||||
public class RobotMessageRestService extends BaseRestServiceWithExport<RobotMessageEntity, RobotMessageRequest, RobotMessageResponse, RobotMessageExcel> {
|
||||
|
||||
private final RobotMessageRepository robotMessageRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-06-03 14:30:25
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-17 17:57:36
|
||||
* @LastEditTime: 2025-08-20 17:25:38
|
||||
* @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.
|
||||
@@ -39,7 +39,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RequestMapping("/api/v1/freeswitch/call")
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = "bytedesk.call.freeswitch", name = "enabled", havingValue = "true", matchIfMissing = false)
|
||||
public class CallCallRestController extends BaseRestController<CallCallRequest> {
|
||||
public class CallCallRestController extends BaseRestController<CallCallRequest, CallCallRestService> {
|
||||
|
||||
private final CallCallService callService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-06-08 10:00:00
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-14 09:34:30
|
||||
* @LastEditTime: 2025-08-20 17:31: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.
|
||||
@@ -30,7 +30,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/freeswitch/cdr")
|
||||
@AllArgsConstructor
|
||||
public class CallCdrRestController extends BaseRestController<CallCdrRequest> {
|
||||
public class CallCdrRestController extends BaseRestController<CallCdrRequest, CallCdrRestService> {
|
||||
|
||||
private final CallCdrRestService callCdrRestService;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
@@ -37,7 +37,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CallCdrRestService extends BaseRestServiceWithExcel<CallCdrEntity, CallCdrRequest, CallCdrResponse, CallCdrExcel> {
|
||||
public class CallCdrRestService extends BaseRestServiceWithExport<CallCdrEntity, CallCdrRequest, CallCdrResponse, CallCdrExcel> {
|
||||
|
||||
private final CallCdrRepository callCdrRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-06-08 10:00:00
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-08 10:00:00
|
||||
* @LastEditTime: 2025-08-20 17:31:36
|
||||
* @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.
|
||||
@@ -29,7 +29,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/freeswitch/conference")
|
||||
@AllArgsConstructor
|
||||
public class CallConferenceRestController extends BaseRestController<CallConferenceRequest> {
|
||||
public class CallConferenceRestController extends BaseRestController<CallConferenceRequest, CallConferenceRestService> {
|
||||
|
||||
private final CallConferenceRestService freeSwitchConferenceRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.enums.LevelEnum;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -37,7 +37,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CallConferenceRestService extends BaseRestServiceWithExcel<CallConferenceEntity, CallConferenceRequest, CallConferenceResponse, CallConferenceExcel> {
|
||||
public class CallConferenceRestService extends BaseRestServiceWithExport<CallConferenceEntity, CallConferenceRequest, CallConferenceResponse, CallConferenceExcel> {
|
||||
|
||||
private final CallConferenceRepository freeSwitchConferenceRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-06-09 10:00:00
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-13 21:55:49
|
||||
* @LastEditTime: 2025-08-20 17:31:46
|
||||
* @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.
|
||||
@@ -34,7 +34,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/freeswitch/gateway")
|
||||
@AllArgsConstructor
|
||||
public class CallGatewayRestController extends BaseRestController<CallGatewayRequest> {
|
||||
public class CallGatewayRestController extends BaseRestController<CallGatewayRequest, CallGatewayRestService> {
|
||||
|
||||
private final CallGatewayRestService gatewayRestService;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CallGatewayRestService extends BaseRestServiceWithExcel<CallGatewayEntity, CallGatewayRequest, CallGatewayResponse, CallGatewayExcel> {
|
||||
public class CallGatewayRestService extends BaseRestServiceWithExport<CallGatewayEntity, CallGatewayRequest, CallGatewayResponse, CallGatewayExcel> {
|
||||
|
||||
private final CallGatewayRepository gatewayRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-10 15:21:32
|
||||
* @LastEditTime: 2025-08-20 17:32:03
|
||||
* @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.
|
||||
@@ -35,7 +35,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "CallIvr Management", description = "CallIvr management APIs for organizing and categorizing content with tags")
|
||||
@Description("CallIvr Management Controller - Content tagging and categorization APIs")
|
||||
public class CallIvrRestController extends BaseRestController<CallIvrRequest> {
|
||||
public class CallIvrRestController extends BaseRestController<CallIvrRequest, CallIvrRestService> {
|
||||
|
||||
private final CallIvrRestService ivrRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.enums.LevelEnum;
|
||||
@@ -39,7 +39,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CallIvrRestService extends BaseRestServiceWithExcel<CallIvrEntity, CallIvrRequest, CallIvrResponse, CallIvrExcel> {
|
||||
public class CallIvrRestService extends BaseRestServiceWithExport<CallIvrEntity, CallIvrRequest, CallIvrResponse, CallIvrExcel> {
|
||||
|
||||
private final CallIvrRepository ivrRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-06-08 10:00:00
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-12 17:33:37
|
||||
* @LastEditTime: 2025-08-20 17:32:17
|
||||
* @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.
|
||||
@@ -29,7 +29,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/freeswitch/user")
|
||||
@AllArgsConstructor
|
||||
public class CallUserRestController extends BaseRestController<CallUserRequest> {
|
||||
public class CallUserRestController extends BaseRestController<CallUserRequest, CallUserRestService> {
|
||||
|
||||
private final CallUserRestService freeSwitchNumberRestService;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.enums.LevelEnum;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -24,7 +24,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CallUserRestService extends BaseRestServiceWithExcel<CallUserEntity, CallUserRequest, CallUserResponse, CallUserExcel> {
|
||||
public class CallUserRestService extends BaseRestServiceWithExport<CallUserEntity, CallUserRequest, CallUserResponse, CallUserExcel> {
|
||||
|
||||
private final CallUserRepository freeSwitchNumberRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-13 21:48:49
|
||||
* @LastEditTime: 2025-08-20 17:32:24
|
||||
* @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.
|
||||
@@ -30,7 +30,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/freeswitch/webrtc")
|
||||
@AllArgsConstructor
|
||||
public class CallWebRTCRestController extends BaseRestController<CallWebRTCRequest> {
|
||||
public class CallWebRTCRestController extends BaseRestController<CallWebRTCRequest, CallWebRTCRestService> {
|
||||
|
||||
private final CallWebRTCRestService freeswitchWebRTCRestService;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
@@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CallWebRTCRestService extends BaseRestServiceWithExcel<CallWebRTCEntity, CallWebRTCRequest, CallWebRTCResponse, CallWebRTCExcel> {
|
||||
public class CallWebRTCRestService extends BaseRestServiceWithExport<CallWebRTCEntity, CallWebRTCRequest, CallWebRTCResponse, CallWebRTCExcel> {
|
||||
|
||||
private final CallWebRTCRepository webrtcRepository;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/api/v1/action")
|
||||
@Tag(name = "Action Log Management", description = "Action log management APIs for tracking user activities and system events")
|
||||
public class ActionRestController extends BaseRestController<ActionRequest> {
|
||||
public class ActionRestController extends BaseRestController<ActionRequest, ActionRestService> {
|
||||
|
||||
private final ActionRestService actionRestService;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
@@ -33,7 +33,7 @@ import lombok.AllArgsConstructor;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ActionRestService extends BaseRestServiceWithExcel<ActionEntity, ActionRequest, ActionResponse, ActionExcel> {
|
||||
public class ActionRestService extends BaseRestServiceWithExport<ActionEntity, ActionRequest, ActionResponse, ActionExcel> {
|
||||
|
||||
private final ActionRepository actionRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:04:43
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-07 11:16:11
|
||||
* @LastEditTime: 2025-08-20 17:22: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.
|
||||
@@ -30,7 +30,7 @@ import lombok.RequiredArgsConstructor;
|
||||
@RequestMapping("/api/v1/assistant")
|
||||
// @Tag(name = "assistant - 助手", description = "assistant apis")
|
||||
@Description("Assistant Management Controller - AI assistant and chatbot management APIs")
|
||||
public class AssistantRestController extends BaseRestController<AssistantRequest> {
|
||||
public class AssistantRestController extends BaseRestController<AssistantRequest, AssistantRestService> {
|
||||
|
||||
private final AssistantRestService assistantRestService;
|
||||
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
/*
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-10 12:16:43
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-14 08:45: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.
|
||||
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
|
||||
* contact: 270580156@qq.com
|
||||
* 联系:270580156@qq.com
|
||||
* Copyright (c) 2024 by bytedesk.com, All Rights Reserved.
|
||||
*/
|
||||
|
||||
package com.bytedesk.core.base;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -32,59 +20,143 @@ import java.util.List;
|
||||
/**
|
||||
* @author jackning 270580156@qq.com
|
||||
*/
|
||||
public abstract class BaseRestController<T> {
|
||||
public abstract class BaseRestController<T extends PageableRequest, S> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
* 获取对应的服务实例
|
||||
* 提供默认实现,通过反射自动查找服务字段
|
||||
* 子类也可以重写此方法来提供具体的服务对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected S getService() {
|
||||
try {
|
||||
// 通过反射查找以 Service 结尾的字段
|
||||
java.lang.reflect.Field[] fields = this.getClass().getDeclaredFields();
|
||||
for (java.lang.reflect.Field field : fields) {
|
||||
if (field.getName().endsWith("Service") || field.getName().endsWith("RestService")) {
|
||||
field.setAccessible(true);
|
||||
Object service = field.get(this);
|
||||
if (service != null) {
|
||||
return (S) service;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没找到,查找所有字段中第一个非基本类型的字段(可能是服务)
|
||||
for (java.lang.reflect.Field field : fields) {
|
||||
if (!field.getType().isPrimitive() &&
|
||||
!field.getType().equals(String.class) &&
|
||||
!field.getName().equals("log") &&
|
||||
!java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
|
||||
field.setAccessible(true);
|
||||
Object service = field.get(this);
|
||||
if (service != null) {
|
||||
return (S) service;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException("No service field found. Please override getService() method or ensure you have a field ending with 'Service' or 'RestService'");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to get service instance: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的queryByOrg实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@GetMapping("/query/org")
|
||||
abstract public ResponseEntity<?> queryByOrg(T request);
|
||||
public ResponseEntity<?> queryByOrg(T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("queryByOrg", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* query department users
|
||||
*
|
||||
* @return json
|
||||
* 通用的queryByUser实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@GetMapping("/query")
|
||||
abstract public ResponseEntity<?> queryByUser(T request);
|
||||
public ResponseEntity<?> queryByUser(T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("queryByUser", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* query by uid
|
||||
*
|
||||
* @param request role
|
||||
* @return json
|
||||
* 通用的queryByUid实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@GetMapping("/query/uid")
|
||||
abstract public ResponseEntity<?> queryByUid(T request);
|
||||
public ResponseEntity<?> queryByUid(T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("queryByUid", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create
|
||||
*
|
||||
* @param request role
|
||||
* @return json
|
||||
* 通用的create实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
abstract public ResponseEntity<?> create(@RequestBody T request);
|
||||
public ResponseEntity<?> create(@RequestBody T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("create", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* update
|
||||
*
|
||||
* @param request role
|
||||
* @return json
|
||||
* 通用的update实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
abstract public ResponseEntity<?> update(@RequestBody T request);
|
||||
public ResponseEntity<?> update(@RequestBody T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("update", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete
|
||||
*
|
||||
* @param request role
|
||||
* @return json
|
||||
* 通用的delete实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
abstract public ResponseEntity<?> delete(@RequestBody T request);
|
||||
public ResponseEntity<?> delete(@RequestBody T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("delete", request.getClass());
|
||||
method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success());
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete by org uid
|
||||
@@ -102,7 +174,7 @@ public abstract class BaseRestController<T> {
|
||||
* 通用导出Excel模板方法
|
||||
*
|
||||
* @param <E> Excel实体类型
|
||||
* @param <S> Service类型
|
||||
* @param <SVC> Service类型
|
||||
* @param request 请求参数
|
||||
* @param response HTTP响应
|
||||
* @param service 服务对象
|
||||
@@ -111,10 +183,10 @@ public abstract class BaseRestController<T> {
|
||||
* @param filePrefix 文件名前缀
|
||||
* @return 导出结果
|
||||
*/
|
||||
protected <E, S> Object exportTemplate(
|
||||
protected <E, SVC> Object exportTemplate(
|
||||
T request,
|
||||
HttpServletResponse response,
|
||||
S service,
|
||||
SVC service,
|
||||
Class<E> excelClass,
|
||||
String sheetName,
|
||||
String filePrefix) {
|
||||
@@ -150,7 +222,7 @@ public abstract class BaseRestController<T> {
|
||||
/**
|
||||
* 通过反射调用服务方法
|
||||
*/
|
||||
private <S> Object invokeMethod(S service, String methodName, Object... args) throws Exception {
|
||||
private <SVC> Object invokeMethod(SVC service, String methodName, Object... args) throws Exception {
|
||||
Method method = null;
|
||||
for (Method m : service.getClass().getMethods()) {
|
||||
if (m.getName().equals(methodName)) {
|
||||
@@ -168,7 +240,7 @@ public abstract class BaseRestController<T> {
|
||||
* 转换数据为Excel列表
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private <E, S> List<E> convertToExcelList(S service, Object data) throws Exception {
|
||||
private <E, SVC> List<E> convertToExcelList(SVC service, Object data) throws Exception {
|
||||
if (data instanceof Page) {
|
||||
Page<?> page = (Page<?>) data;
|
||||
Method convertMethod = null;
|
||||
@@ -198,6 +270,8 @@ public abstract class BaseRestController<T> {
|
||||
* @return json
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
abstract public Object export(T request, HttpServletResponse response);
|
||||
public Object export(T request, HttpServletResponse response) {
|
||||
throw new UnsupportedOperationException("Method export needs to be implemented in child class");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
|
||||
package com.bytedesk.core.base;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.bytedesk.core.utils.BdDateUtils;
|
||||
import com.bytedesk.core.utils.JsonResult;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jackning 270580156@qq.com
|
||||
*/
|
||||
public abstract class BaseRestControllerWithExport<T extends PageableRequest, S> {
|
||||
|
||||
/**
|
||||
* 获取对应的服务实例
|
||||
* 提供默认实现,通过反射自动查找服务字段
|
||||
* 子类也可以重写此方法来提供具体的服务对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected S getService() {
|
||||
try {
|
||||
// 通过反射查找以 Service 结尾的字段
|
||||
java.lang.reflect.Field[] fields = this.getClass().getDeclaredFields();
|
||||
for (java.lang.reflect.Field field : fields) {
|
||||
if (field.getName().endsWith("Service") || field.getName().endsWith("RestService")) {
|
||||
field.setAccessible(true);
|
||||
Object service = field.get(this);
|
||||
if (service != null) {
|
||||
return (S) service;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没找到,查找所有字段中第一个非基本类型的字段(可能是服务)
|
||||
for (java.lang.reflect.Field field : fields) {
|
||||
if (!field.getType().isPrimitive() &&
|
||||
!field.getType().equals(String.class) &&
|
||||
!field.getName().equals("log") &&
|
||||
!java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
|
||||
field.setAccessible(true);
|
||||
Object service = field.get(this);
|
||||
if (service != null) {
|
||||
return (S) service;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException("No service field found. Please override getService() method or ensure you have a field ending with 'Service' or 'RestService'");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to get service instance: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的queryByOrg实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@GetMapping("/query/org")
|
||||
public ResponseEntity<?> queryByOrg(T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("queryByOrg", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的queryByUser实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@GetMapping("/query")
|
||||
public ResponseEntity<?> queryByUser(T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("queryByUser", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的queryByUid实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@GetMapping("/query/uid")
|
||||
public ResponseEntity<?> queryByUid(T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("queryByUid", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的create实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResponseEntity<?> create(@RequestBody T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("create", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的update实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public ResponseEntity<?> update(@RequestBody T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("update", request.getClass());
|
||||
Object result = method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success(result));
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用的delete实现
|
||||
* 减少子类重复代码
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<?> delete(@RequestBody T request) {
|
||||
try {
|
||||
S service = getService();
|
||||
Method method = service.getClass().getMethod("delete", request.getClass());
|
||||
method.invoke(service, request);
|
||||
return ResponseEntity.ok(JsonResult.success());
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.ok(JsonResult.error(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete by org uid
|
||||
*
|
||||
* @param request role
|
||||
* @return json
|
||||
*/
|
||||
@PostMapping("/delete/org")
|
||||
public ResponseEntity<?> deleteByOrgUid(@RequestBody T request) {
|
||||
// 默认实现,子类可以覆盖
|
||||
throw new UnsupportedOperationException("Method deleteByOrgUid needs to be implemented in child class");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用导出Excel模板方法
|
||||
*
|
||||
* @param <E> Excel实体类型
|
||||
* @param <SVC> Service类型
|
||||
* @param request 请求参数
|
||||
* @param response HTTP响应
|
||||
* @param service 服务对象
|
||||
* @param excelClass Excel类
|
||||
* @param sheetName 工作表名称
|
||||
* @param filePrefix 文件名前缀
|
||||
* @return 导出结果
|
||||
*/
|
||||
protected <E, SVC> Object exportTemplate(
|
||||
T request,
|
||||
HttpServletResponse response,
|
||||
SVC service,
|
||||
Class<E> excelClass,
|
||||
String sheetName,
|
||||
String filePrefix) {
|
||||
try {
|
||||
// 设置响应类型
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
|
||||
// 生成文件名
|
||||
String fileName = filePrefix + "-" + BdDateUtils.formatDatetimeUid() + ".xlsx";
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName);
|
||||
|
||||
// 获取数据并转换为Excel格式
|
||||
Object data = invokeMethod(service, "queryByOrgEntity", request);
|
||||
List<E> excelList = convertToExcelList(service, data);
|
||||
|
||||
// 写入Excel
|
||||
EasyExcel.write(response.getOutputStream(), excelClass)
|
||||
.autoCloseStream(Boolean.FALSE)
|
||||
.sheet(sheetName)
|
||||
.doWrite(excelList);
|
||||
|
||||
} catch (Exception e) {
|
||||
// 发生异常时重置响应
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
return JsonResult.error(e.getMessage());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过反射调用服务方法
|
||||
*/
|
||||
private <SVC> Object invokeMethod(SVC service, String methodName, Object... args) throws Exception {
|
||||
Method method = null;
|
||||
for (Method m : service.getClass().getMethods()) {
|
||||
if (m.getName().equals(methodName)) {
|
||||
method = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (method != null) {
|
||||
return method.invoke(service, args);
|
||||
}
|
||||
throw new NoSuchMethodException("Method " + methodName + " not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换数据为Excel列表
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private <E, SVC> List<E> convertToExcelList(SVC service, Object data) throws Exception {
|
||||
if (data instanceof Page) {
|
||||
Page<?> page = (Page<?>) data;
|
||||
Method convertMethod = null;
|
||||
for (Method m : service.getClass().getMethods()) {
|
||||
if (m.getName().equals("convertToExcel")) {
|
||||
convertMethod = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (convertMethod != null) {
|
||||
List<Object> content = (List<Object>) page.getContent();
|
||||
List<E> result = new ArrayList<>();
|
||||
for (Object entity : content) {
|
||||
result.add((E) convertMethod.invoke(service, entity));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid data format or convert method not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* export
|
||||
*
|
||||
* @param request role
|
||||
* @return json
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public Object export(T request, HttpServletResponse response) {
|
||||
throw new UnsupportedOperationException("Method export needs to be implemented in child class");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
* 改进的带Excel导出功能的基础RestService类
|
||||
* 继承自BaseRestServiceImproved,增加Excel相关抽象方法
|
||||
*/
|
||||
public abstract class BaseRestServiceWithExcel<T, TRequest extends PageableRequest, TResponse, TExcel>
|
||||
public abstract class BaseRestServiceWithExport<T, TRequest extends PageableRequest, TResponse, TExcel>
|
||||
extends BaseRestService<T, TRequest, TResponse> {
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/black")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "黑名单管理", description = "黑名单增删改查操作")
|
||||
public class BlackRestController extends BaseRestController<BlackRequest> {
|
||||
public class BlackRestController extends BaseRestController<BlackRequest, BlackRestService> {
|
||||
|
||||
private final BlackRestService blackRestService;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
@@ -35,7 +35,7 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BlackRestService extends BaseRestServiceWithExcel<BlackEntity, BlackRequest, BlackResponse, BlackExcel> {
|
||||
public class BlackRestService extends BaseRestServiceWithExport<BlackEntity, BlackRequest, BlackResponse, BlackExcel> {
|
||||
|
||||
private final BlackRepository repository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:21:26
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-14 18:25:24
|
||||
* @LastEditTime: 2025-08-20 17:17:11
|
||||
* @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.
|
||||
@@ -33,7 +33,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/category")
|
||||
@Tag(name = "Category Management", description = "Category management APIs for organizing and classifying content")
|
||||
@Description("Category Management Controller - Content categorization and organization APIs")
|
||||
public class CategoryRestController extends BaseRestController<CategoryRequest> {
|
||||
public class CategoryRestController extends BaseRestController<CategoryRequest, CategoryRestService> {
|
||||
|
||||
private final CategoryRestService categoryRestService;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/clipboard")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Clipboard Management", description = "Clipboard management APIs for sharing and managing clipboard content")
|
||||
public class ClipboardRestController extends BaseRestController<ClipboardRequest> {
|
||||
public class ClipboardRestController extends BaseRestController<ClipboardRequest, ClipboardRestService> {
|
||||
|
||||
private final ClipboardRestService clipboardService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:20:17
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-05-12 14:26:15
|
||||
* @LastEditTime: 2025-08-20 17:17:02
|
||||
* @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.
|
||||
@@ -34,7 +34,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v1/department")
|
||||
@Tag(name = "department - 部门", description = "department apis")
|
||||
public class DepartmentRestController extends BaseRestController<DepartmentRequest> {
|
||||
public class DepartmentRestController extends BaseRestController<DepartmentRequest, DepartmentRestService> {
|
||||
|
||||
private final DepartmentRestService departmentRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-01 15:10:33
|
||||
* @LastEditTime: 2025-08-20 17:18:34
|
||||
* @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.
|
||||
@@ -13,83 +13,20 @@
|
||||
*/
|
||||
package com.bytedesk.core.favorite;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestController;
|
||||
import com.bytedesk.core.utils.JsonResult;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/favorite")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Favorite Management", description = "Favorite management APIs for managing user favorites and bookmarks")
|
||||
public class FavoriteRestController extends BaseRestController<FavoriteRequest> {
|
||||
public class FavoriteRestController extends BaseRestController<FavoriteRequest, FavoriteRestService> {
|
||||
|
||||
private final FavoriteRestService favoriteRestService;
|
||||
|
||||
// @PreAuthorize(RolePermissions.ROLE_ADMIN)
|
||||
@Operation(summary = "Query Favorites by Organization", description = "Retrieve favorites for the current organization (Admin only)")
|
||||
@Override
|
||||
public ResponseEntity<?> queryByOrg(FavoriteRequest request) {
|
||||
|
||||
Page<FavoriteResponse> favorites = favoriteRestService.queryByOrg(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(favorites));
|
||||
}
|
||||
|
||||
@Operation(summary = "Query Favorites by User", description = "Retrieve favorites for the current user")
|
||||
@Override
|
||||
public ResponseEntity<?> queryByUser(FavoriteRequest request) {
|
||||
|
||||
Page<FavoriteResponse> favorites = favoriteRestService.queryByUser(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(favorites));
|
||||
}
|
||||
|
||||
@Operation(summary = "Create Favorite", description = "Create a new favorite item")
|
||||
@Override
|
||||
public ResponseEntity<?> create(FavoriteRequest request) {
|
||||
|
||||
FavoriteResponse favorite = favoriteRestService.create(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(favorite));
|
||||
}
|
||||
|
||||
@Operation(summary = "Update Favorite", description = "Update an existing favorite item")
|
||||
@Override
|
||||
public ResponseEntity<?> update(FavoriteRequest request) {
|
||||
|
||||
FavoriteResponse favorite = favoriteRestService.update(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(favorite));
|
||||
}
|
||||
|
||||
@Operation(summary = "Delete Favorite", description = "Delete a favorite item")
|
||||
@Override
|
||||
public ResponseEntity<?> delete(FavoriteRequest request) {
|
||||
|
||||
favoriteRestService.delete(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object export(FavoriteRequest request, HttpServletResponse response) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'export'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<?> queryByUid(FavoriteRequest request) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'queryByUid'");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/features")
|
||||
public class FeatureRestController extends BaseRestController<FeatureRequest> {
|
||||
public class FeatureRestController extends BaseRestController<FeatureRequest, FeatureRestService> {
|
||||
|
||||
@Autowired
|
||||
private FeatureService featureService;
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2025-08-20 17:14:41
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-20 17:14:45
|
||||
* @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.
|
||||
* Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE
|
||||
* contact: 270580156@qq.com
|
||||
*
|
||||
* Copyright (c) 2025 by bytedesk.com, All Rights Reserved.
|
||||
*/
|
||||
package com.bytedesk.core.feature;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestService;
|
||||
|
||||
@Service
|
||||
public class FeatureRestService extends BaseRestService<FeatureEntity, FeatureRequest, FeatureResponse> {
|
||||
|
||||
@Override
|
||||
public Optional<FeatureEntity> findByUid(String uid) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByUid'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureResponse create(FeatureRequest request) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'create'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureResponse update(FeatureRequest request) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'update'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByUid(String uid) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'deleteByUid'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(FeatureRequest request) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'delete'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureEntity handleOptimisticLockingFailureException(ObjectOptimisticLockingFailureException e,
|
||||
FeatureEntity entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'handleOptimisticLockingFailureException'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureResponse convertToResponse(FeatureEntity entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'convertToResponse'");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Specification<FeatureEntity> createSpecification(FeatureRequest request) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'createSpecification'");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Page<FeatureEntity> executePageQuery(Specification<FeatureEntity> spec, Pageable pageable) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'executePageQuery'");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FeatureEntity doSave(FeatureEntity entity) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'doSave'");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:20:17
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-25 11:24:28
|
||||
* @LastEditTime: 2025-08-20 17:22:25
|
||||
* @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.
|
||||
@@ -39,7 +39,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/api/v1/group")
|
||||
@Tag(name = "群组管理", description = "群组管理相关接口")
|
||||
public class GroupRestController extends BaseRestController<GroupRequest> {
|
||||
public class GroupRestController extends BaseRestController<GroupRequest, GroupRestService> {
|
||||
|
||||
private final GroupRestService groupRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:20:17
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-20 16:21:06
|
||||
* @LastEditTime: 2025-08-20 18:10:39
|
||||
* @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.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
import com.bytedesk.core.rbac.user.UserProtobuf;
|
||||
@@ -46,7 +46,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class GroupRestService extends BaseRestServiceWithExcel<GroupEntity, GroupRequest, GroupResponse, GroupExcel> {
|
||||
public class GroupRestService extends BaseRestServiceWithExport<GroupEntity, GroupRequest, GroupResponse, GroupExcel> {
|
||||
|
||||
private final GroupRepository groupRepository;
|
||||
|
||||
@@ -70,20 +70,6 @@ public class GroupRestService extends BaseRestServiceWithExcel<GroupEntity, Grou
|
||||
return groupRepository.findAll(spec, pageable);
|
||||
}
|
||||
|
||||
public Page<GroupEntity> queryForExport(GroupRequest request) {
|
||||
Pageable pageable = request.getPageable();
|
||||
Specification<GroupEntity> specification = GroupSpecification.search(request, authService);
|
||||
return groupRepository.findAll(specification, pageable);
|
||||
}
|
||||
|
||||
public GroupResponse queryByUid(GroupRequest request) {
|
||||
Optional<GroupEntity> optional = findByUid(request.getUid());
|
||||
if (!optional.isPresent()) {
|
||||
throw new RuntimeException("Failed to query group by uid: " + request.getUid());
|
||||
}
|
||||
return convertToResponse(optional.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询群组成员
|
||||
*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-05-07 13:37:34
|
||||
* @LastEditTime: 2025-08-20 17:22:39
|
||||
* @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.
|
||||
@@ -30,7 +30,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/group/invite")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Group Invitation Management", description = "Group invitation management APIs for creating and managing group invitations")
|
||||
public class GroupInviteRestController extends BaseRestController<GroupInviteRequest> {
|
||||
public class GroupInviteRestController extends BaseRestController<GroupInviteRequest, GroupInviteRestService> {
|
||||
|
||||
private final GroupInviteRestService groupInviteService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-03-08 17:12:01
|
||||
* @LastEditTime: 2025-08-20 17:22:48
|
||||
* @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.
|
||||
@@ -30,7 +30,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/group/notice")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Group Notice Management", description = "Group notice management APIs for managing announcements within groups")
|
||||
public class GroupNoticeRestController extends BaseRestController<GroupNoticeRequest> {
|
||||
public class GroupNoticeRestController extends BaseRestController<GroupNoticeRequest, GroupNoticeRestService> {
|
||||
|
||||
private final GroupNoticeRestService groupNoticeService;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v1/member")
|
||||
@Tag(name = "成员管理", description = "成员管理相关接口")
|
||||
public class MemberRestController extends BaseRestController<MemberRequest> {
|
||||
public class MemberRestController extends BaseRestController<MemberRequest, MemberRestService> {
|
||||
|
||||
private final MemberRestService memberRestService;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.AvatarConsts;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.enums.ChannelEnum;
|
||||
@@ -60,7 +60,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MemberRestService extends BaseRestServiceWithExcel<MemberEntity, MemberRequest, MemberResponse, MemberExcel> {
|
||||
public class MemberRestService extends BaseRestServiceWithExport<MemberEntity, MemberRequest, MemberResponse, MemberExcel> {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Menu Management", description = "Menu management APIs for organizing application navigation and permissions")
|
||||
@Description("Menu Management Controller - Application menu and navigation management APIs")
|
||||
public class MenuRestController extends BaseRestController<MenuRequest> {
|
||||
public class MenuRestController extends BaseRestController<MenuRequest, MenuRestService> {
|
||||
|
||||
private final MenuRestService menuService;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RequestMapping("/api/v1/message")
|
||||
@Tag(name = "消息管理", description = "消息管理相关接口,包括查询、创建、更新、删除等操作")
|
||||
@Description("Message Management Controller - Message management APIs for CRUD operations")
|
||||
public class MessageRestController extends BaseRestController<MessageRequest> {
|
||||
public class MessageRestController extends BaseRestController<MessageRequest, MessageRestService> {
|
||||
|
||||
private final MessageRestService messageRestService;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.exception.NotFoundException;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -41,7 +41,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MessageRestService extends BaseRestServiceWithExcel<MessageEntity, MessageRequest, MessageResponse, MessageExcel> {
|
||||
public class MessageRestService extends BaseRestServiceWithExport<MessageEntity, MessageRequest, MessageResponse, MessageExcel> {
|
||||
|
||||
private final MessageRepository messageRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-07-01 12:38:42
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-24 09:49:50
|
||||
* @LastEditTime: 2025-08-20 17:22:57
|
||||
* @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.
|
||||
@@ -33,7 +33,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@RequestMapping("/api/v1/message/unread")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "未读消息管理", description = "未读消息管理相关接口")
|
||||
public class MessageUnreadRestController extends BaseRestController<MessageUnreadRequest> {
|
||||
public class MessageUnreadRestController extends BaseRestController<MessageUnreadRequest, MessageUnreadRestService> {
|
||||
|
||||
private final MessageUnreadRestService messageUnreadService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-14 09:38:58
|
||||
* @LastEditTime: 2025-08-20 17:25:07
|
||||
* @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.
|
||||
@@ -33,7 +33,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/moment")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Moment Management", description = "Moment management APIs for organizing and categorizing content with moments")
|
||||
public class MomentRestController extends BaseRestController<MomentRequest> {
|
||||
public class MomentRestController extends BaseRestController<MomentRequest, MomentRestService> {
|
||||
|
||||
private final MomentRestService momentRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -36,7 +36,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MomentRestService extends BaseRestServiceWithExcel<MomentEntity, MomentRequest, MomentResponse, MomentExcel> {
|
||||
public class MomentRestService extends BaseRestServiceWithExport<MomentEntity, MomentRequest, MomentResponse, MomentExcel> {
|
||||
|
||||
private final MomentRepository momentRepository;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import lombok.RequiredArgsConstructor;
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Notice Management", description = "Notice management APIs for system announcements and notifications")
|
||||
@Description("Notice Management Controller - System notice and announcement management APIs")
|
||||
public class NoticeRestController extends BaseRestController<NoticeRequest> {
|
||||
public class NoticeRestController extends BaseRestController<NoticeRequest, NoticeRestService> {
|
||||
|
||||
private final NoticeRestService noticeRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-26 21:06:00
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-03-24 12:57:27
|
||||
* @LastEditTime: 2025-08-20 17:25:25
|
||||
* @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.
|
||||
@@ -31,7 +31,7 @@ import lombok.RequiredArgsConstructor;
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v1/channel")
|
||||
// @Tag(name = "channel - 频道", description = "channel apis")
|
||||
public class NoticeAccountRestController extends BaseRestController<NoticeAccountRequest> {
|
||||
public class NoticeAccountRestController extends BaseRestController<NoticeAccountRequest, NoticeAccountRestService> {
|
||||
|
||||
private final NoticeAccountRestService channelService;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import lombok.RequiredArgsConstructor;
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Push Notification Management", description = "Push notification management APIs for sending and managing push notifications")
|
||||
@Description("Push Notification Controller - Push notification and messaging APIs")
|
||||
public class PushRestController extends BaseRestController<PushRequest> {
|
||||
public class PushRestController extends BaseRestController<PushRequest, PushRestService> {
|
||||
|
||||
private final PushRestService pushService;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/quartz")
|
||||
@Tag(name = "Quartz Job Management", description = "Quartz job scheduling and management APIs")
|
||||
@Description("Quartz Job Management Controller - Task scheduling and job management APIs using Quartz")
|
||||
public class QuartzRestController extends BaseRestController<QuartzRequest> {
|
||||
public class QuartzRestController extends BaseRestController<QuartzRequest, QuartzRestService> {
|
||||
|
||||
private QuartzRestService quartzRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-04-24 09:50:21
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-03-05 16:37:02
|
||||
* @LastEditTime: 2025-08-20 17:23:08
|
||||
* @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.
|
||||
@@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@RequestMapping("/api/v1/authority")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Authority Management", description = "Authority management APIs")
|
||||
public class AuthorityRestController extends BaseRestController<AuthorityRequest> {
|
||||
public class AuthorityRestController extends BaseRestController<AuthorityRequest, AuthorityRestService> {
|
||||
|
||||
private final AuthorityRestService authorityService;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/org")
|
||||
@Tag(name = "Organization", description = "Organization management APIs")
|
||||
public class OrganizationRestController extends BaseRestController<OrganizationRequest> {
|
||||
public class OrganizationRestController extends BaseRestController<OrganizationRequest, OrganizationRestService> {
|
||||
|
||||
private final OrganizationRestService organizationRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-05-22 11:21:46
|
||||
* @LastEditTime: 2025-08-20 17:23:17
|
||||
* @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.
|
||||
@@ -13,15 +13,12 @@
|
||||
*/
|
||||
package com.bytedesk.core.rbac.organization_apply;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bytedesk.core.annotation.ActionAnnotation;
|
||||
import com.bytedesk.core.base.BaseRestController;
|
||||
import com.bytedesk.core.utils.JsonResult;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -29,68 +26,10 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/org/apply")
|
||||
@AllArgsConstructor
|
||||
public class OrganizationApplyRestController extends BaseRestController<OrganizationApplyRequest> {
|
||||
public class OrganizationApplyRestController extends BaseRestController<OrganizationApplyRequest, OrganizationApplyRestService> {
|
||||
|
||||
private final OrganizationApplyRestService organizationRestService;
|
||||
|
||||
// @PreAuthorize(RolePermissions.ROLE_ADMIN)
|
||||
@ActionAnnotation(title = "加入组织申请", action = "组织查询", description = "query organizationApply by org")
|
||||
@Override
|
||||
public ResponseEntity<?> queryByOrg(OrganizationApplyRequest request) {
|
||||
|
||||
Page<OrganizationApplyResponse> organizationApplies = organizationRestService.queryByOrg(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(organizationApplies));
|
||||
}
|
||||
|
||||
@ActionAnnotation(title = "加入组织申请", action = "用户查询", description = "query organizationApply by user")
|
||||
@Override
|
||||
public ResponseEntity<?> queryByUser(OrganizationApplyRequest request) {
|
||||
|
||||
Page<OrganizationApplyResponse> organizationApplies = organizationRestService.queryByUser(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(organizationApplies));
|
||||
}
|
||||
|
||||
@ActionAnnotation(title = "加入组织申请", action = "查询详情", description = "query organizationApply by uid")
|
||||
@Override
|
||||
public ResponseEntity<?> queryByUid(OrganizationApplyRequest request) {
|
||||
|
||||
OrganizationApplyResponse organizationApply = organizationRestService.queryByUid(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(organizationApply));
|
||||
}
|
||||
|
||||
@ActionAnnotation(title = "加入组织申请", action = "新建", description = "create organizationApply")
|
||||
@Override
|
||||
// @PreAuthorize("hasAuthority('organizationApply_CREATE')")
|
||||
public ResponseEntity<?> create(OrganizationApplyRequest request) {
|
||||
|
||||
OrganizationApplyResponse organizationApply = organizationRestService.create(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(organizationApply));
|
||||
}
|
||||
|
||||
@ActionAnnotation(title = "加入组织申请", action = "更新", description = "update organizationApply")
|
||||
@Override
|
||||
// @PreAuthorize("hasAuthority('organizationApply_UPDATE')")
|
||||
public ResponseEntity<?> update(OrganizationApplyRequest request) {
|
||||
|
||||
OrganizationApplyResponse organizationApply = organizationRestService.update(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(organizationApply));
|
||||
}
|
||||
|
||||
@ActionAnnotation(title = "加入组织申请", action = "删除", description = "delete organizationApply")
|
||||
@Override
|
||||
// @PreAuthorize("hasAuthority('organizationApply_DELETE')")
|
||||
public ResponseEntity<?> delete(OrganizationApplyRequest request) {
|
||||
|
||||
organizationRestService.delete(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success());
|
||||
}
|
||||
|
||||
@ActionAnnotation(title = "加入组织申请", action = "导出", description = "export organizationApply")
|
||||
@Override
|
||||
// @PreAuthorize("hasAuthority('organizationApply_EXPORT')")
|
||||
@@ -105,7 +44,4 @@ public class OrganizationApplyRestController extends BaseRestController<Organiza
|
||||
"organizationApply"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -35,7 +35,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class OrganizationApplyRestService extends BaseRestServiceWithExcel<OrganizationApplyEntity, OrganizationApplyRequest, OrganizationApplyResponse, OrganizationApplyExcel> {
|
||||
public class OrganizationApplyRestService extends BaseRestServiceWithExport<OrganizationApplyEntity, OrganizationApplyRequest, OrganizationApplyResponse, OrganizationApplyExcel> {
|
||||
|
||||
private final OrganizationApplyRepository organizationRepository;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/role")
|
||||
@Tag(name = "Role Management", description = "Role management APIs")
|
||||
public class RoleRestController extends BaseRestController<RoleRequest> {
|
||||
public class RoleRestController extends BaseRestController<RoleRequest, RoleRestService> {
|
||||
|
||||
private final RoleRestService roleService;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@RequestMapping("/api/v1/token")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Token Management", description = "Token management APIs")
|
||||
public class TokenRestController extends BaseRestController<TokenRequest> {
|
||||
public class TokenRestController extends BaseRestController<TokenRequest, TokenRestService> {
|
||||
|
||||
private final TokenRestService tokenRestService;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "User Management", description = "User management APIs")
|
||||
@Description("User Management Controller - User management APIs for user CRUD operations")
|
||||
public class UserRestController extends BaseRestController<UserRequest> {
|
||||
public class UserRestController extends BaseRestController<UserRequest, UserRestService> {
|
||||
|
||||
private final UserRestService userRestService;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
import com.bytedesk.core.utils.ConvertUtils;
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UserRestService extends BaseRestServiceWithExcel<UserEntity, UserRequest, UserResponse, UserExcel> {
|
||||
public class UserRestService extends BaseRestServiceWithExport<UserEntity, UserRequest, UserResponse, UserExcel> {
|
||||
|
||||
private final UserRepository userRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-14 09:25:07
|
||||
* @LastEditTime: 2025-08-20 17:23: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.
|
||||
@@ -33,7 +33,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/relation")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Relation Management", description = "Relation management APIs for organizing and categorizing content with relations")
|
||||
public class RelationRestController extends BaseRestController<RelationRequest> {
|
||||
public class RelationRestController extends BaseRestController<RelationRequest, RelationRestService> {
|
||||
|
||||
private final RelationRestService relationRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -36,7 +36,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class RelationRestService extends BaseRestServiceWithExcel<RelationEntity, RelationRequest, RelationResponse, RelationExcel> {
|
||||
public class RelationRestService extends BaseRestServiceWithExport<RelationEntity, RelationRequest, RelationResponse, RelationExcel> {
|
||||
|
||||
private final RelationRepository relationRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-07-24 20:43:52
|
||||
* @LastEditTime: 2025-08-20 17:24:02
|
||||
* @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.
|
||||
@@ -35,7 +35,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Server Management", description = "Server management APIs for organizing and categorizing content with servers")
|
||||
@Description("Server Management Controller - Content server and categorization APIs")
|
||||
public class ServerRestController extends BaseRestController<ServerRequest> {
|
||||
public class ServerRestController extends BaseRestController<ServerRequest, ServerRestService> {
|
||||
|
||||
private final ServerRestService serverRestService;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.util.Optional;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Server Metrics Management", description = "Server metrics management APIs for monitoring and analyzing server performance data")
|
||||
@Description("Server Metrics Management Controller - Server performance monitoring and metrics analysis APIs")
|
||||
public class ServerMetricsRestController extends BaseRestController<ServerMetricsRequest> {
|
||||
public class ServerMetricsRestController extends BaseRestController<ServerMetricsRequest, ServerMetricsRestService> {
|
||||
|
||||
private final ServerMetricsRestService serverMetricsRestService;
|
||||
private final ServerRestService serverRestService;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-20 12:39:37
|
||||
* @LastEditTime: 2025-08-20 17:05:57
|
||||
* @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.
|
||||
@@ -35,11 +35,10 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "Tag Management", description = "Tag management APIs for organizing and categorizing content with tags")
|
||||
@Description("Tag Management Controller - Content tagging and categorization APIs")
|
||||
public class TagRestController extends BaseRestController<TagRequest> {
|
||||
public class TagRestController extends BaseRestController<TagRequest, TagRestService> {
|
||||
|
||||
private final TagRestService tagRestService;
|
||||
|
||||
// @PreAuthorize(RolePermissions.ROLE_ADMIN)
|
||||
@ActionAnnotation(title = "标签", action = "组织查询", description = "query tag by org")
|
||||
@Operation(summary = "Query Tags by Organization", description = "Retrieve tags for the current organization")
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.enums.LevelEnum;
|
||||
@@ -40,7 +40,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TagRestService extends BaseRestServiceWithExcel<TagEntity, TagRequest, TagResponse, TagExcel> {
|
||||
public class TagRestService extends BaseRestServiceWithExport<TagEntity, TagRequest, TagResponse, TagExcel> {
|
||||
|
||||
private final TagRepository tagRepository;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:24
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-08-14 14:59:55
|
||||
* @LastEditTime: 2025-08-20 17:06:24
|
||||
* @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.
|
||||
@@ -40,7 +40,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/api/v1/thread")
|
||||
@Tag(name = "会话管理", description = "会话管理相关接口,包括查询、创建、更新、删除、置顶、标星等操作")
|
||||
public class ThreadRestController extends BaseRestController<ThreadRequest> {
|
||||
public class ThreadRestController extends BaseRestController<ThreadRequest, ThreadRestService> {
|
||||
|
||||
private final ThreadRestService threadRestService;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.config.BytedeskEventPublisher;
|
||||
import com.bytedesk.core.enums.ChannelEnum;
|
||||
import com.bytedesk.core.enums.LevelEnum;
|
||||
@@ -65,7 +65,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ThreadRestService
|
||||
extends BaseRestServiceWithExcel<ThreadEntity, ThreadRequest, ThreadResponse, ThreadExcel> {
|
||||
extends BaseRestServiceWithExport<ThreadEntity, ThreadRequest, ThreadResponse, ThreadExcel> {
|
||||
|
||||
private final AuthService authService;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/api/v1/topic")
|
||||
@Tag(name = "主题管理", description = "主题管理相关接口,包括查询、创建、更新、删除等操作")
|
||||
public class TopicRestController extends BaseRestController<TopicRequest> {
|
||||
public class TopicRestController extends BaseRestController<TopicRequest, TopicRestService> {
|
||||
|
||||
private final TopicRestService topicRestService;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
@RequestMapping("/api/v1/upload")
|
||||
@Tag(name = "Upload Management", description = "File upload management APIs")
|
||||
@Description("File Upload Controller - File upload and management APIs for handling file operations")
|
||||
public class UploadRestController extends BaseRestController<UploadRequest> {
|
||||
public class UploadRestController extends BaseRestController<UploadRequest, UploadRestService> {
|
||||
|
||||
private final UploadRestService uploadRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-03-05 16:38:13
|
||||
* @LastEditTime: 2025-08-20 17:24:17
|
||||
* @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.
|
||||
@@ -30,15 +30,15 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/url")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "URL Management", description = "URL management APIs for managing system URLs")
|
||||
public class UrlRestController extends BaseRestController<UrlRequest> {
|
||||
public class UrlRestController extends BaseRestController<UrlRequest, UrlRestService> {
|
||||
|
||||
private final UrlRestService urlService;
|
||||
private final UrlRestService urlRestService;
|
||||
|
||||
@Operation(summary = "Query URLs by Organization", description = "Retrieve URLs for the current organization")
|
||||
@Override
|
||||
public ResponseEntity<?> queryByOrg(UrlRequest request) {
|
||||
|
||||
Page<UrlResponse> urls = urlService.queryByOrg(request);
|
||||
Page<UrlResponse> urls = urlRestService.queryByOrg(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(urls));
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class UrlRestController extends BaseRestController<UrlRequest> {
|
||||
@Override
|
||||
public ResponseEntity<?> queryByUser(UrlRequest request) {
|
||||
|
||||
Page<UrlResponse> urls = urlService.queryByUser(request);
|
||||
Page<UrlResponse> urls = urlRestService.queryByUser(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(urls));
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class UrlRestController extends BaseRestController<UrlRequest> {
|
||||
@Override
|
||||
public ResponseEntity<?> create(UrlRequest request) {
|
||||
|
||||
UrlResponse url = urlService.create(request);
|
||||
UrlResponse url = urlRestService.create(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(url));
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class UrlRestController extends BaseRestController<UrlRequest> {
|
||||
@Override
|
||||
public ResponseEntity<?> update(UrlRequest request) {
|
||||
|
||||
UrlResponse url = urlService.update(request);
|
||||
UrlResponse url = urlRestService.update(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success(url));
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class UrlRestController extends BaseRestController<UrlRequest> {
|
||||
@Override
|
||||
public ResponseEntity<?> delete(UrlRequest request) {
|
||||
|
||||
urlService.delete(request);
|
||||
urlRestService.delete(request);
|
||||
|
||||
return ResponseEntity.ok(JsonResult.success());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/workflow")
|
||||
@AllArgsConstructor
|
||||
public class WorkflowRestController extends BaseRestController<WorkflowRequest> {
|
||||
public class WorkflowRestController extends BaseRestController<WorkflowRequest, WorkflowRestService> {
|
||||
|
||||
private final WorkflowRestService workflowRestService;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-05-11 18:25:36
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2025-06-20 12:39:37
|
||||
* @LastEditTime: 2025-08-20 17:24:41
|
||||
* @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.
|
||||
@@ -30,7 +30,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/workflow/result")
|
||||
@AllArgsConstructor
|
||||
public class WorkflowResultRestController extends BaseRestController<WorkflowResultRequest> {
|
||||
public class WorkflowResultRestController extends BaseRestController<WorkflowResultRequest, WorkflowResultRestService> {
|
||||
|
||||
private final WorkflowResultRestService workflowResultRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.auth.AuthService;
|
||||
@@ -36,7 +36,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class WorkflowResultRestService extends BaseRestServiceWithExcel<WorkflowResultEntity, WorkflowResultRequest, WorkflowResultResponse, WorkflowResultExcel> {
|
||||
public class WorkflowResultRestService extends BaseRestServiceWithExport<WorkflowResultEntity, WorkflowResultRequest, WorkflowResultResponse, WorkflowResultExcel> {
|
||||
|
||||
private final WorkflowResultRepository workflowResultRepository;
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ import com.bytedesk.core.message.MessageTypeEnum;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EntityListeners;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import jakarta.persistence.PostLoad;
|
||||
@@ -34,7 +34,7 @@ import jakarta.persistence.PrePersist;
|
||||
@SuperBuilder
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EntityListeners({ ArticleEntityListener.class })
|
||||
@Table(name = "bytedesk_kbase_article")
|
||||
public class ArticleEntity extends AbstractArticleEntity {
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.context.annotation.Description;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/article")
|
||||
@Description("Article Management Controller - Knowledge base article content management APIs")
|
||||
public class ArticleRestController extends BaseRestController<ArticleRequest> {
|
||||
public class ArticleRestController extends BaseRestController<ArticleRequest, ArticleRestService> {
|
||||
|
||||
private final ArticleRestService articleRestService;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.constant.I18Consts;
|
||||
import com.bytedesk.core.exception.NotLoginException;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
@@ -41,7 +41,7 @@ import lombok.AllArgsConstructor;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class ArticleRestService extends BaseRestServiceWithExcel<ArticleEntity, ArticleRequest, ArticleResponse, ArticleExcel> {
|
||||
public class ArticleRestService extends BaseRestServiceWithExport<ArticleEntity, ArticleRequest, ArticleResponse, ArticleExcel> {
|
||||
|
||||
private final ArticleRepository articleRepository;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/article_archive")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "文章归档管理", description = "文章归档管理相关接口")
|
||||
public class ArticleArchiveRestController extends BaseRestController<ArticleArchiveRequest> {
|
||||
public class ArticleArchiveRestController extends BaseRestController<ArticleArchiveRequest, ArticleArchiveRestService> {
|
||||
|
||||
private final ArticleArchiveRestService article_archiveService;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/autoreply/fixed")
|
||||
@AllArgsConstructor
|
||||
public class AutoReplyFixedRestController extends BaseRestController<AutoReplyFixedRequest> {
|
||||
public class AutoReplyFixedRestController extends BaseRestController<AutoReplyFixedRequest, AutoReplyFixedRestService> {
|
||||
|
||||
private final AutoReplyFixedRestService autoReplyService;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.category.CategoryEntity;
|
||||
import com.bytedesk.core.category.CategoryTypeEnum;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
@@ -45,7 +45,7 @@ import com.bytedesk.core.utils.Utils;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AutoReplyFixedRestService extends BaseRestServiceWithExcel<AutoReplyFixedEntity, AutoReplyFixedRequest, AutoReplyFixedResponse, AutoReplyFixedExcel> {
|
||||
public class AutoReplyFixedRestService extends BaseRestServiceWithExport<AutoReplyFixedEntity, AutoReplyFixedRequest, AutoReplyFixedResponse, AutoReplyFixedExcel> {
|
||||
|
||||
private final AutoReplyFixedRepository autoReplyFixedRepository;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/autoreply/keyword")
|
||||
@AllArgsConstructor
|
||||
public class AutoReplyKeywordRestController extends BaseRestController<AutoReplyKeywordRequest> {
|
||||
public class AutoReplyKeywordRestController extends BaseRestController<AutoReplyKeywordRequest, AutoReplyKeywordRestService> {
|
||||
|
||||
private final AutoReplyKeywordRestService keywordRestService;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.category.CategoryEntity;
|
||||
import com.bytedesk.core.category.CategoryTypeEnum;
|
||||
import com.bytedesk.core.constant.BytedeskConsts;
|
||||
@@ -46,7 +46,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AutoReplyKeywordRestService extends BaseRestServiceWithExcel<AutoReplyKeywordEntity, AutoReplyKeywordRequest, AutoReplyKeywordResponse, AutoReplyKeywordExcel> {
|
||||
public class AutoReplyKeywordRestService extends BaseRestServiceWithExport<AutoReplyKeywordEntity, AutoReplyKeywordRequest, AutoReplyKeywordResponse, AutoReplyKeywordExcel> {
|
||||
|
||||
private final AutoReplyKeywordRepository autoReplyKeywordRepository;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/comment")
|
||||
@AllArgsConstructor
|
||||
public class CommentRestController extends BaseRestController<CommentRequest> {
|
||||
public class CommentRestController extends BaseRestController<CommentRequest, CommentRestService> {
|
||||
|
||||
private final CommentRestService commentService;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@Tag(name = "常见问题管理", description = "常见问题管理相关接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/faq")
|
||||
public class FaqRestController extends BaseRestController<FaqRequest> {
|
||||
public class FaqRestController extends BaseRestController<FaqRequest, FaqRestService> {
|
||||
|
||||
private final FaqRestService faqRestService;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.category.CategoryEntity;
|
||||
import com.bytedesk.core.category.CategoryRequest;
|
||||
import com.bytedesk.core.category.CategoryResponse;
|
||||
@@ -63,7 +63,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class FaqRestService extends BaseRestServiceWithExcel<FaqEntity, FaqRequest, FaqResponse, FaqExcel> {
|
||||
public class FaqRestService extends BaseRestServiceWithExport<FaqEntity, FaqRequest, FaqResponse, FaqExcel> {
|
||||
|
||||
private final FaqRepository faqRepository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/llm/file")
|
||||
@AllArgsConstructor
|
||||
public class FileRestController extends BaseRestController<FileRequest> {
|
||||
public class FileRestController extends BaseRestController<FileRequest, FileRestService> {
|
||||
|
||||
private final FileRestService fileRestService;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import com.bytedesk.core.upload.UploadEntity;
|
||||
import com.bytedesk.core.upload.UploadRestService;
|
||||
@@ -42,7 +42,7 @@ import lombok.AllArgsConstructor;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class FileRestService extends BaseRestServiceWithExcel<FileEntity, FileRequest, FileResponse, FileExcel> {
|
||||
public class FileRestService extends BaseRestServiceWithExport<FileEntity, FileRequest, FileResponse, FileExcel> {
|
||||
|
||||
private final FileRepository fileRepository;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.springframework.context.annotation.Description;
|
||||
@RequestMapping("/api/v1/kbase")
|
||||
@AllArgsConstructor
|
||||
@Description("Knowledge Base Controller - Knowledge base content management and organization APIs")
|
||||
public class KbaseRestController extends BaseRestController<KbaseRequest> {
|
||||
public class KbaseRestController extends BaseRestController<KbaseRequest, KbaseRestService> {
|
||||
|
||||
private final KbaseRestService knowledgeService;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/kbase/invite")
|
||||
@AllArgsConstructor
|
||||
public class KbaseInviteRestController extends BaseRestController<KbaseInviteRequest> {
|
||||
public class KbaseInviteRestController extends BaseRestController<KbaseInviteRequest, KbaseInviteRestService> {
|
||||
|
||||
private final KbaseInviteRestService tagService;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/llm/chunk")
|
||||
public class ChunkRestController extends BaseRestController<ChunkRequest> {
|
||||
public class ChunkRestController extends BaseRestController<ChunkRequest, ChunkRestService> {
|
||||
|
||||
private final ChunkRestService chunkRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.rbac.user.UserEntity;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import com.bytedesk.kbase.file.FileEntity;
|
||||
@@ -41,7 +41,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ChunkRestService extends BaseRestServiceWithExcel<ChunkEntity, ChunkRequest, ChunkResponse, ChunkExcel> {
|
||||
public class ChunkRestService extends BaseRestServiceWithExport<ChunkEntity, ChunkRequest, ChunkResponse, ChunkExcel> {
|
||||
|
||||
private final ChunkRepository chunkRepository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.context.annotation.Description;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/llm/text")
|
||||
@Description("Text Management Controller - LLM text content management and vector processing APIs")
|
||||
public class TextRestController extends BaseRestController<TextRequest> {
|
||||
public class TextRestController extends BaseRestController<TextRequest, TextRestService> {
|
||||
|
||||
private final TextRestService textRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.category.CategoryEntity;
|
||||
import com.bytedesk.core.category.CategoryRequest;
|
||||
import com.bytedesk.core.category.CategoryResponse;
|
||||
@@ -43,7 +43,7 @@ import lombok.AllArgsConstructor;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class TextRestService extends BaseRestServiceWithExcel<TextEntity, TextRequest, TextResponse, TextExcel> {
|
||||
public class TextRestService extends BaseRestServiceWithExport<TextEntity, TextRequest, TextResponse, TextExcel> {
|
||||
|
||||
private final TextRepository textRepository;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import lombok.AllArgsConstructor;
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/llm/webpage")
|
||||
@AllArgsConstructor
|
||||
public class WebpageRestController extends BaseRestController<WebpageRequest> {
|
||||
public class WebpageRestController extends BaseRestController<WebpageRequest, WebpageRestService> {
|
||||
|
||||
private final WebpageRestService webpageRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import com.bytedesk.kbase.kbase.KbaseEntity;
|
||||
import com.bytedesk.kbase.kbase.KbaseRestService;
|
||||
@@ -34,7 +34,7 @@ import lombok.AllArgsConstructor;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class WebpageRestService
|
||||
extends BaseRestServiceWithExcel<WebpageEntity, WebpageRequest, WebpageResponse, WebpageExcel> {
|
||||
extends BaseRestServiceWithExport<WebpageEntity, WebpageRequest, WebpageResponse, WebpageExcel> {
|
||||
|
||||
private final WebpageRepository webpageRepository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import lombok.AllArgsConstructor;
|
||||
@RequestMapping("/api/v1/llm/website")
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "网站管理", description = "网站管理相关接口")
|
||||
public class WebsiteRestController extends BaseRestController<WebsiteRequest> {
|
||||
public class WebsiteRestController extends BaseRestController<WebsiteRequest, WebsiteRestService> {
|
||||
|
||||
private final WebsiteRestService websiteRestService;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.orm.ObjectOptimisticLockingFailureException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExcel;
|
||||
import com.bytedesk.core.base.BaseRestServiceWithExport;
|
||||
import com.bytedesk.core.uid.UidUtils;
|
||||
import com.bytedesk.kbase.kbase.KbaseEntity;
|
||||
import com.bytedesk.kbase.kbase.KbaseRestService;
|
||||
@@ -34,7 +34,7 @@ import lombok.AllArgsConstructor;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class WebsiteRestService
|
||||
extends BaseRestServiceWithExcel<WebsiteEntity, WebsiteRequest, WebsiteResponse, WebsiteExcel> {
|
||||
extends BaseRestServiceWithExport<WebsiteEntity, WebsiteRequest, WebsiteResponse, WebsiteExcel> {
|
||||
|
||||
private final WebsiteRepository websiteRepository;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user