From 4b65eb57b12dbef2f7034bdb535cd902041a4fdd Mon Sep 17 00:00:00 2001
From: cat-shark <1716967236@qq.com>
Date: Fri, 20 Nov 2026 09:36:59 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=9B=9E=E5=BF=86=E6=94=B9?=
=?UTF-8?q?=E7=94=A8=E7=8B=AC=E7=AB=8B=E5=AD=98=E5=82=A8=E4=B8=8E=E8=AF=B7?=
=?UTF-8?q?=E6=B1=82=E5=93=8D=E5=BA=94=20DTO=EF=BC=8C=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E6=8C=89=E5=9F=9F=E6=8B=86=E5=8C=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../LearningProgressTrackerApplication.java | 5 +-
.../common/GlobalExceptionHandler.java | 24 +-
.../learningprogresstracker/common/Ops.java | 6 +-
.../common/StudyTimePolicy.java | 4 +-
.../common/TenantContext.java | 6 +-
.../config/AiUsageProperties.java | 7 +-
.../config/AutoTableField.java | 6 +-
.../config/CorsProperties.java | 1 -
.../config/JacksonConfig.java | 3 +-
.../config/MybatisPlusConfig.java | 20 +-
.../config/WebMvcConfig.java | 6 +-
.../serializer/LocalDateTimeSerializer.java | 5 +-
.../controller/AiTaskController.java | 11 +-
.../controller/AiUsageController.java | 3 +-
.../controller/AiUsageInternalController.java | 6 +-
.../controller/ExportController.java | 12 +-
.../controller/GuidanceController.java | 55 +-
.../controller/LoginController.java | 7 +-
.../controller/MarkerController.java | 94 +--
...er.java => ReportFragmentsController.java} | 46 +-
.../controller/ReviewController.java | 91 ++-
.../controller/ReviewRecallController.java | 90 +++
.../controller/StudySessionController.java | 83 ++-
.../controller/TagMindMapController.java | 33 +-
.../controller/TaskController.java | 70 +-
.../controller/UtilsController.java | 3 +-
.../dto/AiTaskResponse.java | 30 +-
.../dto/AiUsageBreakdownItem.java | 3 +-
.../dto/AiUsageBreakdownRow.java | 3 +-
.../dto/AiUsageSeriesPoint.java | 3 +-
.../dto/AiUsageSeriesRow.java | 3 +-
.../dto/AiUsageSummary.java | 3 +-
.../dto/AiUsageSummaryRow.java | 3 +-
.../dto/ExportDocument.java | 3 +-
.../dto/ExportEntry.java | 10 +-
.../dto/ExportTaskSection.java | 3 +-
.../dto/LoginResult.java | 3 +
.../dto/MindMapFragmentPayload.java | 3 +-
.../dto/MindMapReportContext.java | 14 +-
.../dto/RecallCompareOutcome.java | 30 -
.../dto/ReviewFeedItem.java | 3 +-
.../dto/ReviewSummary.java | 10 +-
.../dto/ReviewTiming.java | 3 +-
.../dto/StudyReportDetail.java | 3 +-
.../dto/StudySessionsDto.java | 3 +-
.../dto/TagMindMapSummary.java | 3 +-
.../dto/TagMindMapView.java | 7 +-
.../learningprogresstracker/dto/TagScope.java | 1 -
.../dto/TaskDeletionSummary.java | 3 -
.../dto/TaskOption.java | 7 +-
.../dto/TaskRecallRatio.java | 19 -
.../dto/TaskReviewDuration.java | 16 -
.../dto/recall/RecallDtos.java | 197 ++++++
.../dto/recall/TaskRecallDuration.java | 9 +
.../dto/request/AddUserTagRequest.java | 18 +
.../dto/request/AiTaskSubmitRequest.java | 3 +-
.../dto/request/AiUsageRecordRequest.java | 3 +-
.../dto/request/AiUsageReportRequest.java | 3 +-
.../dto/request/AssignOwnershipRequest.java | 10 +
.../ConfirmGuidanceFragmentRequest.java | 13 +
.../request/CreateDictionaryTagRequest.java | 12 +
.../dto/request/FindNodeRequest.java | 10 +
.../dto/request/GuidanceStartRequest.java | 15 +
.../dto/request/GuidanceTurnRequest.java | 12 +
.../dto/request/PriorityWeightsRequest.java | 25 +
.../dto/request/RecallCompareRequest.java | 31 -
.../request/RenameDictionaryTagRequest.java | 12 +
.../dto/request/RenameUserTagRequest.java | 15 +
.../dto/request/SortPreferenceRequest.java | 10 +
.../dto/request/TagScopeRequest.java | 3 +-
.../dto/request/TaskRequest.java | 28 +-
.../dto/request/UpdateTagMindMapRequest.java | 3 +-
.../GuidanceConversationResponse.java | 41 ++
.../dto/response/MarkerResponse.java | 35 +
.../dto/response/PriorityWeightsResponse.java | 35 +
.../dto/response/ReportFragmentResponse.java | 39 ++
.../dto/response/StandardMindMapResponse.java | 49 ++
.../response/StudyExpectationResponse.java | 29 +
.../dto/response/StudyReportResponse.java | 35 +
.../dto/response/StudySessionResponse.java | 8 +-
.../dto/response/TagMindMapResponse.java | 51 ++
.../dto/response/TaskApplicationResponse.java | 35 +
.../dto/response/TaskInfoResponse.java | 2 +-
.../dto/response/TasksListInfoResponse.java | 5 +-
.../dto/response/UserTagResponse.java | 29 +
.../entity/AiTaskEntity.java | 6 +-
.../entity/AiUsageRecordEntity.java | 5 +-
.../entity/BaseEntity.java | 3 +-
.../entity/MarkerEntity.java | 7 +-
.../ReviewGuidanceConversationEntity.java | 3 +-
.../entity/ReviewRecallEntity.java | 21 +
.../entity/ReviewRecallReceiptEntity.java | 18 +
.../entity/ReviewRecallRecordEntity.java | 86 ---
.../entity/ReviewRecallRequestEntity.java | 19 +
.../entity/ReviewStandardMindMapEntity.java | 3 +-
.../entity/ReviewTagMindMapEntity.java | 3 +-
.../entity/StudyExpectationsEntity.java | 3 +-
.../entity/StudyReportFragmentsEntity.java | 3 +-
.../entity/StudyReportsEntity.java | 3 +-
.../entity/StudySessionsEntity.java | 59 +-
.../entity/TaskApplicationEntity.java | 3 +-
.../entity/TaskEntity.java | 8 +-
.../entity/UserEntity.java | 8 +-
.../entity/UserPriorityWeightsEntity.java | 3 +-
.../entity/UserReviewPreferencesEntity.java | 3 +-
.../entity/UserTagEntity.java | 3 +-
.../enums/AiTaskStatusEnum.java | 5 +-
.../enums/AiTaskTypeEnum.java | 7 +-
.../enums/MarkerKindEnum.java | 1 -
.../enums/MarkerObjectTypeEnum.java | 1 -
.../enums/MindMapGenerateModeEnum.java | 3 +-
.../enums/ReviewScopeTypeEnum.java | 23 -
.../enums/ReviewSortPresetEnum.java | 3 +-
.../enums/StudySessionStateEnum.java | 1 -
.../enums/TagCombineModeEnum.java | 3 +-
.../enums/TaskApplicationStatusEnum.java | 3 +-
.../exception/AppException.java | 4 +-
.../exception/ErrorParameterException.java | 2 +-
.../exception/NotFindEntitiesException.java | 2 +-
.../exception/OperationFailedException.java | 7 +-
.../exception/RecallBusinessException.java | 14 +
.../mapper/AiTaskMapper.java | 81 +--
.../mapper/AiUsageRecordMapper.java | 53 +-
.../mapper/MarkerMapper.java | 94 ++-
.../ReviewGuidanceConversationMapper.java | 3 +-
.../mapper/ReviewRecallMapper.java | 29 +
.../mapper/ReviewRecallReceiptMapper.java | 8 +
.../mapper/ReviewRecallRecordMapper.java | 34 -
.../mapper/ReviewRecallRequestMapper.java | 8 +
.../mapper/ReviewStandardMindMapMapper.java | 3 +-
.../mapper/ReviewTagMindMapMapper.java | 3 +-
.../mapper/StudyExpectationsMapper.java | 3 +-
.../mapper/StudyReportFragmentsMapper.java | 21 +-
.../mapper/StudyReportsMapper.java | 25 +-
.../mapper/StudySessionsMapper.java | 72 +-
.../mapper/TaskApplicationMapper.java | 3 +-
.../mapper/TasksMapper.java | 16 +-
.../mapper/UserMapper.java | 20 +-
.../mapper/UserPriorityWeightsMapper.java | 3 +-
.../mapper/UserReviewPreferencesMapper.java | 3 +-
.../FragmentsConvert.java | 4 +-
.../mapstruct/RecallConvert.java | 11 +
.../RequestConvert.java | 2 +-
.../StudySessionConvert.java | 5 +-
.../{mapStruct => mapstruct}/TaskConvert.java | 5 +-
.../service/AiTaskService.java | 1 -
.../service/AiUsageService.java | 1 -
.../service/ExportService.java | 1 -
.../service/MarkerService.java | 10 +-
.../service/MindMapAiClient.java | 12 +-
.../service/ReviewService.java | 3 +-
.../service/ReviewTagMindMapService.java | 70 +-
.../service/StandardMindMapService.java | 71 +-
.../service/StudyReportFragmentsService.java | 11 +-
.../service/StudyReportsService.java | 14 +-
.../service/StudySessionsService.java | 14 +-
.../service/TasksService.java | 12 +-
.../service/UserService.java | 11 +-
.../service/{impl => ai}/AiServiceClient.java | 74 +--
.../{impl => ai}/AiTaskFailedException.java | 2 +-
.../service/{impl => ai}/AiTaskHandler.java | 3 +-
.../{impl => ai}/AiTaskHandlerRegistry.java | 22 +-
.../service/{impl => ai}/AiTaskParams.java | 8 +-
.../service/{impl => ai}/AiTaskRunner.java | 51 +-
.../service/{impl => ai}/AiUsageClient.java | 18 +-
.../service/ai/BuiltinMindMapGenerator.java | 193 ++++++
.../{impl => ai}/GuidanceAiTaskHandler.java | 14 +-
.../{impl => ai}/MindMapAiTaskHandler.java | 11 +-
.../{impl => ai}/MindMapOutlineGenerator.java | 25 +-
.../MindMapReportContextLoader.java | 28 +-
.../service/ai/RecallAiClient.java | 281 ++++++++
.../service/ai/RecallAiFailure.java | 64 ++
.../service/ai/RecallAiResultValidator.java | 143 ++++
.../service/ai/RecallAiService.java | 344 ++++++++++
.../service/ai/RecallCheckAiTaskHandler.java | 39 ++
.../service/ai/RecallHintAiTaskHandler.java | 39 ++
.../service/ai/RecallJson.java | 86 +++
.../{impl => ai}/RemoteAiMindMapClient.java | 38 +-
.../ReportDraftAiTaskHandler.java | 9 +-
.../{impl => ai}/TagMindMapAiTaskHandler.java | 14 +-
.../service/event/AiTaskSubmittedEvent.java | 3 +-
.../service/impl/AiTaskServiceImpl.java | 66 +-
.../service/impl/AiUsageServiceImpl.java | 42 +-
.../service/impl/BuiltinMindMapGenerator.java | 164 -----
.../service/impl/ExportServiceImpl.java | 181 +++--
.../service/impl/GuidanceServiceImpl.java | 74 +--
.../service/impl/LoginServiceImpl.java | 2 +-
.../service/impl/MarkerServiceImpl.java | 211 ++----
.../impl/PriorityWeightsServiceImpl.java | 16 +-
.../impl/RecallCompareAiTaskHandler.java | 57 --
.../service/impl/ReviewServiceImpl.java | 616 +++---------------
.../impl/ReviewTagMindMapServiceImpl.java | 158 +----
.../impl/StandardMindMapServiceImpl.java | 449 ++-----------
.../impl/StudyExpectationsServiceImpl.java | 16 +-
.../impl/StudyReportFragmentsServiceImpl.java | 86 +--
.../service/impl/StudyReportsServiceImpl.java | 18 +-
.../impl/StudySessionsServiceImpl.java | 236 +++----
.../impl/TagRecallCompareAiTaskHandler.java | 69 --
.../service/impl/TasksServiceImpl.java | 60 +-
.../service/impl/UserServiceImpl.java | 32 +-
.../recall/RecallExpressionValidator.java | 170 +++++
.../service/recall/RecallPrivacyService.java | 134 ++++
.../service/recall/RecallReferenceLoader.java | 296 +++++++++
.../service/recall/ReviewRecallService.java | 374 +++++++++++
.../service/recall/ReviewRecallStore.java | 371 +++++++++++
.../service/review/ReviewFeedService.java | 373 +++++++++++
.../service/review/ReviewStatsService.java | 172 +++++
.../service/review/TagDictionaryService.java | 182 ++++++
.../session/StudyReportDraftService.java | 63 ++
.../StudySessionConvergenceScheduler.java | 2 +-
.../StudySessionConvergenceService.java | 81 +++
.../TaskDeletionService.java | 100 +--
.../utils/CalculatedPriorityTool.java | 12 +-
.../utils/CompareResult.java | 47 --
.../utils/ExportMarkdownRenderer.java | 26 +-
.../utils/GenerateNumTool.java | 5 +-
.../utils/MindMapMatchTool.java | 200 ++++++
.../utils/MindMapNode.java | 17 +-
.../utils/MindMapTreeTool.java | 203 +-----
.../utils/ReviewDurationTool.java | 11 +-
.../utils/TagScopeTool.java | 11 +-
.../utils/TitleFetcher.java | 131 ++--
...20261115_2__backfill_recall_scope_key.java | 68 ++
...61115_3__validate_marker_value_length.java | 17 +
...61115_5__backfill_fragment_owner_tags.java | 90 +++
.../V20261118_2__strip_recall_exposures.java | 82 +++
src/main/resources/application.yml | 2 +
.../V20261114_1__add_free_recall_drafts.sql | 61 ++
.../V20261115_1__add_recall_scope_key.sql | 2 +
.../V20261115_4__expand_user_tag_names.sql | 15 +
.../V20261116_1__replace_recall_storage.sql | 64 ++
...1118_1__clear_incompatible_recall_data.sql | 6 +
.../mapper/ReviewRecallRecordMapper.xml | 60 --
.../common/GlobalExceptionHandlerTest.java | 10 +-
.../controller/LoginControllerTest.java | 1 +
.../controller/LoginControllerUnitTest.java | 2 +
.../ReportFragmentsControllerUnitTest.java | 10 +-
.../controller/ReviewControllerUnitTest.java | 51 +-
...ReviewExportControllerIntegrationTest.java | 179 +++++
...ReviewRecallControllerIntegrationTest.java | 143 ++++
.../StudySessionControllerUnitTest.java | 22 +-
.../TagMindMapControllerUnitTest.java | 19 +-
.../controller/TaskControllerTest.java | 20 +-
.../controller/TaskControllerUnitTest.java | 29 +-
.../FragmentsConvertTest.java | 2 +-
.../StudySessionConvertTest.java | 2 +-
.../FragmentOwnerTagMigrationTest.java | 126 ++++
.../MigrationIndexKeyLengthTest.java | 29 +-
.../RecallExposuresMigrationTest.java | 57 ++
.../RecallScopeKeyMigrationTest.java | 79 +++
.../migration/RecallStorageMigrationTest.java | 54 ++
.../AiServiceClientAttributionTest.java | 3 +-
.../{impl => ai}/AiServiceClientTest.java | 33 +-
.../service/ai/AiTaskRunnerTest.java | 55 ++
.../{impl => ai}/AiUsageClientTest.java | 2 +-
.../BuiltinMindMapGeneratorTest.java | 2 +-
.../MindMapOutlineGeneratorTest.java | 2 +-
.../MindMapReportContextLoaderTest.java | 2 +-
.../service/ai/RecallAiClientTest.java | 132 ++++
.../ai/RecallAiResultValidatorTest.java | 182 ++++++
.../RemoteAiMindMapClientTest.java | 2 +-
.../service/impl/AiTaskIntegrationTest.java | 32 +-
.../service/impl/AiTaskServiceImplTest.java | 14 +-
.../service/impl/AiUsageServiceUnitTest.java | 1 +
.../service/impl/ExportServiceImplTest.java | 34 +-
.../impl/FragmentOwnerTagIntegrationTest.java | 126 ++++
.../service/impl/GuidanceIntegrationTest.java | 2 +
.../service/impl/HistoricalRecallFixture.java | 29 +
.../impl/RecallRatioQueryIntegrationTest.java | 125 ----
.../impl/ReviewDurationIntegrationTest.java | 107 ---
.../impl/ReviewFeedbackIntegrationTest.java | 2 +-
.../service/impl/ReviewServiceImplTest.java | 168 +++--
.../impl/StandardMindMapServiceImplTest.java | 203 +-----
.../StudyReportFragmentsServiceImplTest.java | 7 +-
.../impl/StudySessionsServiceImplTest.java | 162 ++++-
.../impl/TagMindMapIntegrationTest.java | 116 +---
.../recall/RecallReferenceLoaderTest.java | 86 +++
.../ReviewRecallServiceIntegrationTest.java | 249 +++++++
.../support/TestHttpServer.java | 1 +
.../utils/MindMapTreeToolTest.java | 111 ++--
280 files changed, 8774 insertions(+), 4364 deletions(-)
rename src/main/java/com/guo/learningprogresstracker/controller/{reportFragmentsController.java => ReportFragmentsController.java} (58%)
create mode 100644 src/main/java/com/guo/learningprogresstracker/controller/ReviewRecallController.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/dto/RecallCompareOutcome.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/dto/TaskRecallRatio.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/dto/TaskReviewDuration.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/recall/RecallDtos.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/recall/TaskRecallDuration.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/AddUserTagRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/AssignOwnershipRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/ConfirmGuidanceFragmentRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/CreateDictionaryTagRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/FindNodeRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/GuidanceStartRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/GuidanceTurnRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/PriorityWeightsRequest.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/RecallCompareRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/RenameDictionaryTagRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/RenameUserTagRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/request/SortPreferenceRequest.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/GuidanceConversationResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/MarkerResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/PriorityWeightsResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/ReportFragmentResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/StandardMindMapResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/StudyExpectationResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/StudyReportResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/TagMindMapResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/TaskApplicationResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/dto/response/UserTagResponse.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/entity/ReviewRecallEntity.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/entity/ReviewRecallReceiptEntity.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/entity/ReviewRecallRecordEntity.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/entity/ReviewRecallRequestEntity.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/enums/ReviewScopeTypeEnum.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/exception/RecallBusinessException.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/mapper/ReviewRecallMapper.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/mapper/ReviewRecallReceiptMapper.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/mapper/ReviewRecallRecordMapper.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/mapper/ReviewRecallRequestMapper.java
rename src/main/java/com/guo/learningprogresstracker/{mapStruct => mapstruct}/FragmentsConvert.java (82%)
create mode 100644 src/main/java/com/guo/learningprogresstracker/mapstruct/RecallConvert.java
rename src/main/java/com/guo/learningprogresstracker/{mapStruct => mapstruct}/RequestConvert.java (90%)
rename src/main/java/com/guo/learningprogresstracker/{mapStruct => mapstruct}/StudySessionConvert.java (81%)
rename src/main/java/com/guo/learningprogresstracker/{mapStruct => mapstruct}/TaskConvert.java (88%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiServiceClient.java (90%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiTaskFailedException.java (87%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiTaskHandler.java (94%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiTaskHandlerRegistry.java (79%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiTaskParams.java (96%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiTaskRunner.java (71%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/AiUsageClient.java (95%)
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/BuiltinMindMapGenerator.java
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/GuidanceAiTaskHandler.java (97%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/MindMapAiTaskHandler.java (93%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/MindMapOutlineGenerator.java (87%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/MindMapReportContextLoader.java (89%)
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallAiClient.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallAiFailure.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallAiResultValidator.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallAiService.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallCheckAiTaskHandler.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallHintAiTaskHandler.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/ai/RecallJson.java
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/RemoteAiMindMapClient.java (78%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/ReportDraftAiTaskHandler.java (97%)
rename src/main/java/com/guo/learningprogresstracker/service/{impl => ai}/TagMindMapAiTaskHandler.java (93%)
delete mode 100644 src/main/java/com/guo/learningprogresstracker/service/impl/BuiltinMindMapGenerator.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/service/impl/RecallCompareAiTaskHandler.java
delete mode 100644 src/main/java/com/guo/learningprogresstracker/service/impl/TagRecallCompareAiTaskHandler.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/recall/RecallExpressionValidator.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/recall/RecallPrivacyService.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/recall/RecallReferenceLoader.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/recall/ReviewRecallService.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/recall/ReviewRecallStore.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/review/ReviewFeedService.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/review/ReviewStatsService.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/review/TagDictionaryService.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/session/StudyReportDraftService.java
rename src/main/java/com/guo/learningprogresstracker/service/{impl => session}/StudySessionConvergenceScheduler.java (96%)
create mode 100644 src/main/java/com/guo/learningprogresstracker/service/session/StudySessionConvergenceService.java
rename src/main/java/com/guo/learningprogresstracker/service/{impl => session}/TaskDeletionService.java (54%)
delete mode 100644 src/main/java/com/guo/learningprogresstracker/utils/CompareResult.java
create mode 100644 src/main/java/com/guo/learningprogresstracker/utils/MindMapMatchTool.java
create mode 100644 src/main/java/db/migration/V20261115_2__backfill_recall_scope_key.java
create mode 100644 src/main/java/db/migration/V20261115_3__validate_marker_value_length.java
create mode 100644 src/main/java/db/migration/V20261115_5__backfill_fragment_owner_tags.java
create mode 100644 src/main/java/db/migration/V20261118_2__strip_recall_exposures.java
create mode 100644 src/main/resources/db/migration/V20261114_1__add_free_recall_drafts.sql
create mode 100644 src/main/resources/db/migration/V20261115_1__add_recall_scope_key.sql
create mode 100644 src/main/resources/db/migration/V20261115_4__expand_user_tag_names.sql
create mode 100644 src/main/resources/db/migration/V20261116_1__replace_recall_storage.sql
create mode 100644 src/main/resources/db/migration/V20261118_1__clear_incompatible_recall_data.sql
delete mode 100644 src/main/resources/mapper/ReviewRecallRecordMapper.xml
create mode 100644 src/test/java/com/guo/learningprogresstracker/controller/ReviewExportControllerIntegrationTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/controller/ReviewRecallControllerIntegrationTest.java
rename src/test/java/com/guo/learningprogresstracker/{mapStruct => mapstruct}/FragmentsConvertTest.java (95%)
rename src/test/java/com/guo/learningprogresstracker/{mapStruct => mapstruct}/StudySessionConvertTest.java (95%)
create mode 100644 src/test/java/com/guo/learningprogresstracker/migration/FragmentOwnerTagMigrationTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/migration/RecallExposuresMigrationTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/migration/RecallScopeKeyMigrationTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/migration/RecallStorageMigrationTest.java
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/AiServiceClientAttributionTest.java (97%)
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/AiServiceClientTest.java (87%)
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/ai/AiTaskRunnerTest.java
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/AiUsageClientTest.java (98%)
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/BuiltinMindMapGeneratorTest.java (99%)
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/MindMapOutlineGeneratorTest.java (98%)
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/MindMapReportContextLoaderTest.java (98%)
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/ai/RecallAiClientTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/ai/RecallAiResultValidatorTest.java
rename src/test/java/com/guo/learningprogresstracker/service/{impl => ai}/RemoteAiMindMapClientTest.java (99%)
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/impl/FragmentOwnerTagIntegrationTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/impl/HistoricalRecallFixture.java
delete mode 100644 src/test/java/com/guo/learningprogresstracker/service/impl/RecallRatioQueryIntegrationTest.java
delete mode 100644 src/test/java/com/guo/learningprogresstracker/service/impl/ReviewDurationIntegrationTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/recall/RecallReferenceLoaderTest.java
create mode 100644 src/test/java/com/guo/learningprogresstracker/service/recall/ReviewRecallServiceIntegrationTest.java
diff --git a/src/main/java/com/guo/learningprogresstracker/LearningProgressTrackerApplication.java b/src/main/java/com/guo/learningprogresstracker/LearningProgressTrackerApplication.java
index b98d49b..cfba5d2 100644
--- a/src/main/java/com/guo/learningprogresstracker/LearningProgressTrackerApplication.java
+++ b/src/main/java/com/guo/learningprogresstracker/LearningProgressTrackerApplication.java
@@ -1,6 +1,7 @@
package com.guo.learningprogresstracker;
import cn.dev33.satoken.SaManager;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -8,12 +9,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author guo
* 应用程序启动类
*/
+@Slf4j
@SpringBootApplication
public class LearningProgressTrackerApplication {
public static void main(String[] args) {
SpringApplication.run(LearningProgressTrackerApplication.class, args);
- System.out.println("启动成功,Sa-Token 配置如下:" + SaManager.getConfig());
+ log.info("启动成功,Sa-Token 配置如下:{}", SaManager.getConfig());
}
-
}
diff --git a/src/main/java/com/guo/learningprogresstracker/common/GlobalExceptionHandler.java b/src/main/java/com/guo/learningprogresstracker/common/GlobalExceptionHandler.java
index 2914a63..4d78d73 100644
--- a/src/main/java/com/guo/learningprogresstracker/common/GlobalExceptionHandler.java
+++ b/src/main/java/com/guo/learningprogresstracker/common/GlobalExceptionHandler.java
@@ -15,51 +15,55 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
-
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
+ @ExceptionHandler(com.guo.learningprogresstracker.exception.RecallBusinessException.class)
+ public CommonResult recallBusinessException(
+ com.guo.learningprogresstracker.exception.RecallBusinessException ex) {
+ return new CommonResult<>(400, ex.getMessage(), ex.getData());
+ }
+
@ExceptionHandler({ErrorParameterException.class})
- public CommonResult errorParameterException(ErrorParameterException ex) {
+ public CommonResult errorParameterException(ErrorParameterException ex) {
log.warn("参数异常: {}", ex.getMessage(), ex);
return CommonResult.error(ex.getMessage());
}
@ExceptionHandler({NotFindEntitiesException.class})
- public CommonResult notFindEntitiesException(NotFindEntitiesException ex) {
+ public CommonResult notFindEntitiesException(NotFindEntitiesException ex) {
log.warn("数据不存在: {}", ex.getMessage(), ex);
return CommonResult.error(ex.getMessage());
}
@ExceptionHandler({OperationFailedException.class})
- public CommonResult operationFailedException(OperationFailedException ex) {
+ public CommonResult operationFailedException(OperationFailedException ex) {
log.warn("操作失败: {}", ex.getMessage(), ex);
return CommonResult.error(ex.getMessage());
}
@ExceptionHandler({AppException.class})
- public CommonResult AppException(AppException ex) {
+ public CommonResult handleAppException(AppException ex) {
log.error("业务异常: {}", ex.getMessage(), ex);
return CommonResult.serverError(ex.getMessage());
}
@ExceptionHandler(MethodArgumentNotValidException.class)
- public CommonResult MyMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
+ public CommonResult handleArgumentNotValid(MethodArgumentNotValidException ex) {
BindingResult bindingResult = ex.getBindingResult();
return CommonResult.error(bindingResult.getFieldError().getDefaultMessage());
}
@ExceptionHandler(NotLoginException.class)
- public CommonResult handleNotLogin(NotLoginException e, HttpServletRequest req, HttpServletResponse res) {
+ public CommonResult handleNotLogin(NotLoginException e, HttpServletRequest req, HttpServletResponse res) {
res.setStatus(HttpStatus.UNAUTHORIZED.value());
return new CommonResult<>(HttpStatus.UNAUTHORIZED.value(), "未登录,请重新登录", null);
}
@ExceptionHandler(Exception.class)
- public CommonResult Exception(Exception ex) {
+ public CommonResult handleUnexpected(Exception ex) {
log.error("系统异常", ex);
- return CommonResult.error("操作没有成功,请稍后再试");
+ return CommonResult.serverError("操作没有成功,请稍后再试");
}
-
}
diff --git a/src/main/java/com/guo/learningprogresstracker/common/Ops.java b/src/main/java/com/guo/learningprogresstracker/common/Ops.java
index 4a288d1..f91bf31 100644
--- a/src/main/java/com/guo/learningprogresstracker/common/Ops.java
+++ b/src/main/java/com/guo/learningprogresstracker/common/Ops.java
@@ -7,10 +7,8 @@ import jakarta.validation.groups.Default;
*/
public interface Ops {
// 创建组
- interface CreateG extends Default {
- }
+ interface CreateG extends Default {}
// 更新组
- interface UpdateG {
- }
+ interface UpdateG {}
}
diff --git a/src/main/java/com/guo/learningprogresstracker/common/StudyTimePolicy.java b/src/main/java/com/guo/learningprogresstracker/common/StudyTimePolicy.java
index fd5db91..daacecb 100644
--- a/src/main/java/com/guo/learningprogresstracker/common/StudyTimePolicy.java
+++ b/src/main/java/com/guo/learningprogresstracker/common/StudyTimePolicy.java
@@ -35,8 +35,8 @@ public class StudyTimePolicy {
*/
private final long minEffectiveTimeSeconds;
- public StudyTimePolicy(int workDurationMinutes, int forgetThresholdMinutes,
- int forcePauseMinutes, long minEffectiveTimeSeconds) {
+ public StudyTimePolicy(
+ int workDurationMinutes, int forgetThresholdMinutes, int forcePauseMinutes, long minEffectiveTimeSeconds) {
if (workDurationMinutes <= 0) {
throw new IllegalArgumentException("番茄钟长度必须大于 0 分钟");
}
diff --git a/src/main/java/com/guo/learningprogresstracker/common/TenantContext.java b/src/main/java/com/guo/learningprogresstracker/common/TenantContext.java
index 32ba690..3ecf7e7 100644
--- a/src/main/java/com/guo/learningprogresstracker/common/TenantContext.java
+++ b/src/main/java/com/guo/learningprogresstracker/common/TenantContext.java
@@ -18,13 +18,11 @@ public final class TenantContext {
* @param loginId 登录用户
* @param device 设备类型,可为 null(后台任务通常没有设备信息)
*/
- public record Identity(String loginId, String device) {
- }
+ public record Identity(String loginId, String device) {}
private static final ThreadLocal CURRENT = new ThreadLocal<>();
- private TenantContext() {
- }
+ private TenantContext() {}
/** 取当前执行身份;未设置时返回 null(表示应回落到 StpUtil) */
public static Identity get() {
diff --git a/src/main/java/com/guo/learningprogresstracker/config/AiUsageProperties.java b/src/main/java/com/guo/learningprogresstracker/config/AiUsageProperties.java
index dca0533..76db1bf 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/AiUsageProperties.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/AiUsageProperties.java
@@ -1,11 +1,10 @@
package com.guo.learningprogresstracker.config;
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
import java.math.BigDecimal;
import java.util.List;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
/**
* AI 用量统计配置。
diff --git a/src/main/java/com/guo/learningprogresstracker/config/AutoTableField.java b/src/main/java/com/guo/learningprogresstracker/config/AutoTableField.java
index 9d78cef..355a12b 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/AutoTableField.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/AutoTableField.java
@@ -3,12 +3,11 @@ package com.guo.learningprogresstracker.config;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.guo.learningprogresstracker.common.TenantContext;
+import java.time.LocalDateTime;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.context.annotation.Configuration;
-import java.time.LocalDateTime;
-
/**
* 用于公共字段的自动填充
*
@@ -18,7 +17,6 @@ import java.time.LocalDateTime;
@Slf4j
public class AutoTableField implements MetaObjectHandler {
-
@Override
public void insertFill(MetaObject metaObject) {
this.strictInsertFill(metaObject, "createdBy", AutoTableField::currentLoginId, String.class);
@@ -28,7 +26,6 @@ public class AutoTableField implements MetaObjectHandler {
this.strictInsertFill(metaObject, "deviceInfo", AutoTableField::currentDevice, String.class);
}
-
@Override
public void updateFill(MetaObject metaObject) {
this.strictInsertFill(metaObject, "lastModifiedBy", AutoTableField::currentLoginId, String.class);
@@ -51,5 +48,4 @@ public class AutoTableField implements MetaObjectHandler {
TenantContext.Identity identity = TenantContext.get();
return identity != null ? identity.device() : StpUtil.getLoginDevice();
}
-
}
diff --git a/src/main/java/com/guo/learningprogresstracker/config/CorsProperties.java b/src/main/java/com/guo/learningprogresstracker/config/CorsProperties.java
index 91dacad..cde37c0 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/CorsProperties.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/CorsProperties.java
@@ -10,5 +10,4 @@ import org.springframework.context.annotation.Configuration;
public class CorsProperties {
private String[] allowedOrigins;
private Boolean allowCredentials;
-
}
diff --git a/src/main/java/com/guo/learningprogresstracker/config/JacksonConfig.java b/src/main/java/com/guo/learningprogresstracker/config/JacksonConfig.java
index db416ac..001dfe1 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/JacksonConfig.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/JacksonConfig.java
@@ -4,12 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.guo.learningprogresstracker.config.serializer.LocalDateTimeSerializer;
+import java.time.LocalDateTime;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
-import java.time.LocalDateTime;
-
@Configuration
public class JacksonConfig {
@Bean
diff --git a/src/main/java/com/guo/learningprogresstracker/config/MybatisPlusConfig.java b/src/main/java/com/guo/learningprogresstracker/config/MybatisPlusConfig.java
index 342c8bb..958d60a 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/MybatisPlusConfig.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/MybatisPlusConfig.java
@@ -1,18 +1,17 @@
package com.guo.learningprogresstracker.config;
import cn.dev33.satoken.stp.StpUtil;
-import com.guo.learningprogresstracker.common.TenantContext;
-import net.sf.jsqlparser.expression.StringValue;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
-import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
-import net.sf.jsqlparser.expression.Expression;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
+import com.guo.learningprogresstracker.common.TenantContext;
import java.util.Arrays;
import java.util.List;
+import net.sf.jsqlparser.expression.Expression;
+import net.sf.jsqlparser.expression.StringValue;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
/**
* MyBatis-Plus 多租户配置
@@ -30,12 +29,7 @@ public class MybatisPlusConfig {
* 若按 created_by 过滤,每个人只能看到自己触发的那几次调用,面板等于永远空的。
*/
private static final List EXCLUDE_TABLES = Arrays.asList(
- "user",
- "flyway_schema_history",
- "databasechangelog",
- "databasechangeloglock",
- "ai_usage_records"
- );
+ "user", "flyway_schema_history", "databasechangelog", "databasechangeloglock", "ai_usage_records");
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
diff --git a/src/main/java/com/guo/learningprogresstracker/config/WebMvcConfig.java b/src/main/java/com/guo/learningprogresstracker/config/WebMvcConfig.java
index f90cff8..e69978b 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/WebMvcConfig.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/WebMvcConfig.java
@@ -3,6 +3,7 @@ package com.guo.learningprogresstracker.config;
import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.stp.StpUtil;
+import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
@@ -10,8 +11,6 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-import java.util.Arrays;
-
@Configuration
@RequiredArgsConstructor
@Slf4j
@@ -49,7 +48,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
.allowedOrigins(origins)
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
- .allowCredentials(corsProperties.getAllowCredentials() == null || corsProperties.getAllowCredentials());
+ .allowCredentials(
+ corsProperties.getAllowCredentials() == null || corsProperties.getAllowCredentials());
}
}
}
diff --git a/src/main/java/com/guo/learningprogresstracker/config/serializer/LocalDateTimeSerializer.java b/src/main/java/com/guo/learningprogresstracker/config/serializer/LocalDateTimeSerializer.java
index 15932f3..c6ee0c8 100644
--- a/src/main/java/com/guo/learningprogresstracker/config/serializer/LocalDateTimeSerializer.java
+++ b/src/main/java/com/guo/learningprogresstracker/config/serializer/LocalDateTimeSerializer.java
@@ -3,13 +3,12 @@ package com.guo.learningprogresstracker.config.serializer;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class LocalDateTimeSerializer extends StdSerializer {
- private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
+ private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
public LocalDateTimeSerializer() {
super(LocalDateTime.class);
@@ -20,7 +19,7 @@ public class LocalDateTimeSerializer extends StdSerializer {
if (value == null) {
gen.writeNull();
} else {
- String formattedDate = value.format(formatter);
+ String formattedDate = value.format(FORMATTER);
gen.writeString(formattedDate);
}
}
diff --git a/src/main/java/com/guo/learningprogresstracker/controller/AiTaskController.java b/src/main/java/com/guo/learningprogresstracker/controller/AiTaskController.java
index a44c630..2102255 100644
--- a/src/main/java/com/guo/learningprogresstracker/controller/AiTaskController.java
+++ b/src/main/java/com/guo/learningprogresstracker/controller/AiTaskController.java
@@ -9,7 +9,13 @@ import com.guo.learningprogresstracker.service.AiTaskService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
/**
* AI 异步任务控制层(AI-02)。
@@ -49,8 +55,7 @@ public class AiTaskController {
* @return 无任务时 data 为 null
*/
@GetMapping("/latest")
- public CommonResult getLatestTask(@RequestParam String type,
- @RequestParam String targetNum) {
+ public CommonResult getLatestTask(@RequestParam String type, @RequestParam String targetNum) {
return CommonResult.success(aiTaskService.findLatest(type, targetNum));
}
}
diff --git a/src/main/java/com/guo/learningprogresstracker/controller/AiUsageController.java b/src/main/java/com/guo/learningprogresstracker/controller/AiUsageController.java
index 322b5bb..63e9711 100644
--- a/src/main/java/com/guo/learningprogresstracker/controller/AiUsageController.java
+++ b/src/main/java/com/guo/learningprogresstracker/controller/AiUsageController.java
@@ -9,13 +9,12 @@ import com.guo.learningprogresstracker.dto.request.AiUsageQuery;
import com.guo.learningprogresstracker.entity.CommonResult;
import com.guo.learningprogresstracker.exception.ErrorParameterException;
import com.guo.learningprogresstracker.service.AiUsageService;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
-
/**
* 「AI 用量统计」面板查询接口(契约 2)。
*
diff --git a/src/main/java/com/guo/learningprogresstracker/controller/AiUsageInternalController.java b/src/main/java/com/guo/learningprogresstracker/controller/AiUsageInternalController.java
index 5840268..e188198 100644
--- a/src/main/java/com/guo/learningprogresstracker/controller/AiUsageInternalController.java
+++ b/src/main/java/com/guo/learningprogresstracker/controller/AiUsageInternalController.java
@@ -8,6 +8,7 @@ import com.guo.learningprogresstracker.entity.CommonResult;
import com.guo.learningprogresstracker.exception.ErrorParameterException;
import com.guo.learningprogresstracker.service.AiUsageService;
import jakarta.validation.Valid;
+import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -15,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import java.util.List;
-
/**
* lpt-ai 用量上报(契约 1)。
*
@@ -43,7 +42,8 @@ public class AiUsageInternalController {
@PostMapping("/records")
public CommonResult report(
@RequestHeader(name = "x-api-token", required = false) String apiToken,
- @Valid @RequestBody AiUsageReportRequest request) throws ErrorParameterException {
+ @Valid @RequestBody AiUsageReportRequest request)
+ throws ErrorParameterException {
if (!isTokenAccepted(apiToken)) {
return CommonResult.error("上报令牌不正确");
}
diff --git a/src/main/java/com/guo/learningprogresstracker/controller/ExportController.java b/src/main/java/com/guo/learningprogresstracker/controller/ExportController.java
index 3025ee6..a3a0d29 100644
--- a/src/main/java/com/guo/learningprogresstracker/controller/ExportController.java
+++ b/src/main/java/com/guo/learningprogresstracker/controller/ExportController.java
@@ -5,12 +5,15 @@ import com.guo.learningprogresstracker.entity.CommonResult;
import com.guo.learningprogresstracker.exception.NotFindEntitiesException;
import com.guo.learningprogresstracker.exception.OperationFailedException;
import com.guo.learningprogresstracker.service.ExportService;
+import java.time.LocalDate;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.time.LocalDate;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
/**
* 数据导出控制层(导出-01):把学习报告、知识碎片与任务统计导出为 Markdown / JSON。
@@ -29,8 +32,7 @@ public class ExportController {
*/
@GetMapping("/task/{taskNum}")
public CommonResult exportTask(
- @PathVariable String taskNum,
- @RequestParam(defaultValue = "markdown") String format)
+ @PathVariable String taskNum, @RequestParam(defaultValue = "markdown") String format)
throws NotFindEntitiesException, OperationFailedException {
return CommonResult.success(exportService.exportTask(taskNum, format));
}
diff --git a/src/main/java/com/guo/learningprogresstracker/controller/GuidanceController.java b/src/main/java/com/guo/learningprogresstracker/controller/GuidanceController.java
index 13af6d0..ecfb6da 100644
--- a/src/main/java/com/guo/learningprogresstracker/controller/GuidanceController.java
+++ b/src/main/java/com/guo/learningprogresstracker/controller/GuidanceController.java
@@ -1,24 +1,34 @@
package com.guo.learningprogresstracker.controller;
+import com.guo.learningprogresstracker.dto.AiTaskResponse;
import com.guo.learningprogresstracker.dto.ReviewTiming;
import com.guo.learningprogresstracker.dto.request.AiTaskSubmitRequest;
+import com.guo.learningprogresstracker.dto.request.ConfirmGuidanceFragmentRequest;
+import com.guo.learningprogresstracker.dto.request.GuidanceStartRequest;
+import com.guo.learningprogresstracker.dto.request.GuidanceTurnRequest;
+import com.guo.learningprogresstracker.dto.response.GuidanceConversationResponse;
+import com.guo.learningprogresstracker.dto.response.ReportFragmentResponse;
import com.guo.learningprogresstracker.entity.CommonResult;
import com.guo.learningprogresstracker.entity.ReviewGuidanceConversationEntity;
-import com.guo.learningprogresstracker.entity.StudyReportFragmentsEntity;
import com.guo.learningprogresstracker.exception.ErrorParameterException;
import com.guo.learningprogresstracker.exception.NotFindEntitiesException;
import com.guo.learningprogresstracker.service.AiTaskService;
import com.guo.learningprogresstracker.service.GuidanceService;
-import com.guo.learningprogresstracker.dto.AiTaskResponse;
import io.swagger.v3.oas.annotations.Operation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
+import jakarta.validation.Valid;
import java.time.LocalDateTime;
import java.time.format.DateTimeParseException;
import java.util.LinkedHashMap;
import java.util.Map;
+import lombok.RequiredArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
/**
* 学习引导控制层(复习-06)。
@@ -42,11 +52,10 @@ public class GuidanceController {
*/
@PostMapping
@Operation(summary = "开启学习引导:返回引导编号与首个 AI 任务编号")
- public CommonResult