From 844516988b3f6fd49c8f36f80773ca3814366c2f Mon Sep 17 00:00:00 2001 From: xiaowang Date: Sat, 23 May 2026 18:44:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=82=E5=8A=A1=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E7=BA=A7=E6=B3=A8=E9=87=8A=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yuminailcore/YumiNailCoreApplication.java | 8 + .../annotation/OperationGuard.java | 4 + .../annotation/RequirePermission.java | 4 + .../aspect/OperationGuardAspect.java | 12 + .../yuminailcore/aspect/PermissionAspect.java | 28 ++ .../common/BusinessException.java | 8 + .../common/GlobalExceptionHandler.java | 48 ++ .../xiaowang/yuminailcore/common/Result.java | 28 ++ .../config/AppCacheProperties.java | 16 + .../yuminailcore/config/AuthInterceptor.java | 60 +++ .../yuminailcore/config/HttpClientConfig.java | 8 + .../config/HttpClientProperties.java | 24 + .../yuminailcore/config/JacksonConfig.java | 16 + .../config/LoginLockProperties.java | 16 + .../yuminailcore/config/MinioConfig.java | 24 + .../config/MyBatisPlusConfig.java | 12 + .../config/MyMetaObjectHandler.java | 8 + .../yuminailcore/config/RabbitMQConfig.java | 20 + .../config/RateLimitProperties.java | 12 + .../yuminailcore/config/RedisConfig.java | 4 + .../config/SecurityHeadersFilter.java | 8 + .../config/SlowRequestLogProperties.java | 16 + .../config/SlowRequestLoggingInterceptor.java | 48 ++ .../config/UploadSecurityProperties.java | 8 + .../yuminailcore/config/WebMvcConfig.java | 16 + .../config/WechatMiniProperties.java | 20 + .../controller/AdminAuthController.java | 4 + .../AdminLegalAgreementController.java | 36 ++ .../controller/AdminNailArtistController.java | 12 + .../controller/AdminOrderController.java | 4 + .../controller/AdminPermissionController.java | 4 + .../AdminSecurityAuditController.java | 12 + .../controller/AdminShopController.java | 12 + .../controller/AdminShopRoleController.java | 4 + .../controller/AdminUserController.java | 16 + .../controller/CartController.java | 4 + .../controller/ContactInfoController.java | 4 + .../controller/DashboardController.java | 20 + .../controller/FrontendFileController.java | 20 + .../controller/LegalAgreementController.java | 52 ++ .../controller/NailArtistController.java | 4 + .../ObjectStorageFileController.java | 4 + .../controller/OrderController.java | 24 + .../controller/ProductController.java | 28 ++ .../controller/ShopController.java | 8 + .../SystemParameterConfigController.java | 24 + .../controller/UserController.java | 32 ++ .../controller/VipRechargePlanController.java | 8 + .../controller/WishlistController.java | 20 + .../dto/AgreementAwareRequest.java | 4 + .../yuminailcore/dto/LegalAgreementDTO.java | 20 + .../yuminailcore/dto/LoginRequestDTO.java | 12 + .../dto/OrderArtistChangeRejectDTO.java | 8 + .../dto/OrderArtistChangeRequestDTO.java | 20 + .../dto/OrderArtistReviewSubmitDTO.java | 16 + .../dto/PhoneLoginRequestDTO.java | 12 + .../yuminailcore/dto/RegisterRequestDTO.java | 12 + .../xiaowang/yuminailcore/dto/ShopDTO.java | 44 ++ .../dto/SystemMessageCreateDTO.java | 12 + .../dto/SystemParameterConfigDTO.java | 28 ++ .../dto/WechatMiniConfirmLoginRequestDTO.java | 12 + .../dto/WechatMiniPhoneLoginRequestDTO.java | 12 + .../yuminailcore/entity/BalanceDO.java | 8 + .../entity/BusinessEventOutboxDO.java | 52 ++ .../yuminailcore/entity/LegalAgreementDO.java | 32 ++ .../entity/OrderArtistChangeRequestDO.java | 72 +++ .../entity/OrderArtistReviewDO.java | 56 +++ .../entity/SecurityAuditLogDO.java | 36 ++ .../xiaowang/yuminailcore/entity/ShopDO.java | 44 ++ .../yuminailcore/entity/SystemMessageDO.java | 16 + .../entity/SystemParameterConfigDO.java | 32 ++ .../entity/UserAgreementConsentDO.java | 36 ++ .../filter/RequestBodyCacheFilter.java | 4 + .../mapper/BusinessEventOutboxMapper.java | 4 + .../mapper/LegalAgreementMapper.java | 4 + .../OrderArtistChangeRequestMapper.java | 4 + .../mapper/OrderArtistReviewMapper.java | 4 + .../mapper/SecurityAuditLogMapper.java | 4 + .../mapper/SystemParameterConfigMapper.java | 4 + .../mapper/UserAgreementConsentMapper.java | 4 + .../service/BusinessEventOutboxService.java | 4 + .../service/LegalAgreementService.java | 4 + .../yuminailcore/service/MapService.java | 4 + .../service/SecurityAuditLogService.java | 4 + .../service/SystemParameterConfigService.java | 4 + .../service/impl/AnnouncementServiceImpl.java | 20 + .../impl/BusinessEventOutboxProcessor.java | 32 ++ .../impl/BusinessEventOutboxServiceImpl.java | 28 ++ .../service/impl/CartServiceImpl.java | 28 ++ .../service/impl/ChunkUploadServiceImpl.java | 76 +++ .../service/impl/CouponServiceImpl.java | 24 + .../impl/LegalAgreementServiceImpl.java | 96 ++++ .../service/impl/MapServiceImpl.java | 16 + .../impl/MessageHubClientServiceImpl.java | 16 + .../impl/NailArtistInfoServiceImpl.java | 12 + .../impl/ObjectStorageFileServiceImpl.java | 4 + .../service/impl/OrderServiceImpl.java | 332 +++++++++++++ .../service/impl/PermissionServiceImpl.java | 28 ++ .../service/impl/ProductLikeServiceImpl.java | 4 + .../service/impl/ProductServiceImpl.java | 56 +++ .../impl/SecurityAuditLogServiceImpl.java | 24 + .../service/impl/ShopServiceImpl.java | 28 ++ .../impl/SystemMessageServiceImpl.java | 24 + .../SystemParameterConfigServiceImpl.java | 32 ++ .../service/impl/TagServiceImpl.java | 8 + .../service/impl/UserAssetServiceImpl.java | 32 ++ .../service/impl/UserServiceImpl.java | 44 ++ .../impl/VerificationCodeServiceImpl.java | 20 + .../impl/VipRechargePlanServiceImpl.java | 12 + .../impl/WechatMiniAuthServiceImpl.java | 36 ++ .../impl/WechatMiniClientServiceImpl.java | 8 + .../service/impl/WishlistServiceImpl.java | 8 + .../support/AdminScopeHelper.java | 56 +++ .../support/BookableArtistSupport.java | 28 ++ .../support/ObjectStorageUrlSupport.java | 40 ++ .../support/OrderStateMachine.java | 12 + .../yuminailcore/support/OrderStatus.java | 16 + .../support/PermissionCatalog.java | 48 ++ .../support/PermissionPolicy.java | 16 + .../support/RequestShopContext.java | 16 + .../support/SecurityAuditActions.java | 76 +++ .../support/SecurityAuditSupport.java | 28 ++ .../support/ShopThemeSupport.java | 8 + .../support/UserShopBindingSupport.java | 140 ++++++ .../support/cache/MultiLevelCacheService.java | 104 ++++ .../id/TimeOrderedSnowflakeIdGenerator.java | 100 ++++ .../CachedBodyHttpServletRequest.java | 28 ++ .../security/OperationGuardService.java | 88 ++++ .../security/OperationGuardStrategy.java | 4 + .../security/RequestSignatureService.java | 76 +++ .../security/RequestThrottleService.java | 84 ++++ .../security/UploadSecurityValidator.java | 36 ++ .../support/security/UserSessionService.java | 104 ++++ .../utils/AccountValidationUtils.java | 24 + .../xiaowang/yuminailcore/utils/JwtUtil.java | 72 +++ .../yuminailcore/utils/RedisUtils.java | 4 + .../yuminailcore/vo/DashboardStatsVO.java | 40 ++ .../yuminailcore/vo/LegalAgreementVO.java | 48 ++ .../yuminailcore/vo/LoginResponseVO.java | 4 + .../vo/MessageTargetOptionsVO.java | 8 + .../vo/OrderArtistChangeOptionsVO.java | 48 ++ .../vo/OrderArtistChangeRequestVO.java | 120 +++++ .../yuminailcore/vo/OrderArtistReviewVO.java | 84 ++++ .../xiaowang/yuminailcore/vo/OrderItemVO.java | 12 + .../com/xiaowang/yuminailcore/vo/OrderVO.java | 4 + .../yuminailcore/vo/SecurityAuditLogVO.java | 40 ++ .../com/xiaowang/yuminailcore/vo/ShopVO.java | 48 ++ .../yuminailcore/vo/SystemMessageVO.java | 12 + .../vo/SystemParameterConfigVO.java | 40 ++ .../vo/UserAgreementConsentVO.java | 8 + .../vo/WechatMiniLoginResultVO.java | 20 + YumiNail-Frontend/src/App.vue | 28 ++ YumiNail-Frontend/src/api/admin.ts | 232 +++++++++ YumiNail-Frontend/src/api/auth-free-paths.ts | 24 + YumiNail-Frontend/src/api/auth.ts | 48 ++ YumiNail-Frontend/src/api/cart.ts | 4 + YumiNail-Frontend/src/api/comment.ts | 4 + YumiNail-Frontend/src/api/coupon.ts | 20 + YumiNail-Frontend/src/api/file.ts | 28 ++ YumiNail-Frontend/src/api/index.ts | 52 ++ YumiNail-Frontend/src/api/order.ts | 36 ++ YumiNail-Frontend/src/api/permission.ts | 12 + YumiNail-Frontend/src/api/product.ts | 20 + YumiNail-Frontend/src/api/shop.ts | 20 + YumiNail-Frontend/src/api/tag.ts | 8 + YumiNail-Frontend/src/api/user.ts | 76 +++ YumiNail-Frontend/src/api/wishlist.ts | 4 + .../src/components/BottomNav.vue | 8 + .../src/components/DraftActions.vue | 4 + .../src/components/SystemMessageCard.vue | 16 + .../src/components/TableEllipsisText.vue | 4 + .../components/admin/AdminResponsiveModal.vue | 24 + .../src/composables/useAdminViewport.ts | 28 ++ .../src/composables/useConfirmEnter.test.ts | 36 ++ .../src/composables/useConfirmEnter.ts | 52 ++ .../src/composables/useShopTheme.ts | 44 ++ YumiNail-Frontend/src/config/antdv-locale.ts | 12 + YumiNail-Frontend/src/config/api.ts | 24 + YumiNail-Frontend/src/constants/index.ts | 12 + YumiNail-Frontend/src/main.ts | 8 + YumiNail-Frontend/src/router/index.ts | 4 + YumiNail-Frontend/src/utils/account.ts | 16 + YumiNail-Frontend/src/utils/action-loading.ts | 24 + .../src/utils/admin-auth-bootstrap.ts | 40 ++ YumiNail-Frontend/src/utils/admin-session.ts | 28 ++ YumiNail-Frontend/src/utils/cart-state.ts | 12 + YumiNail-Frontend/src/utils/chunk-upload.ts | 40 ++ YumiNail-Frontend/src/utils/form-draft.ts | 28 ++ YumiNail-Frontend/src/utils/id.ts | 12 + YumiNail-Frontend/src/utils/image-upload.ts | 64 +++ YumiNail-Frontend/src/utils/permission.ts | 40 ++ .../src/utils/platform-admin-permissions.ts | 12 + .../src/utils/request-signature.ts | 104 ++++ YumiNail-Frontend/src/utils/shop-theme.ts | 68 +++ .../src/views/AccountSettingsView.vue | 48 ++ .../src/views/ArtistCalendarView.vue | 24 + .../src/views/ArtistOrderView.vue | 88 ++++ YumiNail-Frontend/src/views/AuthView.vue | 92 ++++ YumiNail-Frontend/src/views/CartView.vue | 64 +++ YumiNail-Frontend/src/views/CouponView.vue | 12 + YumiNail-Frontend/src/views/HomeView.vue | 76 +++ YumiNail-Frontend/src/views/NotFoundView.vue | 4 + .../src/views/NotificationsView.vue | 24 + YumiNail-Frontend/src/views/OrderView.vue | 132 ++++++ .../src/views/PasswordSettingsView.vue | 24 + .../src/views/ProductDetailView.vue | 52 ++ .../src/views/ProductListView.vue | 52 ++ YumiNail-Frontend/src/views/ProfileView.vue | 36 ++ YumiNail-Frontend/src/views/SettingsView.vue | 4 + .../src/views/ShopDetailView.vue | 100 ++++ YumiNail-Frontend/src/views/VipCenterView.vue | 20 + YumiNail-Frontend/src/views/WishlistView.vue | 28 ++ .../src/views/admin/AdminLayout.vue | 32 ++ .../src/views/admin/AdminLoginView.vue | 24 + .../src/views/admin/AnnouncementsView.vue | 24 + .../src/views/admin/CommentsView.vue | 60 +++ .../src/views/admin/CouponsView.vue | 84 ++++ .../src/views/admin/DashboardView.vue | 60 +++ .../src/views/admin/HomeView.vue | 20 + .../src/views/admin/LegalAgreementsView.vue | 60 +++ .../src/views/admin/ManageView.vue | 4 + .../views/admin/MessageHubPushConfigsView.vue | 60 +++ .../src/views/admin/NailArtistsView.vue | 60 +++ .../src/views/admin/OrdersView.vue | 100 ++++ .../src/views/admin/PermissionsView.vue | 64 +++ .../src/views/admin/ProductsView.vue | 108 +++++ .../src/views/admin/ProfileView.vue | 8 + .../src/views/admin/ShopsView.vue | 280 +++++++++++ .../src/views/admin/SystemMessagesView.vue | 124 +++++ .../src/views/admin/TagsView.vue | 40 ++ .../src/views/admin/UsersView.vue | 120 +++++ .../src/views/admin/VipRechargePlansView.vue | 32 ++ .../src/views/admin/admin-helpers.ts | 16 + scripts/comment-coverage.mjs | 444 ++++++++++++++++++ 234 files changed, 8356 insertions(+) create mode 100644 scripts/comment-coverage.mjs diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/YumiNailCoreApplication.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/YumiNailCoreApplication.java index 395b22ea..f34501a5 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/YumiNailCoreApplication.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/YumiNailCoreApplication.java @@ -8,8 +8,16 @@ import org.springframework.scheduling.annotation.EnableScheduling; @EnableDiscoveryClient @EnableScheduling @SpringBootApplication +/** + * Purpose: YumiNailCoreApplication supports YumiNailCoreApplication.java by holding or executing the yumi nail core application business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class YumiNailCoreApplication { + /** + * Purpose: main supports YumiNailCoreApplication.java by holding or executing the main business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static void main(String[] args) { SpringApplication.run(YumiNailCoreApplication.class, args); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/OperationGuard.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/OperationGuard.java index 4ec3b969..13cd711c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/OperationGuard.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/OperationGuard.java @@ -9,6 +9,10 @@ import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) +/** + * Purpose: OperationGuard supports OperationGuard.java by holding or executing the operation guard business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public @interface OperationGuard { String action(); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/RequirePermission.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/RequirePermission.java index fb041bc5..0d146cf8 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/RequirePermission.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/annotation/RequirePermission.java @@ -7,6 +7,10 @@ import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) +/** + * Purpose: RequirePermission supports RequirePermission.java by holding or executing the require permission business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public @interface RequirePermission { String value() default ""; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/OperationGuardAspect.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/OperationGuardAspect.java index 8cd35c6b..c7d4614f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/OperationGuardAspect.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/OperationGuardAspect.java @@ -21,11 +21,23 @@ import java.time.Duration; @Component @Order(100) @RequiredArgsConstructor +/** + * Purpose: OperationGuardAspect supports OperationGuardAspect.java by holding or executing the operation guard aspect business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OperationGuardAspect { + /** + * Purpose: operationGuardService supports OperationGuardAspect.java by holding or executing the operation guard service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final OperationGuardService operationGuardService; @Around("@annotation(operationGuard)") + /** + * Purpose: guardOperation supports OperationGuardAspect.java by holding or executing the guard operation business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Object guardOperation(ProceedingJoinPoint joinPoint, OperationGuard operationGuard) throws Throwable { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/PermissionAspect.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/PermissionAspect.java index c7f0485a..0479c35b 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/PermissionAspect.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/aspect/PermissionAspect.java @@ -28,13 +28,33 @@ import java.lang.reflect.Method; @Component @Order(Ordered.HIGHEST_PRECEDENCE) @RequiredArgsConstructor +/** + * Purpose: PermissionAspect supports PermissionAspect.java by holding or executing the permission aspect business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class PermissionAspect { + /** + * Purpose: permissionService supports PermissionAspect.java by holding or executing the permission service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final PermissionService permissionService; + /** + * Purpose: permissionMapper supports PermissionAspect.java by holding or executing the permission mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final PermissionMapper permissionMapper; + /** + * Purpose: userMapper supports PermissionAspect.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserMapper userMapper; @Around("@annotation(com.xiaowang.yuminailcore.annotation.RequirePermission)") + /** + * Purpose: checkPermission supports PermissionAspect.java by holding or executing the check permission business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Object checkPermission(ProceedingJoinPoint joinPoint) throws Throwable { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { @@ -84,6 +104,10 @@ public class PermissionAspect { return joinPoint.proceed(); } + /** + * Purpose: buildPermissionDeniedMessage supports PermissionAspect.java by holding or executing the build permission denied message business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildPermissionDeniedMessage(String permissionCode) { if (!StringUtils.hasText(permissionCode)) { return "权限不足"; @@ -101,6 +125,10 @@ public class PermissionAspect { return "权限不足:缺少权限代码 " + permissionCode; } + /** + * Purpose: parseShopId supports PermissionAspect.java by holding or executing the parse shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long parseShopId(Object value) { if (value instanceof Number number) { long shopId = number.longValue(); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/BusinessException.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/BusinessException.java index bd928de6..a6391b2f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/BusinessException.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/BusinessException.java @@ -5,6 +5,10 @@ package com.xiaowang.yuminailcore.common; */ public class BusinessException extends RuntimeException { + /** + * Purpose: code supports BusinessException.java by holding or executing the code business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final Integer code; public BusinessException(String message) { @@ -25,6 +29,10 @@ public class BusinessException extends RuntimeException { this.code = code; } + /** + * Purpose: getCode supports BusinessException.java by holding or executing the get code business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Integer getCode() { return code; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/GlobalExceptionHandler.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/GlobalExceptionHandler.java index a2fc36f0..23805aa7 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/GlobalExceptionHandler.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/GlobalExceptionHandler.java @@ -18,9 +18,17 @@ import javax.validation.ConstraintViolationException; @RestControllerAdvice public class GlobalExceptionHandler { + /** + * Purpose: MAX_UPLOAD_SIZE_BYTES supports GlobalExceptionHandler.java by holding or executing the max upload size bytes business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long MAX_UPLOAD_SIZE_BYTES = 5L * 1024 * 1024; @ExceptionHandler(MethodArgumentNotValidException.class) + /** + * Purpose: handleMethodArgumentNotValidException supports GlobalExceptionHandler.java by holding or executing the handle method argument not valid exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { String message = e.getBindingResult().getAllErrors().stream() .map(DefaultMessageSourceResolvable::getDefaultMessage) @@ -30,6 +38,10 @@ public class GlobalExceptionHandler { } @ExceptionHandler(BindException.class) + /** + * Purpose: handleBindException supports GlobalExceptionHandler.java by holding or executing the handle bind exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleBindException(BindException e) { String message = e.getBindingResult().getAllErrors().stream() .map(DefaultMessageSourceResolvable::getDefaultMessage) @@ -39,6 +51,10 @@ public class GlobalExceptionHandler { } @ExceptionHandler(ConstraintViolationException.class) + /** + * Purpose: handleConstraintViolationException supports GlobalExceptionHandler.java by holding or executing the handle constraint violation exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleConstraintViolationException(ConstraintViolationException e) { String message = e.getConstraintViolations().stream() .map(violation -> violation.getMessage()) @@ -48,18 +64,30 @@ public class GlobalExceptionHandler { } @ExceptionHandler(MaxUploadSizeExceededException.class) + /** + * Purpose: handleMaxUploadSizeExceededException supports GlobalExceptionHandler.java by holding or executing the handle max upload size exceeded exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e) { log.warn("上传文件超过限制: {}", e.getMessage()); return Result.error(buildUploadLimitMessage()); } @ExceptionHandler(MultipartException.class) + /** + * Purpose: handleMultipartException supports GlobalExceptionHandler.java by holding or executing the handle multipart exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleMultipartException(MultipartException e) { log.warn("文件上传请求异常: {}", e.getMessage()); return Result.error(buildUploadLimitMessage()); } @ExceptionHandler(IllegalStateException.class) + /** + * Purpose: handleIllegalStateException supports GlobalExceptionHandler.java by holding or executing the handle illegal state exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleIllegalStateException(IllegalStateException e) { if (isUploadLimitException(e)) { log.warn("上传文件超过限制: {}", e.getMessage()); @@ -70,27 +98,47 @@ public class GlobalExceptionHandler { } @ExceptionHandler(BusinessException.class) + /** + * Purpose: handleBusinessException supports GlobalExceptionHandler.java by holding or executing the handle business exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleBusinessException(BusinessException e) { log.warn("业务异常: {}", e.getMessage()); return Result.error(e.getCode(), e.getMessage()); } @ExceptionHandler(RuntimeException.class) + /** + * Purpose: handleRuntimeException supports GlobalExceptionHandler.java by holding or executing the handle runtime exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleRuntimeException(RuntimeException e) { log.error("运行时异常", e); return Result.error(e.getMessage()); } @ExceptionHandler(Exception.class) + /** + * Purpose: handleException supports GlobalExceptionHandler.java by holding or executing the handle exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result handleException(Exception e) { log.error("系统异常", e); return Result.error("系统繁忙,请稍后再试"); } + /** + * Purpose: buildUploadLimitMessage supports GlobalExceptionHandler.java by holding or executing the build upload limit message business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildUploadLimitMessage() { return "上传文件不能超过 " + (MAX_UPLOAD_SIZE_BYTES / 1024 / 1024) + "MB"; } + /** + * Purpose: isUploadLimitException supports GlobalExceptionHandler.java by holding or executing the is upload limit exception business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isUploadLimitException(Throwable throwable) { Throwable current = throwable; while (current != null) { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/Result.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/Result.java index 7188ba9e..b1894d23 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/Result.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/common/Result.java @@ -18,22 +18,50 @@ import java.io.Serializable; @AllArgsConstructor public class Result implements Serializable { + /** + * Purpose: code supports Result.java by holding or executing the code business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer code; + /** + * Purpose: message supports Result.java by holding or executing the message business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String message; + /** + * Purpose: data supports Result.java by holding or executing the data business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private T data; + /** + * Purpose: success supports Result.java by holding or executing the success business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Result success() { return new Result<>(200, "操作成功", null); } + /** + * Purpose: success supports Result.java by holding or executing the success business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Result success(T data) { return new Result<>(200, "操作成功", data); } + /** + * Purpose: error supports Result.java by holding or executing the error business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Result error(String message) { return new Result<>(500, message, null); } + /** + * Purpose: error supports Result.java by holding or executing the error business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Result error(Integer code, String message) { return new Result<>(code, message, null); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AppCacheProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AppCacheProperties.java index d8879a85..ff50eb5e 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AppCacheProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AppCacheProperties.java @@ -12,6 +12,10 @@ import org.springframework.context.annotation.Configuration; @ConfigurationProperties(prefix = "yuminail.cache") public class AppCacheProperties { + /** + * Purpose: localMaxSize supports AppCacheProperties.java by holding or executing the local max size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long localMaxSize = 2048; private CacheSpec productDetail = new CacheSpec(120, 900); @@ -29,8 +33,20 @@ public class AppCacheProperties { private CacheSpec dashboard = new CacheSpec(30, 90); @Data + /** + * Purpose: CacheSpec supports AppCacheProperties.java by holding or executing the cache spec business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class CacheSpec { + /** + * Purpose: localTtlSeconds supports AppCacheProperties.java by holding or executing the local ttl seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long localTtlSeconds; + /** + * Purpose: redisTtlSeconds supports AppCacheProperties.java by holding or executing the redis ttl seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long redisTtlSeconds; public CacheSpec() { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AuthInterceptor.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AuthInterceptor.java index 9f481a83..f9971ecc 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AuthInterceptor.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/AuthInterceptor.java @@ -18,19 +18,59 @@ import javax.servlet.http.HttpServletResponse; @Component @RequiredArgsConstructor +/** + * Purpose: AuthInterceptor supports AuthInterceptor.java by holding or executing the auth interceptor business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class AuthInterceptor implements HandlerInterceptor { + /** + * Purpose: jwtUtil supports AuthInterceptor.java by holding or executing the jwt util business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final JwtUtil jwtUtil; + /** + * Purpose: userMapper supports AuthInterceptor.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserMapper userMapper; + /** + * Purpose: userShopBindingSupport supports AuthInterceptor.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserShopBindingSupport userShopBindingSupport; + /** + * Purpose: userSessionService supports AuthInterceptor.java by holding or executing the user session service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserSessionService userSessionService; + /** + * Purpose: requestSignatureService supports AuthInterceptor.java by holding or executing the request signature service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final RequestSignatureService requestSignatureService; + /** + * Purpose: requestThrottleService supports AuthInterceptor.java by holding or executing the request throttle service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final RequestThrottleService requestThrottleService; + /** + * Purpose: AUTHORIZATION_HEADER supports AuthInterceptor.java by holding or executing the authorization header business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String AUTHORIZATION_HEADER = "Authorization"; + /** + * Purpose: BEARER_PREFIX supports AuthInterceptor.java by holding or executing the bearer prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String BEARER_PREFIX = "Bearer "; @Override + /** + * Purpose: preHandle supports AuthInterceptor.java by holding or executing the pre handle business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String path = request.getRequestURI(); @@ -136,10 +176,18 @@ public class AuthInterceptor implements HandlerInterceptor { return true; } + /** + * Purpose: requiresSignature supports AuthInterceptor.java by holding or executing the requires signature business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean requiresSignature(HttpServletRequest request) { return requiresWriteRateLimit(request); } + /** + * Purpose: requiresWriteRateLimit supports AuthInterceptor.java by holding or executing the requires write rate limit business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean requiresWriteRateLimit(HttpServletRequest request) { String method = request.getMethod(); if (!StringUtils.hasText(method)) { @@ -149,10 +197,18 @@ public class AuthInterceptor implements HandlerInterceptor { return !("GET".equals(normalized) || "HEAD".equals(normalized) || "OPTIONS".equals(normalized)); } + /** + * Purpose: isAdminPath supports AuthInterceptor.java by holding or executing the is admin path business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isAdminPath(String path) { return path.startsWith("/admin/") || path.startsWith("/order/admin/"); } + /** + * Purpose: isExpiredAdminAllowedPath supports AuthInterceptor.java by holding or executing the is expired admin allowed path business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isExpiredAdminAllowedPath(String path) { return path.startsWith("/admin/auth/") || path.equals("/admin/user/info") @@ -161,6 +217,10 @@ public class AuthInterceptor implements HandlerInterceptor { || path.startsWith("/admin/shops/"); } + /** + * Purpose: writeJsonResponse supports AuthInterceptor.java by holding or executing the write json response business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void writeJsonResponse(HttpServletResponse response, int status, String message) throws Exception { response.setStatus(status); response.setContentType("application/json;charset=UTF-8"); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientConfig.java index 2324055e..b00ff1c8 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientConfig.java @@ -12,9 +12,17 @@ import org.springframework.web.client.RestTemplate; import java.util.concurrent.TimeUnit; @Configuration +/** + * Purpose: HttpClientConfig supports HttpClientConfig.java by holding or executing the http client config business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class HttpClientConfig { @Bean + /** + * Purpose: poolingHttpClientConnectionManager supports HttpClientConfig.java by holding or executing the pooling http client connection manager business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public PoolingHttpClientConnectionManager poolingHttpClientConnectionManager(HttpClientProperties properties) { PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); connectionManager.setMaxTotal(properties.getMaxTotalConnections()); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientProperties.java index 38cc5278..4f22d618 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/HttpClientProperties.java @@ -7,15 +7,39 @@ import org.springframework.context.annotation.Configuration; @Data @Configuration @ConfigurationProperties(prefix = "yuminail.http-client") +/** + * Purpose: HttpClientProperties supports HttpClientProperties.java by holding or executing the http client properties business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class HttpClientProperties { + /** + * Purpose: connectTimeoutMs supports HttpClientProperties.java by holding or executing the connect timeout ms business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int connectTimeoutMs = 3000; + /** + * Purpose: readTimeoutMs supports HttpClientProperties.java by holding or executing the read timeout ms business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int readTimeoutMs = 5000; + /** + * Purpose: connectionRequestTimeoutMs supports HttpClientProperties.java by holding or executing the connection request timeout ms business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int connectionRequestTimeoutMs = 1000; + /** + * Purpose: maxTotalConnections supports HttpClientProperties.java by holding or executing the max total connections business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int maxTotalConnections = 200; + /** + * Purpose: maxConnectionsPerRoute supports HttpClientProperties.java by holding or executing the max connections per route business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int maxConnectionsPerRoute = 50; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/JacksonConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/JacksonConfig.java index 3c2638ca..aa4ab665 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/JacksonConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/JacksonConfig.java @@ -14,9 +14,17 @@ import java.io.IOException; import java.time.format.DateTimeFormatter; @Configuration +/** + * Purpose: JacksonConfig supports JacksonConfig.java by holding or executing the jackson config business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class JacksonConfig { @Bean + /** + * Purpose: longToStringJacksonCustomizer supports JacksonConfig.java by holding or executing the long to string jackson customizer business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Jackson2ObjectMapperBuilderCustomizer longToStringJacksonCustomizer() { return builder -> { // Snowflake IDs are serialized as strings so the web and mini program do not lose precision. @@ -29,10 +37,18 @@ public class JacksonConfig { }; } + /** + * Purpose: FlexibleLocalDateTimeDeserializer supports JacksonConfig.java by holding or executing the flexible local date time deserializer business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static class FlexibleLocalDateTimeDeserializer extends JsonDeserializer { private static final DateTimeFormatter SPACE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); @Override + /** + * Purpose: deserialize supports JacksonConfig.java by holding or executing the deserialize business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public LocalDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { String value = parser.getValueAsString(); if (value == null || value.trim().isEmpty()) { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/LoginLockProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/LoginLockProperties.java index ff5ba5a0..9f2c4ed9 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/LoginLockProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/LoginLockProperties.java @@ -7,11 +7,27 @@ import org.springframework.context.annotation.Configuration; @Data @Configuration @ConfigurationProperties(prefix = "yuminail.security.login-lock") +/** + * Purpose: LoginLockProperties supports LoginLockProperties.java by holding or executing the login lock properties business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class LoginLockProperties { + /** + * Purpose: maxFailures supports LoginLockProperties.java by holding or executing the max failures business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int maxFailures = 5; + /** + * Purpose: windowSeconds supports LoginLockProperties.java by holding or executing the window seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long windowSeconds = 600; + /** + * Purpose: lockSeconds supports LoginLockProperties.java by holding or executing the lock seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long lockSeconds = 900; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MinioConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MinioConfig.java index c34c42ef..d57f6a2f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MinioConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MinioConfig.java @@ -9,14 +9,38 @@ import org.springframework.context.annotation.Configuration; @Data @Configuration @ConfigurationProperties(prefix = "minio") +/** + * Purpose: MinioConfig supports MinioConfig.java by holding or executing the minio config business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class MinioConfig { + /** + * Purpose: endpoint supports MinioConfig.java by holding or executing the endpoint business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String endpoint; + /** + * Purpose: accessKey supports MinioConfig.java by holding or executing the access key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String accessKey; + /** + * Purpose: secretKey supports MinioConfig.java by holding or executing the secret key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String secretKey; + /** + * Purpose: bucketName supports MinioConfig.java by holding or executing the bucket name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String bucketName; @Bean + /** + * Purpose: minioClient supports MinioConfig.java by holding or executing the minio client business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public MinioClient minioClient() { return MinioClient.builder() .endpoint(endpoint) diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyBatisPlusConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyBatisPlusConfig.java index 81dca31b..9e6672ee 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyBatisPlusConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyBatisPlusConfig.java @@ -42,14 +42,26 @@ public class MyBatisPlusConfig { } @Bean + /** + * Purpose: identifierGenerator supports MyBatisPlusConfig.java by holding or executing the identifier generator business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public IdentifierGenerator identifierGenerator(TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator) { return new IdentifierGenerator() { @Override + /** + * Purpose: nextId supports MyBatisPlusConfig.java by holding or executing the next id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Number nextId(Object entity) { return snowflakeIdGenerator.nextId(); } @Override + /** + * Purpose: nextUUID supports MyBatisPlusConfig.java by holding or executing the next uuid business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String nextUUID(Object entity) { return snowflakeIdGenerator.nextIdString(); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyMetaObjectHandler.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyMetaObjectHandler.java index f2d3cbb0..00510b8d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyMetaObjectHandler.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/MyMetaObjectHandler.java @@ -19,6 +19,10 @@ import java.time.LocalDateTime; public class MyMetaObjectHandler implements MetaObjectHandler { @Override + /** + * Purpose: insertFill supports MyMetaObjectHandler.java by holding or executing the insert fill business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void insertFill(MetaObject metaObject) { log.info("start insert fill ...."); this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now()); @@ -26,6 +30,10 @@ public class MyMetaObjectHandler implements MetaObjectHandler { } @Override + /** + * Purpose: updateFill supports MyMetaObjectHandler.java by holding or executing the update fill business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void updateFill(MetaObject metaObject) { log.info("start update fill ...."); this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RabbitMQConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RabbitMQConfig.java index 86698fc7..71c82516 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RabbitMQConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RabbitMQConfig.java @@ -29,20 +29,40 @@ public class RabbitMQConfig { // 示例队列和交换机配置,方便后续扩展 public static final String EXAMPLE_QUEUE = "yuminail.example.queue"; + /** + * Purpose: EXAMPLE_EXCHANGE supports RabbitMQConfig.java by holding or executing the example exchange business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String EXAMPLE_EXCHANGE = "yuminail.example.exchange"; + /** + * Purpose: EXAMPLE_ROUTING_KEY supports RabbitMQConfig.java by holding or executing the example routing key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String EXAMPLE_ROUTING_KEY = "yuminail.example.routing.key"; @Bean + /** + * Purpose: exampleQueue supports RabbitMQConfig.java by holding or executing the example queue business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Queue exampleQueue() { return new Queue(EXAMPLE_QUEUE, true); } @Bean + /** + * Purpose: exampleExchange supports RabbitMQConfig.java by holding or executing the example exchange business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public DirectExchange exampleExchange() { return new DirectExchange(EXAMPLE_EXCHANGE); } @Bean + /** + * Purpose: exampleBinding supports RabbitMQConfig.java by holding or executing the example binding business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Binding exampleBinding() { return BindingBuilder.bind(exampleQueue()).to(exampleExchange()).with(EXAMPLE_ROUTING_KEY); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RateLimitProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RateLimitProperties.java index c85d146a..e466a761 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RateLimitProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RateLimitProperties.java @@ -29,8 +29,20 @@ public class RateLimitProperties { private LimitRule orderCreate = new LimitRule(10, 60); @Data + /** + * Purpose: LimitRule supports RateLimitProperties.java by holding or executing the limit rule business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class LimitRule { + /** + * Purpose: limit supports RateLimitProperties.java by holding or executing the limit business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private int limit; + /** + * Purpose: windowSeconds supports RateLimitProperties.java by holding or executing the window seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long windowSeconds; public LimitRule() { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RedisConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RedisConfig.java index 10a2b7e4..7a9822ae 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RedisConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/RedisConfig.java @@ -24,6 +24,10 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; public class RedisConfig extends CachingConfigurerSupport { @Bean + /** + * Purpose: redisTemplate supports RedisConfig.java by holding or executing the redis template business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public RedisTemplate redisTemplate(RedisConnectionFactory factory) { RedisTemplate template = new RedisTemplate<>(); template.setConnectionFactory(factory); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SecurityHeadersFilter.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SecurityHeadersFilter.java index 80dac6f5..82fd42c5 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SecurityHeadersFilter.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SecurityHeadersFilter.java @@ -11,9 +11,17 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Component +/** + * Purpose: SecurityHeadersFilter supports SecurityHeadersFilter.java by holding or executing the security headers filter business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SecurityHeadersFilter implements Filter { @Override + /** + * Purpose: doFilter supports SecurityHeadersFilter.java by holding or executing the do filter business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (response instanceof HttpServletResponse httpResponse) { httpResponse.setHeader("X-Content-Type-Options", "nosniff"); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLogProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLogProperties.java index f80359f4..b1bf1ec4 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLogProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLogProperties.java @@ -7,11 +7,27 @@ import org.springframework.context.annotation.Configuration; @Data @Configuration @ConfigurationProperties(prefix = "yuminail.slow-request") +/** + * Purpose: SlowRequestLogProperties supports SlowRequestLogProperties.java by holding or executing the slow request log properties business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SlowRequestLogProperties { + /** + * Purpose: enabled supports SlowRequestLogProperties.java by holding or executing the enabled business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean enabled = true; + /** + * Purpose: thresholdMs supports SlowRequestLogProperties.java by holding or executing the threshold ms business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long thresholdMs = 300; + /** + * Purpose: logResponseHeaderRequestId supports SlowRequestLogProperties.java by holding or executing the log response header request id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean logResponseHeaderRequestId = true; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLoggingInterceptor.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLoggingInterceptor.java index d6a1a26d..f22e55d9 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLoggingInterceptor.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/SlowRequestLoggingInterceptor.java @@ -14,13 +14,25 @@ import javax.servlet.http.HttpServletResponse; import java.util.UUID; @Component +/** + * Purpose: SlowRequestLoggingInterceptor supports SlowRequestLoggingInterceptor.java by holding or executing the slow request logging interceptor business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { + /** + * Purpose: REQUEST_ID_HEADER supports SlowRequestLoggingInterceptor.java by holding or executing the request id header business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String REQUEST_ID_HEADER = "X-Request-Id"; private static final String START_TIME_ATTRIBUTE = SlowRequestLoggingInterceptor.class.getName() + ".startTime"; private static final Logger SLOW_REQUEST_LOGGER = LoggerFactory.getLogger("core-slow"); + /** + * Purpose: properties supports SlowRequestLoggingInterceptor.java by holding or executing the properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SlowRequestLogProperties properties; public SlowRequestLoggingInterceptor(SlowRequestLogProperties properties) { @@ -28,6 +40,10 @@ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { } @Override + /** + * Purpose: preHandle supports SlowRequestLoggingInterceptor.java by holding or executing the pre handle business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { String requestId = resolveRequestId(request); request.setAttribute(REQUEST_ID_HEADER, requestId); @@ -41,6 +57,10 @@ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { } @Override + /** + * Purpose: afterCompletion supports SlowRequestLoggingInterceptor.java by holding or executing the after completion business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) { if (!properties.isEnabled()) { return; @@ -79,11 +99,19 @@ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { ); } + /** + * Purpose: resolveRequestId supports SlowRequestLoggingInterceptor.java by holding or executing the resolve request id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveRequestId(HttpServletRequest request) { String requestId = request.getHeader(REQUEST_ID_HEADER); return StringUtils.hasText(requestId) ? requestId.trim() : UUID.randomUUID().toString().replace("-", ""); } + /** + * Purpose: resolveControllerMethod supports SlowRequestLoggingInterceptor.java by holding or executing the resolve controller method business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveControllerMethod(Object handler) { if (handler instanceof HandlerMethod handlerMethod) { return handlerMethod.getBeanType().getSimpleName() + "#" + handlerMethod.getMethod().getName(); @@ -91,6 +119,10 @@ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { return ""; } + /** + * Purpose: resolveClientIp supports SlowRequestLoggingInterceptor.java by holding or executing the resolve client ip business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveClientIp(HttpServletRequest request) { String forwarded = request.getHeader("X-Forwarded-For"); if (StringUtils.hasText(forwarded)) { @@ -103,6 +135,10 @@ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { return request.getRemoteAddr(); } + /** + * Purpose: sanitize supports SlowRequestLoggingInterceptor.java by holding or executing the sanitize business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String sanitize(String value) { if (!StringUtils.hasText(value)) { return ""; @@ -110,14 +146,26 @@ public class SlowRequestLoggingInterceptor implements HandlerInterceptor { return value.replace('\n', '_').replace('\r', '_'); } + /** + * Purpose: toStringValue supports SlowRequestLoggingInterceptor.java by holding or executing the to string value business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String toStringValue(Object value) { return value == null ? "" : value.toString(); } + /** + * Purpose: castLong supports SlowRequestLoggingInterceptor.java by holding or executing the cast long business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long castLong(Object value) { return value instanceof Long ? (Long) value : null; } + /** + * Purpose: castInteger supports SlowRequestLoggingInterceptor.java by holding or executing the cast integer business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer castInteger(Object value) { return value instanceof Integer ? (Integer) value : null; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/UploadSecurityProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/UploadSecurityProperties.java index 670a5ee7..568e3aba 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/UploadSecurityProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/UploadSecurityProperties.java @@ -10,8 +10,16 @@ import java.util.List; @Data @Configuration @ConfigurationProperties(prefix = "yuminail.security.upload") +/** + * Purpose: UploadSecurityProperties supports UploadSecurityProperties.java by holding or executing the upload security properties business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class UploadSecurityProperties { + /** + * Purpose: maxSize supports UploadSecurityProperties.java by holding or executing the max size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long maxSize = 10 * 1024 * 1024; private List allowedMimeTypes = new ArrayList<>(List.of( diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WebMvcConfig.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WebMvcConfig.java index 3d851d7f..6b5bec46 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WebMvcConfig.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WebMvcConfig.java @@ -7,12 +7,28 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration @RequiredArgsConstructor +/** + * Purpose: WebMvcConfig supports WebMvcConfig.java by holding or executing the web mvc config business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class WebMvcConfig implements WebMvcConfigurer { + /** + * Purpose: authInterceptor supports WebMvcConfig.java by holding or executing the auth interceptor business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final AuthInterceptor authInterceptor; + /** + * Purpose: slowRequestLoggingInterceptor supports WebMvcConfig.java by holding or executing the slow request logging interceptor business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SlowRequestLoggingInterceptor slowRequestLoggingInterceptor; @Override + /** + * Purpose: addInterceptors supports WebMvcConfig.java by holding or executing the add interceptors business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(slowRequestLoggingInterceptor) .addPathPatterns("/**") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WechatMiniProperties.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WechatMiniProperties.java index ed63e59d..3f5a4df5 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WechatMiniProperties.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/config/WechatMiniProperties.java @@ -12,9 +12,29 @@ import org.springframework.context.annotation.Configuration; @ConfigurationProperties(prefix = "yuminail.wechat.mini") public class WechatMiniProperties { + /** + * Purpose: appId supports WechatMiniProperties.java by holding or executing the app id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String appId; + /** + * Purpose: appSecret supports WechatMiniProperties.java by holding or executing the app secret business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String appSecret; + /** + * Purpose: code2sessionUrl supports WechatMiniProperties.java by holding or executing the code2session url business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String code2sessionUrl = "https://api.weixin.qq.com/sns/jscode2session"; + /** + * Purpose: phoneNumberUrl supports WechatMiniProperties.java by holding or executing the phone number url business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String phoneNumberUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber"; + /** + * Purpose: accessTokenBufferSeconds supports WechatMiniProperties.java by holding or executing the access token buffer seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer accessTokenBufferSeconds = 60; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminAuthController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminAuthController.java index 78bd8840..0c3bd421 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminAuthController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminAuthController.java @@ -34,6 +34,10 @@ public class AdminAuthController { * Variable `requestThrottleService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final RequestThrottleService requestThrottleService; + /** + * Purpose: securityAuditLogService supports AdminAuthController.java by holding or executing the security audit log service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogService securityAuditLogService; @PostMapping("/login") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminLegalAgreementController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminLegalAgreementController.java index e0e3b4a1..b3ab53fe 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminLegalAgreementController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminLegalAgreementController.java @@ -19,14 +19,34 @@ import java.util.List; @RestController @RequiredArgsConstructor @RequestMapping("/admin/legal-agreement") +/** + * Purpose: AdminLegalAgreementController supports AdminLegalAgreementController.java by holding or executing the admin legal agreement controller business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class AdminLegalAgreementController { + /** + * Purpose: legalAgreementService supports AdminLegalAgreementController.java by holding or executing the legal agreement service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final LegalAgreementService legalAgreementService; + /** + * Purpose: adminScopeHelper supports AdminLegalAgreementController.java by holding or executing the admin scope helper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final AdminScopeHelper adminScopeHelper; + /** + * Purpose: securityAuditLogService supports AdminLegalAgreementController.java by holding or executing the security audit log service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogService securityAuditLogService; @GetMapping("/list") @RequirePermission("legal_agreement:manage") + /** + * Purpose: list supports AdminLegalAgreementController.java by holding or executing the list business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> list(HttpServletRequest request) { return Result.success(legalAgreementService.listAdminAgreements(adminScopeHelper.getCurrentUser(request))); } @@ -34,6 +54,10 @@ public class AdminLegalAgreementController { @PostMapping("/create") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "admin-legal-agreement-create", ttlSeconds = 8, message = "协议保存处理中,请勿重复提交") + /** + * Purpose: create supports AdminLegalAgreementController.java by holding or executing the create business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result create(HttpServletRequest request, @Valid @RequestBody LegalAgreementDTO dto) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Long id = legalAgreementService.createAgreement(currentUser, dto); @@ -44,6 +68,10 @@ public class AdminLegalAgreementController { @PutMapping("/{id}") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "admin-legal-agreement-update", ttlSeconds = 8, message = "协议保存处理中,请勿重复提交") + /** + * Purpose: update supports AdminLegalAgreementController.java by holding or executing the update business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result update(HttpServletRequest request, @PathVariable Long id, @Valid @RequestBody LegalAgreementDTO dto) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Boolean result = legalAgreementService.updateAgreement(currentUser, id, dto); @@ -54,6 +82,10 @@ public class AdminLegalAgreementController { @PutMapping("/{id}/publish") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "admin-legal-agreement-publish", ttlSeconds = 8, message = "协议发布处理中,请勿重复提交") + /** + * Purpose: publish supports AdminLegalAgreementController.java by holding or executing the publish business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result publish(HttpServletRequest request, @PathVariable Long id) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Boolean result = legalAgreementService.publishAgreement(currentUser, id); @@ -64,6 +96,10 @@ public class AdminLegalAgreementController { @PutMapping("/{id}/disable") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "admin-legal-agreement-disable", ttlSeconds = 8, message = "协议停用处理中,请勿重复提交") + /** + * Purpose: disable supports AdminLegalAgreementController.java by holding or executing the disable business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result disable(HttpServletRequest request, @PathVariable Long id) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Boolean result = legalAgreementService.disableAgreement(currentUser, id); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminNailArtistController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminNailArtistController.java index 8f32e65e..139429ab 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminNailArtistController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminNailArtistController.java @@ -27,8 +27,20 @@ import java.util.List; */ public class AdminNailArtistController { + /** + * Purpose: USER_NOT_FOUND_MESSAGE supports AdminNailArtistController.java by holding or executing the user not found message business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String USER_NOT_FOUND_MESSAGE = "用户信息不存在"; + /** + * Purpose: VIEW_SCOPE_MESSAGE supports AdminNailArtistController.java by holding or executing the view scope message business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String VIEW_SCOPE_MESSAGE = "当前登录店铺无权查看该美甲师,请切换到所属店铺后重试"; + /** + * Purpose: EDIT_SCOPE_MESSAGE supports AdminNailArtistController.java by holding or executing the edit scope message business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String EDIT_SCOPE_MESSAGE = "当前登录店铺无权编辑该美甲师,请切换到所属店铺后重试"; /** * Variable `nailArtistInfoService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminOrderController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminOrderController.java index efca13e2..867bb65c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminOrderController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminOrderController.java @@ -85,6 +85,10 @@ public class AdminOrderController { @GetMapping("/detail/{id}") @RequirePermission("order:view") + /** + * Purpose: getOrderDetail supports AdminOrderController.java by holding or executing the get order detail business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result getOrderDetail(HttpServletRequest request, @PathVariable Long id) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); List allOrders; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminPermissionController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminPermissionController.java index 5c302b81..d7c26224 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminPermissionController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminPermissionController.java @@ -38,6 +38,10 @@ public class AdminPermissionController { * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final AdminScopeHelper adminScopeHelper; + /** + * Purpose: securityAuditSupport supports AdminPermissionController.java by holding or executing the security audit support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditSupport securityAuditSupport; @PostMapping("/create") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminSecurityAuditController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminSecurityAuditController.java index 1c9b95ff..590940ad 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminSecurityAuditController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminSecurityAuditController.java @@ -19,10 +19,18 @@ import java.time.format.DateTimeParseException; @RestController @RequestMapping("/admin/security-audit") @RequiredArgsConstructor +/** + * Purpose: AdminSecurityAuditController supports AdminSecurityAuditController.java by holding or executing the admin security audit controller business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class AdminSecurityAuditController { private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + /** + * Purpose: securityAuditLogService supports AdminSecurityAuditController.java by holding or executing the security audit log service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogService securityAuditLogService; @GetMapping("/logs") @@ -46,6 +54,10 @@ public class AdminSecurityAuditController { )); } + /** + * Purpose: parseDateTime supports AdminSecurityAuditController.java by holding or executing the parse date time business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime parseDateTime(String value) { if (!StringUtils.hasText(value)) { return null; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopController.java index 61b30656..9509288d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopController.java @@ -34,6 +34,10 @@ public class AdminShopController { * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final AdminScopeHelper adminScopeHelper; + /** + * Purpose: securityAuditSupport supports AdminShopController.java by holding or executing the security audit support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditSupport securityAuditSupport; @GetMapping("/list") @@ -177,7 +181,15 @@ public class AdminShopController { } @Data + /** + * Purpose: StatusRequest supports AdminShopController.java by holding or executing the status request business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class StatusRequest { + /** + * Purpose: status supports AdminShopController.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; } } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopRoleController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopRoleController.java index 089adb97..cfccea8a 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopRoleController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminShopRoleController.java @@ -134,6 +134,10 @@ public class AdminShopRoleController { @GetMapping("/invite-code/list") @RequirePermission("user:relation:view") + /** + * Purpose: listInviteCodes supports AdminShopRoleController.java by holding or executing the list invite codes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listInviteCodes(HttpServletRequest request, @RequestParam(required = false) Long shopId) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); return Result.success(shopRoleService.listInviteCodes(currentUser, shopId)); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminUserController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminUserController.java index 796098e9..7d1ddb06 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminUserController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/AdminUserController.java @@ -58,6 +58,10 @@ public class AdminUserController { * Variable `bookableArtistSupport`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final BookableArtistSupport bookableArtistSupport; + /** + * Purpose: securityAuditSupport supports AdminUserController.java by holding or executing the security audit support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditSupport securityAuditSupport; @GetMapping("/list") @@ -119,6 +123,10 @@ public class AdminUserController { @GetMapping("/relation/options") @RequirePermission("user:relation:view") + /** + * Purpose: relationOptions supports AdminUserController.java by holding or executing the relation options business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> relationOptions(HttpServletRequest request, @RequestParam(required = false) Long shopId) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); return Result.success(shopRoleService.listRelationOptions(currentUser, shopId)); @@ -497,7 +505,15 @@ public class AdminUserController { } @Data + /** + * Purpose: StatusRequest supports AdminUserController.java by holding or executing the status request business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class StatusRequest { + /** + * Purpose: status supports AdminUserController.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; } } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/CartController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/CartController.java index 67e7049e..0c2e21d2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/CartController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/CartController.java @@ -21,6 +21,10 @@ import java.util.List; public class CartController { @Resource + /** + * Purpose: cartService supports CartController.java by holding or executing the cart service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private CartService cartService; @PostMapping("/add") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ContactInfoController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ContactInfoController.java index f03c9503..9f84fde7 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ContactInfoController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ContactInfoController.java @@ -49,6 +49,10 @@ public class ContactInfoController { } @GetMapping("/order/{orderId}/artist") + /** + * Purpose: orderArtist supports ContactInfoController.java by holding or executing the order artist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result orderArtist(HttpServletRequest request, @PathVariable Long orderId, @RequestParam(required = false) Long artistId) { Long userId = (Long) request.getAttribute("userId"); return Result.success(contactInfoService.getOrderArtistContact(userId, orderId, artistId)); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/DashboardController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/DashboardController.java index b0fbfffa..2843bfd1 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/DashboardController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/DashboardController.java @@ -193,6 +193,10 @@ public class DashboardController { return currentUser.getShopId(); } + /** + * Purpose: countUsers supports DashboardController.java by holding or executing the count users business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long countUsers(Long shopId, Integer type, LocalDateTime from, LocalDateTime to) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); if (type != null) { @@ -214,10 +218,18 @@ public class DashboardController { return userMapper.selectCount(wrapper); } + /** + * Purpose: countOrders supports DashboardController.java by holding or executing the count orders business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long countOrders(Long shopId, Long artistId, Integer status, LocalDateTime from, LocalDateTime to) { return (long) listScopedOrders(shopId, artistId, status, from, to).size(); } + /** + * Purpose: sumOrderAmount supports DashboardController.java by holding or executing the sum order amount business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal sumOrderAmount(Long shopId, Long artistId, LocalDateTime from, LocalDateTime to) { return listScopedOrders(shopId, artistId, null, from, to).stream() .map(order -> order.getActualAmount() != null ? order.getActualAmount() : order.getTotalAmount()) @@ -225,6 +237,10 @@ public class DashboardController { .reduce(BigDecimal.ZERO, BigDecimal::add); } + /** + * Purpose: listScopedOrders supports DashboardController.java by holding or executing the list scoped orders business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private List listScopedOrders(Long shopId, Long artistId, Integer status, LocalDateTime from, LocalDateTime to) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); if (shopId != null) { @@ -249,6 +265,10 @@ public class DashboardController { return orderMapper.selectList(wrapper); } + /** + * Purpose: listOrderIdsByArtist supports DashboardController.java by holding or executing the list order ids by artist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Set listOrderIdsByArtist(Long artistId) { List items = orderItemMapper.selectList(new LambdaQueryWrapper() .select(OrderItemDO::getOrderId) diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/FrontendFileController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/FrontendFileController.java index d316651f..f16052cf 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/FrontendFileController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/FrontendFileController.java @@ -34,8 +34,20 @@ public class FrontendFileController { * Variable `objectStorageUrlSupport`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final ObjectStorageUrlSupport objectStorageUrlSupport; + /** + * Purpose: productMapper supports FrontendFileController.java by holding or executing the product mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final ProductMapper productMapper; + /** + * Purpose: shopMapper supports FrontendFileController.java by holding or executing the shop mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final ShopMapper shopMapper; + /** + * Purpose: effectDiagramMapper supports FrontendFileController.java by holding or executing the effect diagram mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final EffectDiagramMapper effectDiagramMapper; /** @@ -70,6 +82,10 @@ public class FrontendFileController { } } + /** + * Purpose: isPublicFileReference supports FrontendFileController.java by holding or executing the is public file reference business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isPublicFileReference(Long fileId) { if (fileId == null) { return false; @@ -79,6 +95,10 @@ public class FrontendFileController { || positive(effectDiagramMapper.countPublicImageReference(fileId)); } + /** + * Purpose: positive supports FrontendFileController.java by holding or executing the positive business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean positive(Long count) { return count != null && count > 0; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/LegalAgreementController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/LegalAgreementController.java index d2b53507..f0d97ba0 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/LegalAgreementController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/LegalAgreementController.java @@ -21,20 +21,48 @@ import java.util.List; @RestController @RequiredArgsConstructor @RequestMapping({"/legal-agreement", "/api/legal-agreement"}) +/** + * Purpose: LegalAgreementController supports LegalAgreementController.java by holding or executing the legal agreement controller business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class LegalAgreementController { + /** + * Purpose: legalAgreementService supports LegalAgreementController.java by holding or executing the legal agreement service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final LegalAgreementService legalAgreementService; + /** + * Purpose: adminScopeHelper supports LegalAgreementController.java by holding or executing the admin scope helper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final AdminScopeHelper adminScopeHelper; + /** + * Purpose: securityAuditLogService supports LegalAgreementController.java by holding or executing the security audit log service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogService securityAuditLogService; + /** + * Purpose: requestThrottleService supports LegalAgreementController.java by holding or executing the request throttle service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final RequestThrottleService requestThrottleService; @GetMapping("/current") + /** + * Purpose: listCurrent supports LegalAgreementController.java by holding or executing the list current business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listCurrent(HttpServletRequest request) { requestThrottleService.checkAgreementRead(request, "ALL"); return Result.success(legalAgreementService.listCurrentAgreements()); } @GetMapping("/current/{type}") + /** + * Purpose: getCurrent supports LegalAgreementController.java by holding or executing the get current business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result getCurrent(HttpServletRequest request, @PathVariable String type) { requestThrottleService.checkAgreementRead(request, type); return Result.success(legalAgreementService.getCurrentAgreement(type)); @@ -42,6 +70,10 @@ public class LegalAgreementController { @GetMapping("/admin/list") @RequirePermission("legal_agreement:manage") + /** + * Purpose: listAdmin supports LegalAgreementController.java by holding or executing the list admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listAdmin(HttpServletRequest request) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); return Result.success(legalAgreementService.listAdminAgreements(currentUser)); @@ -50,6 +82,10 @@ public class LegalAgreementController { @PostMapping("/admin/create") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "legal-agreement-create", ttlSeconds = 8, message = "协议保存处理中,请勿重复提交") + /** + * Purpose: create supports LegalAgreementController.java by holding or executing the create business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result create(HttpServletRequest request, @Valid @RequestBody LegalAgreementDTO dto) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Long id = legalAgreementService.createAgreement(currentUser, dto); @@ -60,6 +96,10 @@ public class LegalAgreementController { @PutMapping("/admin/{id}") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "legal-agreement-update", ttlSeconds = 8, message = "协议保存处理中,请勿重复提交") + /** + * Purpose: update supports LegalAgreementController.java by holding or executing the update business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result update(HttpServletRequest request, @PathVariable Long id, @Valid @RequestBody LegalAgreementDTO dto) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Boolean result = legalAgreementService.updateAgreement(currentUser, id, dto); @@ -70,6 +110,10 @@ public class LegalAgreementController { @PutMapping("/admin/{id}/publish") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "legal-agreement-publish", ttlSeconds = 8, message = "协议发布处理中,请勿重复提交") + /** + * Purpose: publish supports LegalAgreementController.java by holding or executing the publish business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result publish(HttpServletRequest request, @PathVariable Long id) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Boolean result = legalAgreementService.publishAgreement(currentUser, id); @@ -80,6 +124,10 @@ public class LegalAgreementController { @PutMapping("/admin/{id}/disable") @RequirePermission("legal_agreement:manage") @OperationGuard(action = "legal-agreement-disable", ttlSeconds = 8, message = "协议停用处理中,请勿重复提交") + /** + * Purpose: disable supports LegalAgreementController.java by holding or executing the disable business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result disable(HttpServletRequest request, @PathVariable Long id) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); Boolean result = legalAgreementService.disableAgreement(currentUser, id); @@ -88,6 +136,10 @@ public class LegalAgreementController { } @GetMapping("/user/agreement-consent/me") + /** + * Purpose: getMyConsent supports LegalAgreementController.java by holding or executing the get my consent business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result getMyConsent(HttpServletRequest request) { Long userId = (Long) request.getAttribute("userId"); return Result.success(legalAgreementService.getMyConsent(userId)); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/NailArtistController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/NailArtistController.java index fa62db1b..25d58f7f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/NailArtistController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/NailArtistController.java @@ -19,6 +19,10 @@ import java.util.List; public class NailArtistController { @Autowired + /** + * Purpose: nailArtistInfoService supports NailArtistController.java by holding or executing the nail artist info service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private NailArtistInfoService nailArtistInfoService; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ObjectStorageFileController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ObjectStorageFileController.java index b5e2d925..9e1e8e5e 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ObjectStorageFileController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ObjectStorageFileController.java @@ -60,6 +60,10 @@ public class ObjectStorageFileController { * Variable `snowflakeIdGenerator`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator; + /** + * Purpose: uploadSecurityValidator supports ObjectStorageFileController.java by holding or executing the upload security validator business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UploadSecurityValidator uploadSecurityValidator; @PostMapping("/upload/init") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/OrderController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/OrderController.java index b06ad977..6433bcd6 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/OrderController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/OrderController.java @@ -33,12 +33,24 @@ import java.util.List; public class OrderController { @Resource + /** + * Purpose: orderService supports OrderController.java by holding or executing the order service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderService orderService; @Resource + /** + * Purpose: userService supports OrderController.java by holding or executing the user service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserService userService; @Resource + /** + * Purpose: securityAuditSupport supports OrderController.java by holding or executing the security audit support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private SecurityAuditSupport securityAuditSupport; @PostMapping("/create") @@ -278,12 +290,20 @@ public class OrderController { } @GetMapping("/review/my-pending") + /** + * Purpose: listMyPendingReviews supports OrderController.java by holding or executing the list my pending reviews business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listMyPendingReviews(HttpServletRequest request) { Long userId = (Long) request.getAttribute("userId"); return Result.success(orderService.listMyPendingReviews(userId)); } @GetMapping("/{orderId}/reviews") + /** + * Purpose: listOrderReviews supports OrderController.java by holding or executing the list order reviews business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listOrderReviews(@PathVariable Long orderId, HttpServletRequest request) { Long userId = (Long) request.getAttribute("userId"); Integer userType = (Integer) request.getAttribute("userType"); @@ -319,6 +339,10 @@ public class OrderController { } @GetMapping("/artist-change/my-pending") + /** + * Purpose: listMyPendingArtistChangeRequests supports OrderController.java by holding or executing the list my pending artist change requests business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listMyPendingArtistChangeRequests(HttpServletRequest request) { Long userId = (Long) request.getAttribute("userId"); Integer userType = (Integer) request.getAttribute("userType"); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ProductController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ProductController.java index e20414c5..300d632d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ProductController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ProductController.java @@ -26,7 +26,15 @@ import java.util.List; * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. */ public class ProductController { + /** + * Purpose: AUTHORIZATION_HEADER supports ProductController.java by holding or executing the authorization header business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String AUTHORIZATION_HEADER = "Authorization"; + /** + * Purpose: BEARER_PREFIX supports ProductController.java by holding or executing the bearer prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String BEARER_PREFIX = "Bearer "; /** @@ -37,8 +45,20 @@ public class ProductController { * Variable `adminScopeHelper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final AdminScopeHelper adminScopeHelper; + /** + * Purpose: jwtUtil supports ProductController.java by holding or executing the jwt util business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final JwtUtil jwtUtil; + /** + * Purpose: userSessionService supports ProductController.java by holding or executing the user session service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserSessionService userSessionService; + /** + * Purpose: userShopBindingSupport supports ProductController.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserShopBindingSupport userShopBindingSupport; @PostMapping("/create") @@ -151,6 +171,10 @@ public class ProductController { } @GetMapping("/list/search") + /** + * Purpose: searchProducts supports ProductController.java by holding or executing the search products business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> searchProducts(HttpServletRequest request, @RequestParam("keyword") String keyword) { List productVOs = productService.searchProducts(keyword, resolveOptionalCurrentShopId(request)); return Result.success(productVOs); @@ -165,6 +189,10 @@ public class ProductController { return Result.success(productService.pagePublicProducts(page, size, keyword, tag, resolveOptionalCurrentShopId(request))); } + /** + * Purpose: resolveOptionalCurrentShopId supports ProductController.java by holding or executing the resolve optional current shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long resolveOptionalCurrentShopId(HttpServletRequest request) { if (request == null) { return null; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ShopController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ShopController.java index 9ecc63f3..50810546 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ShopController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/ShopController.java @@ -175,7 +175,15 @@ public class ShopController { } @Data + /** + * Purpose: StatusRequest supports ShopController.java by holding or executing the status request business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class StatusRequest { + /** + * Purpose: status supports ShopController.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; } } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/SystemParameterConfigController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/SystemParameterConfigController.java index d0a005ae..28c7ce0e 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/SystemParameterConfigController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/SystemParameterConfigController.java @@ -20,9 +20,21 @@ import java.util.Map; @RestController @RequiredArgsConstructor @RequestMapping({"/system-parameter-config", "/api/system-parameter-config", "/admin/system-parameter-config"}) +/** + * Purpose: SystemParameterConfigController supports SystemParameterConfigController.java by holding or executing the system parameter config controller business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SystemParameterConfigController { + /** + * Purpose: configService supports SystemParameterConfigController.java by holding or executing the config service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SystemParameterConfigService configService; + /** + * Purpose: adminScopeHelper supports SystemParameterConfigController.java by holding or executing the admin scope helper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final AdminScopeHelper adminScopeHelper; @GetMapping("/admin/list") @@ -36,12 +48,20 @@ public class SystemParameterConfigController { @PostMapping("/admin/save") @RequirePermission("messagehub:config:manage") @OperationGuard(action = "system-parameter-config-save", ttlSeconds = 8, message = "系统参数保存处理中,请勿重复提交") + /** + * Purpose: save supports SystemParameterConfigController.java by holding or executing the save business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result save(HttpServletRequest request, @Valid @RequestBody SystemParameterConfigDTO dto) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); return Result.success(configService.saveConfig(currentUser, dto)); } @GetMapping("/admin/tencent-map") + /** + * Purpose: getTencentMapKey supports SystemParameterConfigController.java by holding or executing the get tencent map key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> getTencentMapKey(HttpServletRequest request) { adminScopeHelper.getCurrentUser(request); Map result = new HashMap<>(); @@ -50,6 +70,10 @@ public class SystemParameterConfigController { } @GetMapping("/admin/map-config") + /** + * Purpose: getMapConfig supports SystemParameterConfigController.java by holding or executing the get map config business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> getMapConfig(HttpServletRequest request) { adminScopeHelper.getCurrentUser(request); Map result = new HashMap<>(); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/UserController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/UserController.java index fdad2d1e..28e2e47b 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/UserController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/UserController.java @@ -100,7 +100,15 @@ public class UserController { * Variable `requestThrottleService`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final RequestThrottleService requestThrottleService; + /** + * Purpose: legalAgreementService supports UserController.java by holding or executing the legal agreement service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final LegalAgreementService legalAgreementService; + /** + * Purpose: securityAuditLogService supports UserController.java by holding or executing the security audit log service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogService securityAuditLogService; /** @@ -749,6 +757,10 @@ public class UserController { @PostMapping("/upload-avatar") @OperationGuard(action = "user-avatar-upload", ttlSeconds = 30, message = "上传处理中,请勿重复操作") + /** + * Purpose: uploadAvatar supports UserController.java by holding or executing the upload avatar business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result uploadAvatar(HttpServletRequest request, @RequestParam("file") MultipartFile file) { try { Long userId = (Long) request.getAttribute("userId"); @@ -891,12 +903,28 @@ public class UserController { } @Data + /** + * Purpose: PasswordDTO supports UserController.java by holding or executing the password dto business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class PasswordDTO { + /** + * Purpose: password supports UserController.java by holding or executing the password business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String password; + /** + * Purpose: verificationCode supports UserController.java by holding or executing the verification code business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String verificationCode; } @Data + /** + * Purpose: AvailabilityVO supports UserController.java by holding or executing the availability vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class AvailabilityVO { /** * Variable `available`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -909,6 +937,10 @@ public class UserController { } @Data + /** + * Purpose: LoginAccountAvailabilityVO supports UserController.java by holding or executing the login account availability vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class LoginAccountAvailabilityVO { /** * Variable `exists`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/VipRechargePlanController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/VipRechargePlanController.java index 586ea7f2..1fbd5bd5 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/VipRechargePlanController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/VipRechargePlanController.java @@ -34,6 +34,10 @@ public class VipRechargePlanController { @GetMapping("/admin/list") @RequirePermission("user:vip:manage") + /** + * Purpose: listAdmin supports VipRechargePlanController.java by holding or executing the list admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listAdmin(HttpServletRequest request, @RequestParam(required = false) Long shopId) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); return Result.success(vipRechargePlanService.listAdminPlans(currentUser, shopId)); @@ -98,6 +102,10 @@ public class VipRechargePlanController { } @GetMapping({"/admin/vip-level-options", "/api/vip-recharge-plan/vip-level-options", "/vip-level-options"}) + /** + * Purpose: listVipLevelOptions supports VipRechargePlanController.java by holding or executing the list vip level options business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> listVipLevelOptions(HttpServletRequest request, @RequestParam(required = false) Long shopId) { UserDO currentUser = adminScopeHelper.getCurrentUser(request); return Result.success(vipRechargePlanService.listVipLevelOptions(currentUser, shopId)); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/WishlistController.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/WishlistController.java index 136a0853..d3554d48 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/WishlistController.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/controller/WishlistController.java @@ -20,10 +20,18 @@ import java.util.Map; public class WishlistController { @Autowired + /** + * Purpose: wishlistService supports WishlistController.java by holding or executing the wishlist service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private WishlistService wishlistService; @PostMapping("/add") @OperationGuard(action = "wishlist-add", strategy = OperationGuardStrategy.NOOP_IF_DUPLICATE, ttlSeconds = 10) + /** + * Purpose: addToWishlist supports WishlistController.java by holding or executing the add to wishlist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result addToWishlist(@RequestBody Map request, @RequestAttribute("userId") Long userId) { Long productId = request.get("productId"); wishlistService.addToWishlist(userId, productId); @@ -32,6 +40,10 @@ public class WishlistController { @PostMapping("/remove") @OperationGuard(action = "wishlist-remove", strategy = OperationGuardStrategy.NOOP_IF_DUPLICATE, ttlSeconds = 10) + /** + * Purpose: removeFromWishlist supports WishlistController.java by holding or executing the remove from wishlist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result removeFromWishlist(@RequestBody Map request, @RequestAttribute("userId") Long userId) { Long productId = request.get("productId"); wishlistService.removeFromWishlist(userId, productId); @@ -39,12 +51,20 @@ public class WishlistController { } @GetMapping("/check") + /** + * Purpose: checkWishlist supports WishlistController.java by holding or executing the check wishlist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result checkWishlist(@RequestParam Long productId, @RequestAttribute("userId") Long userId) { boolean isInWishlist = wishlistService.isInWishlist(userId, productId); return Result.success(isInWishlist); } @GetMapping("/list") + /** + * Purpose: getWishlist supports WishlistController.java by holding or executing the get wishlist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Result> getWishlist(@RequestAttribute("userId") Long userId) { List wishlist = wishlistService.getWishlistByUserId(userId); return Result.success(wishlist); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/AgreementAwareRequest.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/AgreementAwareRequest.java index b9308d49..48611d5f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/AgreementAwareRequest.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/AgreementAwareRequest.java @@ -2,6 +2,10 @@ package com.xiaowang.yuminailcore.dto; import java.util.Map; +/** + * Purpose: AgreementAwareRequest supports AgreementAwareRequest.java by holding or executing the agreement aware request business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface AgreementAwareRequest { Boolean getAgreementAccepted(); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LegalAgreementDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LegalAgreementDTO.java index 47617875..575fa14d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LegalAgreementDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LegalAgreementDTO.java @@ -6,19 +6,39 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; @Data +/** + * Purpose: LegalAgreementDTO supports LegalAgreementDTO.java by holding or executing the legal agreement dto business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class LegalAgreementDTO { @NotBlank(message = "协议类型不能为空") + /** + * Purpose: agreementType supports LegalAgreementDTO.java by holding or executing the agreement type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String agreementType; @NotBlank(message = "协议标题不能为空") @Size(max = 100, message = "协议标题不能超过100个字符") + /** + * Purpose: title supports LegalAgreementDTO.java by holding or executing the title business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String title; @NotBlank(message = "协议版本不能为空") @Size(max = 40, message = "协议版本不能超过40个字符") + /** + * Purpose: version supports LegalAgreementDTO.java by holding or executing the version business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String version; @NotBlank(message = "协议内容不能为空") + /** + * Purpose: content supports LegalAgreementDTO.java by holding or executing the content business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String content; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LoginRequestDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LoginRequestDTO.java index 4718e218..37d95885 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LoginRequestDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/LoginRequestDTO.java @@ -41,9 +41,21 @@ public class LoginRequestDTO implements AgreementAwareRequest { */ private Long shopId; + /** + * Purpose: agreementAccepted supports LoginRequestDTO.java by holding or executing the agreement accepted business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean agreementAccepted; + /** + * Purpose: agreementVersions supports LoginRequestDTO.java by holding or executing the agreement versions business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map agreementVersions; + /** + * Purpose: clientType supports LoginRequestDTO.java by holding or executing the client type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String clientType; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRejectDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRejectDTO.java index 0e765a1d..b38b678b 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRejectDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRejectDTO.java @@ -3,6 +3,14 @@ package com.xiaowang.yuminailcore.dto; import lombok.Data; @Data +/** + * Purpose: OrderArtistChangeRejectDTO supports OrderArtistChangeRejectDTO.java by holding or executing the order artist change reject dto business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistChangeRejectDTO { + /** + * Purpose: rejectReason supports OrderArtistChangeRejectDTO.java by holding or executing the reject reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String rejectReason; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRequestDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRequestDTO.java index 8c3ef23c..e8f332c6 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRequestDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistChangeRequestDTO.java @@ -3,9 +3,29 @@ package com.xiaowang.yuminailcore.dto; import lombok.Data; @Data +/** + * Purpose: OrderArtistChangeRequestDTO supports OrderArtistChangeRequestDTO.java by holding or executing the order artist change request dto business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistChangeRequestDTO { + /** + * Purpose: orderId supports OrderArtistChangeRequestDTO.java by holding or executing the order id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderId; + /** + * Purpose: orderItemId supports OrderArtistChangeRequestDTO.java by holding or executing the order item id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderItemId; + /** + * Purpose: requestedArtistId supports OrderArtistChangeRequestDTO.java by holding or executing the requested artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long requestedArtistId; + /** + * Purpose: reason supports OrderArtistChangeRequestDTO.java by holding or executing the reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String reason; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistReviewSubmitDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistReviewSubmitDTO.java index 0a0c160d..6a6f126f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistReviewSubmitDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/OrderArtistReviewSubmitDTO.java @@ -6,8 +6,24 @@ import java.math.BigDecimal; import java.util.List; @Data +/** + * Purpose: OrderArtistReviewSubmitDTO supports OrderArtistReviewSubmitDTO.java by holding or executing the order artist review submit dto business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistReviewSubmitDTO { + /** + * Purpose: rating supports OrderArtistReviewSubmitDTO.java by holding or executing the rating business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal rating; + /** + * Purpose: content supports OrderArtistReviewSubmitDTO.java by holding or executing the content business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String content; + /** + * Purpose: imageFileIds supports OrderArtistReviewSubmitDTO.java by holding or executing the image file ids business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private List imageFileIds; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/PhoneLoginRequestDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/PhoneLoginRequestDTO.java index dff6133e..8cb47ef2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/PhoneLoginRequestDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/PhoneLoginRequestDTO.java @@ -33,9 +33,21 @@ public class PhoneLoginRequestDTO implements AgreementAwareRequest { */ private Long shopId; + /** + * Purpose: agreementAccepted supports PhoneLoginRequestDTO.java by holding or executing the agreement accepted business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean agreementAccepted; + /** + * Purpose: agreementVersions supports PhoneLoginRequestDTO.java by holding or executing the agreement versions business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map agreementVersions; + /** + * Purpose: clientType supports PhoneLoginRequestDTO.java by holding or executing the client type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String clientType; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/RegisterRequestDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/RegisterRequestDTO.java index 6bf8e97c..3258cbd2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/RegisterRequestDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/RegisterRequestDTO.java @@ -57,9 +57,21 @@ public class RegisterRequestDTO implements AgreementAwareRequest { */ private String verificationCode; + /** + * Purpose: agreementAccepted supports RegisterRequestDTO.java by holding or executing the agreement accepted business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean agreementAccepted; + /** + * Purpose: agreementVersions supports RegisterRequestDTO.java by holding or executing the agreement versions business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map agreementVersions; + /** + * Purpose: clientType supports RegisterRequestDTO.java by holding or executing the client type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String clientType; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/ShopDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/ShopDTO.java index 58b23334..0f668da2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/ShopDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/ShopDTO.java @@ -31,10 +31,22 @@ public class ShopDTO { */ private String address; + /** + * Purpose: mapProvider supports ShopDTO.java by holding or executing the map provider business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String mapProvider; + /** + * Purpose: longitude supports ShopDTO.java by holding or executing the longitude business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal longitude; + /** + * Purpose: latitude supports ShopDTO.java by holding or executing the latitude business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal latitude; /** @@ -52,16 +64,40 @@ public class ShopDTO { */ private String imageFileIds; + /** + * Purpose: themePrimaryColor supports ShopDTO.java by holding or executing the theme primary color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themePrimaryColor; + /** + * Purpose: themeSecondaryColor supports ShopDTO.java by holding or executing the theme secondary color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeSecondaryColor; + /** + * Purpose: themeAccentColor supports ShopDTO.java by holding or executing the theme accent color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeAccentColor; + /** + * Purpose: themePageBgColor supports ShopDTO.java by holding or executing the theme page bg color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themePageBgColor; + /** + * Purpose: themeCardBgColor supports ShopDTO.java by holding or executing the theme card bg color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeCardBgColor; + /** + * Purpose: themeBackgroundImageFileId supports ShopDTO.java by holding or executing the theme background image file id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeBackgroundImageFileId; /** @@ -69,8 +105,16 @@ public class ShopDTO { */ private Integer status; + /** + * Purpose: authorizationStartDate supports ShopDTO.java by holding or executing the authorization start date business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDate authorizationStartDate; + /** + * Purpose: authorizationDays supports ShopDTO.java by holding or executing the authorization days business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer authorizationDays; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemMessageCreateDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemMessageCreateDTO.java index 72c23b77..99f10406 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemMessageCreateDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemMessageCreateDTO.java @@ -49,9 +49,21 @@ public class SystemMessageCreateDTO { */ private Integer popupEnabled = 1; + /** + * Purpose: businessType supports SystemMessageCreateDTO.java by holding or executing the business type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String businessType; + /** + * Purpose: businessId supports SystemMessageCreateDTO.java by holding or executing the business id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long businessId; + /** + * Purpose: actionPath supports SystemMessageCreateDTO.java by holding or executing the action path business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String actionPath; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemParameterConfigDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemParameterConfigDTO.java index 1ccc06a5..bda6a49c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemParameterConfigDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/SystemParameterConfigDTO.java @@ -6,25 +6,53 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; @Data +/** + * Purpose: SystemParameterConfigDTO supports SystemParameterConfigDTO.java by holding or executing the system parameter config dto business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SystemParameterConfigDTO { @NotBlank(message = "配置分组不能为空") @Size(max = 50, message = "配置分组不能超过50个字符") + /** + * Purpose: configGroup supports SystemParameterConfigDTO.java by holding or executing the config group business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configGroup; @NotBlank(message = "配置键不能为空") @Size(max = 100, message = "配置键不能超过100个字符") + /** + * Purpose: configKey supports SystemParameterConfigDTO.java by holding or executing the config key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configKey; @NotBlank(message = "配置名称不能为空") @Size(max = 100, message = "配置名称不能超过100个字符") + /** + * Purpose: configName supports SystemParameterConfigDTO.java by holding or executing the config name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configName; @Size(max = 1000, message = "配置值不能超过1000个字符") + /** + * Purpose: configValue supports SystemParameterConfigDTO.java by holding or executing the config value business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configValue; + /** + * Purpose: enabled supports SystemParameterConfigDTO.java by holding or executing the enabled business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer enabled = 1; @Size(max = 255, message = "备注不能超过255个字符") + /** + * Purpose: remark supports SystemParameterConfigDTO.java by holding or executing the remark business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String remark; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniConfirmLoginRequestDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniConfirmLoginRequestDTO.java index b3a00174..8de14a71 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniConfirmLoginRequestDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniConfirmLoginRequestDTO.java @@ -24,9 +24,21 @@ public class WechatMiniConfirmLoginRequestDTO implements AgreementAwareRequest { */ private Long shopId; + /** + * Purpose: agreementAccepted supports WechatMiniConfirmLoginRequestDTO.java by holding or executing the agreement accepted business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean agreementAccepted; + /** + * Purpose: agreementVersions supports WechatMiniConfirmLoginRequestDTO.java by holding or executing the agreement versions business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map agreementVersions; + /** + * Purpose: clientType supports WechatMiniConfirmLoginRequestDTO.java by holding or executing the client type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String clientType; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniPhoneLoginRequestDTO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniPhoneLoginRequestDTO.java index f1a3ab81..c2346bb0 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniPhoneLoginRequestDTO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/dto/WechatMiniPhoneLoginRequestDTO.java @@ -28,9 +28,21 @@ public class WechatMiniPhoneLoginRequestDTO implements AgreementAwareRequest { */ private Long preferredShopId; + /** + * Purpose: agreementAccepted supports WechatMiniPhoneLoginRequestDTO.java by holding or executing the agreement accepted business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean agreementAccepted; + /** + * Purpose: agreementVersions supports WechatMiniPhoneLoginRequestDTO.java by holding or executing the agreement versions business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map agreementVersions; + /** + * Purpose: clientType supports WechatMiniPhoneLoginRequestDTO.java by holding or executing the client type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String clientType; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BalanceDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BalanceDO.java index afcb9148..ccae19d2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BalanceDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BalanceDO.java @@ -22,9 +22,17 @@ import java.time.LocalDateTime; public class BalanceDO { @TableId(type = IdType.ASSIGN_ID) + /** + * Purpose: id supports BalanceDO.java by holding or executing the id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long id; @TableField(fill = FieldFill.INSERT) + /** + * Purpose: createTime supports BalanceDO.java by holding or executing the create time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime createTime; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BusinessEventOutboxDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BusinessEventOutboxDO.java index 8e034c5d..500645d1 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BusinessEventOutboxDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/BusinessEventOutboxDO.java @@ -10,41 +10,93 @@ import java.time.LocalDateTime; @Data @EqualsAndHashCode(callSuper = true) @TableName("t_business_event_outbox") +/** + * Purpose: BusinessEventOutboxDO supports BusinessEventOutboxDO.java by holding or executing the business event outbox do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class BusinessEventOutboxDO extends BaseEntity { @TableField("event_key") + /** + * Purpose: eventKey supports BusinessEventOutboxDO.java by holding or executing the event key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String eventKey; @TableField("event_type") + /** + * Purpose: eventType supports BusinessEventOutboxDO.java by holding or executing the event type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String eventType; @TableField("business_type") + /** + * Purpose: businessType supports BusinessEventOutboxDO.java by holding or executing the business type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String businessType; @TableField("business_id") + /** + * Purpose: businessId supports BusinessEventOutboxDO.java by holding or executing the business id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long businessId; @TableField("payload_json") + /** + * Purpose: payloadJson supports BusinessEventOutboxDO.java by holding or executing the payload json business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String payloadJson; @TableField("status") + /** + * Purpose: status supports BusinessEventOutboxDO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String status; @TableField("retry_count") + /** + * Purpose: retryCount supports BusinessEventOutboxDO.java by holding or executing the retry count business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer retryCount; @TableField("next_retry_time") + /** + * Purpose: nextRetryTime supports BusinessEventOutboxDO.java by holding or executing the next retry time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime nextRetryTime; @TableField("last_error") + /** + * Purpose: lastError supports BusinessEventOutboxDO.java by holding or executing the last error business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String lastError; @TableField("claimed_at") + /** + * Purpose: claimedAt supports BusinessEventOutboxDO.java by holding or executing the claimed at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime claimedAt; @TableField("processed_at") + /** + * Purpose: processedAt supports BusinessEventOutboxDO.java by holding or executing the processed at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime processedAt; @TableField("is_delete") + /** + * Purpose: isDelete supports BusinessEventOutboxDO.java by holding or executing the is delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer isDelete; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/LegalAgreementDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/LegalAgreementDO.java index bd9c7229..56dcc005 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/LegalAgreementDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/LegalAgreementDO.java @@ -11,27 +11,59 @@ import java.time.LocalDateTime; @Getter @Setter @TableName("t_legal_agreement") +/** + * Purpose: LegalAgreementDO supports LegalAgreementDO.java by holding or executing the legal agreement do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class LegalAgreementDO extends BaseEntity { @TableField("agreement_type") + /** + * Purpose: agreementType supports LegalAgreementDO.java by holding or executing the agreement type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String agreementType; @TableField("title") + /** + * Purpose: title supports LegalAgreementDO.java by holding or executing the title business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String title; @TableField("version") + /** + * Purpose: version supports LegalAgreementDO.java by holding or executing the version business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String version; @TableField("content") + /** + * Purpose: content supports LegalAgreementDO.java by holding or executing the content business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String content; @TableField("status") + /** + * Purpose: status supports LegalAgreementDO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; @TableField("effective_time") + /** + * Purpose: effectiveTime supports LegalAgreementDO.java by holding or executing the effective time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime effectiveTime; @TableField("is_delete") @TableLogic + /** + * Purpose: isDelete supports LegalAgreementDO.java by holding or executing the is delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer isDelete; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistChangeRequestDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistChangeRequestDO.java index 114aee69..ca125efe 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistChangeRequestDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistChangeRequestDO.java @@ -10,56 +10,128 @@ import java.time.LocalDateTime; @Data @EqualsAndHashCode(callSuper = true) @TableName("t_order_artist_change_request") +/** + * Purpose: OrderArtistChangeRequestDO supports OrderArtistChangeRequestDO.java by holding or executing the order artist change request do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistChangeRequestDO extends BaseEntity { @TableField("order_id") + /** + * Purpose: orderId supports OrderArtistChangeRequestDO.java by holding or executing the order id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderId; @TableField("order_item_id") + /** + * Purpose: orderItemId supports OrderArtistChangeRequestDO.java by holding or executing the order item id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderItemId; @TableField("product_id") + /** + * Purpose: productId supports OrderArtistChangeRequestDO.java by holding or executing the product id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long productId; @TableField("shop_id") + /** + * Purpose: shopId supports OrderArtistChangeRequestDO.java by holding or executing the shop id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long shopId; @TableField("customer_id") + /** + * Purpose: customerId supports OrderArtistChangeRequestDO.java by holding or executing the customer id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long customerId; @TableField("from_artist_id") + /** + * Purpose: fromArtistId supports OrderArtistChangeRequestDO.java by holding or executing the from artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long fromArtistId; @TableField("to_artist_id") + /** + * Purpose: toArtistId supports OrderArtistChangeRequestDO.java by holding or executing the to artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long toArtistId; @TableField("requester_id") + /** + * Purpose: requesterId supports OrderArtistChangeRequestDO.java by holding or executing the requester id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long requesterId; @TableField("status") + /** + * Purpose: status supports OrderArtistChangeRequestDO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String status; @TableField("reason") + /** + * Purpose: reason supports OrderArtistChangeRequestDO.java by holding or executing the reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String reason; @TableField("reject_reason") + /** + * Purpose: rejectReason supports OrderArtistChangeRequestDO.java by holding or executing the reject reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String rejectReason; @TableField("message_id") + /** + * Purpose: messageId supports OrderArtistChangeRequestDO.java by holding or executing the message id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long messageId; @TableField("pending_key") + /** + * Purpose: pendingKey supports OrderArtistChangeRequestDO.java by holding or executing the pending key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String pendingKey; @TableField("approved_time") + /** + * Purpose: approvedTime supports OrderArtistChangeRequestDO.java by holding or executing the approved time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime approvedTime; @TableField("rejected_time") + /** + * Purpose: rejectedTime supports OrderArtistChangeRequestDO.java by holding or executing the rejected time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime rejectedTime; @TableField("expire_time") + /** + * Purpose: expireTime supports OrderArtistChangeRequestDO.java by holding or executing the expire time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime expireTime; @TableField("is_delete") + /** + * Purpose: isDelete supports OrderArtistChangeRequestDO.java by holding or executing the is delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer isDelete; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistReviewDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistReviewDO.java index cbe31fc8..65404e90 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistReviewDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/OrderArtistReviewDO.java @@ -11,44 +11,100 @@ import java.time.LocalDateTime; @Data @EqualsAndHashCode(callSuper = true) @TableName("t_order_artist_review") +/** + * Purpose: OrderArtistReviewDO supports OrderArtistReviewDO.java by holding or executing the order artist review do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistReviewDO extends BaseEntity { @TableField("order_id") + /** + * Purpose: orderId supports OrderArtistReviewDO.java by holding or executing the order id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderId; @TableField("order_item_id") + /** + * Purpose: orderItemId supports OrderArtistReviewDO.java by holding or executing the order item id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderItemId; @TableField("product_id") + /** + * Purpose: productId supports OrderArtistReviewDO.java by holding or executing the product id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long productId; @TableField("artist_id") + /** + * Purpose: artistId supports OrderArtistReviewDO.java by holding or executing the artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long artistId; @TableField("shop_id") + /** + * Purpose: shopId supports OrderArtistReviewDO.java by holding or executing the shop id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long shopId; @TableField("customer_id") + /** + * Purpose: customerId supports OrderArtistReviewDO.java by holding or executing the customer id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long customerId; @TableField("status") + /** + * Purpose: status supports OrderArtistReviewDO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; @TableField("rating_score") + /** + * Purpose: ratingScore supports OrderArtistReviewDO.java by holding or executing the rating score business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal ratingScore; @TableField("content") + /** + * Purpose: content supports OrderArtistReviewDO.java by holding or executing the content business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String content; @TableField("image_file_ids") + /** + * Purpose: imageFileIds supports OrderArtistReviewDO.java by holding or executing the image file ids business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String imageFileIds; @TableField("reminder_message_id") + /** + * Purpose: reminderMessageId supports OrderArtistReviewDO.java by holding or executing the reminder message id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long reminderMessageId; @TableField("submitted_at") + /** + * Purpose: submittedAt supports OrderArtistReviewDO.java by holding or executing the submitted at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime submittedAt; @TableField("is_delete") + /** + * Purpose: isDelete supports OrderArtistReviewDO.java by holding or executing the is delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer isDelete; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SecurityAuditLogDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SecurityAuditLogDO.java index 2fe37d08..8dbc1435 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SecurityAuditLogDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SecurityAuditLogDO.java @@ -10,29 +10,65 @@ import java.time.LocalDateTime; @Getter @Setter @TableName("t_security_audit_log") +/** + * Purpose: SecurityAuditLogDO supports SecurityAuditLogDO.java by holding or executing the security audit log do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SecurityAuditLogDO extends BaseEntity { @TableField("user_id") + /** + * Purpose: userId supports SecurityAuditLogDO.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; @TableField("account") + /** + * Purpose: account supports SecurityAuditLogDO.java by holding or executing the account business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String account; @TableField("action") + /** + * Purpose: action supports SecurityAuditLogDO.java by holding or executing the action business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String action; @TableField("result") + /** + * Purpose: result supports SecurityAuditLogDO.java by holding or executing the result business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String result; @TableField("reason") + /** + * Purpose: reason supports SecurityAuditLogDO.java by holding or executing the reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String reason; @TableField("ip_address") + /** + * Purpose: ipAddress supports SecurityAuditLogDO.java by holding or executing the ip address business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String ipAddress; @TableField("device_id") + /** + * Purpose: deviceId supports SecurityAuditLogDO.java by holding or executing the device id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String deviceId; @TableField("operate_time") + /** + * Purpose: operateTime supports SecurityAuditLogDO.java by holding or executing the operate time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime operateTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/ShopDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/ShopDO.java index bbcfeace..3e0b169f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/ShopDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/ShopDO.java @@ -49,12 +49,24 @@ public class ShopDO extends BaseEntity { private String address; @TableField("map_provider") + /** + * Purpose: mapProvider supports ShopDO.java by holding or executing the map provider business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String mapProvider; @TableField("longitude") + /** + * Purpose: longitude supports ShopDO.java by holding or executing the longitude business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal longitude; @TableField("latitude") + /** + * Purpose: latitude supports ShopDO.java by holding or executing the latitude business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal latitude; /** @@ -76,21 +88,45 @@ public class ShopDO extends BaseEntity { private String imageFileIds; @TableField("theme_primary_color") + /** + * Purpose: themePrimaryColor supports ShopDO.java by holding or executing the theme primary color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themePrimaryColor; @TableField("theme_secondary_color") + /** + * Purpose: themeSecondaryColor supports ShopDO.java by holding or executing the theme secondary color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeSecondaryColor; @TableField("theme_accent_color") + /** + * Purpose: themeAccentColor supports ShopDO.java by holding or executing the theme accent color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeAccentColor; @TableField("theme_page_bg_color") + /** + * Purpose: themePageBgColor supports ShopDO.java by holding or executing the theme page bg color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themePageBgColor; @TableField("theme_card_bg_color") + /** + * Purpose: themeCardBgColor supports ShopDO.java by holding or executing the theme card bg color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeCardBgColor; @TableField("theme_background_image_file_id") + /** + * Purpose: themeBackgroundImageFileId supports ShopDO.java by holding or executing the theme background image file id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeBackgroundImageFileId; /** @@ -100,9 +136,17 @@ public class ShopDO extends BaseEntity { private Integer status; @TableField("authorization_start_date") + /** + * Purpose: authorizationStartDate supports ShopDO.java by holding or executing the authorization start date business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDate authorizationStartDate; @TableField("authorization_days") + /** + * Purpose: authorizationDays supports ShopDO.java by holding or executing the authorization days business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer authorizationDays; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemMessageDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemMessageDO.java index 39ba2624..abc6dcee 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemMessageDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemMessageDO.java @@ -66,15 +66,31 @@ public class SystemMessageDO extends BaseEntity { private String targetIds; @TableField("business_type") + /** + * Purpose: businessType supports SystemMessageDO.java by holding or executing the business type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String businessType; @TableField("business_id") + /** + * Purpose: businessId supports SystemMessageDO.java by holding or executing the business id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long businessId; @TableField("action_path") + /** + * Purpose: actionPath supports SystemMessageDO.java by holding or executing the action path business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String actionPath; @TableField("idempotency_key") + /** + * Purpose: idempotencyKey supports SystemMessageDO.java by holding or executing the idempotency key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String idempotencyKey; @TableField("popup_enabled") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemParameterConfigDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemParameterConfigDO.java index 06008e72..40b08a06 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemParameterConfigDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/SystemParameterConfigDO.java @@ -9,27 +9,59 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = true) @TableName("t_system_parameter_config") +/** + * Purpose: SystemParameterConfigDO supports SystemParameterConfigDO.java by holding or executing the system parameter config do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SystemParameterConfigDO extends BaseEntity { @TableField("config_group") + /** + * Purpose: configGroup supports SystemParameterConfigDO.java by holding or executing the config group business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configGroup; @TableField("config_key") + /** + * Purpose: configKey supports SystemParameterConfigDO.java by holding or executing the config key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configKey; @TableField("config_name") + /** + * Purpose: configName supports SystemParameterConfigDO.java by holding or executing the config name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configName; @TableField("config_value") + /** + * Purpose: configValue supports SystemParameterConfigDO.java by holding or executing the config value business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configValue; @TableField("enabled") + /** + * Purpose: enabled supports SystemParameterConfigDO.java by holding or executing the enabled business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer enabled; @TableField("remark") + /** + * Purpose: remark supports SystemParameterConfigDO.java by holding or executing the remark business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String remark; @TableField("is_delete") @TableLogic + /** + * Purpose: isDelete supports SystemParameterConfigDO.java by holding or executing the is delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer isDelete; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/UserAgreementConsentDO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/UserAgreementConsentDO.java index 281cad7c..fe74b3a6 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/UserAgreementConsentDO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/entity/UserAgreementConsentDO.java @@ -10,29 +10,65 @@ import java.time.LocalDateTime; @Getter @Setter @TableName("t_user_agreement_consent") +/** + * Purpose: UserAgreementConsentDO supports UserAgreementConsentDO.java by holding or executing the user agreement consent do business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class UserAgreementConsentDO extends BaseEntity { @TableField("user_id") + /** + * Purpose: userId supports UserAgreementConsentDO.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; @TableField("agreement_type") + /** + * Purpose: agreementType supports UserAgreementConsentDO.java by holding or executing the agreement type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String agreementType; @TableField("version") + /** + * Purpose: version supports UserAgreementConsentDO.java by holding or executing the version business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String version; @TableField("entry") + /** + * Purpose: entry supports UserAgreementConsentDO.java by holding or executing the entry business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String entry; @TableField("client_type") + /** + * Purpose: clientType supports UserAgreementConsentDO.java by holding or executing the client type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String clientType; @TableField("ip_address") + /** + * Purpose: ipAddress supports UserAgreementConsentDO.java by holding or executing the ip address business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String ipAddress; @TableField("device_id") + /** + * Purpose: deviceId supports UserAgreementConsentDO.java by holding or executing the device id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String deviceId; @TableField("consent_time") + /** + * Purpose: consentTime supports UserAgreementConsentDO.java by holding or executing the consent time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime consentTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/filter/RequestBodyCacheFilter.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/filter/RequestBodyCacheFilter.java index 3b41b556..60e6bbb3 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/filter/RequestBodyCacheFilter.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/filter/RequestBodyCacheFilter.java @@ -37,6 +37,10 @@ public class RequestBodyCacheFilter extends OncePerRequestFilter { filterChain.doFilter(wrappedRequest, response); } + /** + * Purpose: shouldWrap supports RequestBodyCacheFilter.java by holding or executing the should wrap business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean shouldWrap(HttpServletRequest request) { String method = request.getMethod(); if (!StringUtils.hasText(method)) { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/BusinessEventOutboxMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/BusinessEventOutboxMapper.java index 460d1f37..8fc4772c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/BusinessEventOutboxMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/BusinessEventOutboxMapper.java @@ -11,6 +11,10 @@ import java.time.LocalDateTime; import java.util.List; @Mapper +/** + * Purpose: BusinessEventOutboxMapper supports BusinessEventOutboxMapper.java by holding or executing the business event outbox mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface BusinessEventOutboxMapper extends BaseMapper { @Select("SELECT * FROM t_business_event_outbox WHERE status IN ('PENDING', 'FAILED') AND is_delete = 0 AND (next_retry_time IS NULL OR next_retry_time <= #{now}) ORDER BY create_time ASC, id ASC LIMIT #{limit}") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/LegalAgreementMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/LegalAgreementMapper.java index 6b2399e2..8dc5032d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/LegalAgreementMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/LegalAgreementMapper.java @@ -5,5 +5,9 @@ import com.xiaowang.yuminailcore.entity.LegalAgreementDO; import org.apache.ibatis.annotations.Mapper; @Mapper +/** + * Purpose: LegalAgreementMapper supports LegalAgreementMapper.java by holding or executing the legal agreement mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface LegalAgreementMapper extends BaseMapper { } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistChangeRequestMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistChangeRequestMapper.java index 349644a0..259513b2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistChangeRequestMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistChangeRequestMapper.java @@ -12,6 +12,10 @@ import java.time.LocalDateTime; import java.util.List; @Mapper +/** + * Purpose: OrderArtistChangeRequestMapper supports OrderArtistChangeRequestMapper.java by holding or executing the order artist change request mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface OrderArtistChangeRequestMapper extends BaseMapper { @Select("SELECT * FROM t_order_artist_change_request WHERE order_item_id = #{orderItemId} AND status = 'PENDING' AND is_delete = 0 AND (expire_time IS NULL OR expire_time > NOW()) LIMIT 1") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistReviewMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistReviewMapper.java index d005b774..5be80abc 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistReviewMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/OrderArtistReviewMapper.java @@ -10,6 +10,10 @@ import java.math.BigDecimal; import java.util.List; @Mapper +/** + * Purpose: OrderArtistReviewMapper supports OrderArtistReviewMapper.java by holding or executing the order artist review mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface OrderArtistReviewMapper extends BaseMapper { @Select("SELECT * FROM t_order_artist_review WHERE customer_id = #{userId} AND status = 0 AND is_delete = 0 ORDER BY create_time DESC, id DESC") diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SecurityAuditLogMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SecurityAuditLogMapper.java index dd9c1819..4ee7571e 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SecurityAuditLogMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SecurityAuditLogMapper.java @@ -5,5 +5,9 @@ import com.xiaowang.yuminailcore.entity.SecurityAuditLogDO; import org.apache.ibatis.annotations.Mapper; @Mapper +/** + * Purpose: SecurityAuditLogMapper supports SecurityAuditLogMapper.java by holding or executing the security audit log mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface SecurityAuditLogMapper extends BaseMapper { } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SystemParameterConfigMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SystemParameterConfigMapper.java index d023aa4a..da4bde42 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SystemParameterConfigMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/SystemParameterConfigMapper.java @@ -5,5 +5,9 @@ import com.xiaowang.yuminailcore.entity.SystemParameterConfigDO; import org.apache.ibatis.annotations.Mapper; @Mapper +/** + * Purpose: SystemParameterConfigMapper supports SystemParameterConfigMapper.java by holding or executing the system parameter config mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface SystemParameterConfigMapper extends BaseMapper { } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/UserAgreementConsentMapper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/UserAgreementConsentMapper.java index 603df175..4589b4e2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/UserAgreementConsentMapper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/mapper/UserAgreementConsentMapper.java @@ -5,5 +5,9 @@ import com.xiaowang.yuminailcore.entity.UserAgreementConsentDO; import org.apache.ibatis.annotations.Mapper; @Mapper +/** + * Purpose: UserAgreementConsentMapper supports UserAgreementConsentMapper.java by holding or executing the user agreement consent mapper business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface UserAgreementConsentMapper extends BaseMapper { } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/BusinessEventOutboxService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/BusinessEventOutboxService.java index 98add903..15282c9c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/BusinessEventOutboxService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/BusinessEventOutboxService.java @@ -1,5 +1,9 @@ package com.xiaowang.yuminailcore.service; +/** + * Purpose: BusinessEventOutboxService supports BusinessEventOutboxService.java by holding or executing the business event outbox service business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface BusinessEventOutboxService { void enqueueOrderCompleted(Long orderId); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/LegalAgreementService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/LegalAgreementService.java index a3c2a7bb..96c9db12 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/LegalAgreementService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/LegalAgreementService.java @@ -9,6 +9,10 @@ import com.xiaowang.yuminailcore.vo.UserAgreementConsentVO; import javax.servlet.http.HttpServletRequest; import java.util.List; +/** + * Purpose: LegalAgreementService supports LegalAgreementService.java by holding or executing the legal agreement service business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface LegalAgreementService { List listAdminAgreements(UserDO currentUser); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/MapService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/MapService.java index 76d924e4..f3128ab5 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/MapService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/MapService.java @@ -3,6 +3,10 @@ package com.xiaowang.yuminailcore.service; import java.math.BigDecimal; import java.util.Map; +/** + * Purpose: MapService supports MapService.java by holding or executing the map service business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface MapService { String normalizeProvider(String provider); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SecurityAuditLogService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SecurityAuditLogService.java index 9ab7fdd8..7f48adce 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SecurityAuditLogService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SecurityAuditLogService.java @@ -6,6 +6,10 @@ import java.time.LocalDateTime; import com.xiaowang.yuminailcore.vo.PageResultVO; import com.xiaowang.yuminailcore.vo.SecurityAuditLogVO; +/** + * Purpose: SecurityAuditLogService supports SecurityAuditLogService.java by holding or executing the security audit log service business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface SecurityAuditLogService { void record(Long userId, String account, String action, String result, String reason, HttpServletRequest request); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SystemParameterConfigService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SystemParameterConfigService.java index c04e0b7d..add38c2d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SystemParameterConfigService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/SystemParameterConfigService.java @@ -6,6 +6,10 @@ import com.xiaowang.yuminailcore.vo.SystemParameterConfigVO; import java.util.List; +/** + * Purpose: SystemParameterConfigService supports SystemParameterConfigService.java by holding or executing the system parameter config service business role. + * Usage: reference this interface from the owning layer and pass validated inputs before reading or updating related state. + */ public interface SystemParameterConfigService { List listConfigs(UserDO currentUser, String configGroup); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/AnnouncementServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/AnnouncementServiceImpl.java index fdb5d340..5aeaa7ef 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/AnnouncementServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/AnnouncementServiceImpl.java @@ -38,10 +38,30 @@ import java.util.stream.Collectors; */ public class AnnouncementServiceImpl extends ServiceImpl implements AnnouncementService { + /** + * Purpose: TARGET_PLATFORM_ALL supports AnnouncementServiceImpl.java by holding or executing the target platform all business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TARGET_PLATFORM_ALL = "PLATFORM_ALL"; + /** + * Purpose: TARGET_CURRENT_SHOP_ALL supports AnnouncementServiceImpl.java by holding or executing the target current shop all business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TARGET_CURRENT_SHOP_ALL = "CURRENT_SHOP_ALL"; + /** + * Purpose: TARGET_SHOP_ALL supports AnnouncementServiceImpl.java by holding or executing the target shop all business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TARGET_SHOP_ALL = "SHOP_ALL"; + /** + * Purpose: TARGET_SELECTED_SHOPS supports AnnouncementServiceImpl.java by holding or executing the target selected shops business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TARGET_SELECTED_SHOPS = "SELECTED_SHOPS"; + /** + * Purpose: TARGET_SELECTED_USERS supports AnnouncementServiceImpl.java by holding or executing the target selected users business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TARGET_SELECTED_USERS = "SELECTED_USERS"; /** * Variable `announcementMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxProcessor.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxProcessor.java index 2eed4fdd..33093dfa 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxProcessor.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxProcessor.java @@ -14,17 +14,45 @@ import java.util.List; @Component @RequiredArgsConstructor +/** + * Purpose: BusinessEventOutboxProcessor supports BusinessEventOutboxProcessor.java by holding or executing the business event outbox processor business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class BusinessEventOutboxProcessor { + /** + * Purpose: EVENT_ORDER_COMPLETED supports BusinessEventOutboxProcessor.java by holding or executing the event order completed business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String EVENT_ORDER_COMPLETED = "ORDER_COMPLETED"; + /** + * Purpose: PROCESS_BATCH_SIZE supports BusinessEventOutboxProcessor.java by holding or executing the process batch size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int PROCESS_BATCH_SIZE = 20; + /** + * Purpose: outboxMapper supports BusinessEventOutboxProcessor.java by holding or executing the outbox mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final BusinessEventOutboxMapper outboxMapper; + /** + * Purpose: orderMapper supports BusinessEventOutboxProcessor.java by holding or executing the order mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final OrderMapper orderMapper; + /** + * Purpose: orderService supports BusinessEventOutboxProcessor.java by holding or executing the order service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final OrderServiceImpl orderService; @Scheduled(fixedDelay = 10000L) @Transactional + /** + * Purpose: processDueEvents supports BusinessEventOutboxProcessor.java by holding or executing the process due events business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void processDueEvents() { LocalDateTime now = LocalDateTime.now(); List events = outboxMapper.selectDueEvents(now, PROCESS_BATCH_SIZE); @@ -34,6 +62,10 @@ public class BusinessEventOutboxProcessor { } @Transactional + /** + * Purpose: processOne supports BusinessEventOutboxProcessor.java by holding or executing the process one business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void processOne(BusinessEventOutboxDO event) { if (event == null || event.getId() == null) { return; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxServiceImpl.java index cd101c95..593b053c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/BusinessEventOutboxServiceImpl.java @@ -12,15 +12,39 @@ import java.time.LocalDateTime; @Service @RequiredArgsConstructor +/** + * Purpose: BusinessEventOutboxServiceImpl supports BusinessEventOutboxServiceImpl.java by holding or executing the business event outbox service impl business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class BusinessEventOutboxServiceImpl implements BusinessEventOutboxService { + /** + * Purpose: EVENT_ORDER_COMPLETED supports BusinessEventOutboxServiceImpl.java by holding or executing the event order completed business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String EVENT_ORDER_COMPLETED = "ORDER_COMPLETED"; + /** + * Purpose: BUSINESS_ORDER supports BusinessEventOutboxServiceImpl.java by holding or executing the business order business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String BUSINESS_ORDER = "ORDER"; + /** + * Purpose: STATUS_PENDING supports BusinessEventOutboxServiceImpl.java by holding or executing the status pending business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String STATUS_PENDING = "PENDING"; + /** + * Purpose: outboxMapper supports BusinessEventOutboxServiceImpl.java by holding or executing the outbox mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final BusinessEventOutboxMapper outboxMapper; @Override + /** + * Purpose: enqueueOrderCompleted supports BusinessEventOutboxServiceImpl.java by holding or executing the enqueue order completed business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void enqueueOrderCompleted(Long orderId) { if (orderId == null) { return; @@ -43,6 +67,10 @@ public class BusinessEventOutboxServiceImpl implements BusinessEventOutboxServic } @Override + /** + * Purpose: processDueEvents supports BusinessEventOutboxServiceImpl.java by holding or executing the process due events business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void processDueEvents() { // Processing is owned by BusinessEventOutboxProcessor. This method remains on // the public service contract for callers that only need enqueue capability. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CartServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CartServiceImpl.java index 151683f7..47e5e021 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CartServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CartServiceImpl.java @@ -37,24 +37,52 @@ import java.util.stream.Collectors; public class CartServiceImpl implements CartService { @Resource + /** + * Purpose: cartMapper supports CartServiceImpl.java by holding or executing the cart mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private CartMapper cartMapper; @Resource + /** + * Purpose: productMapper supports CartServiceImpl.java by holding or executing the product mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ProductMapper productMapper; @Resource + /** + * Purpose: tagService supports CartServiceImpl.java by holding or executing the tag service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private TagService tagService; @Resource + /** + * Purpose: userMapper supports CartServiceImpl.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserMapper userMapper; @Resource + /** + * Purpose: userShopBindingSupport supports CartServiceImpl.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserShopBindingSupport userShopBindingSupport; @Resource + /** + * Purpose: bookableArtistSupport supports CartServiceImpl.java by holding or executing the bookable artist support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BookableArtistSupport bookableArtistSupport; @Resource + /** + * Purpose: objectStorageUrlSupport supports CartServiceImpl.java by holding or executing the object storage url support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ObjectStorageUrlSupport objectStorageUrlSupport; @Override diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ChunkUploadServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ChunkUploadServiceImpl.java index bfa0d528..b87f7064 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ChunkUploadServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ChunkUploadServiceImpl.java @@ -39,9 +39,25 @@ public class ChunkUploadServiceImpl implements ChunkUploadService { // Keep each chunk comfortably below the common 1 MB gateway/body limit. private static final int CHUNK_SIZE = 512 * 1024; + /** + * Purpose: SESSION_EXPIRE_HOURS supports ChunkUploadServiceImpl.java by holding or executing the session expire hours business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long SESSION_EXPIRE_HOURS = 24; + /** + * Purpose: METADATA_FILE_NAME supports ChunkUploadServiceImpl.java by holding or executing the metadata file name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String METADATA_FILE_NAME = "metadata.json"; + /** + * Purpose: CHUNK_FILE_PREFIX supports ChunkUploadServiceImpl.java by holding or executing the chunk file prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHUNK_FILE_PREFIX = "chunk-"; + /** + * Purpose: CHUNK_FILE_SUFFIX supports ChunkUploadServiceImpl.java by holding or executing the chunk file suffix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHUNK_FILE_SUFFIX = ".part"; /** * Variable `objectMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -768,27 +784,87 @@ public class ChunkUploadServiceImpl implements ChunkUploadService { } } + /** + * Purpose: UploadTargetType supports ChunkUploadServiceImpl.java by holding or executing the upload target type business role. + * Usage: reference this enum from the owning layer and pass validated inputs before reading or updating related state. + */ private enum UploadTargetType { ADMIN_OBJECT_STORAGE, USER_AVATAR } @Data + /** + * Purpose: UploadMetadata supports ChunkUploadServiceImpl.java by holding or executing the upload metadata business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static class UploadMetadata { + /** + * Purpose: uploadId supports ChunkUploadServiceImpl.java by holding or executing the upload id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String uploadId; + /** + * Purpose: targetType supports ChunkUploadServiceImpl.java by holding or executing the target type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String targetType; + /** + * Purpose: ownerId supports ChunkUploadServiceImpl.java by holding or executing the owner id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long ownerId; + /** + * Purpose: fileName supports ChunkUploadServiceImpl.java by holding or executing the file name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String fileName; + /** + * Purpose: contentType supports ChunkUploadServiceImpl.java by holding or executing the content type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String contentType; + /** + * Purpose: fileSize supports ChunkUploadServiceImpl.java by holding or executing the file size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long fileSize; + /** + * Purpose: fileFingerprint supports ChunkUploadServiceImpl.java by holding or executing the file fingerprint business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String fileFingerprint; + /** + * Purpose: scene supports ChunkUploadServiceImpl.java by holding or executing the scene business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String scene; + /** + * Purpose: chunkSize supports ChunkUploadServiceImpl.java by holding or executing the chunk size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer chunkSize; + /** + * Purpose: totalChunks supports ChunkUploadServiceImpl.java by holding or executing the total chunks business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer totalChunks; + /** + * Purpose: createdAt supports ChunkUploadServiceImpl.java by holding or executing the created at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long createdAt; + /** + * Purpose: updatedAt supports ChunkUploadServiceImpl.java by holding or executing the updated at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long updatedAt; } + /** + * Purpose: LocalPreparedUploadFile supports ChunkUploadServiceImpl.java by holding or executing the local prepared upload file business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static class LocalPreparedUploadFile implements PreparedUploadFile { /** * Variable `file`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CouponServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CouponServiceImpl.java index 13735140..18d9eac2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CouponServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/CouponServiceImpl.java @@ -43,9 +43,25 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class CouponServiceImpl extends ServiceImpl implements CouponService { + /** + * Purpose: COUPON_SOURCE_USER supports CouponServiceImpl.java by holding or executing the coupon source user business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String COUPON_SOURCE_USER = "USER_COUPON"; + /** + * Purpose: COUPON_SOURCE_SYSTEM_VIP supports CouponServiceImpl.java by holding or executing the coupon source system vip business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String COUPON_SOURCE_SYSTEM_VIP = "SYSTEM_VIP"; + /** + * Purpose: COUPON_SCENE_VIP_AUTO supports CouponServiceImpl.java by holding or executing the coupon scene vip auto business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String COUPON_SCENE_VIP_AUTO = "VIP_AUTO"; + /** + * Purpose: DEFAULT_VIP_AUTO_COUPON_TOTAL_COUNT supports CouponServiceImpl.java by holding or executing the default vip auto coupon total count business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int DEFAULT_VIP_AUTO_COUPON_TOTAL_COUNT = 999999; private static final LocalDateTime DEFAULT_VIP_AUTO_COUPON_END_TIME = LocalDateTime.of(2099, 12, 31, 23, 59, 59); private static final List DEFAULT_SHOP_VIP_AUTO_COUPONS = List.of( @@ -53,6 +69,10 @@ public class CouponServiceImpl extends ServiceImpl imple new VipAutoCouponTemplate("SILVER_92", "白银VIP自动92折券", "白银", BigDecimal.valueOf(9.2)), new VipAutoCouponTemplate("GOLD_90", "黄金VIP自动90折券", "黄金", BigDecimal.valueOf(9.0)) ); + /** + * Purpose: VIP_LEVEL_NORMAL supports CouponServiceImpl.java by holding or executing the vip level normal business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String VIP_LEVEL_NORMAL = "普通"; /** * Variable `couponTagMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -1198,6 +1218,10 @@ public class CouponServiceImpl extends ServiceImpl imple return BigDecimal.ZERO; } + /** + * Purpose: VipAutoCouponTemplate supports CouponServiceImpl.java by holding or executing the vip auto coupon template business role. + * Usage: reference this record from the owning layer and pass validated inputs before reading or updating related state. + */ private record VipAutoCouponTemplate( String codeSuffix, String couponName, diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/LegalAgreementServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/LegalAgreementServiceImpl.java index 01ff20ba..0514954e 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/LegalAgreementServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/LegalAgreementServiceImpl.java @@ -27,15 +27,39 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor +/** + * Purpose: LegalAgreementServiceImpl supports LegalAgreementServiceImpl.java by holding or executing the legal agreement service impl business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class LegalAgreementServiceImpl implements LegalAgreementService { + /** + * Purpose: USER_TERMS supports LegalAgreementServiceImpl.java by holding or executing the user terms business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_TERMS = "USER_TERMS"; + /** + * Purpose: PRIVACY_POLICY supports LegalAgreementServiceImpl.java by holding or executing the privacy policy business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String PRIVACY_POLICY = "PRIVACY_POLICY"; + /** + * Purpose: agreementMapper supports LegalAgreementServiceImpl.java by holding or executing the agreement mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final LegalAgreementMapper agreementMapper; + /** + * Purpose: consentMapper supports LegalAgreementServiceImpl.java by holding or executing the consent mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserAgreementConsentMapper consentMapper; @Override + /** + * Purpose: listAdminAgreements supports LegalAgreementServiceImpl.java by holding or executing the list admin agreements business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listAdminAgreements(UserDO currentUser) { ensurePlatformAdmin(currentUser); return agreementMapper.selectList(new LambdaQueryWrapper() @@ -49,6 +73,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { @Override @Transactional(rollbackFor = Exception.class) + /** + * Purpose: createAgreement supports LegalAgreementServiceImpl.java by holding or executing the create agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Long createAgreement(UserDO currentUser, LegalAgreementDTO dto) { ensurePlatformAdmin(currentUser); LegalAgreementDO agreement = new LegalAgreementDO(); @@ -61,6 +89,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { @Override @Transactional(rollbackFor = Exception.class) + /** + * Purpose: updateAgreement supports LegalAgreementServiceImpl.java by holding or executing the update agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Boolean updateAgreement(UserDO currentUser, Long id, LegalAgreementDTO dto) { ensurePlatformAdmin(currentUser); LegalAgreementDO agreement = requireAgreement(id); @@ -71,6 +103,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { @Override @Transactional(rollbackFor = Exception.class) + /** + * Purpose: publishAgreement supports LegalAgreementServiceImpl.java by holding or executing the publish agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Boolean publishAgreement(UserDO currentUser, Long id) { ensurePlatformAdmin(currentUser); LegalAgreementDO agreement = requireAgreement(id); @@ -85,6 +121,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } @Override + /** + * Purpose: disableAgreement supports LegalAgreementServiceImpl.java by holding or executing the disable agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Boolean disableAgreement(UserDO currentUser, Long id) { ensurePlatformAdmin(currentUser); LegalAgreementDO agreement = requireAgreement(id); @@ -94,6 +134,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } @Override + /** + * Purpose: listCurrentAgreements supports LegalAgreementServiceImpl.java by holding or executing the list current agreements business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listCurrentAgreements() { return List.of(USER_TERMS, PRIVACY_POLICY).stream() .map(this::getCurrentAgreement) @@ -101,6 +145,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } @Override + /** + * Purpose: getCurrentAgreement supports LegalAgreementServiceImpl.java by holding or executing the get current agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public LegalAgreementVO getCurrentAgreement(String agreementType) { LegalAgreementDO agreement = findCurrentAgreement(normalizeType(agreementType)); if (agreement == null) { @@ -110,6 +158,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } @Override + /** + * Purpose: getMyConsent supports LegalAgreementServiceImpl.java by holding or executing the get my consent business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public UserAgreementConsentVO getMyConsent(Long userId) { Map versions = consentMapper.selectList(new LambdaQueryWrapper() .eq(UserAgreementConsentDO::getUserId, userId)) @@ -119,6 +171,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } @Override + /** + * Purpose: requireAccepted supports LegalAgreementServiceImpl.java by holding or executing the require accepted business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void requireAccepted(AgreementAwareRequest request) { if (request == null || !Boolean.TRUE.equals(request.getAgreementAccepted())) { throw new RuntimeException("请先阅读并同意用户协议和隐私政策"); @@ -130,6 +186,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { @Override @Transactional(rollbackFor = Exception.class) + /** + * Purpose: recordConsent supports LegalAgreementServiceImpl.java by holding or executing the record consent business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void recordConsent(Long userId, AgreementAwareRequest request, String entry, HttpServletRequest httpRequest) { if (userId == null || request == null || request.getAgreementVersions() == null) { return; @@ -146,6 +206,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { )); } + /** + * Purpose: requireVersion supports LegalAgreementServiceImpl.java by holding or executing the require version business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void requireVersion(Map versions, String type) { LegalAgreementDO current = findCurrentAgreement(type); if (current == null) { @@ -157,6 +221,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } } + /** + * Purpose: upsertConsent supports LegalAgreementServiceImpl.java by holding or executing the upsert consent business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void upsertConsent(Long userId, String type, String version, String entry, String clientType, String ip, String deviceId) { if (!StringUtils.hasText(version)) { return; @@ -181,6 +249,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { } } + /** + * Purpose: findCurrentAgreement supports LegalAgreementServiceImpl.java by holding or executing the find current agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private LegalAgreementDO findCurrentAgreement(String type) { return agreementMapper.selectOne(new LambdaQueryWrapper() .eq(LegalAgreementDO::getAgreementType, normalizeType(type)) @@ -190,6 +262,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { .last("limit 1")); } + /** + * Purpose: requireAgreement supports LegalAgreementServiceImpl.java by holding or executing the require agreement business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private LegalAgreementDO requireAgreement(Long id) { LegalAgreementDO agreement = agreementMapper.selectById(id); if (agreement == null || Integer.valueOf(1).equals(agreement.getIsDelete())) { @@ -198,6 +274,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { return agreement; } + /** + * Purpose: apply supports LegalAgreementServiceImpl.java by holding or executing the apply business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void apply(LegalAgreementDO agreement, LegalAgreementDTO dto) { agreement.setAgreementType(normalizeType(dto.getAgreementType())); agreement.setTitle(dto.getTitle().trim()); @@ -205,6 +285,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { agreement.setContent(dto.getContent().trim()); } + /** + * Purpose: normalizeType supports LegalAgreementServiceImpl.java by holding or executing the normalize type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String normalizeType(String type) { if (!StringUtils.hasText(type)) { throw new RuntimeException("协议类型不能为空"); @@ -216,12 +300,20 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { return normalized; } + /** + * Purpose: ensurePlatformAdmin supports LegalAgreementServiceImpl.java by holding or executing the ensure platform admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void ensurePlatformAdmin(UserDO currentUser) { if (currentUser == null || !Integer.valueOf(4).equals(currentUser.getType())) { throw new RuntimeException("仅平台管理员可以管理协议"); } } + /** + * Purpose: resolveClientIp supports LegalAgreementServiceImpl.java by holding or executing the resolve client ip business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveClientIp(HttpServletRequest request) { if (request == null) { return null; @@ -234,6 +326,10 @@ public class LegalAgreementServiceImpl implements LegalAgreementService { return StringUtils.hasText(realIp) ? realIp.trim() : request.getRemoteAddr(); } + /** + * Purpose: toVO supports LegalAgreementServiceImpl.java by holding or executing the to vo business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private LegalAgreementVO toVO(LegalAgreementDO agreement) { LegalAgreementVO vo = new LegalAgreementVO(); vo.setId(agreement.getId()); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MapServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MapServiceImpl.java index 5e5748ac..cd29012d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MapServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MapServiceImpl.java @@ -11,9 +11,17 @@ import java.util.LinkedHashMap; import java.util.Map; @Service +/** + * Purpose: MapServiceImpl supports MapServiceImpl.java by holding or executing the map service impl business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class MapServiceImpl implements MapService { @Override + /** + * Purpose: normalizeProvider supports MapServiceImpl.java by holding or executing the normalize provider business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String normalizeProvider(String provider) { if (!StringUtils.hasText(provider)) { return "TENCENT"; @@ -23,6 +31,10 @@ public class MapServiceImpl implements MapService { } @Override + /** + * Purpose: buildNavigationUrls supports MapServiceImpl.java by holding or executing the build navigation urls business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Map buildNavigationUrls(String shopName, String address, BigDecimal longitude, BigDecimal latitude) { Map urls = new LinkedHashMap<>(); if (longitude == null || latitude == null) { @@ -39,6 +51,10 @@ public class MapServiceImpl implements MapService { return urls; } + /** + * Purpose: encode supports MapServiceImpl.java by holding or executing the encode business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String encode(String value) { return UriUtils.encode(value, StandardCharsets.UTF_8); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MessageHubClientServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MessageHubClientServiceImpl.java index d14f88a7..bd4219eb 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MessageHubClientServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/MessageHubClientServiceImpl.java @@ -48,15 +48,31 @@ public class MessageHubClientServiceImpl implements MessageHubClientService { private final MessageHubPushConfigService messageHubPushConfigService; @Value("${messagehub.client.sms-queue:smsQueue}") + /** + * Purpose: smsQueue supports MessageHubClientServiceImpl.java by holding or executing the sms queue business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String smsQueue; @Value("${messagehub.client.source-system:yuminail}") + /** + * Purpose: sourceSystem supports MessageHubClientServiceImpl.java by holding or executing the source system business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String sourceSystem; @Value("${messagehub.client.verify-template-code:SPUG0001}") + /** + * Purpose: verifyTemplateCode supports MessageHubClientServiceImpl.java by holding or executing the verify template code business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String verifyTemplateCode; @Value("${messagehub.client.send-method:SPUG}") + /** + * Purpose: sendMethod supports MessageHubClientServiceImpl.java by holding or executing the send method business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String sendMethod; @Override diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/NailArtistInfoServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/NailArtistInfoServiceImpl.java index 4c37fc43..c36f16da 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/NailArtistInfoServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/NailArtistInfoServiceImpl.java @@ -27,12 +27,24 @@ import java.util.List; public class NailArtistInfoServiceImpl extends ServiceImpl implements NailArtistInfoService { @Autowired + /** + * Purpose: userMapper supports NailArtistInfoServiceImpl.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserMapper userMapper; @Autowired + /** + * Purpose: shopMapper supports NailArtistInfoServiceImpl.java by holding or executing the shop mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ShopMapper shopMapper; @Autowired + /** + * Purpose: userShopBindingSupport supports NailArtistInfoServiceImpl.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserShopBindingSupport userShopBindingSupport; @Override diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ObjectStorageFileServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ObjectStorageFileServiceImpl.java index e2c20ebe..e956865c 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ObjectStorageFileServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ObjectStorageFileServiceImpl.java @@ -35,6 +35,10 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class ObjectStorageFileServiceImpl extends ServiceImpl implements ObjectStorageFileService { + /** + * Purpose: FILE_DETAIL_CACHE_PREFIX supports ObjectStorageFileServiceImpl.java by holding or executing the file detail cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String FILE_DETAIL_CACHE_PREFIX = "cache:file:detail:"; /** * Variable `objectStorageFileMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/OrderServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/OrderServiceImpl.java index aa1e440f..cf243be2 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/OrderServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/OrderServiceImpl.java @@ -97,25 +97,97 @@ public class OrderServiceImpl implements OrderService { private static final DateTimeFormatter ORDER_NO_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); private static final DateTimeFormatter APPOINTMENT_OUTPUT_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + /** + * Purpose: COUPON_SOURCE_NONE supports OrderServiceImpl.java by holding or executing the coupon source none business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String COUPON_SOURCE_NONE = "NONE"; + /** + * Purpose: COUPON_SOURCE_USER supports OrderServiceImpl.java by holding or executing the coupon source user business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String COUPON_SOURCE_USER = "USER_COUPON"; + /** + * Purpose: COUPON_SOURCE_SYSTEM_VIP supports OrderServiceImpl.java by holding or executing the coupon source system vip business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String COUPON_SOURCE_SYSTEM_VIP = "SYSTEM_VIP"; + /** + * Purpose: REVIEW_STATUS_PENDING supports OrderServiceImpl.java by holding or executing the review status pending business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int REVIEW_STATUS_PENDING = 0; + /** + * Purpose: REVIEW_STATUS_SUBMITTED supports OrderServiceImpl.java by holding or executing the review status submitted business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int REVIEW_STATUS_SUBMITTED = 1; + /** + * Purpose: CHANGE_STATUS_PENDING supports OrderServiceImpl.java by holding or executing the change status pending business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHANGE_STATUS_PENDING = "PENDING"; + /** + * Purpose: CHANGE_STATUS_APPROVED supports OrderServiceImpl.java by holding or executing the change status approved business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHANGE_STATUS_APPROVED = "APPROVED"; + /** + * Purpose: CHANGE_STATUS_REJECTED supports OrderServiceImpl.java by holding or executing the change status rejected business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHANGE_STATUS_REJECTED = "REJECTED"; + /** + * Purpose: CHANGE_STATUS_EXPIRED supports OrderServiceImpl.java by holding or executing the change status expired business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHANGE_STATUS_EXPIRED = "EXPIRED"; + /** + * Purpose: ARTIST_CHANGE_PENDING_KEY_PREFIX supports OrderServiceImpl.java by holding or executing the artist change pending key prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String ARTIST_CHANGE_PENDING_KEY_PREFIX = "ORDER_ITEM:"; + /** + * Purpose: MESSAGE_TARGET_SELECTED_USERS supports OrderServiceImpl.java by holding or executing the message target selected users business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String MESSAGE_TARGET_SELECTED_USERS = "SELECTED_USERS"; + /** + * Purpose: REVIEW_BUSINESS_TYPE supports OrderServiceImpl.java by holding or executing the review business type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String REVIEW_BUSINESS_TYPE = "ORDER_ARTIST_REVIEW"; + /** + * Purpose: CHANGE_BUSINESS_TYPE supports OrderServiceImpl.java by holding or executing the change business type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CHANGE_BUSINESS_TYPE = "ORDER_ARTIST_CHANGE"; + /** + * Purpose: ORDER_CREATE_USER_LOCK_PREFIX supports OrderServiceImpl.java by holding or executing the order create user lock prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String ORDER_CREATE_USER_LOCK_PREFIX = "order:create:user:"; + /** + * Purpose: ORDER_CREATE_ARTIST_LOCK_PREFIX supports OrderServiceImpl.java by holding or executing the order create artist lock prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String ORDER_CREATE_ARTIST_LOCK_PREFIX = "order:create:artist:"; private static final Duration ORDER_CREATE_LOCK_TTL = Duration.ofSeconds(15); private static final long ORDER_CREATE_LOCK_TTL_MILLIS = ORDER_CREATE_LOCK_TTL.toMillis(); + /** + * Purpose: ORDER_CREATE_LOCK_RENEW_INTERVAL_MILLIS supports OrderServiceImpl.java by holding or executing the order create lock renew interval millis business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long ORDER_CREATE_LOCK_RENEW_INTERVAL_MILLIS = 5000L; + /** + * Purpose: ARTIST_LOCK_RETRY_INTERVAL_MILLIS supports OrderServiceImpl.java by holding or executing the artist lock retry interval millis business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long ARTIST_LOCK_RETRY_INTERVAL_MILLIS = 150L; + /** + * Purpose: ARTIST_LOCK_WAIT_TIMEOUT_MILLIS supports OrderServiceImpl.java by holding or executing the artist lock wait timeout millis business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long ARTIST_LOCK_WAIT_TIMEOUT_MILLIS = 1500L; private static final List APPOINTMENT_INPUT_FORMATTERS = Arrays.asList( DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"), @@ -125,6 +197,10 @@ public class OrderServiceImpl implements OrderService { ); private static final Pattern DURATION_PATTERN = Pattern.compile("(\\d+)"); private static final Pattern BUSINESS_HOURS_PATTERN = Pattern.compile("^(\\d{1,2}:\\d{2})\\s*[-~至]\\s*(\\d{1,2}:\\d{2})$"); + /** + * Purpose: DEFAULT_SERVICE_DURATION_MINUTES supports OrderServiceImpl.java by holding or executing the default service duration minutes business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long DEFAULT_SERVICE_DURATION_MINUTES = 60L; private static final DefaultRedisScript RELEASE_LOCK_SCRIPT = new DefaultRedisScript<>(); private static final DefaultRedisScript RENEW_LOCK_SCRIPT = new DefaultRedisScript<>(); @@ -147,66 +223,150 @@ public class OrderServiceImpl implements OrderService { } @Resource + /** + * Purpose: orderMapper supports OrderServiceImpl.java by holding or executing the order mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderMapper orderMapper; @Resource + /** + * Purpose: orderItemMapper supports OrderServiceImpl.java by holding or executing the order item mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderItemMapper orderItemMapper; @Resource + /** + * Purpose: orderArtistReviewMapper supports OrderServiceImpl.java by holding or executing the order artist review mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistReviewMapper orderArtistReviewMapper; @Resource + /** + * Purpose: orderArtistChangeRequestMapper supports OrderServiceImpl.java by holding or executing the order artist change request mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistChangeRequestMapper orderArtistChangeRequestMapper; @Resource + /** + * Purpose: cartMapper supports OrderServiceImpl.java by holding or executing the cart mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private CartMapper cartMapper; @Resource + /** + * Purpose: productMapper supports OrderServiceImpl.java by holding or executing the product mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ProductMapper productMapper; @Resource + /** + * Purpose: couponMapper supports OrderServiceImpl.java by holding or executing the coupon mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private CouponMapper couponMapper; @Resource + /** + * Purpose: nailArtistInfoMapper supports OrderServiceImpl.java by holding or executing the nail artist info mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private NailArtistInfoMapper nailArtistInfoMapper; @Resource + /** + * Purpose: userCouponMapper supports OrderServiceImpl.java by holding or executing the user coupon mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserCouponMapper userCouponMapper; @Resource + /** + * Purpose: userMapper supports OrderServiceImpl.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserMapper userMapper; @Resource + /** + * Purpose: shopMapper supports OrderServiceImpl.java by holding or executing the shop mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ShopMapper shopMapper; @Resource + /** + * Purpose: systemMessageMapper supports OrderServiceImpl.java by holding or executing the system message mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private SystemMessageMapper systemMessageMapper; @Resource + /** + * Purpose: couponService supports OrderServiceImpl.java by holding or executing the coupon service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private CouponService couponService; @Resource + /** + * Purpose: tagService supports OrderServiceImpl.java by holding or executing the tag service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private TagService tagService; @Resource + /** + * Purpose: userShopBindingSupport supports OrderServiceImpl.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private UserShopBindingSupport userShopBindingSupport; @Resource + /** + * Purpose: bookableArtistSupport supports OrderServiceImpl.java by holding or executing the bookable artist support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BookableArtistSupport bookableArtistSupport; @Resource + /** + * Purpose: businessEventOutboxService supports OrderServiceImpl.java by holding or executing the business event outbox service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BusinessEventOutboxService businessEventOutboxService; @Resource + /** + * Purpose: snowflakeIdGenerator supports OrderServiceImpl.java by holding or executing the snowflake id generator business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private TimeOrderedSnowflakeIdGenerator snowflakeIdGenerator; @Resource + /** + * Purpose: stringRedisTemplate supports OrderServiceImpl.java by holding or executing the string redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private StringRedisTemplate stringRedisTemplate; @Resource + /** + * Purpose: objectStorageUrlSupport supports OrderServiceImpl.java by holding or executing the object storage url support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ObjectStorageUrlSupport objectStorageUrlSupport; @Resource + /** + * Purpose: transactionTemplate supports OrderServiceImpl.java by holding or executing the transaction template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private TransactionTemplate transactionTemplate; @PreDestroy @@ -871,6 +1031,10 @@ public class OrderServiceImpl implements OrderService { } @Override + /** + * Purpose: listMyPendingReviews supports OrderServiceImpl.java by holding or executing the list my pending reviews business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listMyPendingReviews(Long userId) { return orderArtistReviewMapper.selectPendingByUserId(userId).stream() .map(this::buildArtistReviewVO) @@ -878,6 +1042,10 @@ public class OrderServiceImpl implements OrderService { } @Override + /** + * Purpose: listOrderReviews supports OrderServiceImpl.java by holding or executing the list order reviews business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listOrderReviews(Long orderId, Long userId, Integer userType) { OrderDO order = requireActiveOrder(orderId); if (!canAccessOrder(order, userId, userType)) { @@ -890,6 +1058,10 @@ public class OrderServiceImpl implements OrderService { @Override @Transactional + /** + * Purpose: submitArtistReview supports OrderServiceImpl.java by holding or executing the submit artist review business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public OrderArtistReviewVO submitArtistReview(Long reviewId, Long userId, OrderArtistReviewSubmitDTO dto) { OrderArtistReviewDO review = orderArtistReviewMapper.selectById(reviewId); if (review == null || Integer.valueOf(1).equals(review.getIsDelete())) { @@ -914,6 +1086,10 @@ public class OrderServiceImpl implements OrderService { } @Override + /** + * Purpose: getArtistChangeOptions supports OrderServiceImpl.java by holding or executing the get artist change options business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public OrderArtistChangeOptionsVO getArtistChangeOptions(Long orderId, Long orderItemId, Long userId, Integer userType) { OrderDO order = requireActiveOrder(orderId); if (!canAccessOrder(order, userId, userType)) { @@ -939,6 +1115,10 @@ public class OrderServiceImpl implements OrderService { @Override @Transactional + /** + * Purpose: requestArtistChange supports OrderServiceImpl.java by holding or executing the request artist change business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public OrderArtistChangeRequestVO requestArtistChange(Long userId, OrderArtistChangeRequestDTO dto) { if (dto == null || dto.getOrderId() == null || dto.getOrderItemId() == null || dto.getRequestedArtistId() == null) { throw new RuntimeException("改派申请信息不完整"); @@ -991,6 +1171,10 @@ public class OrderServiceImpl implements OrderService { } @Override + /** + * Purpose: listMyPendingArtistChangeRequests supports OrderServiceImpl.java by holding or executing the list my pending artist change requests business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listMyPendingArtistChangeRequests(Long userId, Integer userType) { expireDueArtistChangeRequests(); List requests; @@ -1011,6 +1195,10 @@ public class OrderServiceImpl implements OrderService { @Override @Transactional + /** + * Purpose: approveArtistChange supports OrderServiceImpl.java by holding or executing the approve artist change business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public OrderArtistChangeRequestVO approveArtistChange(Long requestId, Long userId, Integer userType) { OrderArtistChangeRequestDO request = requirePendingArtistChangeRequest(requestId); assertCanProcessArtistChange(request, userId, userType); @@ -1048,6 +1236,10 @@ public class OrderServiceImpl implements OrderService { @Override @Transactional + /** + * Purpose: rejectArtistChange supports OrderServiceImpl.java by holding or executing the reject artist change business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public OrderArtistChangeRequestVO rejectArtistChange(Long requestId, Long userId, Integer userType, OrderArtistChangeRejectDTO dto) { OrderArtistChangeRequestDO request = requirePendingArtistChangeRequest(requestId); assertCanProcessArtistChange(request, userId, userType); @@ -1063,10 +1255,18 @@ public class OrderServiceImpl implements OrderService { return buildArtistChangeRequestVO(request); } + /** + * Purpose: createPendingArtistReviewTasksAndNotifyFromOutbox supports OrderServiceImpl.java by holding or executing the create pending artist review tasks and notify from outbox business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void createPendingArtistReviewTasksAndNotifyFromOutbox(OrderDO order) { createPendingArtistReviewTasksAndNotify(order); } + /** + * Purpose: createPendingArtistReviewTasksAndNotify supports OrderServiceImpl.java by holding or executing the create pending artist review tasks and notify business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void createPendingArtistReviewTasksAndNotify(OrderDO order) { if (order == null || order.getId() == null || !Integer.valueOf(2).equals(order.getStatus())) { return; @@ -1107,6 +1307,10 @@ public class OrderServiceImpl implements OrderService { } } + /** + * Purpose: insertPendingArtistReview supports OrderServiceImpl.java by holding or executing the insert pending artist review business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistReviewDO insertPendingArtistReview(OrderArtistReviewDO review) { try { orderArtistReviewMapper.insert(review); @@ -1122,6 +1326,10 @@ public class OrderServiceImpl implements OrderService { } } + /** + * Purpose: createReviewReminderMessage supports OrderServiceImpl.java by holding or executing the create review reminder message business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long createReviewReminderMessage(OrderDO order, OrderItemDO item, ProductDO product, OrderArtistReviewDO review) { String productTitle = product == null ? "订单项目" : product.getTitle(); UserDO artist = item == null || item.getArtistId() == null ? null : userMapper.selectById(item.getArtistId()); @@ -1139,6 +1347,10 @@ public class OrderServiceImpl implements OrderService { ); } + /** + * Purpose: buildArtistReviewVO supports OrderServiceImpl.java by holding or executing the build artist review vo business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistReviewVO buildArtistReviewVO(OrderArtistReviewDO review) { if (review == null) { return null; @@ -1169,6 +1381,10 @@ public class OrderServiceImpl implements OrderService { return vo; } + /** + * Purpose: requireActiveOrder supports OrderServiceImpl.java by holding or executing the require active order business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderDO requireActiveOrder(Long orderId) { if (orderId == null) { throw new RuntimeException("订单信息不完整"); @@ -1180,6 +1396,10 @@ public class OrderServiceImpl implements OrderService { return order; } + /** + * Purpose: canAccessOrder supports OrderServiceImpl.java by holding or executing the can access order business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean canAccessOrder(OrderDO order, Long userId, Integer userType) { if (order == null || userId == null) { return false; @@ -1201,6 +1421,10 @@ public class OrderServiceImpl implements OrderService { .anyMatch(item -> Objects.equals(item.getArtistId(), userId)); } + /** + * Purpose: normalizeReviewRating supports OrderServiceImpl.java by holding or executing the normalize review rating business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal normalizeReviewRating(BigDecimal rating) { if (rating == null) { throw new RuntimeException("评分不能为空"); @@ -1221,6 +1445,10 @@ public class OrderServiceImpl implements OrderService { return normalized; } + /** + * Purpose: trimToNull supports OrderServiceImpl.java by holding or executing the trim to null business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String trimToNull(String value) { if (!StringUtils.hasText(value)) { return null; @@ -1228,6 +1456,10 @@ public class OrderServiceImpl implements OrderService { return value.trim(); } + /** + * Purpose: joinLongIds supports OrderServiceImpl.java by holding or executing the join long ids business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String joinLongIds(List ids) { if (ids == null || ids.isEmpty()) { return null; @@ -1240,6 +1472,10 @@ public class OrderServiceImpl implements OrderService { return joined.isBlank() ? null : joined; } + /** + * Purpose: parseIdSet supports OrderServiceImpl.java by holding or executing the parse id set business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Set parseIdSet(String rawIds) { if (!StringUtils.hasText(rawIds)) { return Collections.emptySet(); @@ -1257,6 +1493,10 @@ public class OrderServiceImpl implements OrderService { return result; } + /** + * Purpose: refreshArtistRating supports OrderServiceImpl.java by holding or executing the refresh artist rating business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void refreshArtistRating(Long artistId) { if (artistId == null) { return; @@ -1273,18 +1513,34 @@ public class OrderServiceImpl implements OrderService { nailArtistInfoMapper.updateById(artistInfo); } + /** + * Purpose: requireOrderItem supports OrderServiceImpl.java by holding or executing the require order item business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderItemDO requireOrderItem(Long orderItemId, Long orderId) { return requireOrderItem(orderItemId, orderId, false); } + /** + * Purpose: requireOrderItemForUpdate supports OrderServiceImpl.java by holding or executing the require order item for update business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderItemDO requireOrderItemForUpdate(Long orderItemId, Long orderId) { return requireOrderItem(orderItemId, orderId, true); } + /** + * Purpose: buildArtistChangePendingKey supports OrderServiceImpl.java by holding or executing the build artist change pending key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildArtistChangePendingKey(Long orderItemId) { return orderItemId == null ? null : ARTIST_CHANGE_PENDING_KEY_PREFIX + orderItemId; } + /** + * Purpose: requireOrderItem supports OrderServiceImpl.java by holding or executing the require order item business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderItemDO requireOrderItem(Long orderItemId, Long orderId, boolean forUpdate) { if (orderItemId == null) { throw new RuntimeException("订单项信息不完整"); @@ -1298,6 +1554,10 @@ public class OrderServiceImpl implements OrderService { return item; } + /** + * Purpose: requireActiveProduct supports OrderServiceImpl.java by holding or executing the require active product business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private ProductDO requireActiveProduct(Long productId) { ProductDO product = getProductFromCache(productId, new HashMap<>()); if (product == null) { @@ -1306,6 +1566,10 @@ public class OrderServiceImpl implements OrderService { return product; } + /** + * Purpose: isArtistAvailableForItem supports OrderServiceImpl.java by holding or executing the is artist available for item business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isArtistAvailableForItem(Long shopId, Long artistId, OrderItemDO item, ProductDO product) { try { validateRequestedArtistForItem(shopId, artistId, item, product); @@ -1330,6 +1594,10 @@ public class OrderServiceImpl implements OrderService { return vo; } + /** + * Purpose: validateRequestedArtistForItem supports OrderServiceImpl.java by holding or executing the validate requested artist for item business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void validateRequestedArtistForItem(Long shopId, Long artistId, OrderItemDO item, ProductDO product) { validateArtistForProduct(product, artistId); if (!bookableArtistSupport.isValidBookableArtist(shopId, artistId)) { @@ -1346,6 +1614,10 @@ public class OrderServiceImpl implements OrderService { validateArtistScheduleConflicts(artistId, Collections.singletonList(new AppointmentSlot(product.getTitle(), startTime, endTime)), new HashMap<>()); } + /** + * Purpose: createArtistChangeMessage supports OrderServiceImpl.java by holding or executing the create artist change message business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long createArtistChangeMessage(OrderDO order, OrderArtistChangeRequestDO request) { ProductDO product = getProductFromCache(request.getProductId(), new HashMap<>()); UserDO fromArtist = request.getFromArtistId() == null ? null : userMapper.selectById(request.getFromArtistId()); @@ -1370,6 +1642,10 @@ public class OrderServiceImpl implements OrderService { return messageId; } + /** + * Purpose: buildArtistChangeRequestVO supports OrderServiceImpl.java by holding or executing the build artist change request vo business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistChangeRequestVO buildArtistChangeRequestVO(OrderArtistChangeRequestDO request) { if (request == null) { return null; @@ -1411,6 +1687,10 @@ public class OrderServiceImpl implements OrderService { return vo; } + /** + * Purpose: requirePendingArtistChangeRequest supports OrderServiceImpl.java by holding or executing the require pending artist change request business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistChangeRequestDO requirePendingArtistChangeRequest(Long requestId) { if (requestId == null) { throw new RuntimeException("改派申请信息不完整"); @@ -1432,6 +1712,10 @@ public class OrderServiceImpl implements OrderService { return request; } + /** + * Purpose: assertCanProcessArtistChange supports OrderServiceImpl.java by holding or executing the assert can process artist change business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void assertCanProcessArtistChange(OrderArtistChangeRequestDO request, Long userId, Integer userType) { if (request == null || userId == null || !Objects.equals(request.getCustomerId(), userId)) { throw new RuntimeException("仅订单客户可以处理改派申请"); @@ -1439,10 +1723,18 @@ public class OrderServiceImpl implements OrderService { } @org.springframework.scheduling.annotation.Scheduled(fixedDelay = 300000L) + /** + * Purpose: expireDueArtistChangeRequests supports OrderServiceImpl.java by holding or executing the expire due artist change requests business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void expireDueArtistChangeRequests() { orderArtistChangeRequestMapper.expirePendingBefore(LocalDateTime.now()); } + /** + * Purpose: canRequestArtistChangeForItem supports OrderServiceImpl.java by holding or executing the can request artist change for item business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean canRequestArtistChangeForItem(OrderDO order, OrderItemDO item, Long userId) { if (order == null || item == null || userId == null) { return false; @@ -1461,6 +1753,10 @@ public class OrderServiceImpl implements OrderService { && userShopBindingSupport.isUserAccessibleInShop(userId, order.getShopId()); } + /** + * Purpose: ensureArtistChangeRequester supports OrderServiceImpl.java by holding or executing the ensure artist change requester business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void ensureArtistChangeRequester(Long userId) { UserDO user = userMapper.selectById(userId); if (user == null || Integer.valueOf(1).equals(user.getIsDelete()) || !Integer.valueOf(1).equals(user.getStatus())) { @@ -1478,6 +1774,10 @@ public class OrderServiceImpl implements OrderService { throw new RuntimeException("仅美甲师或参与制作的店长可以申请改派"); } + /** + * Purpose: getArtistInfoByUserId supports OrderServiceImpl.java by holding or executing the get artist info by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private NailArtistInfoDO getArtistInfoByUserId(Long userId) { if (userId == null) { return null; @@ -1488,6 +1788,10 @@ public class OrderServiceImpl implements OrderService { .last("LIMIT 1")); } + /** + * Purpose: resolveArtistChangeStatusText supports OrderServiceImpl.java by holding or executing the resolve artist change status text business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveArtistChangeStatusText(String status) { if (CHANGE_STATUS_APPROVED.equals(status)) { return "已同意"; @@ -1546,6 +1850,10 @@ public class OrderServiceImpl implements OrderService { return message.getId(); } + /** + * Purpose: buildSystemMessageIdempotencyKey supports OrderServiceImpl.java by holding or executing the build system message idempotency key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildSystemMessageIdempotencyKey(String businessType, Long businessId, Long targetUserId) { if (!StringUtils.hasText(businessType) || businessId == null || targetUserId == null) { return null; @@ -2688,6 +2996,10 @@ public class OrderServiceImpl implements OrderService { couponMapper.updateById(couponDO); } + /** + * Purpose: LockLease supports OrderServiceImpl.java by holding or executing the lock lease business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static final class LockLease { /** * Variable `lockKey`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -2697,7 +3009,15 @@ public class OrderServiceImpl implements OrderService { * Variable `lockToken`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final String lockToken; + /** + * Purpose: future supports OrderServiceImpl.java by holding or executing the future business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private volatile ScheduledFuture future; + /** + * Purpose: active supports OrderServiceImpl.java by holding or executing the active business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private volatile boolean active = true; /** @@ -2766,6 +3086,10 @@ public class OrderServiceImpl implements OrderService { } } + /** + * Purpose: LockRenewThreadFactory supports OrderServiceImpl.java by holding or executing the lock renew thread factory business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static final class LockRenewThreadFactory implements ThreadFactory { @Override /** @@ -2781,6 +3105,10 @@ public class OrderServiceImpl implements OrderService { } } + /** + * Purpose: CouponSelection supports OrderServiceImpl.java by holding or executing the coupon selection business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static final class CouponSelection { /** * Variable `sourceType`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -2837,6 +3165,10 @@ public class OrderServiceImpl implements OrderService { } } + /** + * Purpose: AppointmentSlot supports OrderServiceImpl.java by holding or executing the appointment slot business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static final class AppointmentSlot { /** * Variable `productTitle`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/PermissionServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/PermissionServiceImpl.java index fdf501a3..127c020f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/PermissionServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/PermissionServiceImpl.java @@ -497,6 +497,10 @@ public class PermissionServiceImpl extends ServiceImpl activeShopRoles, String permissionCode) { List permissionIds = listPermissionIdsByShopRoles(activeShopRoles); if (permissionIds.isEmpty()) { @@ -552,6 +556,10 @@ public class PermissionServiceImpl extends ServiceImpl listActiveShopRoles(Long userId) { if (userId == null) { return List.of(); @@ -571,6 +579,10 @@ public class PermissionServiceImpl extends ServiceImpl listPermissionIdsByShopRoles(List activeShopRoles) { if (activeShopRoles == null || activeShopRoles.isEmpty()) { return List.of(); @@ -596,6 +608,10 @@ public class PermissionServiceImpl extends ServiceImpl listPermissionsByIds(List permissionIds) { if (permissionIds == null || permissionIds.isEmpty()) { return List.of(); @@ -610,10 +626,18 @@ public class PermissionServiceImpl extends ServiceImpl activeShopRoles) { return !isPlatformAdmin(userDO) && activeShopRoles != null && !activeShopRoles.isEmpty(); } + /** + * Purpose: isPermissionAllowedForUserType supports PermissionServiceImpl.java by holding or executing the is permission allowed for user type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isPermissionAllowedForUserType(UserDO userDO, String permissionCode) { if (userDO == null || Integer.valueOf(1).equals(userDO.getIsDelete())) { return false; @@ -624,6 +648,10 @@ public class PermissionServiceImpl extends ServiceImpl implements ProductLikeService { @Autowired + /** + * Purpose: productMapper supports ProductLikeServiceImpl.java by holding or executing the product mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ProductMapper productMapper; @Override diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ProductServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ProductServiceImpl.java index 15e45bcf..5181a4d3 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ProductServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ProductServiceImpl.java @@ -48,10 +48,30 @@ import java.util.stream.Collectors; * Beginner guide: follow the call chain Controller -> Service -> ServiceImpl -> Mapper/support class. */ public class ProductServiceImpl extends ServiceImpl implements ProductService { + /** + * Purpose: PRODUCT_DETAIL_CACHE_PREFIX supports ProductServiceImpl.java by holding or executing the product detail cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String PRODUCT_DETAIL_CACHE_PREFIX = "cache:product:detail:"; + /** + * Purpose: PRODUCT_LIST_CACHE_PREFIX supports ProductServiceImpl.java by holding or executing the product list cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String PRODUCT_LIST_CACHE_PREFIX = "cache:product:list:"; + /** + * Purpose: PRODUCT_SEARCH_CACHE_PREFIX supports ProductServiceImpl.java by holding or executing the product search cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String PRODUCT_SEARCH_CACHE_PREFIX = "cache:product:search:"; + /** + * Purpose: DEFAULT_PUBLIC_PAGE_SIZE supports ProductServiceImpl.java by holding or executing the default public page size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int DEFAULT_PUBLIC_PAGE_SIZE = 10; + /** + * Purpose: MAX_PUBLIC_PAGE_SIZE supports ProductServiceImpl.java by holding or executing the max public page size business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int MAX_PUBLIC_PAGE_SIZE = 30; /** * Variable `productMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -323,6 +343,10 @@ public class ProductServiceImpl extends ServiceImpl im } @Override + /** + * Purpose: listProductsByTag supports ProductServiceImpl.java by holding or executing the list products by tag business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listProductsByTag(String tag, Long shopId) { AppCacheProperties.CacheSpec cacheSpec = appCacheProperties.getProductList(); String normalizedTag = normalizeOptionalKeyword(tag); @@ -349,6 +373,10 @@ public class ProductServiceImpl extends ServiceImpl im } @Override + /** + * Purpose: searchProducts supports ProductServiceImpl.java by holding or executing the search products business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List searchProducts(String keyword, Long shopId) { if (!StringUtils.hasText(keyword)) { return new ArrayList<>(); @@ -497,6 +525,10 @@ public class ProductServiceImpl extends ServiceImpl im } @Override + /** + * Purpose: pageProducts supports ProductServiceImpl.java by holding or executing the page products business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public PageResultVO pageProducts(Integer page, Integer size, String keyword, Long shopId, Long tagId, java.math.BigDecimal minPrice, java.math.BigDecimal maxPrice, String createdFrom, String createdTo) { Page pageParam = new Page<>(page, size); @@ -539,6 +571,10 @@ public class ProductServiceImpl extends ServiceImpl im return result; } + /** + * Purpose: parseDateTime supports ProductServiceImpl.java by holding or executing the parse date time business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime parseDateTime(String value) { if (!StringUtils.hasText(value)) { return null; @@ -569,6 +605,10 @@ public class ProductServiceImpl extends ServiceImpl im } @Override + /** + * Purpose: pagePublicProducts supports ProductServiceImpl.java by holding or executing the page public products business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public PageResultVO pagePublicProducts(Integer page, Integer size, String keyword, String tag, Long shopId) { int normalizedPage = normalizePage(page); int normalizedSize = normalizePageSize(size); @@ -825,6 +865,10 @@ public class ProductServiceImpl extends ServiceImpl im return buildFrontQuery(keyword, tag, exactTagIds, null); } + /** + * Purpose: buildFrontQuery supports ProductServiceImpl.java by holding or executing the build front query business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private LambdaQueryWrapper buildFrontQuery(String keyword, String tag, Set exactTagIds, Long shopId) { LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProductDO.class) .eq(ProductDO::getIsDelete, 0); @@ -1064,10 +1108,18 @@ public class ProductServiceImpl extends ServiceImpl im return StringUtils.hasText(value) ? value.trim() : ""; } + /** + * Purpose: normalizeShopId supports ProductServiceImpl.java by holding or executing the normalize shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long normalizeShopId(Long shopId) { return shopId != null && shopId > 0 ? shopId : null; } + /** + * Purpose: buildShopCacheSegment supports ProductServiceImpl.java by holding or executing the build shop cache segment business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildShopCacheSegment(Long shopId) { return shopId == null ? "all:" : "shop:" + shopId + ":"; } @@ -1086,6 +1138,10 @@ public class ProductServiceImpl extends ServiceImpl im multiLevelCacheService.evictByPrefix(PRODUCT_SEARCH_CACHE_PREFIX); } + /** + * Purpose: ProductEnrichmentContext supports ProductServiceImpl.java by holding or executing the product enrichment context business role. + * Usage: reference this record from the owning layer and pass validated inputs before reading or updating related state. + */ private record ProductEnrichmentContext( Map shopNames, Map tags, diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SecurityAuditLogServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SecurityAuditLogServiceImpl.java index a52b8042..12807097 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SecurityAuditLogServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SecurityAuditLogServiceImpl.java @@ -17,11 +17,23 @@ import java.time.LocalDateTime; @Service @RequiredArgsConstructor +/** + * Purpose: SecurityAuditLogServiceImpl supports SecurityAuditLogServiceImpl.java by holding or executing the security audit log service impl business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SecurityAuditLogServiceImpl implements SecurityAuditLogService { + /** + * Purpose: auditLogMapper supports SecurityAuditLogServiceImpl.java by holding or executing the audit log mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogMapper auditLogMapper; @Override + /** + * Purpose: record supports SecurityAuditLogServiceImpl.java by holding or executing the record business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void record(Long userId, String account, String action, String result, String reason, HttpServletRequest request) { try { SecurityAuditLogDO log = new SecurityAuditLogDO(); @@ -76,6 +88,10 @@ public class SecurityAuditLogServiceImpl implements SecurityAuditLogService { return resultVO; } + /** + * Purpose: toVO supports SecurityAuditLogServiceImpl.java by holding or executing the to vo business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private SecurityAuditLogVO toVO(SecurityAuditLogDO log) { SecurityAuditLogVO vo = new SecurityAuditLogVO(); vo.setId(log.getId()); @@ -90,6 +106,10 @@ public class SecurityAuditLogServiceImpl implements SecurityAuditLogService { return vo; } + /** + * Purpose: resolveClientIp supports SecurityAuditLogServiceImpl.java by holding or executing the resolve client ip business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveClientIp(HttpServletRequest request) { if (request == null) { return null; @@ -102,6 +122,10 @@ public class SecurityAuditLogServiceImpl implements SecurityAuditLogService { return StringUtils.hasText(realIp) ? realIp.trim() : request.getRemoteAddr(); } + /** + * Purpose: limit supports SecurityAuditLogServiceImpl.java by holding or executing the limit business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String limit(String value, int max) { if (value == null || value.length() <= max) { return value; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ShopServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ShopServiceImpl.java index c7fa86be..08b90ca7 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ShopServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/ShopServiceImpl.java @@ -48,9 +48,25 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class ShopServiceImpl extends ServiceImpl implements ShopService { + /** + * Purpose: SHOP_DETAIL_CACHE_PREFIX supports ShopServiceImpl.java by holding or executing the shop detail cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SHOP_DETAIL_CACHE_PREFIX = "cache:shop:detail:"; + /** + * Purpose: SHOP_LIST_CACHE_PREFIX supports ShopServiceImpl.java by holding or executing the shop list cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SHOP_LIST_CACHE_PREFIX = "cache:shop:list:"; + /** + * Purpose: SHOP_DELETE_DISABLED_MESSAGE supports ShopServiceImpl.java by holding or executing the shop delete disabled message business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SHOP_DELETE_DISABLED_MESSAGE = "店铺删除已停用,请使用停用封存"; + /** + * Purpose: DISABLED_SHOP_ARCHIVED_MESSAGE supports ShopServiceImpl.java by holding or executing the disabled shop archived message business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String DISABLED_SHOP_ARCHIVED_MESSAGE = "停用店铺已封存,仅允许重新启用"; /** * Variable `shopMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -92,6 +108,10 @@ public class ShopServiceImpl extends ServiceImpl implements * Variable `appCacheProperties`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final AppCacheProperties appCacheProperties; + /** + * Purpose: mapService supports ShopServiceImpl.java by holding or executing the map service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final MapService mapService; @Override @@ -448,6 +468,10 @@ public class ShopServiceImpl extends ServiceImpl implements return Integer.valueOf(0).equals(status) ? 0 : 1; } + /** + * Purpose: applyAuthorization supports ShopServiceImpl.java by holding or executing the apply authorization business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void applyAuthorization(ShopDO shopDO, ShopDTO shopDTO) { LocalDate startDate = shopDTO.getAuthorizationStartDate(); Integer days = shopDTO.getAuthorizationDays(); @@ -460,6 +484,10 @@ public class ShopServiceImpl extends ServiceImpl implements shopDO.setAuthorizationExpireTime(shopDTO.getAuthorizationExpireTime()); } + /** + * Purpose: applyTheme supports ShopServiceImpl.java by holding or executing the apply theme business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void applyTheme(ShopDO shopDO, ShopDTO shopDTO) { shopDO.setThemePrimaryColor(ShopThemeSupport.normalizeColor(shopDTO.getThemePrimaryColor(), "themePrimaryColor")); shopDO.setThemeSecondaryColor(ShopThemeSupport.normalizeColor(shopDTO.getThemeSecondaryColor(), "themeSecondaryColor")); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SystemMessageServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SystemMessageServiceImpl.java index 72d92861..02f9cd5e 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SystemMessageServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/SystemMessageServiceImpl.java @@ -45,10 +45,30 @@ import java.util.stream.Collectors; */ public class SystemMessageServiceImpl extends ServiceImpl implements SystemMessageService { + /** + * Purpose: TARGET_PLATFORM_ALL supports SystemMessageServiceImpl.java by holding or executing the target platform all business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String TARGET_PLATFORM_ALL = "PLATFORM_ALL"; + /** + * Purpose: TARGET_CURRENT_SHOP_ALL supports SystemMessageServiceImpl.java by holding or executing the target current shop all business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String TARGET_CURRENT_SHOP_ALL = "CURRENT_SHOP_ALL"; + /** + * Purpose: TARGET_SHOP_ALL supports SystemMessageServiceImpl.java by holding or executing the target shop all business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String TARGET_SHOP_ALL = "SHOP_ALL"; + /** + * Purpose: TARGET_SELECTED_SHOPS supports SystemMessageServiceImpl.java by holding or executing the target selected shops business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String TARGET_SELECTED_SHOPS = "SELECTED_SHOPS"; + /** + * Purpose: TARGET_SELECTED_USERS supports SystemMessageServiceImpl.java by holding or executing the target selected users business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String TARGET_SELECTED_USERS = "SELECTED_USERS"; /** * Variable `systemMessageMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -781,6 +801,10 @@ public class SystemMessageServiceImpl extends ServiceImpl listConfigs(UserDO currentUser, String configGroup) { ensurePlatformAdmin(currentUser); LambdaQueryWrapper wrapper = new LambdaQueryWrapper() @@ -37,6 +49,10 @@ public class SystemParameterConfigServiceImpl implements SystemParameterConfigSe @Override @Transactional(rollbackFor = Exception.class) + /** + * Purpose: saveConfig supports SystemParameterConfigServiceImpl.java by holding or executing the save config business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Boolean saveConfig(UserDO currentUser, SystemParameterConfigDTO dto) { ensurePlatformAdmin(currentUser); String group = normalize(dto.getConfigGroup()); @@ -65,6 +81,10 @@ public class SystemParameterConfigServiceImpl implements SystemParameterConfigSe } @Override + /** + * Purpose: getEnabledValue supports SystemParameterConfigServiceImpl.java by holding or executing the get enabled value business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String getEnabledValue(String configGroup, String configKey) { if (!StringUtils.hasText(configGroup) || !StringUtils.hasText(configKey)) { return ""; @@ -78,16 +98,28 @@ public class SystemParameterConfigServiceImpl implements SystemParameterConfigSe return config == null ? "" : config.getConfigValue(); } + /** + * Purpose: ensurePlatformAdmin supports SystemParameterConfigServiceImpl.java by holding or executing the ensure platform admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void ensurePlatformAdmin(UserDO currentUser) { if (currentUser == null || !Integer.valueOf(4).equals(currentUser.getType())) { throw new RuntimeException("仅平台管理员可以管理系统参数"); } } + /** + * Purpose: normalize supports SystemParameterConfigServiceImpl.java by holding or executing the normalize business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String normalize(String value) { return value.trim().toUpperCase(Locale.ROOT); } + /** + * Purpose: toVO supports SystemParameterConfigServiceImpl.java by holding or executing the to vo business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private SystemParameterConfigVO toVO(SystemParameterConfigDO config) { SystemParameterConfigVO vo = new SystemParameterConfigVO(); vo.setId(config.getId()); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/TagServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/TagServiceImpl.java index 99bb20d8..ba337063 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/TagServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/TagServiceImpl.java @@ -31,7 +31,15 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class TagServiceImpl extends ServiceImpl implements TagService { + /** + * Purpose: TAG_DETAIL_CACHE_PREFIX supports TagServiceImpl.java by holding or executing the tag detail cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TAG_DETAIL_CACHE_PREFIX = "cache:tag:detail:"; + /** + * Purpose: TAG_LIST_CACHE_PREFIX supports TagServiceImpl.java by holding or executing the tag list cache prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TAG_LIST_CACHE_PREFIX = "cache:tag:list:"; /** * Variable `tagMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserAssetServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserAssetServiceImpl.java index 5b7969d7..4a1425b6 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserAssetServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserAssetServiceImpl.java @@ -39,11 +39,35 @@ import java.util.stream.Collectors; */ public class UserAssetServiceImpl implements UserAssetService { + /** + * Purpose: VIP_LEVEL_NORMAL supports UserAssetServiceImpl.java by holding or executing the vip level normal business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String VIP_LEVEL_NORMAL = "普通"; + /** + * Purpose: SCENE_RECHARGE supports UserAssetServiceImpl.java by holding or executing the scene recharge business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SCENE_RECHARGE = "RECHARGE"; + /** + * Purpose: SCENE_MANUAL_ADD supports UserAssetServiceImpl.java by holding or executing the scene manual add business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SCENE_MANUAL_ADD = "MANUAL_ADD"; + /** + * Purpose: SCENE_MANUAL_DEDUCT supports UserAssetServiceImpl.java by holding or executing the scene manual deduct business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SCENE_MANUAL_DEDUCT = "MANUAL_DEDUCT"; + /** + * Purpose: SCENE_ORDER_CONSUME supports UserAssetServiceImpl.java by holding or executing the scene order consume business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SCENE_ORDER_CONSUME = "ORDER_CONSUME"; + /** + * Purpose: SCENE_ORDER_REFUND supports UserAssetServiceImpl.java by holding or executing the scene order refund business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SCENE_ORDER_REFUND = "ORDER_REFUND"; /** * Variable `balanceMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -61,6 +85,10 @@ public class UserAssetServiceImpl implements UserAssetService { * Variable `vipBenefitMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. */ private final VipBenefitMapper vipBenefitMapper; + /** + * Purpose: vipRechargePlanMapper supports UserAssetServiceImpl.java by holding or executing the vip recharge plan mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final VipRechargePlanMapper vipRechargePlanMapper; /** * Variable `userMapper`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. @@ -517,6 +545,10 @@ public class UserAssetServiceImpl implements UserAssetService { return user; } + /** + * Purpose: isVipLevelAvailable supports UserAssetServiceImpl.java by holding or executing the is vip level available business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isVipLevelAvailable(String vipLevel) { if (!StringUtils.hasText(vipLevel)) { return false; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserServiceImpl.java index 837199ea..89062cfe 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/UserServiceImpl.java @@ -71,14 +71,42 @@ import java.util.stream.Collectors; @Service @RequiredArgsConstructor public class UserServiceImpl extends ServiceImpl implements UserService { + /** + * Purpose: VIP_LEVEL_NORMAL supports UserServiceImpl.java by holding or executing the vip level normal business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String VIP_LEVEL_NORMAL = "普通"; + /** + * Purpose: PHONE_REGEX supports UserServiceImpl.java by holding or executing the phone regex business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String PHONE_REGEX = "^1[3-9]\\d{9}$"; + /** + * Purpose: DEFAULT_AVATAR_URL supports UserServiceImpl.java by holding or executing the default avatar url business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String DEFAULT_AVATAR_URL = "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"; private static final BigDecimal DEFAULT_NAIL_ARTIST_RATING = BigDecimal.valueOf(4.5); + /** + * Purpose: DELETED_PHONE_MARKER supports UserServiceImpl.java by holding or executing the deleted phone marker business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String DELETED_PHONE_MARKER = "_deleted_"; + /** + * Purpose: LOGIN_FAIL_KEY_PREFIX supports UserServiceImpl.java by holding or executing the login fail key prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String LOGIN_FAIL_KEY_PREFIX = "user:login:failed:"; + /** + * Purpose: MAX_LOGIN_FAILURES supports UserServiceImpl.java by holding or executing the max login failures business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int MAX_LOGIN_FAILURES = 5; private static final Duration LOGIN_FAIL_EXPIRE = Duration.ofDays(7); + /** + * Purpose: SYSTEM_PERMISSION_ASSIGNER_ID supports UserServiceImpl.java by holding or executing the system permission assigner id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final Long SYSTEM_PERMISSION_ASSIGNER_ID = 0L; private static final Set MANAGED_DEFAULT_PERMISSION_CODES = PermissionPolicy.getManagedDefaultPermissionCodes(); private static final Map DEFAULT_PERMISSION_SEEDS = PermissionCatalog.getDefinitionsByCode(); @@ -1055,7 +1083,15 @@ public class UserServiceImpl extends ServiceImpl implements return buildLoginResponse(userDO, resolvedShopId, ENCODED_UNSET_PASSWORD.equals(userDO.getPassword())); } + /** + * Purpose: UNSET_PASSWORD_MARKER supports UserServiceImpl.java by holding or executing the unset password marker business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String UNSET_PASSWORD_MARKER = "__UNSET_PASSWORD__"; + /** + * Purpose: ENCODED_UNSET_PASSWORD supports UserServiceImpl.java by holding or executing the encoded unset password business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String ENCODED_UNSET_PASSWORD = "$2a$10$EixZaYVK1fsbw1ZfbX3OXePaWxn96p36WQoeG6Lruj3vjPGga31lW"; // 加密后的特殊标识 /** @@ -2319,6 +2355,10 @@ public class UserServiceImpl extends ServiceImpl implements } } + /** + * Purpose: validatePasswordStrength supports UserServiceImpl.java by holding or executing the validate password strength business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void validatePasswordStrength(String password) { if (!StringUtils.hasText(password) || password.length() < 8 || password.length() > 32) { throw new RuntimeException("密码长度需为 8-32 位"); @@ -2692,6 +2732,10 @@ public class UserServiceImpl extends ServiceImpl implements .collect(Collectors.toList()); } + /** + * Purpose: listSelectableShopOptionsForPlatformAdmin supports UserServiceImpl.java by holding or executing the list selectable shop options for platform admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private List listSelectableShopOptionsForPlatformAdmin() { return shopService.listAllShopsForAdmin().stream() .filter(shop -> !Boolean.TRUE.equals(shop.getAuthorizationExpired())) diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VerificationCodeServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VerificationCodeServiceImpl.java index 7be43f93..9a49fea9 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VerificationCodeServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VerificationCodeServiceImpl.java @@ -18,10 +18,30 @@ import java.time.Duration; @RequiredArgsConstructor public class VerificationCodeServiceImpl implements VerificationCodeService { + /** + * Purpose: CODE_PREFIX supports VerificationCodeServiceImpl.java by holding or executing the code prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String CODE_PREFIX = "verification:code:"; + /** + * Purpose: SEND_TIME_PREFIX supports VerificationCodeServiceImpl.java by holding or executing the send time prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SEND_TIME_PREFIX = "verification:send_time:"; + /** + * Purpose: CODE_LENGTH supports VerificationCodeServiceImpl.java by holding or executing the code length business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int CODE_LENGTH = 6; + /** + * Purpose: CODE_EXPIRE_MINUTES supports VerificationCodeServiceImpl.java by holding or executing the code expire minutes business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int CODE_EXPIRE_MINUTES = 5; + /** + * Purpose: RESEND_INTERVAL_SECONDS supports VerificationCodeServiceImpl.java by holding or executing the resend interval seconds business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int RESEND_INTERVAL_SECONDS = 60; /** * Variable `redisTemplate`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VipRechargePlanServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VipRechargePlanServiceImpl.java index 0ce1f85a..e621a6f4 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VipRechargePlanServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/VipRechargePlanServiceImpl.java @@ -204,6 +204,10 @@ public class VipRechargePlanServiceImpl extends ServiceImpl listVipLevelOptions(UserDO currentUser, Long shopId) { Long scopedShopId = currentUser == null ? shopId : adminScopeHelper.resolveShopScope(currentUser, shopId); if (scopedShopId != null && scopedShopId > 0) { @@ -322,6 +326,10 @@ public class VipRechargePlanServiceImpl extends ServiceImpl() .eq(VipRechargePlanDO::getShopId, shopId) diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniAuthServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniAuthServiceImpl.java index 24ece4cc..a701bf47 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniAuthServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniAuthServiceImpl.java @@ -44,7 +44,15 @@ import java.util.Objects; @RequiredArgsConstructor public class WechatMiniAuthServiceImpl implements WechatMiniAuthService { + /** + * Purpose: PHONE_REGEX supports WechatMiniAuthServiceImpl.java by holding or executing the phone regex business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String PHONE_REGEX = "^1[3-9]\\d{9}$"; + /** + * Purpose: TICKET_KEY_PREFIX supports WechatMiniAuthServiceImpl.java by holding or executing the ticket key prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String TICKET_KEY_PREFIX = "user:wechat-mini:login-ticket:"; private static final Duration TICKET_TTL = Duration.ofMinutes(5); /** @@ -269,6 +277,10 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService { ); } + /** + * Purpose: resolvePlatformAdminLoginShops supports WechatMiniAuthServiceImpl.java by holding or executing the resolve platform admin login shops business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private List resolvePlatformAdminLoginShops(UserDO userDO) { LoginShopSelectionVO selection = null; if (StringUtils.hasText(userDO.getPhone())) { @@ -690,11 +702,35 @@ public class WechatMiniAuthServiceImpl implements WechatMiniAuthService { } @Data + /** + * Purpose: TicketPayload supports WechatMiniAuthServiceImpl.java by holding or executing the ticket payload business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static class TicketPayload { + /** + * Purpose: userId supports WechatMiniAuthServiceImpl.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; + /** + * Purpose: phone supports WechatMiniAuthServiceImpl.java by holding or executing the phone business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String phone; + /** + * Purpose: openId supports WechatMiniAuthServiceImpl.java by holding or executing the open id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String openId; + /** + * Purpose: unionId supports WechatMiniAuthServiceImpl.java by holding or executing the union id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String unionId; + /** + * Purpose: newUser supports WechatMiniAuthServiceImpl.java by holding or executing the new user business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean newUser; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniClientServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniClientServiceImpl.java index d6817a3b..0d16e366 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniClientServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WechatMiniClientServiceImpl.java @@ -28,7 +28,15 @@ import java.util.Objects; @RequiredArgsConstructor public class WechatMiniClientServiceImpl implements WechatMiniClientService { + /** + * Purpose: ACCESS_TOKEN_CACHE_KEY_PREFIX supports WechatMiniClientServiceImpl.java by holding or executing the access token cache key prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String ACCESS_TOKEN_CACHE_KEY_PREFIX = "wechat:mini:access-token:"; + /** + * Purpose: ACCESS_TOKEN_URL supports WechatMiniClientServiceImpl.java by holding or executing the access token url business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token"; /** * Variable `restTemplate`: Spring-injected collaborator used by this class to finish database access, validation, or downstream calls. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WishlistServiceImpl.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WishlistServiceImpl.java index 9cc22d45..668c7b81 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WishlistServiceImpl.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/service/impl/WishlistServiceImpl.java @@ -26,9 +26,17 @@ import java.util.stream.Collectors; public class WishlistServiceImpl extends ServiceImpl implements WishlistService { @Autowired + /** + * Purpose: productService supports WishlistServiceImpl.java by holding or executing the product service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ProductService productService; @Autowired + /** + * Purpose: productMapper supports WishlistServiceImpl.java by holding or executing the product mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private ProductMapper productMapper; @Override diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/AdminScopeHelper.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/AdminScopeHelper.java index 6f4884db..11a8f83f 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/AdminScopeHelper.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/AdminScopeHelper.java @@ -9,11 +9,27 @@ import javax.servlet.http.HttpServletRequest; @Component @RequiredArgsConstructor +/** + * Purpose: AdminScopeHelper supports AdminScopeHelper.java by holding or executing the admin scope helper business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class AdminScopeHelper { + /** + * Purpose: userService supports AdminScopeHelper.java by holding or executing the user service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserService userService; + /** + * Purpose: userShopBindingSupport supports AdminScopeHelper.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserShopBindingSupport userShopBindingSupport; + /** + * Purpose: getCurrentUser supports AdminScopeHelper.java by holding or executing the get current user business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public UserDO getCurrentUser(HttpServletRequest request) { Long userId = (Long) request.getAttribute("userId"); if (userId == null) { @@ -31,19 +47,35 @@ public class AdminScopeHelper { return currentUser; } + /** + * Purpose: isPlatformAdmin supports AdminScopeHelper.java by holding or executing the is platform admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isPlatformAdmin(UserDO currentUser) { return currentUser != null && Integer.valueOf(4).equals(currentUser.getType()); } + /** + * Purpose: isPlatformOverviewMode supports AdminScopeHelper.java by holding or executing the is platform overview mode business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isPlatformOverviewMode(UserDO currentUser) { return isPlatformAdmin(currentUser) && (currentUser.getShopId() == null || currentUser.getShopId() <= 0); } + /** + * Purpose: requireShopContext supports AdminScopeHelper.java by holding or executing the require shop context business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void requireShopContext(UserDO currentUser) { requireShopContext(currentUser, "请先选择店铺后再管理店铺细节"); } + /** + * Purpose: requireShopContext supports AdminScopeHelper.java by holding or executing the require shop context business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void requireShopContext(UserDO currentUser, String message) { if (isPlatformOverviewMode(currentUser)) { throw new RuntimeException(message); @@ -53,6 +85,10 @@ public class AdminScopeHelper { } } + /** + * Purpose: getManagedShopId supports AdminScopeHelper.java by holding or executing the get managed shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Long getManagedShopId(UserDO currentUser) { if (isPlatformAdmin(currentUser)) { return null; @@ -65,6 +101,10 @@ public class AdminScopeHelper { return currentUser.getShopId(); } + /** + * Purpose: resolveShopScope supports AdminScopeHelper.java by holding or executing the resolve shop scope business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Long resolveShopScope(UserDO currentUser, Long requestedShopId) { Long managedShopId = getManagedShopId(currentUser); if (managedShopId != null) { @@ -79,6 +119,10 @@ public class AdminScopeHelper { return null; } + /** + * Purpose: ensureShopAccessible supports AdminScopeHelper.java by holding or executing the ensure shop accessible business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void ensureShopAccessible(UserDO currentUser, Long targetShopId, String message) { Long managedShopId = getManagedShopId(currentUser); if (managedShopId != null && !managedShopId.equals(targetShopId)) { @@ -86,6 +130,10 @@ public class AdminScopeHelper { } } + /** + * Purpose: ensureUserAccessibleInCurrentShop supports AdminScopeHelper.java by holding or executing the ensure user accessible in current shop business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void ensureUserAccessibleInCurrentShop(UserDO currentUser, Long targetUserId, String message) { if (currentUser == null || targetUserId == null) { throw new RuntimeException(message); @@ -99,12 +147,20 @@ public class AdminScopeHelper { } } + /** + * Purpose: requirePlatformAdmin supports AdminScopeHelper.java by holding or executing the require platform admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void requirePlatformAdmin(UserDO currentUser, String message) { if (!isPlatformAdmin(currentUser)) { throw new RuntimeException(message); } } + /** + * Purpose: ensureAssignableUserType supports AdminScopeHelper.java by holding or executing the ensure assignable user type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void ensureAssignableUserType(UserDO currentUser, Integer targetType) { if (targetType == null) { throw new RuntimeException("用户类型不能为空"); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/BookableArtistSupport.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/BookableArtistSupport.java index 9c18c210..945a5e19 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/BookableArtistSupport.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/BookableArtistSupport.java @@ -15,12 +15,32 @@ import java.util.stream.Collectors; @Component @RequiredArgsConstructor +/** + * Purpose: BookableArtistSupport supports BookableArtistSupport.java by holding or executing the bookable artist support business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class BookableArtistSupport { + /** + * Purpose: userMapper supports BookableArtistSupport.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserMapper userMapper; + /** + * Purpose: nailArtistInfoMapper supports BookableArtistSupport.java by holding or executing the nail artist info mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final NailArtistInfoMapper nailArtistInfoMapper; + /** + * Purpose: userShopBindingSupport supports BookableArtistSupport.java by holding or executing the user shop binding support business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserShopBindingSupport userShopBindingSupport; + /** + * Purpose: isValidBookableArtist supports BookableArtistSupport.java by holding or executing the is valid bookable artist business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isValidBookableArtist(Long shopId, Long artistId) { if (artistId == null || artistId <= 0) { return false; @@ -39,6 +59,10 @@ public class BookableArtistSupport { return shopId == null || shopId <= 0 || userShopBindingSupport.isUserAccessibleInShop(artistId, shopId); } + /** + * Purpose: isBookableServiceUser supports BookableArtistSupport.java by holding or executing the is bookable service user business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isBookableServiceUser(UserDO user) { if (user == null || Integer.valueOf(1).equals(user.getIsDelete()) || !Integer.valueOf(1).equals(user.getStatus())) { return false; @@ -60,6 +84,10 @@ public class BookableArtistSupport { && Integer.valueOf(1).equals(info.getParticipateProduction()); } + /** + * Purpose: filterValidBookableArtists supports BookableArtistSupport.java by holding or executing the filter valid bookable artists business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String filterValidBookableArtists(Long shopId, String rawBookableArtists) { if (!StringUtils.hasText(rawBookableArtists)) { return ""; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ObjectStorageUrlSupport.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ObjectStorageUrlSupport.java index 931739fd..def57a57 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ObjectStorageUrlSupport.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ObjectStorageUrlSupport.java @@ -17,11 +17,27 @@ import java.net.URI; @RequiredArgsConstructor public class ObjectStorageUrlSupport { + /** + * Purpose: DEFAULT_SIGNED_URL_EXPIRE_MINUTES supports ObjectStorageUrlSupport.java by holding or executing the default signed url expire minutes business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final int DEFAULT_SIGNED_URL_EXPIRE_MINUTES = 60; + /** + * Purpose: minioService supports ObjectStorageUrlSupport.java by holding or executing the minio service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final MinioService minioService; + /** + * Purpose: minioConfig supports ObjectStorageUrlSupport.java by holding or executing the minio config business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final MinioConfig minioConfig; + /** + * Purpose: toAccessibleUrl supports ObjectStorageUrlSupport.java by holding or executing the to accessible url business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String toAccessibleUrl(String fileUrl) { if (!StringUtils.hasText(fileUrl)) { return fileUrl; @@ -38,6 +54,10 @@ public class ObjectStorageUrlSupport { } } + /** + * Purpose: toStoredUrl supports ObjectStorageUrlSupport.java by holding or executing the to stored url business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String toStoredUrl(String fileUrl) { if (!StringUtils.hasText(fileUrl)) { return fileUrl; @@ -49,6 +69,10 @@ public class ObjectStorageUrlSupport { return minioService.getFileUrl(objectName); } + /** + * Purpose: extractObjectName supports ObjectStorageUrlSupport.java by holding or executing the extract object name business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String extractObjectName(String fileUrl) { if (!StringUtils.hasText(fileUrl)) { return ""; @@ -72,6 +96,10 @@ public class ObjectStorageUrlSupport { } } + /** + * Purpose: extractObjectNameFromPath supports ObjectStorageUrlSupport.java by holding or executing the extract object name from path business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String extractObjectNameFromPath(String path) { String bucketPrefix = "/" + minioConfig.getBucketName() + "/"; if (path.startsWith(bucketPrefix)) { @@ -103,6 +131,10 @@ public class ObjectStorageUrlSupport { return ""; } + /** + * Purpose: trimBucketPrefix supports ObjectStorageUrlSupport.java by holding or executing the trim bucket prefix business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String trimBucketPrefix(String rawValue) { String normalized = stripLeadingSlash(rawValue); String bucketPrefix = minioConfig.getBucketName() + "/"; @@ -112,6 +144,10 @@ public class ObjectStorageUrlSupport { return normalized; } + /** + * Purpose: stripLeadingSlash supports ObjectStorageUrlSupport.java by holding or executing the strip leading slash business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String stripLeadingSlash(String rawValue) { String normalized = rawValue; while (normalized.startsWith("/")) { @@ -120,6 +156,10 @@ public class ObjectStorageUrlSupport { return normalized; } + /** + * Purpose: stripQuery supports ObjectStorageUrlSupport.java by holding or executing the strip query business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String stripQuery(String rawValue) { int queryIndex = rawValue.indexOf('?'); return queryIndex >= 0 ? rawValue.substring(0, queryIndex) : rawValue; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStateMachine.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStateMachine.java index 88301a01..e990b8ca 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStateMachine.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStateMachine.java @@ -1,10 +1,18 @@ package com.xiaowang.yuminailcore.support; +/** + * Purpose: OrderStateMachine supports OrderStateMachine.java by holding or executing the order state machine business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public final class OrderStateMachine { private OrderStateMachine() { } + /** + * Purpose: isAllowedTransition supports OrderStateMachine.java by holding or executing the is allowed transition business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static boolean isAllowedTransition(Integer fromStatus, Integer toStatus) { OrderStatus from = OrderStatus.requireKnown(fromStatus); OrderStatus to = OrderStatus.requireKnown(toStatus); @@ -12,6 +20,10 @@ public final class OrderStateMachine { && (to == OrderStatus.COMPLETED || to == OrderStatus.CANCELLED); } + /** + * Purpose: requireAllowedTransition supports OrderStateMachine.java by holding or executing the require allowed transition business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static void requireAllowedTransition(Integer fromStatus, Integer toStatus) { if (!isAllowedTransition(fromStatus, toStatus)) { throw new RuntimeException("订单状态不允许处理"); diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStatus.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStatus.java index 79609520..bea2d805 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStatus.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/OrderStatus.java @@ -2,21 +2,37 @@ package com.xiaowang.yuminailcore.support; import java.util.Arrays; +/** + * Purpose: OrderStatus supports OrderStatus.java by holding or executing the order status business role. + * Usage: reference this enum from the owning layer and pass validated inputs before reading or updating related state. + */ public enum OrderStatus { PENDING_SERVICE(1), COMPLETED(2), CANCELLED(3); + /** + * Purpose: code supports OrderStatus.java by holding or executing the code business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final int code; OrderStatus(int code) { this.code = code; } + /** + * Purpose: getCode supports OrderStatus.java by holding or executing the get code business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public int getCode() { return code; } + /** + * Purpose: requireKnown supports OrderStatus.java by holding or executing the require known business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static OrderStatus requireKnown(Integer code) { return Arrays.stream(values()) .filter(status -> Integer.valueOf(status.code).equals(code)) diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionCatalog.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionCatalog.java index f3ab5ddc..7a7fdf6a 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionCatalog.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionCatalog.java @@ -84,6 +84,10 @@ public final class PermissionCatalog { private PermissionCatalog() { } + /** + * Purpose: getDefaultPermissionCodes supports PermissionCatalog.java by holding or executing the get default permission codes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static List getDefaultPermissionCodes(Integer userType) { return switch (userType == null ? -1 : userType) { case 4 -> ADMIN_DEFAULT_PERMISSION_CODES; @@ -93,24 +97,44 @@ public final class PermissionCatalog { }; } + /** + * Purpose: getDefaultPermissionCodeSet supports PermissionCatalog.java by holding or executing the get default permission code set business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Set getDefaultPermissionCodeSet(Integer userType) { return Set.copyOf(getDefaultPermissionCodes(userType)); } + /** + * Purpose: getManagedPermissionCodes supports PermissionCatalog.java by holding or executing the get managed permission codes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Set getManagedPermissionCodes() { return MANAGED_PERMISSION_CODES; } + /** + * Purpose: getManagedDefinitions supports PermissionCatalog.java by holding or executing the get managed definitions business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Collection getManagedDefinitions() { return MANAGED_PERMISSION_CODES.stream() .map(PermissionCatalog::getRequiredDefinition) .toList(); } + /** + * Purpose: getDefinitionsByCode supports PermissionCatalog.java by holding or executing the get definitions by code business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Map getDefinitionsByCode() { return DEFINITIONS; } + /** + * Purpose: getRequiredDefinition supports PermissionCatalog.java by holding or executing the get required definition business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static PermissionDefinition getRequiredDefinition(String permissionCode) { PermissionDefinition definition = DEFINITIONS.get(permissionCode); if (definition == null) { @@ -119,6 +143,10 @@ public final class PermissionCatalog { return definition; } + /** + * Purpose: isAllowedForPlatformOverview supports PermissionCatalog.java by holding or executing the is allowed for platform overview business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static boolean isAllowedForPlatformOverview(String permissionCode) { if (permissionCode == null || permissionCode.isBlank()) { return true; @@ -132,6 +160,10 @@ public final class PermissionCatalog { return PLATFORM_OVERVIEW_PREFIXES.stream().anyMatch(permissionCode::startsWith); } + /** + * Purpose: canManageUserType supports PermissionCatalog.java by holding or executing the can manage user type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static boolean canManageUserType(Integer operatorType, Integer targetType) { if (operatorType == null || targetType == null) { return false; @@ -145,6 +177,10 @@ public final class PermissionCatalog { }; } + /** + * Purpose: buildManagedPermissionCodes supports PermissionCatalog.java by holding or executing the build managed permission codes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private static Set buildManagedPermissionCodes() { LinkedHashSet permissionCodes = new LinkedHashSet<>(); permissionCodes.addAll(ADMIN_DEFAULT_PERMISSION_CODES); @@ -153,6 +189,10 @@ public final class PermissionCatalog { return Set.copyOf(permissionCodes); } + /** + * Purpose: buildDefinitions supports PermissionCatalog.java by holding or executing the build definitions business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private static Map buildDefinitions() { LinkedHashMap definitions = new LinkedHashMap<>(); put(definitions, "home:view", "查看首页", "首页", "查看系统首页入口与概览"); @@ -219,10 +259,18 @@ public final class PermissionCatalog { return Map.copyOf(definitions); } + /** + * Purpose: put supports PermissionCatalog.java by holding or executing the put business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private static void put(Map definitions, String code, String name, String group, String description) { definitions.put(code, new PermissionDefinition(code, name, group, description)); } + /** + * Purpose: PermissionDefinition supports PermissionCatalog.java by holding or executing the permission definition business role. + * Usage: reference this record from the owning layer and pass validated inputs before reading or updating related state. + */ public record PermissionDefinition( String permissionCode, String permissionName, diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionPolicy.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionPolicy.java index 42c00da5..d6df0cfa 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionPolicy.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/PermissionPolicy.java @@ -11,18 +11,34 @@ public final class PermissionPolicy { private PermissionPolicy() { } + /** + * Purpose: getDefaultPermissionCodes supports PermissionPolicy.java by holding or executing the get default permission codes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static List getDefaultPermissionCodes(Integer userType) { return PermissionCatalog.getDefaultPermissionCodes(userType); } + /** + * Purpose: getDefaultPermissionCodeSet supports PermissionPolicy.java by holding or executing the get default permission code set business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Set getDefaultPermissionCodeSet(Integer userType) { return PermissionCatalog.getDefaultPermissionCodeSet(userType); } + /** + * Purpose: getManagedDefaultPermissionCodes supports PermissionPolicy.java by holding or executing the get managed default permission codes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Set getManagedDefaultPermissionCodes() { return PermissionCatalog.getManagedPermissionCodes(); } + /** + * Purpose: canManageUserType supports PermissionPolicy.java by holding or executing the can manage user type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static boolean canManageUserType(Integer operatorType, Integer targetType) { return PermissionCatalog.canManageUserType(operatorType, targetType); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/RequestShopContext.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/RequestShopContext.java index eaec3c4a..74e35877 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/RequestShopContext.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/RequestShopContext.java @@ -10,11 +10,19 @@ import javax.servlet.http.HttpServletRequest; */ public final class RequestShopContext { + /** + * Purpose: CURRENT_SHOP_ID_ATTRIBUTE supports RequestShopContext.java by holding or executing the current shop id attribute business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String CURRENT_SHOP_ID_ATTRIBUTE = "currentShopId"; private RequestShopContext() { } + /** + * Purpose: getCurrentShopId supports RequestShopContext.java by holding or executing the get current shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Long getCurrentShopId() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) { @@ -23,6 +31,10 @@ public final class RequestShopContext { return parseShopId(attributes.getRequest().getAttribute(CURRENT_SHOP_ID_ATTRIBUTE)); } + /** + * Purpose: getCurrentShopId supports RequestShopContext.java by holding or executing the get current shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static Long getCurrentShopId(HttpServletRequest request) { if (request == null) { return null; @@ -30,6 +42,10 @@ public final class RequestShopContext { return parseShopId(request.getAttribute(CURRENT_SHOP_ID_ATTRIBUTE)); } + /** + * Purpose: parseShopId supports RequestShopContext.java by holding or executing the parse shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private static Long parseShopId(Object value) { if (value == null) { return null; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditActions.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditActions.java index 82680e8e..637a56d9 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditActions.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditActions.java @@ -1,25 +1,101 @@ package com.xiaowang.yuminailcore.support; +/** + * Purpose: SecurityAuditActions supports SecurityAuditActions.java by holding or executing the security audit actions business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public final class SecurityAuditActions { + /** + * Purpose: SUCCESS supports SecurityAuditActions.java by holding or executing the success business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String SUCCESS = "SUCCESS"; + /** + * Purpose: FAIL supports SecurityAuditActions.java by holding or executing the fail business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String FAIL = "FAIL"; + /** + * Purpose: ORDER_PROCESS supports SecurityAuditActions.java by holding or executing the order process business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String ORDER_PROCESS = "ORDER_PROCESS"; + /** + * Purpose: ARTIST_CHANGE_APPROVE supports SecurityAuditActions.java by holding or executing the artist change approve business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String ARTIST_CHANGE_APPROVE = "ARTIST_CHANGE_APPROVE"; + /** + * Purpose: ARTIST_CHANGE_REJECT supports SecurityAuditActions.java by holding or executing the artist change reject business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String ARTIST_CHANGE_REJECT = "ARTIST_CHANGE_REJECT"; + /** + * Purpose: SHOP_DELETE_BLOCKED supports SecurityAuditActions.java by holding or executing the shop delete blocked business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String SHOP_DELETE_BLOCKED = "SHOP_DELETE_BLOCKED"; + /** + * Purpose: SHOP_STATUS_UPDATE supports SecurityAuditActions.java by holding or executing the shop status update business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String SHOP_STATUS_UPDATE = "SHOP_STATUS_UPDATE"; + /** + * Purpose: PERMISSION_CREATE supports SecurityAuditActions.java by holding or executing the permission create business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String PERMISSION_CREATE = "PERMISSION_CREATE"; + /** + * Purpose: PERMISSION_UPDATE supports SecurityAuditActions.java by holding or executing the permission update business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String PERMISSION_UPDATE = "PERMISSION_UPDATE"; + /** + * Purpose: PERMISSION_DELETE supports SecurityAuditActions.java by holding or executing the permission delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String PERMISSION_DELETE = "PERMISSION_DELETE"; + /** + * Purpose: PERMISSION_ASSIGN supports SecurityAuditActions.java by holding or executing the permission assign business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String PERMISSION_ASSIGN = "PERMISSION_ASSIGN"; + /** + * Purpose: USER_STATUS_UPDATE supports SecurityAuditActions.java by holding or executing the user status update business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_STATUS_UPDATE = "USER_STATUS_UPDATE"; + /** + * Purpose: USER_RESET_PASSWORD supports SecurityAuditActions.java by holding or executing the user reset password business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_RESET_PASSWORD = "USER_RESET_PASSWORD"; + /** + * Purpose: USER_DELETE supports SecurityAuditActions.java by holding or executing the user delete business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_DELETE = "USER_DELETE"; + /** + * Purpose: USER_UNBIND supports SecurityAuditActions.java by holding or executing the user unbind business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_UNBIND = "USER_UNBIND"; + /** + * Purpose: USER_BALANCE_CHANGE supports SecurityAuditActions.java by holding or executing the user balance change business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_BALANCE_CHANGE = "USER_BALANCE_CHANGE"; + /** + * Purpose: USER_VIP_OVERRIDE supports SecurityAuditActions.java by holding or executing the user vip override business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_VIP_OVERRIDE = "USER_VIP_OVERRIDE"; + /** + * Purpose: USER_VIP_RECALCULATE supports SecurityAuditActions.java by holding or executing the user vip recalculate business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String USER_VIP_RECALCULATE = "USER_VIP_RECALCULATE"; private SecurityAuditActions() { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditSupport.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditSupport.java index cc9decdb..ac68e418 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditSupport.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/SecurityAuditSupport.java @@ -8,18 +8,38 @@ import javax.servlet.http.HttpServletRequest; @Component @RequiredArgsConstructor +/** + * Purpose: SecurityAuditSupport supports SecurityAuditSupport.java by holding or executing the security audit support business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SecurityAuditSupport { + /** + * Purpose: securityAuditLogService supports SecurityAuditSupport.java by holding or executing the security audit log service business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final SecurityAuditLogService securityAuditLogService; + /** + * Purpose: success supports SecurityAuditSupport.java by holding or executing the success business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void success(HttpServletRequest request, String action, String reason) { record(request, action, SecurityAuditActions.SUCCESS, reason); } + /** + * Purpose: fail supports SecurityAuditSupport.java by holding or executing the fail business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void fail(HttpServletRequest request, String action, String reason) { record(request, action, SecurityAuditActions.FAIL, reason); } + /** + * Purpose: record supports SecurityAuditSupport.java by holding or executing the record business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void record(HttpServletRequest request, String action, String result, String reason) { try { Long userId = request == null ? null : asLong(request.getAttribute("userId")); @@ -30,6 +50,10 @@ public class SecurityAuditSupport { } } + /** + * Purpose: asLong supports SecurityAuditSupport.java by holding or executing the as long business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long asLong(Object value) { if (value instanceof Long) { return (Long) value; @@ -40,6 +64,10 @@ public class SecurityAuditSupport { return null; } + /** + * Purpose: asString supports SecurityAuditSupport.java by holding or executing the as string business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String asString(Object value) { return value == null ? null : String.valueOf(value); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ShopThemeSupport.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ShopThemeSupport.java index 97c52929..d2038dc4 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ShopThemeSupport.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/ShopThemeSupport.java @@ -5,12 +5,20 @@ import org.springframework.util.StringUtils; import java.util.Locale; import java.util.regex.Pattern; +/** + * Purpose: ShopThemeSupport supports ShopThemeSupport.java by holding or executing the shop theme support business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public final class ShopThemeSupport { private static final Pattern HEX_COLOR = Pattern.compile("^#[0-9a-fA-F]{6}$"); private ShopThemeSupport() { } + /** + * Purpose: normalizeColor supports ShopThemeSupport.java by holding or executing the normalize color business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static String normalizeColor(String color, String fieldName) { if (!StringUtils.hasText(color)) { return null; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/UserShopBindingSupport.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/UserShopBindingSupport.java index 21c6ca9b..7785d608 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/UserShopBindingSupport.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/UserShopBindingSupport.java @@ -32,10 +32,26 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class UserShopBindingSupport { + /** + * Purpose: userShopBindingMapper supports UserShopBindingSupport.java by holding or executing the user shop binding mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserShopBindingMapper userShopBindingMapper; + /** + * Purpose: shopMapper supports UserShopBindingSupport.java by holding or executing the shop mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final ShopMapper shopMapper; + /** + * Purpose: userMapper supports UserShopBindingSupport.java by holding or executing the user mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UserMapper userMapper; + /** + * Purpose: listBindingsByUserId supports UserShopBindingSupport.java by holding or executing the list bindings by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listBindingsByUserId(Long userId, boolean includeDeleted) { if (userId == null) { return List.of(); @@ -50,6 +66,10 @@ public class UserShopBindingSupport { return userShopBindingMapper.selectList(wrapper); } + /** + * Purpose: hasBindingHistory supports UserShopBindingSupport.java by holding or executing the has binding history business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean hasBindingHistory(Long userId) { if (userId == null) { return false; @@ -58,6 +78,10 @@ public class UserShopBindingSupport { .eq(UserShopBindingDO::getUserId, userId)) > 0; } + /** + * Purpose: listActiveBindingsByUserId supports UserShopBindingSupport.java by holding or executing the list active bindings by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listActiveBindingsByUserId(Long userId) { return listBindingsByUserId(userId, false).stream() .filter(binding -> Integer.valueOf(1).equals(binding.getStatus())) @@ -67,18 +91,34 @@ public class UserShopBindingSupport { .collect(Collectors.toList()); } + /** + * Purpose: listActiveShopIdsByUserId supports UserShopBindingSupport.java by holding or executing the list active shop ids by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listActiveShopIdsByUserId(Long userId) { return listShopIdsByUserId(userId, true, true); } + /** + * Purpose: listActiveShopOptionsByUserId supports UserShopBindingSupport.java by holding or executing the list active shop options by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listActiveShopOptionsByUserId(Long userId) { return listShopOptionsByUserId(userId, true, true); } + /** + * Purpose: listAllActiveShopOptions supports UserShopBindingSupport.java by holding or executing the list all active shop options business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listAllActiveShopOptions() { return toShopOptions(fetchAllShopMap(true)); } + /** + * Purpose: listShopIdsByUserId supports UserShopBindingSupport.java by holding or executing the list shop ids by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listShopIdsByUserId(Long userId, boolean onlyActiveBindings, boolean onlyActiveShops) { return listShopOptionsByUserId(userId, onlyActiveBindings, onlyActiveShops).stream() .map(ShopSimpleVO::getId) @@ -86,11 +126,19 @@ public class UserShopBindingSupport { .collect(Collectors.toList()); } + /** + * Purpose: listShopOptionsByUserId supports UserShopBindingSupport.java by holding or executing the list shop options by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listShopOptionsByUserId(Long userId, boolean onlyActiveBindings, boolean onlyActiveShops) { return listShopOptionsByUserIds(List.of(userId), onlyActiveBindings, onlyActiveShops) .getOrDefault(userId, List.of()); } + /** + * Purpose: hasActiveBinding supports UserShopBindingSupport.java by holding or executing the has active binding business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean hasActiveBinding(Long userId, Long shopId) { if (userId == null || shopId == null || shopId <= 0) { return false; @@ -99,6 +147,10 @@ public class UserShopBindingSupport { .anyMatch(binding -> shopId.equals(binding.getShopId())); } + /** + * Purpose: hasBindingInShop supports UserShopBindingSupport.java by holding or executing the has binding in shop business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean hasBindingInShop(Long userId, Long shopId) { if (userId == null || shopId == null || shopId <= 0) { return false; @@ -109,10 +161,18 @@ public class UserShopBindingSupport { .eq(UserShopBindingDO::getIsDelete, 0)) > 0; } + /** + * Purpose: isShopActive supports UserShopBindingSupport.java by holding or executing the is shop active business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isShopActive(Long shopId) { return isShopEnabledIgnoringAuthorization(shopId) && !isShopAuthorizationExpired(shopId); } + /** + * Purpose: isShopEnabledIgnoringAuthorization supports UserShopBindingSupport.java by holding or executing the is shop enabled ignoring authorization business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isShopEnabledIgnoringAuthorization(Long shopId) { if (shopId == null || shopId <= 0) { return false; @@ -123,6 +183,10 @@ public class UserShopBindingSupport { && Integer.valueOf(1).equals(normalizeShopStatus(shopDO.getStatus())); } + /** + * Purpose: isShopAuthorizationExpired supports UserShopBindingSupport.java by holding or executing the is shop authorization expired business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isShopAuthorizationExpired(Long shopId) { if (shopId == null || shopId <= 0) { return false; @@ -133,6 +197,10 @@ public class UserShopBindingSupport { && shopDO.getAuthorizationExpireTime().isBefore(LocalDateTime.now()); } + /** + * Purpose: pickPrimaryShopId supports UserShopBindingSupport.java by holding or executing the pick primary shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Long pickPrimaryShopId(Long userId) { return listActiveBindingsByUserId(userId).stream() .map(UserShopBindingDO::getShopId) @@ -140,6 +208,10 @@ public class UserShopBindingSupport { .orElse(null); } + /** + * Purpose: listActiveShopOptionsByUserIds supports UserShopBindingSupport.java by holding or executing the list active shop options by user ids business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Map> listActiveShopOptionsByUserIds(Collection userIds) { return listShopOptionsByUserIds(userIds, true, true); } @@ -193,6 +265,10 @@ public class UserShopBindingSupport { return result; } + /** + * Purpose: listUserIdsByShopId supports UserShopBindingSupport.java by holding or executing the list user ids by shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public List listUserIdsByShopId(Long shopId, boolean onlyActiveBindings) { if (shopId == null || shopId <= 0) { return List.of(); @@ -210,11 +286,19 @@ public class UserShopBindingSupport { .collect(Collectors.toList()); } + /** + * Purpose: countUsersByShopId supports UserShopBindingSupport.java by holding or executing the count users by shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public long countUsersByShopId(Long shopId, boolean onlyActiveBindings) { return listUserIdsByShopId(shopId, onlyActiveBindings).size(); } @Transactional(rollbackFor = Exception.class) + /** + * Purpose: ensureUserBoundToShop supports UserShopBindingSupport.java by holding or executing the ensure user bound to shop business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void ensureUserBoundToShop(Long userId, Long shopId) { if (userId == null || shopId == null || shopId <= 0) { throw new RuntimeException("店铺绑定信息不完整"); @@ -246,6 +330,10 @@ public class UserShopBindingSupport { } @Transactional(rollbackFor = Exception.class) + /** + * Purpose: syncUserShopBindings supports UserShopBindingSupport.java by holding or executing the sync user shop bindings business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void syncUserShopBindings(Long userId, Collection shopIds) { if (userId == null) { return; @@ -284,6 +372,10 @@ public class UserShopBindingSupport { } @Transactional(rollbackFor = Exception.class) + /** + * Purpose: updateBindingStatus supports UserShopBindingSupport.java by holding or executing the update binding status business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean updateBindingStatus(Long userId, Long shopId, Integer status) { if (userId == null || shopId == null || shopId <= 0) { return false; @@ -311,6 +403,10 @@ public class UserShopBindingSupport { } @Transactional(rollbackFor = Exception.class) + /** + * Purpose: deleteBinding supports UserShopBindingSupport.java by holding or executing the delete binding business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean deleteBinding(Long userId, Long shopId) { if (userId == null || shopId == null || shopId <= 0) { return false; @@ -337,6 +433,10 @@ public class UserShopBindingSupport { } @Transactional(rollbackFor = Exception.class) + /** + * Purpose: deleteBindingsByShopId supports UserShopBindingSupport.java by holding or executing the delete bindings by shop id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void deleteBindingsByShopId(Long shopId) { if (shopId == null || shopId <= 0) { return; @@ -363,6 +463,10 @@ public class UserShopBindingSupport { affectedUserIds.forEach(this::refreshLegacyPrimaryShop); } + /** + * Purpose: canUserAccessShop supports UserShopBindingSupport.java by holding or executing the can user access shop business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean canUserAccessShop(Long userId, Long shopId, boolean adminLogin, Integer userType) { if (Integer.valueOf(4).equals(userType)) { if (shopId == null || shopId <= 0) { @@ -383,6 +487,10 @@ public class UserShopBindingSupport { return hasActiveBinding(userId, shopId); } + /** + * Purpose: isShopSelectableForPlatformAdmin supports UserShopBindingSupport.java by holding or executing the is shop selectable for platform admin business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isShopSelectableForPlatformAdmin(Long shopId) { if (shopId == null || shopId <= 0) { return false; @@ -394,11 +502,19 @@ public class UserShopBindingSupport { || !shopDO.getAuthorizationExpireTime().isBefore(LocalDateTime.now())); } + /** + * Purpose: isUserAccessibleInShop supports UserShopBindingSupport.java by holding or executing the is user accessible in shop business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isUserAccessibleInShop(Long userId, Long shopId) { return hasActiveBinding(userId, shopId); } @Transactional(rollbackFor = Exception.class) + /** + * Purpose: deleteBindingsByUserId supports UserShopBindingSupport.java by holding or executing the delete bindings by user id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void deleteBindingsByUserId(Long userId) { if (userId == null) { return; @@ -415,6 +531,10 @@ public class UserShopBindingSupport { refreshLegacyPrimaryShop(userId); } + /** + * Purpose: normalizeActiveShopIds supports UserShopBindingSupport.java by holding or executing the normalize active shop ids business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Set normalizeActiveShopIds(Collection shopIds) { if (shopIds == null || shopIds.isEmpty()) { return Collections.emptySet(); @@ -432,6 +552,10 @@ public class UserShopBindingSupport { return normalizedShopIds; } + /** + * Purpose: refreshLegacyPrimaryShop supports UserShopBindingSupport.java by holding or executing the refresh legacy primary shop business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void refreshLegacyPrimaryShop(Long userId) { if (userId == null) { return; @@ -454,6 +578,10 @@ public class UserShopBindingSupport { ); } + /** + * Purpose: fetchAllShopMap supports UserShopBindingSupport.java by holding or executing the fetch all shop map business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Map fetchAllShopMap(boolean onlyActiveShops) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper() .eq(ShopDO::getIsDelete, 0); @@ -465,6 +593,10 @@ public class UserShopBindingSupport { .collect(Collectors.toMap(ShopDO::getId, shop -> shop, (left, right) -> left, LinkedHashMap::new)); } + /** + * Purpose: fetchShopMap supports UserShopBindingSupport.java by holding or executing the fetch shop map business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Map fetchShopMap(Collection shopIds, boolean onlyActiveShops) { if (shopIds == null || shopIds.isEmpty()) { return Collections.emptyMap(); @@ -481,6 +613,10 @@ public class UserShopBindingSupport { .collect(Collectors.toMap(ShopDO::getId, shop -> shop, (left, right) -> left, LinkedHashMap::new)); } + /** + * Purpose: toShopOptions supports UserShopBindingSupport.java by holding or executing the to shop options business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private List toShopOptions(Map shopMap) { return shopMap.values().stream() .sorted(Comparator.comparing(ShopDO::getShopName, Comparator.nullsLast(String::compareTo)) @@ -489,6 +625,10 @@ public class UserShopBindingSupport { .collect(Collectors.toList()); } + /** + * Purpose: normalizeShopStatus supports UserShopBindingSupport.java by holding or executing the normalize shop status business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer normalizeShopStatus(Integer status) { return status == null ? 1 : status; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/cache/MultiLevelCacheService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/cache/MultiLevelCacheService.java index 629e3647..fdcf7b5d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/cache/MultiLevelCacheService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/cache/MultiLevelCacheService.java @@ -33,14 +33,38 @@ import java.util.function.Supplier; @Slf4j public class MultiLevelCacheService { + /** + * Purpose: NULL_SENTINEL supports MultiLevelCacheService.java by holding or executing the null sentinel business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String NULL_SENTINEL = "__CACHE_NULL__"; + /** + * Purpose: stringRedisTemplate supports MultiLevelCacheService.java by holding or executing the string redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final StringRedisTemplate stringRedisTemplate; + /** + * Purpose: objectMapper supports MultiLevelCacheService.java by holding or executing the object mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final ObjectMapper objectMapper; + /** + * Purpose: cacheProperties supports MultiLevelCacheService.java by holding or executing the cache properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final AppCacheProperties cacheProperties; + /** + * Purpose: localCache supports MultiLevelCacheService.java by holding or executing the local cache business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Cache localCache; + /** + * Purpose: getLocalCache supports MultiLevelCacheService.java by holding or executing the get local cache business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Cache getLocalCache() { if (localCache == null) { localCache = Caffeine.newBuilder() @@ -65,6 +89,10 @@ public class MultiLevelCacheService { return loaded; } + /** + * Purpose: get supports MultiLevelCacheService.java by holding or executing the get business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public CacheLookup get(String key, Duration localTtl, TypeReference typeReference) { if (!StringUtils.hasText(key)) { return CacheLookup.miss(); @@ -87,6 +115,10 @@ public class MultiLevelCacheService { return CacheLookup.hit(readValue(json, typeReference)); } + /** + * Purpose: put supports MultiLevelCacheService.java by holding or executing the put business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void put(String key, Object value, Duration localTtl, Duration redisTtl) { if (!StringUtils.hasText(key)) { return; @@ -96,6 +128,10 @@ public class MultiLevelCacheService { writeRedisValue(key, json, redisTtl); } + /** + * Purpose: evict supports MultiLevelCacheService.java by holding or executing the evict business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void evict(String... keys) { if (keys == null || keys.length == 0) { return; @@ -106,6 +142,10 @@ public class MultiLevelCacheService { deleteRedisKeys(Set.of(keys)); } + /** + * Purpose: evictByPrefix supports MultiLevelCacheService.java by holding or executing the evict by prefix business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void evictByPrefix(String prefix) { if (!StringUtils.hasText(prefix)) { return; @@ -117,6 +157,10 @@ public class MultiLevelCacheService { } } + /** + * Purpose: readRedisValue supports MultiLevelCacheService.java by holding or executing the read redis value business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String readRedisValue(String key) { try { return stringRedisTemplate.opsForValue().get(key); @@ -126,6 +170,10 @@ public class MultiLevelCacheService { } } + /** + * Purpose: writeRedisValue supports MultiLevelCacheService.java by holding or executing the write redis value business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void writeRedisValue(String key, String json, Duration redisTtl) { try { stringRedisTemplate.opsForValue().set(key, json, redisTtl.getSeconds(), TimeUnit.SECONDS); @@ -134,6 +182,10 @@ public class MultiLevelCacheService { } } + /** + * Purpose: deleteRedisKeys supports MultiLevelCacheService.java by holding or executing the delete redis keys business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void deleteRedisKeys(Set keys) { if (CollectionUtils.isEmpty(keys)) { return; @@ -145,6 +197,10 @@ public class MultiLevelCacheService { } } + /** + * Purpose: scanRedisKeys supports MultiLevelCacheService.java by holding or executing the scan redis keys business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Set scanRedisKeys(String pattern) { Set keys = new LinkedHashSet<>(); try { @@ -166,10 +222,18 @@ public class MultiLevelCacheService { } } + /** + * Purpose: putLocal supports MultiLevelCacheService.java by holding or executing the put local business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void putLocal(String key, String json, Duration localTtl) { getLocalCache().put(key, new LocalCacheEntry(json, System.currentTimeMillis() + Math.max(1L, localTtl.toMillis()))); } + /** + * Purpose: writeValue supports MultiLevelCacheService.java by holding or executing the write value business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String writeValue(Object value) { try { return value == null ? NULL_SENTINEL : objectMapper.writeValueAsString(value); @@ -178,6 +242,10 @@ public class MultiLevelCacheService { } } + /** + * Purpose: readValue supports MultiLevelCacheService.java by holding or executing the read value business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private T readValue(String json, TypeReference typeReference) { if (NULL_SENTINEL.equals(json)) { return null; @@ -190,8 +258,20 @@ public class MultiLevelCacheService { } @Getter + /** + * Purpose: CacheLookup supports MultiLevelCacheService.java by holding or executing the cache lookup business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static final class CacheLookup { + /** + * Purpose: hit supports MultiLevelCacheService.java by holding or executing the hit business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final boolean hit; + /** + * Purpose: value supports MultiLevelCacheService.java by holding or executing the value business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final T value; private CacheLookup(boolean hit, T value) { @@ -199,10 +279,18 @@ public class MultiLevelCacheService { this.value = value; } + /** + * Purpose: hit supports MultiLevelCacheService.java by holding or executing the hit business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static CacheLookup hit(T value) { return new CacheLookup<>(true, value); } + /** + * Purpose: miss supports MultiLevelCacheService.java by holding or executing the miss business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static CacheLookup miss() { return new CacheLookup<>(false, null); } @@ -210,10 +298,26 @@ public class MultiLevelCacheService { @Getter @RequiredArgsConstructor + /** + * Purpose: LocalCacheEntry supports MultiLevelCacheService.java by holding or executing the local cache entry business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ private static final class LocalCacheEntry { + /** + * Purpose: json supports MultiLevelCacheService.java by holding or executing the json business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final String json; + /** + * Purpose: expireAt supports MultiLevelCacheService.java by holding or executing the expire at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final long expireAt; + /** + * Purpose: isExpired supports MultiLevelCacheService.java by holding or executing the is expired business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isExpired() { return System.currentTimeMillis() >= expireAt; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/id/TimeOrderedSnowflakeIdGenerator.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/id/TimeOrderedSnowflakeIdGenerator.java index 1acb2150..df5a5b67 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/id/TimeOrderedSnowflakeIdGenerator.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/id/TimeOrderedSnowflakeIdGenerator.java @@ -19,22 +19,70 @@ import java.util.Locale; @Component public class TimeOrderedSnowflakeIdGenerator { + /** + * Purpose: DEFAULT_EPOCH supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the default epoch business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long DEFAULT_EPOCH = 1704067200000L; + /** + * Purpose: WORKER_ID_BITS supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the worker id bits business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long WORKER_ID_BITS = 5L; + /** + * Purpose: DATACENTER_ID_BITS supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the datacenter id bits business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long DATACENTER_ID_BITS = 5L; + /** + * Purpose: SEQUENCE_BITS supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the sequence bits business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long SEQUENCE_BITS = 12L; private static final long MAX_WORKER_ID = ~(-1L << WORKER_ID_BITS); private static final long MAX_DATACENTER_ID = ~(-1L << DATACENTER_ID_BITS); private static final long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS); + /** + * Purpose: WORKER_ID_SHIFT supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the worker id shift business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long WORKER_ID_SHIFT = SEQUENCE_BITS; + /** + * Purpose: DATACENTER_ID_SHIFT supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the datacenter id shift business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long DATACENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS; + /** + * Purpose: TIMESTAMP_LEFT_SHIFT supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the timestamp left shift business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATACENTER_ID_BITS; + /** + * Purpose: epoch supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the epoch business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final long epoch; + /** + * Purpose: workerId supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the worker id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final long workerId; + /** + * Purpose: datacenterId supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the datacenter id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final long datacenterId; + /** + * Purpose: sequence supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the sequence business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long sequence = 0L; + /** + * Purpose: lastTimestamp supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the last timestamp business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private long lastTimestamp = -1L; public TimeOrderedSnowflakeIdGenerator( @@ -50,6 +98,10 @@ public class TimeOrderedSnowflakeIdGenerator { applicationName, this.epoch, this.datacenterId, this.workerId); } + /** + * Purpose: nextId supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the next id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public synchronized long nextId() { long timestamp = currentTimeMillis(); if (timestamp < lastTimestamp) { @@ -72,10 +124,18 @@ public class TimeOrderedSnowflakeIdGenerator { | sequence; } + /** + * Purpose: nextIdString supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the next id string business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String nextIdString() { return Long.toUnsignedString(nextId()); } + /** + * Purpose: nextBase36String supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the next base36 string business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String nextBase36String(int width) { String raw = Long.toUnsignedString(nextId(), 36).toUpperCase(Locale.ROOT); if (raw.length() >= width) { @@ -84,10 +144,18 @@ public class TimeOrderedSnowflakeIdGenerator { return "0".repeat(width - raw.length()) + raw; } + /** + * Purpose: currentTimeMillis supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the current time millis business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long currentTimeMillis() { return System.currentTimeMillis(); } + /** + * Purpose: waitUntil supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the wait until business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long waitUntil(long targetTimestamp) { long timestamp = currentTimeMillis(); while (timestamp < targetTimestamp) { @@ -97,6 +165,10 @@ public class TimeOrderedSnowflakeIdGenerator { return timestamp; } + /** + * Purpose: waitUntilNextMillis supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the wait until next millis business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long waitUntilNextMillis(long currentTimestamp) { long timestamp = currentTimeMillis(); while (timestamp <= currentTimestamp) { @@ -106,19 +178,35 @@ public class TimeOrderedSnowflakeIdGenerator { return timestamp; } + /** + * Purpose: resolveNodeId supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the resolve node id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long resolveNodeId(long configuredValue, long maxValue, long fallbackValue) { long candidate = configuredValue >= 0 ? configuredValue : fallbackValue; return Math.floorMod(candidate, maxValue + 1); } + /** + * Purpose: resolveDatacenterId supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the resolve datacenter id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long resolveDatacenterId() { return stableHash(resolveMachineFingerprint()); } + /** + * Purpose: resolveWorkerId supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the resolve worker id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long resolveWorkerId(String applicationName) { return stableHash(applicationName + ":" + resolveProcessFingerprint()); } + /** + * Purpose: resolveMachineFingerprint supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the resolve machine fingerprint business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveMachineFingerprint() { try { Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); @@ -144,6 +232,10 @@ public class TimeOrderedSnowflakeIdGenerator { } } + /** + * Purpose: resolveProcessFingerprint supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the resolve process fingerprint business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveProcessFingerprint() { try { return ManagementFactory.getRuntimeMXBean().getName(); @@ -152,6 +244,10 @@ public class TimeOrderedSnowflakeIdGenerator { } } + /** + * Purpose: stableHash supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the stable hash business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private long stableHash(String value) { if (value == null || value.isEmpty()) { return 0L; @@ -165,6 +261,10 @@ public class TimeOrderedSnowflakeIdGenerator { return hash & Long.MAX_VALUE; } + /** + * Purpose: bytesToHex supports TimeOrderedSnowflakeIdGenerator.java by holding or executing the bytes to hex business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String bytesToHex(byte[] source) { StringBuilder builder = new StringBuilder(source.length * 2); for (byte currentByte : source) { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/CachedBodyHttpServletRequest.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/CachedBodyHttpServletRequest.java index 5770ed9b..382e3443 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/CachedBodyHttpServletRequest.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/CachedBodyHttpServletRequest.java @@ -16,6 +16,10 @@ import java.nio.charset.StandardCharsets; */ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper { + /** + * Purpose: cachedBody supports CachedBodyHttpServletRequest.java by holding or executing the cached body business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final byte[] cachedBody; public CachedBodyHttpServletRequest(HttpServletRequest request, byte[] cachedBody) { @@ -24,25 +28,45 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper { } @Override + /** + * Purpose: getInputStream supports CachedBodyHttpServletRequest.java by holding or executing the get input stream business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public ServletInputStream getInputStream() { ByteArrayInputStream inputStream = new ByteArrayInputStream(cachedBody); return new ServletInputStream() { @Override + /** + * Purpose: isFinished supports CachedBodyHttpServletRequest.java by holding or executing the is finished business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isFinished() { return inputStream.available() == 0; } @Override + /** + * Purpose: isReady supports CachedBodyHttpServletRequest.java by holding or executing the is ready business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isReady() { return true; } @Override + /** + * Purpose: setReadListener supports CachedBodyHttpServletRequest.java by holding or executing the set read listener business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void setReadListener(ReadListener readListener) { // no-op } @Override + /** + * Purpose: read supports CachedBodyHttpServletRequest.java by holding or executing the read business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public int read() { return inputStream.read(); } @@ -50,6 +74,10 @@ public class CachedBodyHttpServletRequest extends HttpServletRequestWrapper { } @Override + /** + * Purpose: getReader supports CachedBodyHttpServletRequest.java by holding or executing the get reader business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public BufferedReader getReader() throws IOException { Charset charset = getCharacterEncoding() == null ? StandardCharsets.UTF_8 diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardService.java index 1a128e10..633b0426 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardService.java @@ -25,6 +25,10 @@ import static com.xiaowang.yuminailcore.support.security.RequestSignatureService @Component @RequiredArgsConstructor +/** + * Purpose: OperationGuardService supports OperationGuardService.java by holding or executing the operation guard service business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OperationGuardService { private static final DefaultRedisScript RELEASE_LOCK_SCRIPT = new DefaultRedisScript<>(); @@ -41,9 +45,21 @@ public class OperationGuardService { private static final TypeReference> MAP_TYPE = new TypeReference<>() { }; + /** + * Purpose: stringRedisTemplate supports OperationGuardService.java by holding or executing the string redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final StringRedisTemplate stringRedisTemplate; + /** + * Purpose: objectMapper supports OperationGuardService.java by holding or executing the object mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final ObjectMapper objectMapper; + /** + * Purpose: tryAcquire supports OperationGuardService.java by holding or executing the try acquire business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public GuardHandle tryAcquire(HttpServletRequest request, String action, Duration ttl) { String key = buildKey(request, action); String token = UUID.randomUUID().toString(); @@ -56,6 +72,10 @@ public class OperationGuardService { return new GuardHandle(key, token, Boolean.TRUE.equals(success)); } + /** + * Purpose: release supports OperationGuardService.java by holding or executing the release business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void release(GuardHandle handle) { if (handle == null || !handle.acquired()) { return; @@ -67,6 +87,10 @@ public class OperationGuardService { ); } + /** + * Purpose: buildKey supports OperationGuardService.java by holding or executing the build key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String buildKey(HttpServletRequest request, String action) { String safeAction = sanitize(action); String path = request == null ? "-" : sanitize(request.getRequestURI()); @@ -110,6 +134,10 @@ public class OperationGuardService { ); } + /** + * Purpose: buildUploadKey supports OperationGuardService.java by holding or executing the build upload key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildUploadKey(HttpServletRequest request, String action, Long userId) { String uploadId = firstNonBlank( request == null ? null : request.getParameter("uploadId"), @@ -132,6 +160,10 @@ public class OperationGuardService { ); } + /** + * Purpose: buildRequestFingerprint supports OperationGuardService.java by holding or executing the build request fingerprint business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildRequestFingerprint(HttpServletRequest request, String path) { String canonicalParams = buildCanonicalParams(request == null ? null : request.getParameterMap()); String bodyHash = buildBodyHash(request); @@ -143,6 +175,10 @@ public class OperationGuardService { return DigestUtils.md5DigestAsHex(raw.getBytes(StandardCharsets.UTF_8)); } + /** + * Purpose: resolvePublicSubject supports OperationGuardService.java by holding or executing the resolve public subject business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolvePublicSubject(HttpServletRequest request) { for (String key : new String[]{"account", "phone", "shopId", "productId", "couponId", "userId", "uploadId", "ticket"}) { String value = firstNonBlank( @@ -156,6 +192,10 @@ public class OperationGuardService { return buildRequestFingerprint(request, request == null ? "-" : request.getRequestURI()); } + /** + * Purpose: buildBodyHash supports OperationGuardService.java by holding or executing the build body hash business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildBodyHash(HttpServletRequest request) { if (request == null) { return "-"; @@ -169,6 +209,10 @@ public class OperationGuardService { ); } + /** + * Purpose: readBodyField supports OperationGuardService.java by holding or executing the read body field business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String readBodyField(HttpServletRequest request, String fieldName) { if (request == null || !StringUtils.hasText(fieldName)) { return null; @@ -186,6 +230,10 @@ public class OperationGuardService { } } + /** + * Purpose: buildCanonicalParams supports OperationGuardService.java by holding or executing the build canonical params business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildCanonicalParams(Map parameterMap) { if (parameterMap == null || parameterMap.isEmpty()) { return ""; @@ -206,21 +254,37 @@ public class OperationGuardService { return builder.toString(); } + /** + * Purpose: sortValues supports OperationGuardService.java by holding or executing the sort values business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String[] sortValues(String[] values) { String[] copy = values == null ? new String[0] : values.clone(); Arrays.sort(copy, Comparator.nullsLast(String::compareTo)); return copy; } + /** + * Purpose: isUploadPath supports OperationGuardService.java by holding or executing the is upload path business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isUploadPath(String path) { return StringUtils.hasText(path) && path.contains("/upload/"); } + /** + * Purpose: isAdminRequest supports OperationGuardService.java by holding or executing the is admin request business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isAdminRequest(String path, Integer userType) { return (StringUtils.hasText(path) && (path.startsWith("/admin/") || path.startsWith("/order/admin/"))) || (userType != null && userType >= 2); } + /** + * Purpose: resolveClientIp supports OperationGuardService.java by holding or executing the resolve client ip business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveClientIp(HttpServletRequest request) { if (request == null) { return "-"; @@ -236,6 +300,10 @@ public class OperationGuardService { return request.getRemoteAddr(); } + /** + * Purpose: resolveDeviceId supports OperationGuardService.java by holding or executing the resolve device id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveDeviceId(HttpServletRequest request) { if (request == null) { return "-"; @@ -243,6 +311,10 @@ public class OperationGuardService { return request.getHeader(RequestThrottleService.DEVICE_ID_HEADER); } + /** + * Purpose: sanitize supports OperationGuardService.java by holding or executing the sanitize business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String sanitize(Object value) { if (value == null) { return "-"; @@ -251,6 +323,10 @@ public class OperationGuardService { return text.isEmpty() ? "-" : text.replace(":", "_"); } + /** + * Purpose: firstNonBlank supports OperationGuardService.java by holding or executing the first non blank business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String firstNonBlank(String... values) { if (values == null) { return null; @@ -263,6 +339,10 @@ public class OperationGuardService { return null; } + /** + * Purpose: parseLong supports OperationGuardService.java by holding or executing the parse long business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Long parseLong(Object value) { if (value instanceof Number number) { return number.longValue(); @@ -277,6 +357,10 @@ public class OperationGuardService { return null; } + /** + * Purpose: parseInteger supports OperationGuardService.java by holding or executing the parse integer business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer parseInteger(Object value) { if (value instanceof Number number) { return number.intValue(); @@ -291,6 +375,10 @@ public class OperationGuardService { return null; } + /** + * Purpose: GuardHandle supports OperationGuardService.java by holding or executing the guard handle business role. + * Usage: reference this record from the owning layer and pass validated inputs before reading or updating related state. + */ public record GuardHandle(String key, String token, boolean acquired) { } } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardStrategy.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardStrategy.java index 88eb0ae3..776b1858 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardStrategy.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/OperationGuardStrategy.java @@ -1,5 +1,9 @@ package com.xiaowang.yuminailcore.support.security; +/** + * Purpose: OperationGuardStrategy supports OperationGuardStrategy.java by holding or executing the operation guard strategy business role. + * Usage: reference this enum from the owning layer and pass validated inputs before reading or updating related state. + */ public enum OperationGuardStrategy { REJECT_IF_RUNNING, NOOP_IF_DUPLICATE diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestSignatureService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestSignatureService.java index 1688c821..d067e1ba 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestSignatureService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestSignatureService.java @@ -24,18 +24,58 @@ import java.util.concurrent.TimeUnit; @RequiredArgsConstructor public class RequestSignatureService { + /** + * Purpose: REQUEST_BODY_ATTRIBUTE supports RequestSignatureService.java by holding or executing the request body attribute business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String REQUEST_BODY_ATTRIBUTE = "cachedRequestBody"; + /** + * Purpose: HEADER_TIMESTAMP supports RequestSignatureService.java by holding or executing the header timestamp business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String HEADER_TIMESTAMP = "X-Timestamp"; + /** + * Purpose: HEADER_NONCE supports RequestSignatureService.java by holding or executing the header nonce business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String HEADER_NONCE = "X-Nonce"; + /** + * Purpose: HEADER_SIGNATURE supports RequestSignatureService.java by holding or executing the header signature business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String HEADER_SIGNATURE = "X-Signature"; + /** + * Purpose: HEADER_SIGNATURE_VERSION supports RequestSignatureService.java by holding or executing the header signature version business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String HEADER_SIGNATURE_VERSION = "X-Sign-Version"; + /** + * Purpose: SIGNATURE_VERSION supports RequestSignatureService.java by holding or executing the signature version business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SIGNATURE_VERSION = "v1"; + /** + * Purpose: HMAC_ALGORITHM supports RequestSignatureService.java by holding or executing the hmac algorithm business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String HMAC_ALGORITHM = "HmacSHA256"; + /** + * Purpose: properties supports RequestSignatureService.java by holding or executing the properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final RequestSignatureProperties properties; + /** + * Purpose: stringRedisTemplate supports RequestSignatureService.java by holding or executing the string redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final StringRedisTemplate stringRedisTemplate; + /** + * Purpose: validateRequest supports RequestSignatureService.java by holding or executing the validate request business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void validateRequest(HttpServletRequest request, String accessToken, Long userId) { if (!properties.isEnabled() || isSafeMethod(request.getMethod())) { return; @@ -71,6 +111,10 @@ public class RequestSignatureService { } } + /** + * Purpose: validateTimestamp supports RequestSignatureService.java by holding or executing the validate timestamp business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void validateTimestamp(String timestamp) { long requestTimestamp; try { @@ -85,6 +129,10 @@ public class RequestSignatureService { } } + /** + * Purpose: registerNonce supports RequestSignatureService.java by holding or executing the register nonce business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void registerNonce(Long userId, String nonce) { String nonceKey = "request:nonce:" + (userId == null ? "anon" : userId) + ":" + nonce; Boolean success = stringRedisTemplate.opsForValue().setIfAbsent( @@ -98,6 +146,10 @@ public class RequestSignatureService { } } + /** + * Purpose: isSafeMethod supports RequestSignatureService.java by holding or executing the is safe method business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isSafeMethod(String method) { if (!StringUtils.hasText(method)) { return true; @@ -106,6 +158,10 @@ public class RequestSignatureService { return "GET".equals(normalized) || "HEAD".equals(normalized) || "OPTIONS".equals(normalized); } + /** + * Purpose: resolvePayloadBytes supports RequestSignatureService.java by holding or executing the resolve payload bytes business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private byte[] resolvePayloadBytes(HttpServletRequest request) { Object cachedBody = request.getAttribute(REQUEST_BODY_ATTRIBUTE); if (cachedBody instanceof byte[] bytes && bytes.length > 0) { @@ -115,6 +171,10 @@ public class RequestSignatureService { return canonicalParams.getBytes(StandardCharsets.UTF_8); } + /** + * Purpose: buildCanonicalParams supports RequestSignatureService.java by holding or executing the build canonical params business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildCanonicalParams(Map parameterMap) { if (parameterMap == null || parameterMap.isEmpty()) { return ""; @@ -126,12 +186,20 @@ public class RequestSignatureService { .orElse(""); } + /** + * Purpose: sorted supports RequestSignatureService.java by holding or executing the sorted business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String[] sorted(String[] values) { String[] result = values == null ? new String[0] : values.clone(); Arrays.sort(result, Comparator.nullsLast(String::compareTo)); return result; } + /** + * Purpose: sha256Hex supports RequestSignatureService.java by holding or executing the sha256 hex business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String sha256Hex(byte[] payload) { try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); @@ -142,6 +210,10 @@ public class RequestSignatureService { } } + /** + * Purpose: hmacSha256Hex supports RequestSignatureService.java by holding or executing the hmac sha256 hex business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String hmacSha256Hex(String secret, String text) { try { Mac mac = Mac.getInstance(HMAC_ALGORITHM); @@ -152,6 +224,10 @@ public class RequestSignatureService { } } + /** + * Purpose: toHex supports RequestSignatureService.java by holding or executing the to hex business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String toHex(byte[] bytes) { StringBuilder builder = new StringBuilder(bytes.length * 2); for (byte value : bytes) { diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestThrottleService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestThrottleService.java index 3f36e07f..5857330b 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestThrottleService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/RequestThrottleService.java @@ -14,39 +14,87 @@ import java.util.concurrent.TimeUnit; @Component @RequiredArgsConstructor +/** + * Purpose: RequestThrottleService supports RequestThrottleService.java by holding or executing the request throttle service business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class RequestThrottleService { + /** + * Purpose: DEVICE_ID_HEADER supports RequestThrottleService.java by holding or executing the device id header business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String DEVICE_ID_HEADER = "X-Device-Id"; + /** + * Purpose: stringRedisTemplate supports RequestThrottleService.java by holding or executing the string redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final StringRedisTemplate stringRedisTemplate; + /** + * Purpose: rateLimitProperties supports RequestThrottleService.java by holding or executing the rate limit properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final RateLimitProperties rateLimitProperties; + /** + * Purpose: loginLockProperties supports RequestThrottleService.java by holding or executing the login lock properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final LoginLockProperties loginLockProperties; + /** + * Purpose: checkLogin supports RequestThrottleService.java by holding or executing the check login business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkLogin(HttpServletRequest request, String account) { assertLoginNotLocked(request, account); assertAllowed("login", request, sanitize(account), rateLimitProperties.getLogin(), "登录过于频繁,请稍后再试"); } + /** + * Purpose: checkRegister supports RequestThrottleService.java by holding or executing the check register business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkRegister(HttpServletRequest request, String account) { assertAllowed("register", request, sanitize(account), rateLimitProperties.getRegister(), "注册过于频繁,请稍后再试"); } + /** + * Purpose: checkSendCode supports RequestThrottleService.java by holding or executing the check send code business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkSendCode(HttpServletRequest request, String phone) { assertAllowed("send-code", request, sanitize(phone), rateLimitProperties.getSendCode(), "验证码发送过于频繁,请稍后再试"); } + /** + * Purpose: checkResetPassword supports RequestThrottleService.java by holding or executing the check reset password business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkResetPassword(HttpServletRequest request, String phone) { assertAllowed("reset-password", request, sanitize(phone), rateLimitProperties.getResetPassword(), "密码重置请求过于频繁,请稍后再试"); } + /** + * Purpose: checkWechatMiniLogin supports RequestThrottleService.java by holding or executing the check wechat mini login business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkWechatMiniLogin(HttpServletRequest request, String subject) { assertAllowed("wechat-mini-login", request, sanitize(subject), rateLimitProperties.getWechatMiniLogin(), "微信登录过于频繁,请稍后再试"); } + /** + * Purpose: checkAgreementRead supports RequestThrottleService.java by holding or executing the check agreement read business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkAgreementRead(HttpServletRequest request, String agreementType) { assertAllowed("agreement-read", request, sanitize(agreementType), rateLimitProperties.getAgreementRead(), "协议读取过于频繁,请稍后再试"); } + /** + * Purpose: checkAuthenticatedWrite supports RequestThrottleService.java by holding or executing the check authenticated write business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void checkAuthenticatedWrite(HttpServletRequest request, Long userId) { String path = request.getRequestURI(); RateLimitProperties.LimitRule rule = rateLimitProperties.getAuthenticatedWrite(); @@ -59,6 +107,10 @@ public class RequestThrottleService { assertAllowed(category, request, userId == null ? "" : String.valueOf(userId), rule, message); } + /** + * Purpose: recordLoginFailure supports RequestThrottleService.java by holding or executing the record login failure business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void recordLoginFailure(HttpServletRequest request, String account) { if (loginLockProperties.getMaxFailures() <= 0 || loginLockProperties.getWindowSeconds() <= 0) { return; @@ -73,6 +125,10 @@ public class RequestThrottleService { } } + /** + * Purpose: clearLoginFailure supports RequestThrottleService.java by holding or executing the clear login failure business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void clearLoginFailure(HttpServletRequest request, String account) { stringRedisTemplate.delete(buildLoginFailureKey(request, account)); stringRedisTemplate.delete(buildLoginLockKey(request, account)); @@ -102,6 +158,10 @@ public class RequestThrottleService { } } + /** + * Purpose: assertLoginNotLocked supports RequestThrottleService.java by holding or executing the assert login not locked business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void assertLoginNotLocked(HttpServletRequest request, String account) { Boolean locked = stringRedisTemplate.hasKey(buildLoginLockKey(request, account)); if (Boolean.TRUE.equals(locked)) { @@ -109,18 +169,34 @@ public class RequestThrottleService { } } + /** + * Purpose: buildLoginFailureKey supports RequestThrottleService.java by holding or executing the build login failure key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildLoginFailureKey(HttpServletRequest request, String account) { return "login:fail:" + DigestUtils.md5DigestAsHex(buildLoginLockRaw(request, account).getBytes(StandardCharsets.UTF_8)); } + /** + * Purpose: buildLoginLockKey supports RequestThrottleService.java by holding or executing the build login lock key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildLoginLockKey(HttpServletRequest request, String account) { return "login:lock:" + DigestUtils.md5DigestAsHex(buildLoginLockRaw(request, account).getBytes(StandardCharsets.UTF_8)); } + /** + * Purpose: buildLoginLockRaw supports RequestThrottleService.java by holding or executing the build login lock raw business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildLoginLockRaw(HttpServletRequest request, String account) { return String.join("|", sanitize(resolveClientIp(request)), sanitize(resolveDeviceId(request)), sanitize(account)); } + /** + * Purpose: resolveClientIp supports RequestThrottleService.java by holding or executing the resolve client ip business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveClientIp(HttpServletRequest request) { if (request == null) { return "-"; @@ -136,10 +212,18 @@ public class RequestThrottleService { return request.getRemoteAddr(); } + /** + * Purpose: resolveDeviceId supports RequestThrottleService.java by holding or executing the resolve device id business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveDeviceId(HttpServletRequest request) { return request == null ? null : request.getHeader(DEVICE_ID_HEADER); } + /** + * Purpose: sanitize supports RequestThrottleService.java by holding or executing the sanitize business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String sanitize(String value) { return StringUtils.hasText(value) ? value.trim() : "-"; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UploadSecurityValidator.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UploadSecurityValidator.java index 911ba136..0d520806 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UploadSecurityValidator.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UploadSecurityValidator.java @@ -11,6 +11,10 @@ import java.util.Set; @Component @RequiredArgsConstructor +/** + * Purpose: UploadSecurityValidator supports UploadSecurityValidator.java by holding or executing the upload security validator business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class UploadSecurityValidator { private static final Set BLOCKED_EXTENSIONS = Set.of( @@ -28,8 +32,16 @@ public class UploadSecurityValidator { "image/gif" ); + /** + * Purpose: properties supports UploadSecurityValidator.java by holding or executing the properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final UploadSecurityProperties properties; + /** + * Purpose: validate supports UploadSecurityValidator.java by holding or executing the validate business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void validate(MultipartFile file) { if (file == null || file.isEmpty()) { throw new RuntimeException("上传文件不能为空"); @@ -51,6 +63,10 @@ public class UploadSecurityValidator { } } + /** + * Purpose: validateMetadata supports UploadSecurityValidator.java by holding or executing the validate metadata business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void validateMetadata(String filename, String contentType, Long fileSize) { if (fileSize == null || fileSize <= 0 || fileSize > properties.getMaxSize()) { throw new RuntimeException("上传文件大小不合法"); @@ -65,6 +81,10 @@ public class UploadSecurityValidator { } } + /** + * Purpose: validateChunk supports UploadSecurityValidator.java by holding or executing the validate chunk business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void validateChunk(MultipartFile chunkFile) { if (chunkFile == null || chunkFile.isEmpty()) { throw new RuntimeException("上传分片不能为空"); @@ -79,18 +99,34 @@ public class UploadSecurityValidator { } } + /** + * Purpose: isAllowedMimeType supports UploadSecurityValidator.java by holding or executing the is allowed mime type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isAllowedMimeType(String contentType) { return properties.getAllowedMimeTypes().contains(contentType) || COMPATIBLE_IMAGE_MIME_TYPES.contains(contentType); } + /** + * Purpose: isLikelyImage supports UploadSecurityValidator.java by holding or executing the is likely image business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean isLikelyImage(String extension, String contentType) { return IMAGE_EXTENSIONS.contains(extension) || contentType.startsWith("image/"); } + /** + * Purpose: normalizeContentType supports UploadSecurityValidator.java by holding or executing the normalize content type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String normalizeContentType(String contentType) { return StringUtils.hasText(contentType) ? contentType.toLowerCase(Locale.ROOT).trim() : ""; } + /** + * Purpose: resolveExtension supports UploadSecurityValidator.java by holding or executing the resolve extension business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String resolveExtension(String filename) { if (!StringUtils.hasText(filename) || !filename.contains(".")) { return ""; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UserSessionService.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UserSessionService.java index 88690d03..6849f970 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UserSessionService.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/support/security/UserSessionService.java @@ -24,14 +24,42 @@ import java.util.concurrent.TimeUnit; @RequiredArgsConstructor public class UserSessionService { + /** + * Purpose: SESSION_KEY_PREFIX supports UserSessionService.java by holding or executing the session key prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String SESSION_KEY_PREFIX = "auth:session:"; + /** + * Purpose: USER_SESSION_SET_PREFIX supports UserSessionService.java by holding or executing the user session set prefix business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private static final String USER_SESSION_SET_PREFIX = "auth:user:sessions:"; + /** + * Purpose: stringRedisTemplate supports UserSessionService.java by holding or executing the string redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final StringRedisTemplate stringRedisTemplate; + /** + * Purpose: objectMapper supports UserSessionService.java by holding or executing the object mapper business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final ObjectMapper objectMapper; + /** + * Purpose: jwtProperties supports UserSessionService.java by holding or executing the jwt properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final JwtProperties jwtProperties; + /** + * Purpose: idGenerator supports UserSessionService.java by holding or executing the id generator business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final TimeOrderedSnowflakeIdGenerator idGenerator; + /** + * Purpose: issueSession supports UserSessionService.java by holding or executing the issue session business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public SessionIssueResult issueSession(Long userId, String account, Long shopId, Integer userType) { String sessionId = idGenerator.nextIdString(); String accessJti = idGenerator.nextIdString(); @@ -49,21 +77,37 @@ public class UserSessionService { return new SessionIssueResult(sessionId, accessJti, refreshJti); } + /** + * Purpose: rotateSession supports UserSessionService.java by holding or executing the rotate session business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public SessionIssueResult rotateSession(String previousSessionId, Long userId, String account, Long shopId, Integer userType) { revokeSession(previousSessionId); return issueSession(userId, account, shopId, userType); } + /** + * Purpose: isAccessSessionActive supports UserSessionService.java by holding or executing the is access session active business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isAccessSessionActive(Long userId, String sessionId, String accessJti) { SessionState state = getSessionState(sessionId); return matches(state, userId) && StringUtils.hasText(accessJti) && accessJti.equals(state.getAccessJti()); } + /** + * Purpose: isRefreshSessionActive supports UserSessionService.java by holding or executing the is refresh session active business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isRefreshSessionActive(Long userId, String sessionId, String refreshJti) { SessionState state = getSessionState(sessionId); return matches(state, userId) && StringUtils.hasText(refreshJti) && refreshJti.equals(state.getRefreshJti()); } + /** + * Purpose: revokeSession supports UserSessionService.java by holding or executing the revoke session business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void revokeSession(String sessionId) { if (!StringUtils.hasText(sessionId)) { return; @@ -75,6 +119,10 @@ public class UserSessionService { } } + /** + * Purpose: revokeAllUserSessions supports UserSessionService.java by holding or executing the revoke all user sessions business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public void revokeAllUserSessions(Long userId) { if (userId == null) { return; @@ -89,10 +137,18 @@ public class UserSessionService { stringRedisTemplate.delete(setKey); } + /** + * Purpose: matches supports UserSessionService.java by holding or executing the matches business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private boolean matches(SessionState state, Long userId) { return state != null && state.getUserId() != null && state.getUserId().equals(userId); } + /** + * Purpose: save supports UserSessionService.java by holding or executing the save business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private void save(SessionState state) { try { String sessionKey = buildSessionKey(state.getSessionId()); @@ -107,6 +163,10 @@ public class UserSessionService { } } + /** + * Purpose: getSessionState supports UserSessionService.java by holding or executing the get session state business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private SessionState getSessionState(String sessionId) { if (!StringUtils.hasText(sessionId)) { return null; @@ -123,10 +183,18 @@ public class UserSessionService { } } + /** + * Purpose: buildSessionKey supports UserSessionService.java by holding or executing the build session key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildSessionKey(String sessionId) { return SESSION_KEY_PREFIX + sessionId; } + /** + * Purpose: buildUserSessionSetKey supports UserSessionService.java by holding or executing the build user session set key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String buildUserSessionSetKey(Long userId) { return USER_SESSION_SET_PREFIX + userId; } @@ -135,16 +203,52 @@ public class UserSessionService { @Builder @NoArgsConstructor @AllArgsConstructor + /** + * Purpose: SessionState supports UserSessionService.java by holding or executing the session state business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class SessionState { + /** + * Purpose: sessionId supports UserSessionService.java by holding or executing the session id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String sessionId; + /** + * Purpose: userId supports UserSessionService.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; + /** + * Purpose: account supports UserSessionService.java by holding or executing the account business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String account; + /** + * Purpose: shopId supports UserSessionService.java by holding or executing the shop id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long shopId; + /** + * Purpose: userType supports UserSessionService.java by holding or executing the user type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer userType; + /** + * Purpose: accessJti supports UserSessionService.java by holding or executing the access jti business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String accessJti; + /** + * Purpose: refreshJti supports UserSessionService.java by holding or executing the refresh jti business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String refreshJti; } + /** + * Purpose: SessionIssueResult supports UserSessionService.java by holding or executing the session issue result business role. + * Usage: reference this record from the owning layer and pass validated inputs before reading or updating related state. + */ public record SessionIssueResult(String sessionId, String accessJti, String refreshJti) { } } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/AccountValidationUtils.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/AccountValidationUtils.java index 401375e5..b98b6a45 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/AccountValidationUtils.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/AccountValidationUtils.java @@ -4,18 +4,34 @@ import org.springframework.util.StringUtils; import java.util.regex.Pattern; +/** + * Purpose: AccountValidationUtils supports AccountValidationUtils.java by holding or executing the account validation utils business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public final class AccountValidationUtils { + /** + * Purpose: ACCOUNT_REGEX supports AccountValidationUtils.java by holding or executing the account regex business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String ACCOUNT_REGEX = "^[A-Za-z0-9]+$"; private static final Pattern ACCOUNT_PATTERN = Pattern.compile(ACCOUNT_REGEX); private AccountValidationUtils() { } + /** + * Purpose: normalizeAccount supports AccountValidationUtils.java by holding or executing the normalize account business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static String normalizeAccount(String account) { return account == null ? "" : account.trim(); } + /** + * Purpose: ensureValidAccountFormat supports AccountValidationUtils.java by holding or executing the ensure valid account format business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static void ensureValidAccountFormat(String account) { if (!StringUtils.hasText(account)) { throw new RuntimeException("账号不能为空"); @@ -25,12 +41,20 @@ public final class AccountValidationUtils { } } + /** + * Purpose: requireValidAccount supports AccountValidationUtils.java by holding or executing the require valid account business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static String requireValidAccount(String account) { String normalized = normalizeAccount(account); ensureValidAccountFormat(normalized); return normalized; } + /** + * Purpose: validateOptionalAccount supports AccountValidationUtils.java by holding or executing the validate optional account business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static String validateOptionalAccount(String account) { if (account == null) { return null; diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/JwtUtil.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/JwtUtil.java index 6b082cc8..c8b297d8 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/JwtUtil.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/JwtUtil.java @@ -16,14 +16,30 @@ import java.util.Map; @Component @RequiredArgsConstructor +/** + * Purpose: JwtUtil supports JwtUtil.java by holding or executing the jwt util business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class JwtUtil { + /** + * Purpose: jwtProperties supports JwtUtil.java by holding or executing the jwt properties business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private final JwtProperties jwtProperties; + /** + * Purpose: getKey supports JwtUtil.java by holding or executing the get key business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private SecretKey getKey() { return Keys.hmacShaKeyFor(jwtProperties.getSecret().getBytes(StandardCharsets.UTF_8)); } + /** + * Purpose: generateAccessToken supports JwtUtil.java by holding or executing the generate access token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String generateAccessToken(Long userId, String account, Long currentShopId, String sessionId, String jti) { Map claims = new HashMap<>(); claims.put("userId", userId); @@ -37,6 +53,10 @@ public class JwtUtil { return createToken(claims, userId.toString(), jwtProperties.getAccessTokenExpirationSeconds() * 1000); } + /** + * Purpose: generateRefreshToken supports JwtUtil.java by holding or executing the generate refresh token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String generateRefreshToken(Long userId, String account, Long currentShopId, String sessionId, String jti) { Map claims = new HashMap<>(); claims.put("userId", userId); @@ -50,6 +70,10 @@ public class JwtUtil { return createToken(claims, userId.toString(), jwtProperties.getRefreshTokenExpirationSeconds() * 1000); } + /** + * Purpose: createToken supports JwtUtil.java by holding or executing the create token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ private String createToken(Map claims, String subject, long expiration) { Date now = new Date(); Date expiryDate = new Date(now.getTime() + expiration); @@ -64,6 +88,10 @@ public class JwtUtil { .compact(); } + /** + * Purpose: parseToken supports JwtUtil.java by holding or executing the parse token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Claims parseToken(String token) { return Jwts.parserBuilder() .setSigningKey(getKey()) @@ -74,36 +102,64 @@ public class JwtUtil { .getBody(); } + /** + * Purpose: getUserIdFromToken supports JwtUtil.java by holding or executing the get user id from token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Long getUserIdFromToken(String token) { Claims claims = parseToken(token); return claims.get("userId", Long.class); } + /** + * Purpose: getAccountFromToken supports JwtUtil.java by holding or executing the get account from token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String getAccountFromToken(String token) { Claims claims = parseToken(token); return claims.get("account", String.class); } + /** + * Purpose: getTokenType supports JwtUtil.java by holding or executing the get token type business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String getTokenType(String token) { Claims claims = parseToken(token); return claims.get("type", String.class); } + /** + * Purpose: getSessionIdFromToken supports JwtUtil.java by holding or executing the get session id from token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String getSessionIdFromToken(String token) { Claims claims = parseToken(token); return claims.get("sessionId", String.class); } + /** + * Purpose: getJtiFromToken supports JwtUtil.java by holding or executing the get jti from token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String getJtiFromToken(String token) { Claims claims = parseToken(token); return claims.get("jti", String.class); } + /** + * Purpose: getIssuerFromToken supports JwtUtil.java by holding or executing the get issuer from token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public String getIssuerFromToken(String token) { Claims claims = parseToken(token); return claims.getIssuer(); } + /** + * Purpose: getShopIdFromToken supports JwtUtil.java by holding or executing the get shop id from token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public Long getShopIdFromToken(String token) { Claims claims = parseToken(token); Object value = claims.get("shopId"); @@ -126,6 +182,10 @@ public class JwtUtil { return null; } + /** + * Purpose: isTokenExpired supports JwtUtil.java by holding or executing the is token expired business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isTokenExpired(String token) { try { Claims claims = parseToken(token); @@ -135,6 +195,10 @@ public class JwtUtil { } } + /** + * Purpose: validateToken supports JwtUtil.java by holding or executing the validate token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean validateToken(String token) { try { parseToken(token); @@ -144,10 +208,18 @@ public class JwtUtil { } } + /** + * Purpose: isAccessToken supports JwtUtil.java by holding or executing the is access token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isAccessToken(String token) { return "access".equals(getTokenType(token)); } + /** + * Purpose: isRefreshToken supports JwtUtil.java by holding or executing the is refresh token business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public boolean isRefreshToken(String token) { return "refresh".equals(getTokenType(token)); } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/RedisUtils.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/RedisUtils.java index 7db691d2..7974d09d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/RedisUtils.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/utils/RedisUtils.java @@ -21,6 +21,10 @@ import java.util.concurrent.TimeUnit; public class RedisUtils { @Autowired + /** + * Purpose: redisTemplate supports RedisUtils.java by holding or executing the redis template business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private RedisTemplate redisTemplate; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/DashboardStatsVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/DashboardStatsVO.java index 135ab3f6..89a852e0 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/DashboardStatsVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/DashboardStatsVO.java @@ -27,15 +27,55 @@ public class DashboardStatsVO { * Field `todayOrders` (Long): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. */ private Long todayOrders; + /** + * Purpose: totalOrderAmount supports DashboardStatsVO.java by holding or executing the total order amount business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal totalOrderAmount; + /** + * Purpose: todayOrderAmount supports DashboardStatsVO.java by holding or executing the today order amount business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal todayOrderAmount; + /** + * Purpose: weekOrderAmount supports DashboardStatsVO.java by holding or executing the week order amount business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal weekOrderAmount; + /** + * Purpose: totalCustomers supports DashboardStatsVO.java by holding or executing the total customers business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long totalCustomers; + /** + * Purpose: totalArtists supports DashboardStatsVO.java by holding or executing the total artists business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long totalArtists; + /** + * Purpose: newCustomersToday supports DashboardStatsVO.java by holding or executing the new customers today business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long newCustomersToday; + /** + * Purpose: newCustomers7Days supports DashboardStatsVO.java by holding or executing the new customers7 days business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long newCustomers7Days; + /** + * Purpose: newOrders7Days supports DashboardStatsVO.java by holding or executing the new orders7 days business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long newOrders7Days; + /** + * Purpose: pendingOrders supports DashboardStatsVO.java by holding or executing the pending orders business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long pendingOrders; + /** + * Purpose: completedOrders supports DashboardStatsVO.java by holding or executing the completed orders business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long completedOrders; /** * Field `hotProducts` (List): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LegalAgreementVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LegalAgreementVO.java index 187f4ff1..d5dcc06b 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LegalAgreementVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LegalAgreementVO.java @@ -5,27 +5,75 @@ import lombok.Data; import java.time.LocalDateTime; @Data +/** + * Purpose: LegalAgreementVO supports LegalAgreementVO.java by holding or executing the legal agreement vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class LegalAgreementVO { + /** + * Purpose: id supports LegalAgreementVO.java by holding or executing the id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long id; + /** + * Purpose: agreementType supports LegalAgreementVO.java by holding or executing the agreement type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String agreementType; + /** + * Purpose: agreementTypeName supports LegalAgreementVO.java by holding or executing the agreement type name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String agreementTypeName; + /** + * Purpose: title supports LegalAgreementVO.java by holding or executing the title business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String title; + /** + * Purpose: version supports LegalAgreementVO.java by holding or executing the version business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String version; + /** + * Purpose: content supports LegalAgreementVO.java by holding or executing the content business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String content; + /** + * Purpose: status supports LegalAgreementVO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; + /** + * Purpose: statusText supports LegalAgreementVO.java by holding or executing the status text business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String statusText; + /** + * Purpose: effectiveTime supports LegalAgreementVO.java by holding or executing the effective time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime effectiveTime; + /** + * Purpose: createTime supports LegalAgreementVO.java by holding or executing the create time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime createTime; + /** + * Purpose: updateTime supports LegalAgreementVO.java by holding or executing the update time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime updateTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LoginResponseVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LoginResponseVO.java index ea9cf24d..4e21dcc3 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LoginResponseVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/LoginResponseVO.java @@ -37,6 +37,10 @@ public class LoginResponseVO { private boolean needSetPassword; // 是否需要设置密码 @Data + /** + * Purpose: UserInfo supports LoginResponseVO.java by holding or executing the user info business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class UserInfo { @JsonSerialize(using = ToStringSerializer.class) /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/MessageTargetOptionsVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/MessageTargetOptionsVO.java index 2d4e9188..cd208ad1 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/MessageTargetOptionsVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/MessageTargetOptionsVO.java @@ -20,6 +20,10 @@ public class MessageTargetOptionsVO { private List users; @Data + /** + * Purpose: ShopOptionVO supports MessageTargetOptionsVO.java by holding or executing the shop option vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class ShopOptionVO { /** * Field `id` (Long): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. @@ -32,6 +36,10 @@ public class MessageTargetOptionsVO { } @Data + /** + * Purpose: UserOptionVO supports MessageTargetOptionsVO.java by holding or executing the user option vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class UserOptionVO { /** * Field `id` (Long): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeOptionsVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeOptionsVO.java index b3863c4e..1e334be1 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeOptionsVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeOptionsVO.java @@ -5,19 +5,67 @@ import lombok.Data; import java.util.List; @Data +/** + * Purpose: OrderArtistChangeOptionsVO supports OrderArtistChangeOptionsVO.java by holding or executing the order artist change options vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistChangeOptionsVO { + /** + * Purpose: orderId supports OrderArtistChangeOptionsVO.java by holding or executing the order id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderId; + /** + * Purpose: orderItemId supports OrderArtistChangeOptionsVO.java by holding or executing the order item id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderItemId; + /** + * Purpose: currentArtistId supports OrderArtistChangeOptionsVO.java by holding or executing the current artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long currentArtistId; + /** + * Purpose: currentArtistName supports OrderArtistChangeOptionsVO.java by holding or executing the current artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String currentArtistName; + /** + * Purpose: artists supports OrderArtistChangeOptionsVO.java by holding or executing the artists business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private List artists; @Data + /** + * Purpose: ArtistOptionVO supports OrderArtistChangeOptionsVO.java by holding or executing the artist option vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public static class ArtistOptionVO { + /** + * Purpose: artistId supports OrderArtistChangeOptionsVO.java by holding or executing the artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long artistId; + /** + * Purpose: artistName supports OrderArtistChangeOptionsVO.java by holding or executing the artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String artistName; + /** + * Purpose: artistAvatar supports OrderArtistChangeOptionsVO.java by holding or executing the artist avatar business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String artistAvatar; + /** + * Purpose: userType supports OrderArtistChangeOptionsVO.java by holding or executing the user type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer userType; + /** + * Purpose: participateProduction supports OrderArtistChangeOptionsVO.java by holding or executing the participate production business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Boolean participateProduction; } } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeRequestVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeRequestVO.java index e110dfa7..246b3427 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeRequestVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistChangeRequestVO.java @@ -5,34 +5,154 @@ import lombok.Data; import java.time.LocalDateTime; @Data +/** + * Purpose: OrderArtistChangeRequestVO supports OrderArtistChangeRequestVO.java by holding or executing the order artist change request vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistChangeRequestVO { + /** + * Purpose: id supports OrderArtistChangeRequestVO.java by holding or executing the id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long id; + /** + * Purpose: orderId supports OrderArtistChangeRequestVO.java by holding or executing the order id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderId; + /** + * Purpose: orderItemId supports OrderArtistChangeRequestVO.java by holding or executing the order item id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderItemId; + /** + * Purpose: productId supports OrderArtistChangeRequestVO.java by holding or executing the product id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long productId; + /** + * Purpose: productTitle supports OrderArtistChangeRequestVO.java by holding or executing the product title business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String productTitle; + /** + * Purpose: shopId supports OrderArtistChangeRequestVO.java by holding or executing the shop id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long shopId; + /** + * Purpose: userId supports OrderArtistChangeRequestVO.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; + /** + * Purpose: customerId supports OrderArtistChangeRequestVO.java by holding or executing the customer id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long customerId; + /** + * Purpose: originalArtistId supports OrderArtistChangeRequestVO.java by holding or executing the original artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long originalArtistId; + /** + * Purpose: originalArtistName supports OrderArtistChangeRequestVO.java by holding or executing the original artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String originalArtistName; + /** + * Purpose: requestedArtistId supports OrderArtistChangeRequestVO.java by holding or executing the requested artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long requestedArtistId; + /** + * Purpose: requestedArtistName supports OrderArtistChangeRequestVO.java by holding or executing the requested artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String requestedArtistName; + /** + * Purpose: fromArtistId supports OrderArtistChangeRequestVO.java by holding or executing the from artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long fromArtistId; + /** + * Purpose: fromArtistName supports OrderArtistChangeRequestVO.java by holding or executing the from artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String fromArtistName; + /** + * Purpose: toArtistId supports OrderArtistChangeRequestVO.java by holding or executing the to artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long toArtistId; + /** + * Purpose: toArtistName supports OrderArtistChangeRequestVO.java by holding or executing the to artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String toArtistName; + /** + * Purpose: requesterId supports OrderArtistChangeRequestVO.java by holding or executing the requester id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long requesterId; + /** + * Purpose: requesterName supports OrderArtistChangeRequestVO.java by holding or executing the requester name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String requesterName; + /** + * Purpose: status supports OrderArtistChangeRequestVO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String status; + /** + * Purpose: statusText supports OrderArtistChangeRequestVO.java by holding or executing the status text business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String statusText; + /** + * Purpose: reason supports OrderArtistChangeRequestVO.java by holding or executing the reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String reason; + /** + * Purpose: rejectReason supports OrderArtistChangeRequestVO.java by holding or executing the reject reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String rejectReason; + /** + * Purpose: reviewerId supports OrderArtistChangeRequestVO.java by holding or executing the reviewer id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long reviewerId; + /** + * Purpose: messageId supports OrderArtistChangeRequestVO.java by holding or executing the message id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long messageId; + /** + * Purpose: reviewTime supports OrderArtistChangeRequestVO.java by holding or executing the review time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime reviewTime; + /** + * Purpose: approvedTime supports OrderArtistChangeRequestVO.java by holding or executing the approved time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime approvedTime; + /** + * Purpose: rejectedTime supports OrderArtistChangeRequestVO.java by holding or executing the rejected time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime rejectedTime; + /** + * Purpose: expireTime supports OrderArtistChangeRequestVO.java by holding or executing the expire time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime expireTime; + /** + * Purpose: createTime supports OrderArtistChangeRequestVO.java by holding or executing the create time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime createTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistReviewVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistReviewVO.java index 06bb8895..06b7dea8 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistReviewVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderArtistReviewVO.java @@ -7,25 +7,109 @@ import java.time.LocalDateTime; import java.util.List; @Data +/** + * Purpose: OrderArtistReviewVO supports OrderArtistReviewVO.java by holding or executing the order artist review vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class OrderArtistReviewVO { + /** + * Purpose: id supports OrderArtistReviewVO.java by holding or executing the id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long id; + /** + * Purpose: orderId supports OrderArtistReviewVO.java by holding or executing the order id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderId; + /** + * Purpose: orderItemId supports OrderArtistReviewVO.java by holding or executing the order item id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long orderItemId; + /** + * Purpose: productId supports OrderArtistReviewVO.java by holding or executing the product id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long productId; + /** + * Purpose: productTitle supports OrderArtistReviewVO.java by holding or executing the product title business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String productTitle; + /** + * Purpose: artistId supports OrderArtistReviewVO.java by holding or executing the artist id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long artistId; + /** + * Purpose: artistName supports OrderArtistReviewVO.java by holding or executing the artist name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String artistName; + /** + * Purpose: artistAvatar supports OrderArtistReviewVO.java by holding or executing the artist avatar business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String artistAvatar; + /** + * Purpose: userId supports OrderArtistReviewVO.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; + /** + * Purpose: customerId supports OrderArtistReviewVO.java by holding or executing the customer id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long customerId; + /** + * Purpose: rating supports OrderArtistReviewVO.java by holding or executing the rating business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal rating; + /** + * Purpose: ratingScore supports OrderArtistReviewVO.java by holding or executing the rating score business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal ratingScore; + /** + * Purpose: content supports OrderArtistReviewVO.java by holding or executing the content business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String content; + /** + * Purpose: imageFileIds supports OrderArtistReviewVO.java by holding or executing the image file ids business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private List imageFileIds; + /** + * Purpose: status supports OrderArtistReviewVO.java by holding or executing the status business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer status; + /** + * Purpose: statusText supports OrderArtistReviewVO.java by holding or executing the status text business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String statusText; + /** + * Purpose: reminderMessageId supports OrderArtistReviewVO.java by holding or executing the reminder message id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long reminderMessageId; + /** + * Purpose: submitTime supports OrderArtistReviewVO.java by holding or executing the submit time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime submitTime; + /** + * Purpose: submittedAt supports OrderArtistReviewVO.java by holding or executing the submitted at business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime submittedAt; + /** + * Purpose: createTime supports OrderArtistReviewVO.java by holding or executing the create time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime createTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderItemVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderItemVO.java index a4bd5f27..53f636c4 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderItemVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderItemVO.java @@ -54,7 +54,19 @@ public class OrderItemVO { * Field `appointmentTime` (String): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. */ private String appointmentTime; + /** + * Purpose: pendingReview supports OrderItemVO.java by holding or executing the pending review business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistReviewVO pendingReview; + /** + * Purpose: reviewSummary supports OrderItemVO.java by holding or executing the review summary business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistReviewVO reviewSummary; + /** + * Purpose: pendingArtistChangeRequest supports OrderItemVO.java by holding or executing the pending artist change request business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private OrderArtistChangeRequestVO pendingArtistChangeRequest; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderVO.java index dfef0ab1..008666f6 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/OrderVO.java @@ -28,6 +28,10 @@ public class OrderVO { * Field `shopId` (Long): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. */ private Long shopId; + /** + * Purpose: shopName supports OrderVO.java by holding or executing the shop name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String shopName; /** * Field `totalAmount` (BigDecimal): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SecurityAuditLogVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SecurityAuditLogVO.java index 6cb72243..9fbf3c9a 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SecurityAuditLogVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SecurityAuditLogVO.java @@ -5,15 +5,55 @@ import lombok.Data; import java.time.LocalDateTime; @Data +/** + * Purpose: SecurityAuditLogVO supports SecurityAuditLogVO.java by holding or executing the security audit log vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SecurityAuditLogVO { + /** + * Purpose: id supports SecurityAuditLogVO.java by holding or executing the id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long id; + /** + * Purpose: userId supports SecurityAuditLogVO.java by holding or executing the user id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long userId; + /** + * Purpose: account supports SecurityAuditLogVO.java by holding or executing the account business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String account; + /** + * Purpose: action supports SecurityAuditLogVO.java by holding or executing the action business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String action; + /** + * Purpose: result supports SecurityAuditLogVO.java by holding or executing the result business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String result; + /** + * Purpose: reason supports SecurityAuditLogVO.java by holding or executing the reason business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String reason; + /** + * Purpose: ipAddress supports SecurityAuditLogVO.java by holding or executing the ip address business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String ipAddress; + /** + * Purpose: deviceId supports SecurityAuditLogVO.java by holding or executing the device id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String deviceId; + /** + * Purpose: operateTime supports SecurityAuditLogVO.java by holding or executing the operate time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime operateTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/ShopVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/ShopVO.java index 713a1a0d..f6b8c94d 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/ShopVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/ShopVO.java @@ -41,12 +41,28 @@ public class ShopVO { */ private String address; + /** + * Purpose: mapProvider supports ShopVO.java by holding or executing the map provider business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String mapProvider; + /** + * Purpose: longitude supports ShopVO.java by holding or executing the longitude business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal longitude; + /** + * Purpose: latitude supports ShopVO.java by holding or executing the latitude business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private BigDecimal latitude; + /** + * Purpose: navigationUrls supports ShopVO.java by holding or executing the navigation urls business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map navigationUrls; /** @@ -74,16 +90,40 @@ public class ShopVO { */ private List imageUrls; + /** + * Purpose: themePrimaryColor supports ShopVO.java by holding or executing the theme primary color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themePrimaryColor; + /** + * Purpose: themeSecondaryColor supports ShopVO.java by holding or executing the theme secondary color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeSecondaryColor; + /** + * Purpose: themeAccentColor supports ShopVO.java by holding or executing the theme accent color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeAccentColor; + /** + * Purpose: themePageBgColor supports ShopVO.java by holding or executing the theme page bg color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themePageBgColor; + /** + * Purpose: themeCardBgColor supports ShopVO.java by holding or executing the theme card bg color business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeCardBgColor; + /** + * Purpose: themeBackgroundImageFileId supports ShopVO.java by holding or executing the theme background image file id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String themeBackgroundImageFileId; /** @@ -91,8 +131,16 @@ public class ShopVO { */ private Integer status; + /** + * Purpose: authorizationStartDate supports ShopVO.java by holding or executing the authorization start date business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDate authorizationStartDate; + /** + * Purpose: authorizationDays supports ShopVO.java by holding or executing the authorization days business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer authorizationDays; /** diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemMessageVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemMessageVO.java index 2d4192de..a6440bc8 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemMessageVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemMessageVO.java @@ -55,8 +55,20 @@ public class SystemMessageVO { * Field `targetIds` (List): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. */ private List targetIds; + /** + * Purpose: businessType supports SystemMessageVO.java by holding or executing the business type business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String businessType; + /** + * Purpose: businessId supports SystemMessageVO.java by holding or executing the business id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long businessId; + /** + * Purpose: actionPath supports SystemMessageVO.java by holding or executing the action path business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String actionPath; /** * Field `popupEnabled` (Integer): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled. diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemParameterConfigVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemParameterConfigVO.java index 3013171d..462cbc6b 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemParameterConfigVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/SystemParameterConfigVO.java @@ -5,15 +5,55 @@ import lombok.Data; import java.time.LocalDateTime; @Data +/** + * Purpose: SystemParameterConfigVO supports SystemParameterConfigVO.java by holding or executing the system parameter config vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class SystemParameterConfigVO { + /** + * Purpose: id supports SystemParameterConfigVO.java by holding or executing the id business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Long id; + /** + * Purpose: configGroup supports SystemParameterConfigVO.java by holding or executing the config group business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configGroup; + /** + * Purpose: configKey supports SystemParameterConfigVO.java by holding or executing the config key business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configKey; + /** + * Purpose: configName supports SystemParameterConfigVO.java by holding or executing the config name business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configName; + /** + * Purpose: configValue supports SystemParameterConfigVO.java by holding or executing the config value business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String configValue; + /** + * Purpose: enabled supports SystemParameterConfigVO.java by holding or executing the enabled business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Integer enabled; + /** + * Purpose: remark supports SystemParameterConfigVO.java by holding or executing the remark business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private String remark; + /** + * Purpose: createTime supports SystemParameterConfigVO.java by holding or executing the create time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime createTime; + /** + * Purpose: updateTime supports SystemParameterConfigVO.java by holding or executing the update time business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private LocalDateTime updateTime; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/UserAgreementConsentVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/UserAgreementConsentVO.java index e86559f1..126f47fe 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/UserAgreementConsentVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/UserAgreementConsentVO.java @@ -9,7 +9,15 @@ import java.util.Map; @Data @NoArgsConstructor @AllArgsConstructor +/** + * Purpose: UserAgreementConsentVO supports UserAgreementConsentVO.java by holding or executing the user agreement consent vo business role. + * Usage: reference this class from the owning layer and pass validated inputs before reading or updating related state. + */ public class UserAgreementConsentVO { + /** + * Purpose: consentVersions supports UserAgreementConsentVO.java by holding or executing the consent versions business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ private Map consentVersions; } diff --git a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/WechatMiniLoginResultVO.java b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/WechatMiniLoginResultVO.java index d20910b5..0f375795 100644 --- a/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/WechatMiniLoginResultVO.java +++ b/YumiNail-Core/src/main/java/com/xiaowang/yuminailcore/vo/WechatMiniLoginResultVO.java @@ -10,8 +10,20 @@ import java.util.List; @Data public class WechatMiniLoginResultVO { + /** + * Purpose: STATUS_SUCCESS supports WechatMiniLoginResultVO.java by holding or executing the status success business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String STATUS_SUCCESS = "SUCCESS"; + /** + * Purpose: STATUS_SELECT_SHOP supports WechatMiniLoginResultVO.java by holding or executing the status select shop business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String STATUS_SELECT_SHOP = "SELECT_SHOP"; + /** + * Purpose: STATUS_NEED_MANUAL_LOGIN supports WechatMiniLoginResultVO.java by holding or executing the status need manual login business role. + * Usage: reference this field from the owning layer and pass validated inputs before reading or updating related state. + */ public static final String STATUS_NEED_MANUAL_LOGIN = "NEED_MANUAL_LOGIN"; /** @@ -51,6 +63,10 @@ public class WechatMiniLoginResultVO { */ private Boolean needSetPassword; + /** + * Purpose: success supports WechatMiniLoginResultVO.java by holding or executing the success business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static WechatMiniLoginResultVO success(String message, LoginResponseVO loginResponse, boolean newUser) { WechatMiniLoginResultVO resultVO = new WechatMiniLoginResultVO(); resultVO.setStatus(STATUS_SUCCESS); @@ -78,6 +94,10 @@ public class WechatMiniLoginResultVO { return resultVO; } + /** + * Purpose: needManualLogin supports WechatMiniLoginResultVO.java by holding or executing the need manual login business role. + * Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state. + */ public static WechatMiniLoginResultVO needManualLogin(String message) { WechatMiniLoginResultVO resultVO = new WechatMiniLoginResultVO(); resultVO.setStatus(STATUS_NEED_MANUAL_LOGIN); diff --git a/YumiNail-Frontend/src/App.vue b/YumiNail-Frontend/src/App.vue index c1008796..07961893 100644 --- a/YumiNail-Frontend/src/App.vue +++ b/YumiNail-Frontend/src/App.vue @@ -27,15 +27,31 @@ import { CheckOutlined } from '@ant-design/icons-vue' import BottomNav from './components/BottomNav.vue' import SystemMessageCard from './components/SystemMessageCard.vue' import { cartApi } from './api/cart' +/** + * Purpose: SystemMessageVO supports App.vue by holding or executing the system message vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { userApi, type SystemMessageVO } from './api/user' import antdLocale from './config/antdv-locale' import { useGlobalConfirmEnter } from './composables/useConfirmEnter' import { useShopTheme } from './composables/useShopTheme' +/** + * Purpose: route supports App.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() +/** + * Purpose: router supports App.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() const { currentTheme, refreshShopTheme, resetShopTheme, setupShopThemeSync } = useShopTheme() useGlobalConfirmEnter() +/** + * Purpose: ButtonPropsWithClass supports App.vue by holding or executing the button props with class page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ type ButtonPropsWithClass = ButtonProps & { class?: string } const popupMessageOkButtonProps: ButtonPropsWithClass = { class: 'popup-message-ok-button' } /** routerReady is a reactive state variable used by the template and event handlers. */ @@ -55,6 +71,10 @@ const isHiddenNav = computed(() => { return route.matched.some(r => r.meta.hideNav) || route.matched.some(r => r.meta.isAdmin) }) +/** + * Purpose: antdTheme supports App.vue by holding or executing the antd theme page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const antdTheme = computed(() => ({ token: { colorPrimary: currentTheme.value.primaryColor, @@ -110,6 +130,10 @@ const updateCartCount = async () => { await loadCartCount() } +/** + * Purpose: resolveSystemMessageActionPath supports App.vue by holding or executing the resolve system message action path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const resolveSystemMessageActionPath = (item: SystemMessageVO) => { const actionPath = String(item.actionPath || '').trim() if (!actionPath || !actionPath.startsWith('/') || actionPath.startsWith('//')) { @@ -118,6 +142,10 @@ const resolveSystemMessageActionPath = (item: SystemMessageVO) => { return actionPath } +/** + * Purpose: openSystemMessageAction supports App.vue by holding or executing the open system message action page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openSystemMessageAction = async (item: SystemMessageVO) => { const actionPath = resolveSystemMessageActionPath(item) if (!actionPath) { diff --git a/YumiNail-Frontend/src/api/admin.ts b/YumiNail-Frontend/src/api/admin.ts index d88b0d62..3858ad02 100644 --- a/YumiNail-Frontend/src/api/admin.ts +++ b/YumiNail-Frontend/src/api/admin.ts @@ -10,10 +10,26 @@ import { clearAdminSessionStorage } from '@/utils/admin-session' import { attachRequestSignature } from '@/utils/request-signature' import { isAdminApiAuthFreePath } from './auth-free-paths' +/** + * Purpose: lastErrorTime supports admin.ts by holding or executing the last error time page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let lastErrorTime = 0 +/** + * Purpose: lastErrorMessage supports admin.ts by holding or executing the last error message page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let lastErrorMessage = '' +/** + * Purpose: ERROR_DEBOUNCE_TIME supports admin.ts by holding or executing the error debounce time page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const ERROR_DEBOUNCE_TIME = 1000 +/** + * Purpose: adminApi supports admin.ts by holding or executing the admin api page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const adminApi = axios.create({ baseURL: ADMIN_API_BASE_URL, timeout: 10000, @@ -22,12 +38,20 @@ const adminApi = axios.create({ } }) +/** + * Purpose: isRefreshing supports admin.ts by holding or executing the is refreshing page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let isRefreshing = false let failedQueue: Array<{ resolve: (value?: any) => void reject: (reason?: any) => void }> = [] +/** + * Purpose: processQueue supports admin.ts by holding or executing the process queue page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const processQueue = (error: any, token: string | null = null) => { failedQueue.forEach(prom => { if (error) { @@ -39,10 +63,18 @@ const processQueue = (error: any, token: string | null = null) => { failedQueue = [] } +/** + * Purpose: getStoredAdminAccessToken supports admin.ts by holding or executing the get stored admin access token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getStoredAdminAccessToken = () => { return localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken') } +/** + * Purpose: getRequestToken supports admin.ts by holding or executing the get request token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getRequestToken = (request: any) => { if (request?._authToken) { return request._authToken as string @@ -54,10 +86,18 @@ const getRequestToken = (request: any) => { return authHeader.startsWith('Bearer ') ? authHeader.slice('Bearer '.length) : null } +/** + * Purpose: isCurrentStoredAdminToken supports admin.ts by holding or executing the is current stored admin token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isCurrentStoredAdminToken = (token: string | null) => { return Boolean(token && token === getStoredAdminAccessToken()) } +/** + * Purpose: showError supports admin.ts by holding or executing the show error page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const showError = (msg: string) => { const now = Date.now() if (now - lastErrorTime > ERROR_DEBOUNCE_TIME || msg !== lastErrorMessage) { @@ -67,10 +107,18 @@ const showError = (msg: string) => { } } +/** + * Purpose: isAuthFreePath supports admin.ts by holding or executing the is auth free path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isAuthFreePath = (url?: string) => { return isAdminApiAuthFreePath(url) } +/** + * Purpose: handleAdminTokenExpired supports admin.ts by holding or executing the handle admin token expired page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const handleAdminTokenExpired = (failedToken: string | null = null) => { if (!isCurrentStoredAdminToken(failedToken)) { return @@ -192,18 +240,30 @@ adminApi.interceptors.response.use( } ) +/** + * Purpose: AdminLoginRequest supports admin.ts by holding or executing the admin login request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AdminLoginRequest { account: string password: string shopId?: IdType } +/** + * Purpose: AdminLoginResponse supports admin.ts by holding or executing the admin login response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AdminLoginResponse { accessToken: string refreshToken: string userInfo: any } +/** + * Purpose: LoginShopSelectionResponse supports admin.ts by holding or executing the login shop selection response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LoginShopSelectionResponse { allowShoplessLogin: boolean message: string @@ -213,6 +273,10 @@ export interface LoginShopSelectionResponse { }> } +/** + * Purpose: LegalAgreementAdminVO supports admin.ts by holding or executing the legal agreement admin vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LegalAgreementAdminVO { id: IdType agreementType: 'USER_TERMS' | 'PRIVACY_POLICY' @@ -227,6 +291,10 @@ export interface LegalAgreementAdminVO { updateTime?: string } +/** + * Purpose: LegalAgreementAdminRequest supports admin.ts by holding or executing the legal agreement admin request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LegalAgreementAdminRequest { agreementType: 'USER_TERMS' | 'PRIVACY_POLICY' title: string @@ -280,6 +348,10 @@ export const adminAuthApi = { } } +/** + * Purpose: adminLegalAgreementApi supports admin.ts by holding or executing the admin legal agreement api page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const adminLegalAgreementApi = { list: () => adminApi.get('/legal-agreement/list'), create: (data: LegalAgreementAdminRequest) => adminApi.post('/legal-agreement/create', data), @@ -288,6 +360,10 @@ export const adminLegalAgreementApi = { disable: (id: IdType) => adminApi.put(`/legal-agreement/${id}/disable`) } +/** + * Purpose: ObjectStorageFileVO supports admin.ts by holding or executing the object storage file vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ObjectStorageFileVO { id: IdType fileName: string @@ -296,6 +372,10 @@ export interface ObjectStorageFileVO { createTime: string } +/** + * Purpose: ChunkUploadInitRequest supports admin.ts by holding or executing the chunk upload init request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadInitRequest { fileName: string fileSize: number @@ -304,6 +384,10 @@ export interface ChunkUploadInitRequest { scene: string } +/** + * Purpose: ChunkUploadSessionVO supports admin.ts by holding or executing the chunk upload session vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadSessionVO { uploadId: string chunkSize: number @@ -339,6 +423,10 @@ export const adminFileApi = { return adminApi.post('/object-storage-file/upload/init', data) as unknown as Promise }, uploadChunk: ( + /** + * Purpose: data supports admin.ts by holding or executing the data page or API role. + * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. + */ data: { uploadId: string; chunkIndex: number; totalChunks: number; chunk: Blob }, config?: { signal?: AbortSignal; onUploadProgress?: (event: AxiosProgressEvent) => void } ) => { @@ -348,10 +436,22 @@ export const adminFileApi = { formData.append('totalChunks', String(data.totalChunks)) formData.append('chunk', data.chunk) return adminApi.post('/object-storage-file/upload/chunk', formData, { + /** + * Purpose: headers supports admin.ts by holding or executing the headers page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ headers: { 'Content-Type': 'multipart/form-data' }, + /** + * Purpose: signal supports admin.ts by holding or executing the signal page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ signal: config?.signal, + /** + * Purpose: onUploadProgress supports admin.ts by holding or executing the on upload progress page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ onUploadProgress: config?.onUploadProgress }) }, @@ -381,6 +481,10 @@ export const adminFileApi = { } } +/** + * Purpose: Tag supports admin.ts by holding or executing the tag page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Tag { id: IdType tagName: string @@ -442,6 +546,10 @@ export const adminTagApi = { } } +/** + * Purpose: Artist supports admin.ts by holding or executing the artist page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Artist { id: IdType nickname: string @@ -472,6 +580,10 @@ export const adminArtistApi = { } } +/** + * Purpose: Coupon supports admin.ts by holding or executing the coupon page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Coupon { id: IdType couponCode?: string @@ -548,6 +660,10 @@ export const adminCouponApi = { } } +/** + * Purpose: AdminCommentVO supports admin.ts by holding or executing the admin comment vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AdminCommentVO { id: IdType userId: IdType @@ -585,6 +701,10 @@ export const adminCommentApi = { } } +/** + * Purpose: Product supports admin.ts by holding or executing the product page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Product { id: IdType shopId: IdType @@ -653,6 +773,10 @@ export const adminProductApi = { } } +/** + * Purpose: Shop supports admin.ts by holding or executing the shop page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Shop { id: IdType shopName: string @@ -682,6 +806,10 @@ export interface Shop { updateTime: string } +/** + * Purpose: ShopListResponse supports admin.ts by holding or executing the shop list response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ShopListResponse { list: Shop[] total: number @@ -689,6 +817,10 @@ export interface ShopListResponse { size: number } +/** + * Purpose: CreateShopRequest supports admin.ts by holding or executing the create shop request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CreateShopRequest { shopName: string description: string @@ -759,6 +891,10 @@ export const adminShopApi = { } } +/** + * Purpose: UserVO supports admin.ts by holding or executing the user vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserVO { id: IdType shopId?: IdType @@ -780,6 +916,10 @@ export interface UserVO { status?: number } +/** + * Purpose: UserRelationVO supports admin.ts by holding or executing the user relation vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserRelationVO { userId: IdType shopId?: IdType @@ -792,6 +932,10 @@ export interface UserRelationVO { sourceTypeName?: string } +/** + * Purpose: UserStatisticsVO supports admin.ts by holding or executing the user statistics vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserStatisticsVO { totalUserCount: number normalUserCount: number @@ -805,6 +949,10 @@ export interface UserStatisticsVO { byParent?: Record } +/** + * Purpose: PageResult supports admin.ts by holding or executing the page result page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface PageResult { list: T[] total: number @@ -960,6 +1108,10 @@ export const adminUserApi = { } } +/** + * Purpose: UserAssetVO supports admin.ts by holding or executing the user asset vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserAssetVO { userId: IdType nickname: string @@ -975,6 +1127,10 @@ export interface UserAssetVO { vipExpireTime?: string } +/** + * Purpose: UserBalanceHistoryItem supports admin.ts by holding or executing the user balance history item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserBalanceHistoryItem { id: IdType userId: IdType @@ -993,6 +1149,10 @@ export interface UserBalanceHistoryItem { changeTime: string } +/** + * Purpose: AdminUserBalanceChangeRequest supports admin.ts by holding or executing the admin user balance change request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AdminUserBalanceChangeRequest { amount: number changeScene: string @@ -1001,13 +1161,25 @@ export interface AdminUserBalanceChangeRequest { remark?: string } +/** + * Purpose: AdminUserVipOverrideRequest supports admin.ts by holding or executing the admin user vip override request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AdminUserVipOverrideRequest { vipLevel: string remark?: string } +/** + * Purpose: userApi supports admin.ts by holding or executing the user api page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const userApi = adminUserApi +/** + * Purpose: OrderVO supports admin.ts by holding or executing the order vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderVO { id: IdType orderNo: string @@ -1067,6 +1239,10 @@ export const adminOrderApi = { } } +/** + * Purpose: HotProductVO supports admin.ts by holding or executing the hot product vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface HotProductVO { id: IdType title: string @@ -1075,6 +1251,10 @@ export interface HotProductVO { collectCount: number } +/** + * Purpose: RecentActivityVO supports admin.ts by holding or executing the recent activity vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface RecentActivityVO { id: IdType type: string @@ -1084,6 +1264,10 @@ export interface RecentActivityVO { color?: string } +/** + * Purpose: DashboardStats supports admin.ts by holding or executing the dashboard stats page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface DashboardStats { totalUsers: number totalProducts: number @@ -1117,6 +1301,10 @@ export const adminDashboardApi = { } } +/** + * Purpose: NailArtistInfoVO supports admin.ts by holding or executing the nail artist info vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface NailArtistInfoVO { id: IdType userId: IdType @@ -1166,6 +1354,10 @@ export const adminNailArtistApi = { } } +/** + * Purpose: SystemMessageVO supports admin.ts by holding or executing the system message vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface SystemMessageVO { id: IdType title: string @@ -1186,11 +1378,19 @@ export interface SystemMessageVO { readStatus?: number } +/** + * Purpose: MessageTargetOptionsVO supports admin.ts by holding or executing the message target options vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface MessageTargetOptionsVO { shops: Array<{ id: IdType; shopName: string }> users: Array<{ id: IdType; nickname: string; account: string; shopId?: IdType; shopName?: string; type?: number }> } +/** + * Purpose: SystemMessageCreateRequest supports admin.ts by holding or executing the system message create request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface SystemMessageCreateRequest { title: string content: string @@ -1240,6 +1440,10 @@ export const adminSystemMessageApi = { } } +/** + * Purpose: AnnouncementVO supports admin.ts by holding or executing the announcement vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AnnouncementVO { id: IdType title: string @@ -1256,6 +1460,10 @@ export interface AnnouncementVO { createTime?: string } +/** + * Purpose: AnnouncementCreateRequest supports admin.ts by holding or executing the announcement create request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AnnouncementCreateRequest { title: string content: string @@ -1303,6 +1511,10 @@ export const adminAnnouncementApi = { } } +/** + * Purpose: VipRechargePlanVO supports admin.ts by holding or executing the vip recharge plan vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface VipRechargePlanVO { id: IdType shopId: IdType @@ -1318,6 +1530,10 @@ export interface VipRechargePlanVO { updateTime?: string } +/** + * Purpose: VipRechargePlanRequest supports admin.ts by holding or executing the vip recharge plan request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface VipRechargePlanRequest { shopId?: IdType title: string @@ -1380,6 +1596,10 @@ export const adminVipRechargePlanApi = { } } +/** + * Purpose: MessageHubPushConfigVO supports admin.ts by holding or executing the message hub push config vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface MessageHubPushConfigVO { id: IdType sceneCode: string @@ -1397,6 +1617,10 @@ export interface MessageHubPushConfigVO { updateTime?: string } +/** + * Purpose: MessageHubPushConfigRequest supports admin.ts by holding or executing the message hub push config request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface MessageHubPushConfigRequest { sceneCode: string sceneName: string @@ -1460,6 +1684,10 @@ export const adminMessageHubPushConfigApi = { } } +/** + * Purpose: SystemParameterConfigVO supports admin.ts by holding or executing the system parameter config vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface SystemParameterConfigVO { id?: IdType configGroup: string @@ -1472,6 +1700,10 @@ export interface SystemParameterConfigVO { updateTime?: string } +/** + * Purpose: adminSystemParameterConfigApi supports admin.ts by holding or executing the admin system parameter config api page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const adminSystemParameterConfigApi = { listConfigs: (configGroup?: string) => { return adminApi.get('/system-parameter-config/admin/list', { params: { configGroup } }) as unknown as Promise diff --git a/YumiNail-Frontend/src/api/auth-free-paths.ts b/YumiNail-Frontend/src/api/auth-free-paths.ts index 7ce403d0..36b2ddf9 100644 --- a/YumiNail-Frontend/src/api/auth-free-paths.ts +++ b/YumiNail-Frontend/src/api/auth-free-paths.ts @@ -1,3 +1,7 @@ +/** + * Purpose: WEB_API_AUTH_FREE_PATHS supports auth-free-paths.ts by holding or executing the web api auth free paths page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const WEB_API_AUTH_FREE_PATHS = [ '/user/login', '/user/register', @@ -22,12 +26,20 @@ export const WEB_API_AUTH_FREE_PATHS = [ '/admin/auth/refresh' ] as const +/** + * Purpose: ADMIN_API_AUTH_FREE_PATHS supports auth-free-paths.ts by holding or executing the admin api auth free paths page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const ADMIN_API_AUTH_FREE_PATHS = [ '/auth/login', '/auth/login-shops/', '/auth/refresh' ] as const +/** + * Purpose: normalizePathname supports auth-free-paths.ts by holding or executing the normalize pathname page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const normalizePathname = (url?: string) => { const raw = String(url || '') const withoutHash = raw.split('#')[0] || '' @@ -39,6 +51,10 @@ const normalizePathname = (url?: string) => { } } +/** + * Purpose: matchesAuthFreePath supports auth-free-paths.ts by holding or executing the matches auth free path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const matchesAuthFreePath = (url: string | undefined, path: string) => { const pathname = normalizePathname(url) if (path.endsWith('/')) { @@ -47,10 +63,18 @@ const matchesAuthFreePath = (url: string | undefined, path: string) => { return pathname === path } +/** + * Purpose: isApiAuthFreePath supports auth-free-paths.ts by holding or executing the is api auth free path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const isApiAuthFreePath = (url?: string) => { return WEB_API_AUTH_FREE_PATHS.some(path => matchesAuthFreePath(url, path)) } +/** + * Purpose: isAdminApiAuthFreePath supports auth-free-paths.ts by holding or executing the is admin api auth free path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const isAdminApiAuthFreePath = (url?: string) => { return ADMIN_API_AUTH_FREE_PATHS.some(path => matchesAuthFreePath(url, path)) } diff --git a/YumiNail-Frontend/src/api/auth.ts b/YumiNail-Frontend/src/api/auth.ts index 33213073..9fe657a0 100644 --- a/YumiNail-Frontend/src/api/auth.ts +++ b/YumiNail-Frontend/src/api/auth.ts @@ -5,11 +5,19 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: SendVerificationCodeRequest supports auth.ts by holding or executing the send verification code request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface SendVerificationCodeRequest { phone: string sceneCode?: string } +/** + * Purpose: LoginRequest supports auth.ts by holding or executing the login request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LoginRequest { account: string password: string @@ -20,6 +28,10 @@ export interface LoginRequest { clientType?: string } +/** + * Purpose: PhoneLoginRequest supports auth.ts by holding or executing the phone login request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface PhoneLoginRequest { phone: string verificationCode: string @@ -29,6 +41,10 @@ export interface PhoneLoginRequest { clientType?: string } +/** + * Purpose: RegisterRequest supports auth.ts by holding or executing the register request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface RegisterRequest { account: string password: string @@ -42,6 +58,10 @@ export interface RegisterRequest { clientType?: string } +/** + * Purpose: LegalAgreement supports auth.ts by holding or executing the legal agreement page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LegalAgreement { id: IdType agreementType: 'USER_TERMS' | 'PRIVACY_POLICY' @@ -54,12 +74,20 @@ export interface LegalAgreement { effectiveTime?: string } +/** + * Purpose: LoginResponse supports auth.ts by holding or executing the login response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LoginResponse { accessToken: string refreshToken: string userInfo: UserInfo } +/** + * Purpose: UserInfo supports auth.ts by holding or executing the user info page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserInfo { id: IdType account: string @@ -77,21 +105,37 @@ export interface UserInfo { updateTime?: string } +/** + * Purpose: RefreshTokenRequest supports auth.ts by holding or executing the refresh token request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface RefreshTokenRequest { refreshToken: string } +/** + * Purpose: RefreshTokenResponse supports auth.ts by holding or executing the refresh token response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface RefreshTokenResponse { accessToken: string refreshToken: string } +/** + * Purpose: ResetPasswordRequest supports auth.ts by holding or executing the reset password request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ResetPasswordRequest { phone: string verificationCode: string newPassword: string } +/** + * Purpose: SwitchShopRequest supports auth.ts by holding or executing the switch shop request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface SwitchShopRequest { shopId?: string | number } @@ -190,6 +234,10 @@ export const authApi = { } } +/** + * Purpose: legalAgreementApi supports auth.ts by holding or executing the legal agreement api page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const legalAgreementApi = { listCurrent: () => { return api.get('/legal-agreement/current') diff --git a/YumiNail-Frontend/src/api/cart.ts b/YumiNail-Frontend/src/api/cart.ts index 3d07b343..763d200d 100644 --- a/YumiNail-Frontend/src/api/cart.ts +++ b/YumiNail-Frontend/src/api/cart.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: CartItem supports cart.ts by holding or executing the cart item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface CartItem { productId: IdType quantity: number diff --git a/YumiNail-Frontend/src/api/comment.ts b/YumiNail-Frontend/src/api/comment.ts index e1bf8e7e..db8e3e06 100644 --- a/YumiNail-Frontend/src/api/comment.ts +++ b/YumiNail-Frontend/src/api/comment.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: CommentVO supports comment.ts by holding or executing the comment vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CommentVO { id: IdType userId: IdType diff --git a/YumiNail-Frontend/src/api/coupon.ts b/YumiNail-Frontend/src/api/coupon.ts index 565b5b1c..751f282d 100644 --- a/YumiNail-Frontend/src/api/coupon.ts +++ b/YumiNail-Frontend/src/api/coupon.ts @@ -5,6 +5,10 @@ import request from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: Coupon supports coupon.ts by holding or executing the coupon page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Coupon { id: IdType couponCode: string @@ -29,11 +33,19 @@ export interface Coupon { unavailableTags: Tag[] } +/** + * Purpose: Tag supports coupon.ts by holding or executing the tag page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface Tag { id: IdType tagName?: string } +/** + * Purpose: UserCoupon supports coupon.ts by holding or executing the user coupon page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserCoupon { id: IdType couponId: IdType @@ -54,6 +66,10 @@ export interface UserCoupon { autoMatched?: boolean } +/** + * Purpose: CreateCouponRequest supports coupon.ts by holding or executing the create coupon request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CreateCouponRequest { couponCode: string couponName: string @@ -71,6 +87,10 @@ export interface CreateCouponRequest { unavailableTagIds: IdType[] } +/** + * Purpose: CouponListResponse supports coupon.ts by holding or executing the coupon list response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CouponListResponse { list: Coupon[] total: number diff --git a/YumiNail-Frontend/src/api/file.ts b/YumiNail-Frontend/src/api/file.ts index 266b7000..9be00464 100644 --- a/YumiNail-Frontend/src/api/file.ts +++ b/YumiNail-Frontend/src/api/file.ts @@ -6,6 +6,10 @@ import type { AxiosProgressEvent } from 'axios' import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: ChunkUploadInitRequest supports file.ts by holding or executing the chunk upload init request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadInitRequest { fileName: string fileSize: number @@ -14,6 +18,10 @@ export interface ChunkUploadInitRequest { scene: string } +/** + * Purpose: ChunkUploadSessionVO supports file.ts by holding or executing the chunk upload session vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadSessionVO { uploadId: string chunkSize: number @@ -49,6 +57,10 @@ export const fileApi = { return api.post('/user/upload-avatar/init', data) as unknown as Promise }, uploadAvatarChunk: ( + /** + * Purpose: data supports file.ts by holding or executing the data page or API role. + * Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow. + */ data: { uploadId: string; chunkIndex: number; totalChunks: number; chunk: Blob }, config?: { signal?: AbortSignal; onUploadProgress?: (event: AxiosProgressEvent) => void } ) => { @@ -58,10 +70,22 @@ export const fileApi = { formData.append('totalChunks', String(data.totalChunks)) formData.append('chunk', data.chunk) return api.post('/user/upload-avatar/chunk', formData, { + /** + * Purpose: headers supports file.ts by holding or executing the headers page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ headers: { 'Content-Type': 'multipart/form-data' }, + /** + * Purpose: signal supports file.ts by holding or executing the signal page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ signal: config?.signal, + /** + * Purpose: onUploadProgress supports file.ts by holding or executing the on upload progress page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ onUploadProgress: config?.onUploadProgress }) }, @@ -90,6 +114,10 @@ export const fileApi = { */ getSignedUrl: (fileId: IdType, expiryTimeInMinutes?: number) => { return api.get(`/file/get-signed-url/${fileId}`, { + /** + * Purpose: params supports file.ts by holding or executing the params page or API role. + * Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow. + */ params: { expiryTimeInMinutes } }) } diff --git a/YumiNail-Frontend/src/api/index.ts b/YumiNail-Frontend/src/api/index.ts index d805103a..ff289469 100644 --- a/YumiNail-Frontend/src/api/index.ts +++ b/YumiNail-Frontend/src/api/index.ts @@ -15,9 +15,21 @@ import { isApiAuthFreePath } from './auth-free-paths' // 防重复提示标志 let lastErrorTime = 0 +/** + * Purpose: lastErrorMessage supports index.ts by holding or executing the last error message page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let lastErrorMessage = '' +/** + * Purpose: ERROR_DEBOUNCE_TIME supports index.ts by holding or executing the error debounce time page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const ERROR_DEBOUNCE_TIME = 1000 // 1秒内不重复显示相同错误 +/** + * Purpose: api supports index.ts by holding or executing the api page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const api = axios.create({ baseURL: API_BASE_URL, timeout: 10000, @@ -26,24 +38,40 @@ const api = axios.create({ } }) +/** + * Purpose: isRefreshing supports index.ts by holding or executing the is refreshing page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let isRefreshing = false let failedQueue: Array<{ resolve: (value?: any) => void reject: (reason?: any) => void }> = [] +/** + * Purpose: getStoredAccessToken supports index.ts by holding or executing the get stored access token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getStoredAccessToken = (isAdmin = false) => { return isAdmin ? (localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken')) : (localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken')) } +/** + * Purpose: getStoredRefreshToken supports index.ts by holding or executing the get stored refresh token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getStoredRefreshToken = (isAdmin = false) => { return isAdmin ? (localStorage.getItem('adminRefreshToken') || sessionStorage.getItem('adminRefreshToken')) : (localStorage.getItem('refreshToken') || sessionStorage.getItem('refreshToken')) } +/** + * Purpose: getRequestToken supports index.ts by holding or executing the get request token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getRequestToken = (request: any) => { if (request?._authToken) { return request._authToken as string @@ -57,14 +85,26 @@ const getRequestToken = (request: any) => { return authHeader.startsWith('Bearer ') ? authHeader.slice('Bearer '.length) : null } +/** + * Purpose: isCurrentStoredToken supports index.ts by holding or executing the is current stored token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isCurrentStoredToken = (token: string | null, isAdmin = false) => { return Boolean(token && token === getStoredAccessToken(isAdmin)) } +/** + * Purpose: getResponseMessage supports index.ts by holding or executing the get response message page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getResponseMessage = (error: AxiosError) => { return (error.response?.data as any)?.message || error.message || '请求失败' } +/** + * Purpose: isTokenExpiredResponse supports index.ts by holding or executing the is token expired response page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isTokenExpiredResponse = (error: AxiosError, requestToken: string | null) => { const messageText = getResponseMessage(error) return Boolean( @@ -81,6 +121,10 @@ const isTokenExpiredResponse = (error: AxiosError, requestToken: string | null) ) } +/** + * Purpose: processQueue supports index.ts by holding or executing the process queue page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const processQueue = (error: any, token: string | null = null) => { failedQueue.forEach(prom => { if (error) { @@ -102,10 +146,18 @@ const showError = (msg: string) => { } } +/** + * Purpose: isAuthFreePath supports index.ts by holding or executing the is auth free path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isAuthFreePath = (url?: string) => { return isApiAuthFreePath(url) } +/** + * Purpose: handleTokenExpired supports index.ts by holding or executing the handle token expired page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const handleTokenExpired = (isAdmin = false, failedToken: string | null = null) => { if (!isCurrentStoredToken(failedToken, isAdmin)) { return diff --git a/YumiNail-Frontend/src/api/order.ts b/YumiNail-Frontend/src/api/order.ts index 1e2c3746..99cf4a10 100644 --- a/YumiNail-Frontend/src/api/order.ts +++ b/YumiNail-Frontend/src/api/order.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: OrderItem supports order.ts by holding or executing the order item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface OrderItem { productId: IdType quantity: number @@ -12,12 +16,20 @@ interface OrderItem { appointmentTime?: string } +/** + * Purpose: CreateOrderRequest supports order.ts by holding or executing the create order request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface CreateOrderRequest { couponId?: IdType couponSourceType?: string items: OrderItem[] } +/** + * Purpose: ArtistCalendarAppointment supports order.ts by holding or executing the artist calendar appointment page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ArtistCalendarAppointment { orderId: IdType orderNo: string @@ -40,6 +52,10 @@ export interface ArtistCalendarAppointment { durationMinutes: number } +/** + * Purpose: OrderArtistReviewVO supports order.ts by holding or executing the order artist review vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderArtistReviewVO { id: IdType orderId: IdType @@ -59,12 +75,20 @@ export interface OrderArtistReviewVO { createTime?: string } +/** + * Purpose: OrderArtistReviewSubmitRequest supports order.ts by holding or executing the order artist review submit request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderArtistReviewSubmitRequest { rating: number content?: string imageFileIds: IdType[] } +/** + * Purpose: OrderArtistChangeOptionsVO supports order.ts by holding or executing the order artist change options vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderArtistChangeOptionsVO { orderId: IdType orderItemId: IdType @@ -79,6 +103,10 @@ export interface OrderArtistChangeOptionsVO { }> } +/** + * Purpose: OrderArtistChangeRequestVO supports order.ts by holding or executing the order artist change request vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderArtistChangeRequestVO { id: IdType orderId: IdType @@ -100,6 +128,10 @@ export interface OrderArtistChangeRequestVO { createTime?: string } +/** + * Purpose: OrderArtistChangeRequestSubmitRequest supports order.ts by holding or executing the order artist change request submit request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderArtistChangeRequestSubmitRequest { orderId: IdType orderItemId: IdType @@ -107,6 +139,10 @@ export interface OrderArtistChangeRequestSubmitRequest { reason: string } +/** + * Purpose: OrderArtistChangeRejectRequest supports order.ts by holding or executing the order artist change reject request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface OrderArtistChangeRejectRequest { rejectReason?: string } diff --git a/YumiNail-Frontend/src/api/permission.ts b/YumiNail-Frontend/src/api/permission.ts index fe1ffdc4..c927b779 100644 --- a/YumiNail-Frontend/src/api/permission.ts +++ b/YumiNail-Frontend/src/api/permission.ts @@ -5,6 +5,10 @@ import { adminApi } from './admin' import type { IdType } from '@/utils/id' +/** + * Purpose: PermissionVO supports permission.ts by holding or executing the permission vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface PermissionVO { id: IdType permissionCode: string @@ -15,6 +19,10 @@ export interface PermissionVO { updateTime: string } +/** + * Purpose: CreatePermissionRequest supports permission.ts by holding or executing the create permission request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CreatePermissionRequest { permissionCode: string permissionName: string @@ -22,6 +30,10 @@ export interface CreatePermissionRequest { description: string } +/** + * Purpose: UpdatePermissionRequest supports permission.ts by holding or executing the update permission request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdatePermissionRequest { permissionCode?: string permissionName?: string diff --git a/YumiNail-Frontend/src/api/product.ts b/YumiNail-Frontend/src/api/product.ts index d6339736..b53d12b4 100644 --- a/YumiNail-Frontend/src/api/product.ts +++ b/YumiNail-Frontend/src/api/product.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: ProductVO supports product.ts by holding or executing the product vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ProductVO { id: IdType shopId: IdType | null @@ -33,6 +37,10 @@ export interface ProductVO { updateTime: string } +/** + * Purpose: TagInfo supports product.ts by holding or executing the tag info page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface TagInfo { id: IdType tagName: string @@ -41,12 +49,20 @@ export interface TagInfo { borderColor?: string } +/** + * Purpose: ListProductsParams supports product.ts by holding or executing the list products params page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ListProductsParams { page: number size: number keyword?: string } +/** + * Purpose: CreateProductRequest supports product.ts by holding or executing the create product request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CreateProductRequest { name: string description: string @@ -58,6 +74,10 @@ export interface CreateProductRequest { shopId: IdType | null } +/** + * Purpose: UpdateProductRequest supports product.ts by holding or executing the update product request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdateProductRequest { name?: string description?: string diff --git a/YumiNail-Frontend/src/api/shop.ts b/YumiNail-Frontend/src/api/shop.ts index 54be1051..39c1f6e7 100644 --- a/YumiNail-Frontend/src/api/shop.ts +++ b/YumiNail-Frontend/src/api/shop.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: ShopVO supports shop.ts by holding or executing the shop vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ShopVO { id: IdType shopName: string @@ -35,18 +39,30 @@ export interface ShopVO { updateTime: string } +/** + * Purpose: ShopSimpleVO supports shop.ts by holding or executing the shop simple vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ShopSimpleVO { id: string | number shopName?: string name?: string } +/** + * Purpose: ListShopsParams supports shop.ts by holding or executing the list shops params page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ListShopsParams { page: number size: number keyword?: string } +/** + * Purpose: CreateShopRequest supports shop.ts by holding or executing the create shop request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CreateShopRequest { name: string description: string @@ -66,6 +82,10 @@ export interface CreateShopRequest { themeBackgroundImageFileId?: string } +/** + * Purpose: UpdateShopRequest supports shop.ts by holding or executing the update shop request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdateShopRequest { name?: string description?: string diff --git a/YumiNail-Frontend/src/api/tag.ts b/YumiNail-Frontend/src/api/tag.ts index 218e7d2e..2136332e 100644 --- a/YumiNail-Frontend/src/api/tag.ts +++ b/YumiNail-Frontend/src/api/tag.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: TagVO supports tag.ts by holding or executing the tag vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface TagVO { id: IdType tagName: string @@ -15,6 +19,10 @@ export interface TagVO { updateTime: string } +/** + * Purpose: TagDTO supports tag.ts by holding or executing the tag dto page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface TagDTO { tagName: string textColor: string diff --git a/YumiNail-Frontend/src/api/user.ts b/YumiNail-Frontend/src/api/user.ts index 00e4627f..407d85ed 100644 --- a/YumiNail-Frontend/src/api/user.ts +++ b/YumiNail-Frontend/src/api/user.ts @@ -6,6 +6,10 @@ import api from './index' import type { UserInfo } from './auth' import type { IdType } from '@/utils/id' +/** + * Purpose: UserVO supports user.ts by holding or executing the user vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserVO extends UserInfo { id: IdType shopId?: IdType @@ -34,12 +38,20 @@ export interface UserVO extends UserInfo { relationSourceType?: string } +/** + * Purpose: UpdateUserInfoRequest supports user.ts by holding or executing the update user info request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdateUserInfoRequest { nickname?: string avatar?: string signature?: string } +/** + * Purpose: ListUsersParams supports user.ts by holding or executing the list users params page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ListUsersParams { page: number size: number @@ -48,6 +60,10 @@ export interface ListUsersParams { status?: number } +/** + * Purpose: CreateUserRequest supports user.ts by holding or executing the create user request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface CreateUserRequest { account: string nickname: string @@ -58,6 +74,10 @@ export interface CreateUserRequest { shopIds?: IdType[] } +/** + * Purpose: UpdateUserRequest supports user.ts by holding or executing the update user request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdateUserRequest { account?: string nickname?: string @@ -67,27 +87,47 @@ export interface UpdateUserRequest { shopIds?: IdType[] } +/** + * Purpose: UpdatePasswordRequest supports user.ts by holding or executing the update password request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdatePasswordRequest { password: string verificationCode: string } +/** + * Purpose: BindPhoneRequest supports user.ts by holding or executing the bind phone request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface BindPhoneRequest { phone: string verificationCode: string } +/** + * Purpose: AvailabilityCheckResponse supports user.ts by holding or executing the availability check response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AvailabilityCheckResponse { available: boolean message: string } +/** + * Purpose: LoginAccountCheckResponse supports user.ts by holding or executing the login account check response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LoginAccountCheckResponse { exists: boolean nickname?: string message: string } +/** + * Purpose: LoginShopSelectionResponse supports user.ts by holding or executing the login shop selection response page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface LoginShopSelectionResponse { allowShoplessLogin: boolean message: string @@ -97,6 +137,10 @@ export interface LoginShopSelectionResponse { }> } +/** + * Purpose: UserRelationVO supports user.ts by holding or executing the user relation vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserRelationVO { userId: IdType shopId?: IdType @@ -109,6 +153,10 @@ export interface UserRelationVO { sourceTypeName?: string } +/** + * Purpose: NailArtistInfoVO supports user.ts by holding or executing the nail artist info vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface NailArtistInfoVO { userId?: IdType userType?: number @@ -133,12 +181,20 @@ export interface InviteCodeVO { createTime?: string } +/** + * Purpose: UpdatePhoneRequest supports user.ts by holding or executing the update phone request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UpdatePhoneRequest { oldPhone: string newPhone: string verificationCode: string } +/** + * Purpose: UserAssetVO supports user.ts by holding or executing the user asset vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface UserAssetVO { userId: IdType nickname: string @@ -154,6 +210,10 @@ export interface UserAssetVO { vipExpireTime?: string } +/** + * Purpose: BalanceHistoryItem supports user.ts by holding or executing the balance history item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface BalanceHistoryItem { id: IdType userId: IdType @@ -171,6 +231,10 @@ export interface BalanceHistoryItem { changeTime?: string } +/** + * Purpose: SystemMessageVO supports user.ts by holding or executing the system message vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface SystemMessageVO { id: IdType title: string @@ -190,6 +254,10 @@ export interface SystemMessageVO { createTime?: string } +/** + * Purpose: AnnouncementVO supports user.ts by holding or executing the announcement vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AnnouncementVO { id: IdType title: string @@ -201,6 +269,10 @@ export interface AnnouncementVO { publishTime?: string } +/** + * Purpose: VipRechargePlanVO supports user.ts by holding or executing the vip recharge plan vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface VipRechargePlanVO { id: IdType shopId: IdType @@ -214,6 +286,10 @@ export interface VipRechargePlanVO { status: number } +/** + * Purpose: ContactInfoVO supports user.ts by holding or executing the contact info vo page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ContactInfoVO { contactUserId?: IdType contactName?: string diff --git a/YumiNail-Frontend/src/api/wishlist.ts b/YumiNail-Frontend/src/api/wishlist.ts index 08041a12..866047e8 100644 --- a/YumiNail-Frontend/src/api/wishlist.ts +++ b/YumiNail-Frontend/src/api/wishlist.ts @@ -5,6 +5,10 @@ import api from './index' import type { IdType } from '@/utils/id' +/** + * Purpose: WishlistItem supports wishlist.ts by holding or executing the wishlist item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface WishlistItem { id: IdType userId: IdType diff --git a/YumiNail-Frontend/src/components/BottomNav.vue b/YumiNail-Frontend/src/components/BottomNav.vue index 777e5aa8..0e4cbb57 100644 --- a/YumiNail-Frontend/src/components/BottomNav.vue +++ b/YumiNail-Frontend/src/components/BottomNav.vue @@ -53,7 +53,15 @@ import { computed, inject, onMounted, ref } from 'vue' import { useRouter, useRoute } from 'vue-router' import { HomeOutlined, ShoppingOutlined, ShoppingCartOutlined, UserOutlined } from '@ant-design/icons-vue' +/** + * Purpose: router supports BottomNav.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: route supports BottomNav.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() // 注入全局购物车数量状态 diff --git a/YumiNail-Frontend/src/components/DraftActions.vue b/YumiNail-Frontend/src/components/DraftActions.vue index dd513e66..10a29f6c 100644 --- a/YumiNail-Frontend/src/components/DraftActions.vue +++ b/YumiNail-Frontend/src/components/DraftActions.vue @@ -24,6 +24,10 @@ */ import { computed } from 'vue' +/** + * Purpose: props supports DraftActions.vue by holding or executing the props page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const props = withDefaults(defineProps<{ savedAt?: number | null disabled?: boolean diff --git a/YumiNail-Frontend/src/components/SystemMessageCard.vue b/YumiNail-Frontend/src/components/SystemMessageCard.vue index 3f8da16c..8616aadc 100644 --- a/YumiNail-Frontend/src/components/SystemMessageCard.vue +++ b/YumiNail-Frontend/src/components/SystemMessageCard.vue @@ -2,6 +2,10 @@ import { computed } from 'vue' import { BellOutlined, ClockCircleOutlined } from '@ant-design/icons-vue' +/** + * Purpose: props supports SystemMessageCard.vue by holding or executing the props page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const props = withDefaults(defineProps<{ title?: string content?: string @@ -24,8 +28,20 @@ const props = withDefaults(defineProps<{ footerAlign: 'between' }) +/** + * Purpose: hasImage supports SystemMessageCard.vue by holding or executing the has image page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const hasImage = computed(() => Boolean(props.imageUrl)) +/** + * Purpose: displayTitle supports SystemMessageCard.vue by holding or executing the display title page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const displayTitle = computed(() => props.title?.trim() || '系统消息') +/** + * Purpose: displayContent supports SystemMessageCard.vue by holding or executing the display content page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const displayContent = computed(() => props.content?.trim() || (hasImage.value ? '' : '你收到了一条新的系统消息。')) diff --git a/YumiNail-Frontend/src/components/TableEllipsisText.vue b/YumiNail-Frontend/src/components/TableEllipsisText.vue index 72c156d8..35d27e95 100644 --- a/YumiNail-Frontend/src/components/TableEllipsisText.vue +++ b/YumiNail-Frontend/src/components/TableEllipsisText.vue @@ -14,6 +14,10 @@ */ import { computed } from 'vue' +/** + * Purpose: props supports TableEllipsisText.vue by holding or executing the props page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const props = withDefaults(defineProps<{ text?: string | number | null lines?: 1 | 2 | 3 diff --git a/YumiNail-Frontend/src/components/admin/AdminResponsiveModal.vue b/YumiNail-Frontend/src/components/admin/AdminResponsiveModal.vue index 622457aa..e9be9287 100644 --- a/YumiNail-Frontend/src/components/admin/AdminResponsiveModal.vue +++ b/YumiNail-Frontend/src/components/admin/AdminResponsiveModal.vue @@ -29,8 +29,16 @@ import { computed, useAttrs } from 'vue' import { useAdminViewport } from '@/composables/useAdminViewport' import { CONFIRM_ENTER_DISABLED_CLASS } from '@/composables/useConfirmEnter' +/** + * Purpose: modalInstanceSeed supports AdminResponsiveModal.vue by holding or executing the modal instance seed page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let modalInstanceSeed = 0 +/** + * Purpose: props supports AdminResponsiveModal.vue by holding or executing the props page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const props = withDefaults(defineProps<{ open: boolean title?: string @@ -44,6 +52,10 @@ const props = withDefaults(defineProps<{ confirmOnEnter: true }) +/** + * Purpose: emit supports AdminResponsiveModal.vue by holding or executing the emit page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const emit = defineEmits<{ (event: 'update:open', value: boolean): void (event: 'cancel', value?: unknown): void @@ -51,7 +63,15 @@ const emit = defineEmits<{ }>() const { isMobile } = useAdminViewport() +/** + * Purpose: attrs supports AdminResponsiveModal.vue by holding or executing the attrs page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const attrs = useAttrs() +/** + * Purpose: modalInstanceClass supports AdminResponsiveModal.vue by holding or executing the modal instance class page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const modalInstanceClass = `admin-responsive-modal-${modalInstanceSeed++}` /** mergedWidth is a reactive state variable used by the template and event handlers. */ @@ -66,6 +86,10 @@ const mergedStyle = computed(() => ( } : undefined )) +/** + * Purpose: mergedWrapClassName supports AdminResponsiveModal.vue by holding or executing the merged wrap class name page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const mergedWrapClassName = computed(() => ( [ attrs.wrapClassName || attrs['wrap-class-name'], diff --git a/YumiNail-Frontend/src/composables/useAdminViewport.ts b/YumiNail-Frontend/src/composables/useAdminViewport.ts index a1e00e5e..de9d0bb7 100644 --- a/YumiNail-Frontend/src/composables/useAdminViewport.ts +++ b/YumiNail-Frontend/src/composables/useAdminViewport.ts @@ -1,13 +1,29 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue' +/** + * Purpose: ADMIN_MOBILE_BREAKPOINT supports useAdminViewport.ts by holding or executing the admin mobile breakpoint page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const ADMIN_MOBILE_BREAKPOINT = 960 +/** + * Purpose: viewportWidth supports useAdminViewport.ts by holding or executing the viewport width page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const viewportWidth = ref( typeof window !== 'undefined' ? window.innerWidth : ADMIN_MOBILE_BREAKPOINT + 1 ) +/** + * Purpose: listenerCount supports useAdminViewport.ts by holding or executing the listener count page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let listenerCount = 0 +/** + * Purpose: updateViewportWidth supports useAdminViewport.ts by holding or executing the update viewport width page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const updateViewportWidth = () => { if (typeof window === 'undefined') { return @@ -15,6 +31,10 @@ const updateViewportWidth = () => { viewportWidth.value = window.innerWidth } +/** + * Purpose: bindViewportListener supports useAdminViewport.ts by holding or executing the bind viewport listener page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const bindViewportListener = () => { if (typeof window === 'undefined') { return @@ -25,6 +45,10 @@ const bindViewportListener = () => { listenerCount += 1 } +/** + * Purpose: unbindViewportListener supports useAdminViewport.ts by holding or executing the unbind viewport listener page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const unbindViewportListener = () => { if (typeof window === 'undefined') { return @@ -35,6 +59,10 @@ const unbindViewportListener = () => { } } +/** + * Purpose: useAdminViewport supports useAdminViewport.ts by holding or executing the use admin viewport page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const useAdminViewport = () => { onMounted(() => { updateViewportWidth() diff --git a/YumiNail-Frontend/src/composables/useConfirmEnter.test.ts b/YumiNail-Frontend/src/composables/useConfirmEnter.test.ts index 928b1742..8063aa24 100644 --- a/YumiNail-Frontend/src/composables/useConfirmEnter.test.ts +++ b/YumiNail-Frontend/src/composables/useConfirmEnter.test.ts @@ -2,6 +2,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { createApp } from 'vue' import { useGlobalConfirmEnter } from './useConfirmEnter' +/** + * Purpose: visibleRects supports useConfirmEnter.test.ts by holding or executing the visible rects page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const visibleRects = [{ bottom: 100, height: 100, @@ -14,10 +18,18 @@ const visibleRects = [{ toJSON: () => ({}) }] as DOMRect[] +/** + * Purpose: makeVisible supports useConfirmEnter.test.ts by holding or executing the make visible page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const makeVisible = (element: HTMLElement) => { vi.spyOn(element, 'getClientRects').mockReturnValue(visibleRects as unknown as DOMRectList) } +/** + * Purpose: setDesktopViewport supports useConfirmEnter.test.ts by holding or executing the set desktop viewport page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const setDesktopViewport = () => { Object.defineProperty(window, 'innerWidth', { configurable: true, @@ -35,6 +47,10 @@ const setDesktopViewport = () => { })) } +/** + * Purpose: setMobileViewport supports useConfirmEnter.test.ts by holding or executing the set mobile viewport page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const setMobileViewport = () => { Object.defineProperty(window, 'innerWidth', { configurable: true, @@ -42,6 +58,10 @@ const setMobileViewport = () => { }) } +/** + * Purpose: setCoarsePointer supports useConfirmEnter.test.ts by holding or executing the set coarse pointer page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const setCoarsePointer = () => { Object.defineProperty(window, 'innerWidth', { configurable: true, @@ -59,6 +79,10 @@ const setCoarsePointer = () => { })) } +/** + * Purpose: mountGlobalConfirmEnter supports useConfirmEnter.test.ts by holding or executing the mount global confirm enter page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const mountGlobalConfirmEnter = () => { const host = document.createElement('div') document.body.appendChild(host) @@ -78,6 +102,10 @@ const mountGlobalConfirmEnter = () => { } } +/** + * Purpose: createModal supports useConfirmEnter.test.ts by holding or executing the create modal page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const createModal = ({ zIndex = 1000, buttonClass = '', @@ -119,12 +147,20 @@ const createModal = ({ return { wrap, button, click, onClick } } +/** + * Purpose: createKeyboardEvent supports useConfirmEnter.test.ts by holding or executing the create keyboard event page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const createKeyboardEvent = () => new KeyboardEvent('keydown', { key: 'Enter', bubbles: true, cancelable: true }) +/** + * Purpose: pressEnter supports useConfirmEnter.test.ts by holding or executing the press enter page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pressEnter = (target: EventTarget = document) => { const event = createKeyboardEvent() target.dispatchEvent(event) diff --git a/YumiNail-Frontend/src/composables/useConfirmEnter.ts b/YumiNail-Frontend/src/composables/useConfirmEnter.ts index 0b5abb50..fdbeae51 100644 --- a/YumiNail-Frontend/src/composables/useConfirmEnter.ts +++ b/YumiNail-Frontend/src/composables/useConfirmEnter.ts @@ -1,5 +1,13 @@ +/** + * Purpose: ComputedRef supports useConfirmEnter.ts by holding or executing the computed ref page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { computed, onBeforeUnmount, onMounted, type ComputedRef } from 'vue' +/** + * Purpose: UseConfirmEnterOptions supports useConfirmEnter.ts by holding or executing the use confirm enter options page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface UseConfirmEnterOptions { enabled: ComputedRef onConfirm: (event: KeyboardEvent) => void @@ -7,9 +15,21 @@ interface UseConfirmEnterOptions { isTopLayer?: () => boolean } +/** + * Purpose: CONFIRM_ENTER_DISABLED_CLASS supports useConfirmEnter.ts by holding or executing the confirm enter disabled class page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const CONFIRM_ENTER_DISABLED_CLASS = 'confirm-enter-disabled' +/** + * Purpose: DESKTOP_MIN_WIDTH supports useConfirmEnter.ts by holding or executing the desktop min width page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DESKTOP_MIN_WIDTH = 960 +/** + * Purpose: isEditableTarget supports useConfirmEnter.ts by holding or executing the is editable target page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isEditableTarget = (target: EventTarget | null) => { if (!(target instanceof HTMLElement)) { return false @@ -22,6 +42,10 @@ const isEditableTarget = (target: EventTarget | null) => { return target.tagName.toLowerCase() === 'textarea' || Boolean(target.closest('[contenteditable="true"]')) } +/** + * Purpose: hasOpenPickerOrDropdown supports useConfirmEnter.ts by holding or executing the has open picker or dropdown page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const hasOpenPickerOrDropdown = () => { return Boolean(document.querySelector([ '.ant-select-dropdown:not(.ant-select-dropdown-hidden)', @@ -32,6 +56,10 @@ const hasOpenPickerOrDropdown = () => { ].join(','))) } +/** + * Purpose: isDesktopViewport supports useConfirmEnter.ts by holding or executing the is desktop viewport page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isDesktopViewport = () => { if (typeof window === 'undefined') { return false @@ -41,6 +69,10 @@ const isDesktopViewport = () => { return window.innerWidth > DESKTOP_MIN_WIDTH && !coarsePointer } +/** + * Purpose: isVisibleElement supports useConfirmEnter.ts by holding or executing the is visible element page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isVisibleElement = (element: Element) => { if (!(element instanceof HTMLElement)) { return false @@ -53,6 +85,10 @@ const isVisibleElement = (element: Element) => { && element.getClientRects().length > 0 } +/** + * Purpose: isDisabledButton supports useConfirmEnter.ts by holding or executing the is disabled button page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isDisabledButton = (button: HTMLButtonElement) => { return button.disabled || button.getAttribute('aria-disabled') === 'true' @@ -60,6 +96,10 @@ const isDisabledButton = (button: HTMLButtonElement) => { || button.classList.contains('ant-btn-disabled') } +/** + * Purpose: getTopModalWrap supports useConfirmEnter.ts by holding or executing the get top modal wrap page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getTopModalWrap = () => { const modals = Array.from(document.querySelectorAll('.ant-modal-wrap')) .filter(isVisibleElement) @@ -82,6 +122,10 @@ const getTopModalWrap = () => { return sortedModals[sortedModals.length - 1]?.modal ?? null } +/** + * Purpose: getTopModalConfirmButton supports useConfirmEnter.ts by holding or executing the get top modal confirm button page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getTopModalConfirmButton = () => { const topModal = getTopModalWrap() if (!topModal || topModal.classList.contains(CONFIRM_ENTER_DISABLED_CLASS)) { @@ -100,6 +144,10 @@ const getTopModalConfirmButton = () => { return button } +/** + * Purpose: useConfirmEnter supports useConfirmEnter.ts by holding or executing the use confirm enter page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const useConfirmEnter = ({ enabled, onConfirm, @@ -141,6 +189,10 @@ export const useConfirmEnter = ({ }) } +/** + * Purpose: useGlobalConfirmEnter supports useConfirmEnter.ts by holding or executing the use global confirm enter page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const useGlobalConfirmEnter = () => { const handleKeydown = (event: KeyboardEvent) => { if ( diff --git a/YumiNail-Frontend/src/composables/useShopTheme.ts b/YumiNail-Frontend/src/composables/useShopTheme.ts index e6b23ecb..56acc555 100644 --- a/YumiNail-Frontend/src/composables/useShopTheme.ts +++ b/YumiNail-Frontend/src/composables/useShopTheme.ts @@ -1,5 +1,9 @@ import { readonly, shallowRef } from 'vue' import { fileApi } from '@/api/file' +/** + * Purpose: ShopVO supports useShopTheme.ts by holding or executing the shop vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { shopApi, type ShopVO } from '@/api/shop' import { applyShopTheme, @@ -9,10 +13,22 @@ import { type ResolvedShopTheme } from '@/utils/shop-theme' +/** + * Purpose: currentTheme supports useShopTheme.ts by holding or executing the current theme page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const currentTheme = shallowRef(DEFAULT_SHOP_THEME) let cleanupThemeSync: (() => void) | undefined +/** + * Purpose: refreshSequence supports useShopTheme.ts by holding or executing the refresh sequence page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let refreshSequence = 0 +/** + * Purpose: useShopTheme supports useShopTheme.ts by holding or executing the use shop theme page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ export function useShopTheme() { return { currentTheme: readonly(currentTheme), @@ -22,6 +38,10 @@ export function useShopTheme() { } } +/** + * Purpose: refreshShopTheme supports useShopTheme.ts by holding or executing the refresh shop theme page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ async function refreshShopTheme() { const token = readToken() const userInfo = readStoredUserInfo() @@ -46,12 +66,20 @@ async function refreshShopTheme() { } } +/** + * Purpose: resetShopTheme supports useShopTheme.ts by holding or executing the reset shop theme page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function resetShopTheme() { refreshSequence += 1 currentTheme.value = DEFAULT_SHOP_THEME applyShopTheme(DEFAULT_SHOP_THEME) } +/** + * Purpose: setupShopThemeSync supports useShopTheme.ts by holding or executing the setup shop theme sync page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function setupShopThemeSync() { if (cleanupThemeSync || typeof window === 'undefined') { return cleanupThemeSync || (() => {}) @@ -79,6 +107,10 @@ function setupShopThemeSync() { return cleanupThemeSync } +/** + * Purpose: applyThemeFromShop supports useShopTheme.ts by holding or executing the apply theme from shop page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ async function applyThemeFromShop(shop: ShopVO) { const theme = resolveShopTheme(shop) currentTheme.value = theme @@ -86,6 +118,10 @@ async function applyThemeFromShop(shop: ShopVO) { applyShopTheme(theme, backgroundImageUrl) } +/** + * Purpose: resolveBackgroundImageUrl supports useShopTheme.ts by holding or executing the resolve background image url page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ async function resolveBackgroundImageUrl(fileId?: string) { if (!fileId) { return null @@ -97,6 +133,10 @@ async function resolveBackgroundImageUrl(fileId?: string) { } } +/** + * Purpose: readToken supports useShopTheme.ts by holding or executing the read token page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function readToken() { if (typeof window === 'undefined') { return '' @@ -104,6 +144,10 @@ function readToken() { return localStorage.getItem('accessToken') || sessionStorage.getItem('accessToken') || '' } +/** + * Purpose: readStoredUserInfo supports useShopTheme.ts by holding or executing the read stored user info page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function readStoredUserInfo(): { shopId?: string | number } | null { if (typeof window === 'undefined') { return null diff --git a/YumiNail-Frontend/src/config/antdv-locale.ts b/YumiNail-Frontend/src/config/antdv-locale.ts index 78ba5913..5e4cbac6 100644 --- a/YumiNail-Frontend/src/config/antdv-locale.ts +++ b/YumiNail-Frontend/src/config/antdv-locale.ts @@ -1,7 +1,19 @@ import zhCN from 'ant-design-vue/es/locale/zh_CN' +/** + * Purpose: baseCalendar supports antdv-locale.ts by holding or executing the base calendar page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const baseCalendar = (zhCN.Calendar || { lang: {} }) as any +/** + * Purpose: baseDatePicker supports antdv-locale.ts by holding or executing the base date picker page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const baseDatePicker = (zhCN.DatePicker || { lang: {}, timePickerLocale: {} }) as any +/** + * Purpose: baseTimePicker supports antdv-locale.ts by holding or executing the base time picker page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const baseTimePicker = (zhCN.TimePicker || {}) as any const antdLocale: any = { diff --git a/YumiNail-Frontend/src/config/api.ts b/YumiNail-Frontend/src/config/api.ts index 7ab4a003..47379c58 100644 --- a/YumiNail-Frontend/src/config/api.ts +++ b/YumiNail-Frontend/src/config/api.ts @@ -1,16 +1,40 @@ +/** + * Purpose: normalizeBaseUrl supports api.ts by holding or executing the normalize base url page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function normalizeBaseUrl(value: string | undefined, fallbackValue: string) { const target = String(value || fallbackValue).trim() return target.replace(/\/+$/, '') } +/** + * Purpose: DEFAULT_API_BASE_URL supports api.ts by holding or executing the default api base url page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEFAULT_API_BASE_URL = import.meta.env.DEV ? '/api' : 'https://yunail.art/api' +/** + * Purpose: DEFAULT_ADMIN_API_BASE_URL supports api.ts by holding or executing the default admin api base url page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEFAULT_ADMIN_API_BASE_URL = import.meta.env.DEV ? '/admin/api' : 'https://yunail.art/admin/api' +/** + * Purpose: API_CONFIG supports api.ts by holding or executing the api config page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const API_CONFIG = { mode: import.meta.env.MODE, apiBaseUrl: normalizeBaseUrl(import.meta.env.VITE_API_BASE_URL, DEFAULT_API_BASE_URL), adminApiBaseUrl: normalizeBaseUrl(import.meta.env.VITE_ADMIN_API_BASE_URL, DEFAULT_ADMIN_API_BASE_URL) } +/** + * Purpose: API_BASE_URL supports api.ts by holding or executing the api base url page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const API_BASE_URL = API_CONFIG.apiBaseUrl +/** + * Purpose: ADMIN_API_BASE_URL supports api.ts by holding or executing the admin api base url page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const ADMIN_API_BASE_URL = API_CONFIG.adminApiBaseUrl diff --git a/YumiNail-Frontend/src/constants/index.ts b/YumiNail-Frontend/src/constants/index.ts index b1b40305..fbc95f60 100644 --- a/YumiNail-Frontend/src/constants/index.ts +++ b/YumiNail-Frontend/src/constants/index.ts @@ -1,3 +1,15 @@ +/** + * Purpose: DEFAULT_AVATAR supports index.ts by holding or executing the default avatar page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const DEFAULT_AVATAR = 'https://api.dicebear.com/7.x/avataaars/svg?seed=default' +/** + * Purpose: DEFAULT_PRODUCT_IMAGE supports index.ts by holding or executing the default product image page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const DEFAULT_PRODUCT_IMAGE = '/assets/images/default-product.png' +/** + * Purpose: DEFAULT_SHOP_IMAGE supports index.ts by holding or executing the default shop image page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const DEFAULT_SHOP_IMAGE = '/assets/images/default-shop.png' diff --git a/YumiNail-Frontend/src/main.ts b/YumiNail-Frontend/src/main.ts index 4971af7c..1947e4dd 100644 --- a/YumiNail-Frontend/src/main.ts +++ b/YumiNail-Frontend/src/main.ts @@ -5,7 +5,15 @@ import './styles/admin-mobile.css' import App from './App.vue' import router from './router' +/** + * Purpose: app supports main.ts by holding or executing the app page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const app = createApp(App) +/** + * Purpose: pinia supports main.ts by holding or executing the pinia page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pinia = createPinia() app.use(pinia) diff --git a/YumiNail-Frontend/src/router/index.ts b/YumiNail-Frontend/src/router/index.ts index 5e6a0f0e..1a296d49 100644 --- a/YumiNail-Frontend/src/router/index.ts +++ b/YumiNail-Frontend/src/router/index.ts @@ -7,6 +7,10 @@ import { resolveAdminLandingPath, } from '@/utils/admin-auth-bootstrap' +/** + * Purpose: router supports index.ts by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ diff --git a/YumiNail-Frontend/src/utils/account.ts b/YumiNail-Frontend/src/utils/account.ts index 2224c2d2..a899a592 100644 --- a/YumiNail-Frontend/src/utils/account.ts +++ b/YumiNail-Frontend/src/utils/account.ts @@ -1,6 +1,22 @@ +/** + * Purpose: ACCOUNT_REGEX supports account.ts by holding or executing the account regex page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const ACCOUNT_REGEX = /^[A-Za-z0-9]+$/ +/** + * Purpose: ACCOUNT_SANITIZE_REGEX supports account.ts by holding or executing the account sanitize regex page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const ACCOUNT_SANITIZE_REGEX = /[^A-Za-z0-9]/g +/** + * Purpose: ACCOUNT_RULE_MESSAGE supports account.ts by holding or executing the account rule message page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const ACCOUNT_RULE_MESSAGE = '账号只能包含字母和数字' +/** + * Purpose: sanitizeAccountInput supports account.ts by holding or executing the sanitize account input page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const sanitizeAccountInput = (value: string) => (value || '').replace(ACCOUNT_SANITIZE_REGEX, '') diff --git a/YumiNail-Frontend/src/utils/action-loading.ts b/YumiNail-Frontend/src/utils/action-loading.ts index e0c1f48f..6a0edb32 100644 --- a/YumiNail-Frontend/src/utils/action-loading.ts +++ b/YumiNail-Frontend/src/utils/action-loading.ts @@ -1,14 +1,30 @@ +/** + * Purpose: LoadingInstance supports action-loading.ts by holding or executing the loading instance page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { ElLoading, type LoadingInstance } from 'element-plus' import 'element-plus/es/components/loading/style/css' +/** + * Purpose: GlobalLoadingOptions supports action-loading.ts by holding or executing the global loading options page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface GlobalLoadingOptions { text?: string lock?: boolean } +/** + * Purpose: activeLoadingCount supports action-loading.ts by holding or executing the active loading count page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let activeLoadingCount = 0 let loadingInstance: LoadingInstance | null = null +/** + * Purpose: openGlobalLoading supports action-loading.ts by holding or executing the open global loading page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openGlobalLoading = (options?: GlobalLoadingOptions) => { activeLoadingCount += 1 @@ -23,6 +39,10 @@ const openGlobalLoading = (options?: GlobalLoadingOptions) => { }) } +/** + * Purpose: closeGlobalLoading supports action-loading.ts by holding or executing the close global loading page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const closeGlobalLoading = () => { activeLoadingCount = Math.max(0, activeLoadingCount - 1) @@ -34,6 +54,10 @@ const closeGlobalLoading = () => { loadingInstance = null } +/** + * Purpose: runWithGlobalLoading supports action-loading.ts by holding or executing the run with global loading page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const runWithGlobalLoading = async ( task: (() => Promise) | Promise, options?: GlobalLoadingOptions diff --git a/YumiNail-Frontend/src/utils/admin-auth-bootstrap.ts b/YumiNail-Frontend/src/utils/admin-auth-bootstrap.ts index 8679a4b0..8e00ab97 100644 --- a/YumiNail-Frontend/src/utils/admin-auth-bootstrap.ts +++ b/YumiNail-Frontend/src/utils/admin-auth-bootstrap.ts @@ -12,8 +12,16 @@ import { getStoredUserPermissions, } from '@/utils/permission' +/** + * Purpose: AuthBootstrapState supports admin-auth-bootstrap.ts by holding or executing the auth bootstrap state page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ export type AuthBootstrapState = 'pending' | 'ready' | 'invalid' +/** + * Purpose: adminBootstrapState supports admin-auth-bootstrap.ts by holding or executing the admin bootstrap state page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const adminBootstrapState = ref('pending') let bootstrapPromise: Promise | null = null @@ -35,13 +43,25 @@ const ADMIN_PERMISSION_ROUTE_MAP: Array<{ code: string; path: string }> = [ { code: 'legal_agreement:manage', path: '/admin/legal-agreements' }, ] +/** + * Purpose: useAdminBootstrapState supports admin-auth-bootstrap.ts by holding or executing the use admin bootstrap state page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const useAdminBootstrapState = () => computed(() => adminBootstrapState.value) +/** + * Purpose: invalidateAdminBootstrap supports admin-auth-bootstrap.ts by holding or executing the invalidate admin bootstrap page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const invalidateAdminBootstrap = () => { adminBootstrapState.value = 'pending' bootstrapPromise = null } +/** + * Purpose: clearAdminBootstrapSession supports admin-auth-bootstrap.ts by holding or executing the clear admin bootstrap session page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const clearAdminBootstrapSession = () => { clearAdminSessionStorage() clearStoredPermissions() @@ -49,6 +69,10 @@ export const clearAdminBootstrapSession = () => { bootstrapPromise = null } +/** + * Purpose: getAdminBootstrapSnapshot supports admin-auth-bootstrap.ts by holding or executing the get admin bootstrap snapshot page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const getAdminBootstrapSnapshot = () => { const userInfo = loadCachedAdminUserInfo() return { @@ -60,6 +84,10 @@ export const getAdminBootstrapSnapshot = () => { } } +/** + * Purpose: hasAdminPermission supports admin-auth-bootstrap.ts by holding or executing the has admin permission page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const hasAdminPermission = (permissionCode?: string) => { if (!permissionCode) { return true @@ -73,6 +101,10 @@ export const hasAdminPermission = (permissionCode?: string) => { return snapshot.permissions.includes(permissionCode) } +/** + * Purpose: resolveAdminLandingPath supports admin-auth-bootstrap.ts by holding or executing the resolve admin landing path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const resolveAdminLandingPath = () => { const snapshot = getAdminBootstrapSnapshot() if (snapshot.userInfo?.shopAuthorizationExpired && snapshot.userInfo?.type !== 4) { @@ -86,6 +118,10 @@ export const resolveAdminLandingPath = () => { return matchedRoute?.path || '/admin' } +/** + * Purpose: canAccessAdminRoute supports admin-auth-bootstrap.ts by holding or executing the can access admin route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const canAccessAdminRoute = (path: string, permissionCode?: string) => { const snapshot = getAdminBootstrapSnapshot() if (snapshot.userInfo?.shopAuthorizationExpired && snapshot.userInfo?.type !== 4) { @@ -98,6 +134,10 @@ export const canAccessAdminRoute = (path: string, permissionCode?: string) => { return hasAdminPermission(permissionCode) } +/** + * Purpose: ensureAdminAuthBootstrap supports admin-auth-bootstrap.ts by holding or executing the ensure admin auth bootstrap page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const ensureAdminAuthBootstrap = async (force = false): Promise => { const snapshot = getAdminBootstrapSnapshot() if (!snapshot.token || !snapshot.userInfo) { diff --git a/YumiNail-Frontend/src/utils/admin-session.ts b/YumiNail-Frontend/src/utils/admin-session.ts index 12e9d70e..58b7285a 100644 --- a/YumiNail-Frontend/src/utils/admin-session.ts +++ b/YumiNail-Frontend/src/utils/admin-session.ts @@ -1,5 +1,9 @@ import type { IdType } from '@/utils/id' +/** + * Purpose: AdminCachedUserInfo supports admin-session.ts by holding or executing the admin cached user info page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface AdminCachedUserInfo { id?: IdType type?: number @@ -14,12 +18,24 @@ export interface AdminCachedUserInfo { shopNames?: string[] } +/** + * Purpose: getAdminAccessToken supports admin-session.ts by holding or executing the get admin access token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const getAdminAccessToken = () => localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken') +/** + * Purpose: getAdminRefreshToken supports admin-session.ts by holding or executing the get admin refresh token page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const getAdminRefreshToken = () => localStorage.getItem('adminRefreshToken') || sessionStorage.getItem('adminRefreshToken') +/** + * Purpose: loadCachedAdminUserInfo supports admin-session.ts by holding or executing the load cached admin user info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const loadCachedAdminUserInfo = (): AdminCachedUserInfo | null => { const raw = localStorage.getItem('adminUserInfo') if (!raw) { @@ -35,11 +51,23 @@ export const loadCachedAdminUserInfo = (): AdminCachedUserInfo | null => { } } +/** + * Purpose: isBootstrapAdminUser supports admin-session.ts by holding or executing the is bootstrap admin user page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const isBootstrapAdminUser = (userInfo?: AdminCachedUserInfo | null) => userInfo?.type === 4 && !userInfo?.shopId +/** + * Purpose: isPlatformOverviewAdminUser supports admin-session.ts by holding or executing the is platform overview admin user page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const isPlatformOverviewAdminUser = isBootstrapAdminUser +/** + * Purpose: clearAdminSessionStorage supports admin-session.ts by holding or executing the clear admin session storage page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const clearAdminSessionStorage = () => { localStorage.removeItem('adminAccessToken') localStorage.removeItem('adminRefreshToken') diff --git a/YumiNail-Frontend/src/utils/cart-state.ts b/YumiNail-Frontend/src/utils/cart-state.ts index ab4f47ed..eee97584 100644 --- a/YumiNail-Frontend/src/utils/cart-state.ts +++ b/YumiNail-Frontend/src/utils/cart-state.ts @@ -1,6 +1,10 @@ import { cartApi } from '@/api/cart' import { toOptionalIdString } from '@/utils/id' +/** + * Purpose: fetchCartProductIdSet supports cart-state.ts by holding or executing the fetch cart product id set page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const fetchCartProductIdSet = async () => { try { const response = await cartApi.getCartList() as unknown as Array<{ productId?: string | number }> @@ -14,11 +18,19 @@ export const fetchCartProductIdSet = async () => { } } +/** + * Purpose: hasCartProduct supports cart-state.ts by holding or executing the has cart product page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const hasCartProduct = (cartProductIdSet: Set, productId: unknown) => { const normalizedId = toOptionalIdString(productId) return Boolean(normalizedId && cartProductIdSet.has(normalizedId)) } +/** + * Purpose: withAddedCartProduct supports cart-state.ts by holding or executing the with added cart product page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const withAddedCartProduct = (cartProductIdSet: Set, productId: unknown) => { const next = new Set(cartProductIdSet || []) const normalizedId = toOptionalIdString(productId) diff --git a/YumiNail-Frontend/src/utils/chunk-upload.ts b/YumiNail-Frontend/src/utils/chunk-upload.ts index 16bcb12f..88537572 100644 --- a/YumiNail-Frontend/src/utils/chunk-upload.ts +++ b/YumiNail-Frontend/src/utils/chunk-upload.ts @@ -1,5 +1,9 @@ import type { AxiosProgressEvent } from 'axios' +/** + * Purpose: ChunkUploadSession supports chunk-upload.ts by holding or executing the chunk upload session page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadSession { uploadId: string chunkSize: number @@ -7,6 +11,10 @@ export interface ChunkUploadSession { uploadedChunks: number[] } +/** + * Purpose: ChunkUploadInitRequest supports chunk-upload.ts by holding or executing the chunk upload init request page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadInitRequest { fileName: string fileSize: number @@ -15,6 +23,10 @@ export interface ChunkUploadInitRequest { scene: string } +/** + * Purpose: ChunkUploadApi supports chunk-upload.ts by holding or executing the chunk upload api page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadApi { initUpload: (payload: ChunkUploadInitRequest) => Promise uploadChunk: ( @@ -25,6 +37,10 @@ export interface ChunkUploadApi { cancelUpload?: (uploadId: string) => Promise } +/** + * Purpose: ChunkUploadOptions supports chunk-upload.ts by holding or executing the chunk upload options page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadOptions { file: File scene: string @@ -33,18 +49,30 @@ export interface ChunkUploadOptions { onProgress?: (percent: number) => void } +/** + * Purpose: ChunkUploadResult supports chunk-upload.ts by holding or executing the chunk upload result page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadResult { response: TResponse uploadId: string processedFile: File } +/** + * Purpose: ChunkUploadTask supports chunk-upload.ts by holding or executing the chunk upload task page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ChunkUploadTask { promise: Promise> cancel: () => void getUploadId: () => string } +/** + * Purpose: computeFileFingerprint supports chunk-upload.ts by holding or executing the compute file fingerprint page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const computeFileFingerprint = async (file: File) => { const fingerprintSeed = `${file.name}|${file.size}|${file.lastModified}|${file.type}` if (!window.crypto?.subtle) { @@ -56,16 +84,28 @@ const computeFileFingerprint = async (file: File) => { return hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('') } +/** + * Purpose: getChunkSizeByIndex supports chunk-upload.ts by holding or executing the get chunk size by index page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getChunkSizeByIndex = (fileSize: number, chunkSize: number, chunkIndex: number) => { const start = chunkIndex * chunkSize const end = Math.min(start + chunkSize, fileSize) return Math.max(end - start, 0) } +/** + * Purpose: calculateUploadedBytes supports chunk-upload.ts by holding or executing the calculate uploaded bytes page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const calculateUploadedBytes = (fileSize: number, chunkSize: number, uploadedChunks: number[]) => { return uploadedChunks.reduce((total, chunkIndex) => total + getChunkSizeByIndex(fileSize, chunkSize, chunkIndex), 0) } +/** + * Purpose: createChunkUploadTask supports chunk-upload.ts by holding or executing the create chunk upload task page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const createChunkUploadTask = (options: ChunkUploadOptions): ChunkUploadTask => { const abortController = new AbortController() let uploadId = '' diff --git a/YumiNail-Frontend/src/utils/form-draft.ts b/YumiNail-Frontend/src/utils/form-draft.ts index 1a7ea494..64643b63 100644 --- a/YumiNail-Frontend/src/utils/form-draft.ts +++ b/YumiNail-Frontend/src/utils/form-draft.ts @@ -1,12 +1,28 @@ +/** + * Purpose: DraftStorageMode supports form-draft.ts by holding or executing the draft storage mode page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ export type DraftStorageMode = 'local' | 'session' +/** + * Purpose: DraftRecord supports form-draft.ts by holding or executing the draft record page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface DraftRecord { savedAt: number payload: T } +/** + * Purpose: getStorage supports form-draft.ts by holding or executing the get storage page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getStorage = (mode: DraftStorageMode) => (mode === 'session' ? window.sessionStorage : window.localStorage) +/** + * Purpose: buildDraftStorageKey supports form-draft.ts by holding or executing the build draft storage key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const buildDraftStorageKey = (...parts: Array) => { const normalizedParts = parts .filter((part): part is string | number => part !== undefined && part !== null && String(part).trim().length > 0) @@ -14,6 +30,10 @@ export const buildDraftStorageKey = (...parts: Array(key: string, payload: T, mode: DraftStorageMode = 'local') => { const record: DraftRecord = { savedAt: Date.now(), @@ -23,6 +43,10 @@ export const saveDraftRecord = (key: string, payload: T, mode: DraftStorageMo return record } +/** + * Purpose: loadDraftRecord supports form-draft.ts by holding or executing the load draft record page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const loadDraftRecord = (key: string, mode: DraftStorageMode = 'local') => { const rawValue = getStorage(mode).getItem(key) if (!rawValue) { @@ -37,6 +61,10 @@ export const loadDraftRecord = (key: string, mode: DraftStorageMode = 'local' } } +/** + * Purpose: clearDraftRecord supports form-draft.ts by holding or executing the clear draft record page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const clearDraftRecord = (key: string, mode: DraftStorageMode = 'local') => { getStorage(mode).removeItem(key) } diff --git a/YumiNail-Frontend/src/utils/id.ts b/YumiNail-Frontend/src/utils/id.ts index 953efeb0..ff766944 100644 --- a/YumiNail-Frontend/src/utils/id.ts +++ b/YumiNail-Frontend/src/utils/id.ts @@ -1,9 +1,21 @@ +/** + * Purpose: IdType supports id.ts by holding or executing the id type page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ export type IdType = string | number +/** + * Purpose: isEmptyId supports id.ts by holding or executing the is empty id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const isEmptyId = (value: unknown): value is undefined | null | '' => { return value === undefined || value === null || `${value}`.trim() === '' } +/** + * Purpose: toIdString supports id.ts by holding or executing the to id string page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const toIdString = (value: IdType) => String(value) // 前端统一把雪花 ID 视为字符串语义处理,避免任何 Number 转换带来的精度污染。 diff --git a/YumiNail-Frontend/src/utils/image-upload.ts b/YumiNail-Frontend/src/utils/image-upload.ts index ae8407ca..78b81f51 100644 --- a/YumiNail-Frontend/src/utils/image-upload.ts +++ b/YumiNail-Frontend/src/utils/image-upload.ts @@ -1,6 +1,18 @@ +/** + * Purpose: DEFAULT_MAX_IMAGE_SIZE supports image-upload.ts by holding or executing the default max image size page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEFAULT_MAX_IMAGE_SIZE = 5 * 1024 * 1024 +/** + * Purpose: AUTO_COMPRESS_TYPES supports image-upload.ts by holding or executing the auto compress types page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const AUTO_COMPRESS_TYPES = new Set(['image/jpeg', 'image/jpg', 'image/png', 'image/webp']) +/** + * Purpose: inferImageMimeType supports image-upload.ts by holding or executing the infer image mime type page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const inferImageMimeType = (file: File) => { if (file.type) return file.type.toLowerCase() const name = file.name.toLowerCase().split(/[?#]/)[0] || '' @@ -11,6 +23,10 @@ const inferImageMimeType = (file: File) => { return '' } +/** + * Purpose: ImageCompressionResult supports image-upload.ts by holding or executing the image compression result page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ImageCompressionResult { file: File originalSize: number @@ -20,9 +36,21 @@ export interface ImageCompressionResult { skippedReason?: string } +/** + * Purpose: QUALITY_STEPS supports image-upload.ts by holding or executing the quality steps page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const QUALITY_STEPS = [0.92, 0.84, 0.76, 0.68, 0.6, 0.52] +/** + * Purpose: SCALE_STEPS supports image-upload.ts by holding or executing the scale steps page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const SCALE_STEPS = [1, 0.9, 0.8, 0.7, 0.6, 0.5] +/** + * Purpose: loadImageElement supports image-upload.ts by holding or executing the load image element page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadImageElement = (file: File) => { return new Promise((resolve, reject) => { const image = new Image() @@ -42,6 +70,10 @@ const loadImageElement = (file: File) => { }) } +/** + * Purpose: canvasToBlob supports image-upload.ts by holding or executing the canvas to blob page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const canvasToBlob = (canvas: HTMLCanvasElement, type: string, quality?: number) => { return new Promise((resolve, reject) => { canvas.toBlob( @@ -58,6 +90,10 @@ const canvasToBlob = (canvas: HTMLCanvasElement, type: string, quality?: number) }) } +/** + * Purpose: getOutputExtension supports image-upload.ts by holding or executing the get output extension page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getOutputExtension = (type: string) => { if (type === 'image/png') { return '.png' @@ -68,6 +104,10 @@ const getOutputExtension = (type: string) => { return '.jpg' } +/** + * Purpose: buildOutputName supports image-upload.ts by holding or executing the build output name page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const buildOutputName = (fileName: string, type: string) => { const extension = getOutputExtension(type) const dotIndex = fileName.lastIndexOf('.') @@ -75,6 +115,10 @@ const buildOutputName = (fileName: string, type: string) => { return `${baseName}${extension}` } +/** + * Purpose: drawImageToCanvas supports image-upload.ts by holding or executing the draw image to canvas page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const drawImageToCanvas = (image: HTMLImageElement, width: number, height: number, mimeType: string) => { const canvas = document.createElement('canvas') canvas.width = width @@ -94,6 +138,10 @@ const drawImageToCanvas = (image: HTMLImageElement, width: number, height: numbe return canvas } +/** + * Purpose: toCompressedFile supports image-upload.ts by holding or executing the to compressed file page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const toCompressedFile = (blob: Blob, sourceFile: File, mimeType: string) => { return new File([blob], buildOutputName(sourceFile.name, mimeType), { type: mimeType, @@ -101,6 +149,10 @@ const toCompressedFile = (blob: Blob, sourceFile: File, mimeType: string) => { }) } +/** + * Purpose: getPreferredMimeTypes supports image-upload.ts by holding or executing the get preferred mime types page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const getPreferredMimeTypes = (file: File) => { if (file.type === 'image/png') { return ['image/png', 'image/jpeg'] @@ -111,6 +163,10 @@ const getPreferredMimeTypes = (file: File) => { return ['image/jpeg'] } +/** + * Purpose: formatFileSize supports image-upload.ts by holding or executing the format file size page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const formatFileSize = (bytes: number) => { if (bytes >= 1024 * 1024) { return `${(bytes / 1024 / 1024).toFixed(2)}MB` @@ -118,6 +174,10 @@ export const formatFileSize = (bytes: number) => { return `${(bytes / 1024).toFixed(0)}KB` } +/** + * Purpose: compressImageIfNeeded supports image-upload.ts by holding or executing the compress image if needed page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const compressImageIfNeeded = async ( file: File, maxSize = DEFAULT_MAX_IMAGE_SIZE @@ -204,4 +264,8 @@ export const compressImageIfNeeded = async ( } } +/** + * Purpose: MAX_IMAGE_UPLOAD_SIZE supports image-upload.ts by holding or executing the max image upload size page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const MAX_IMAGE_UPLOAD_SIZE = DEFAULT_MAX_IMAGE_SIZE diff --git a/YumiNail-Frontend/src/utils/permission.ts b/YumiNail-Frontend/src/utils/permission.ts index 81456202..afdc5b26 100644 --- a/YumiNail-Frontend/src/utils/permission.ts +++ b/YumiNail-Frontend/src/utils/permission.ts @@ -3,8 +3,16 @@ import { computed, ref } from 'vue' import { isBootstrapAdminUser, loadCachedAdminUserInfo } from '@/utils/admin-session' import { isAllowedForShoplessPlatformAdmin } from '@/utils/platform-admin-permissions' +/** + * Purpose: USER_PERMISSIONS_STORAGE_KEY supports permission.ts by holding or executing the user permissions storage key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const USER_PERMISSIONS_STORAGE_KEY = 'userPermissions' +/** + * Purpose: readPermissionsFromStorage supports permission.ts by holding or executing the read permissions from storage page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const readPermissionsFromStorage = () => { const raw = localStorage.getItem(USER_PERMISSIONS_STORAGE_KEY) if (!raw) { @@ -21,24 +29,52 @@ const readPermissionsFromStorage = () => { } } +/** + * Purpose: userPermissions supports permission.ts by holding or executing the user permissions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const userPermissions = ref(readPermissionsFromStorage() || []) +/** + * Purpose: loadingPermissions supports permission.ts by holding or executing the loading permissions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadingPermissions = ref(false) +/** + * Purpose: isPlatformAdminUser supports permission.ts by holding or executing the is platform admin user page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const isPlatformAdminUser = () => Number(loadCachedAdminUserInfo()?.type) === 4 +/** + * Purpose: getStoredUserPermissions supports permission.ts by holding or executing the get stored user permissions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const getStoredUserPermissions = () => readPermissionsFromStorage() +/** + * Purpose: setStoredUserPermissions supports permission.ts by holding or executing the set stored user permissions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const setStoredUserPermissions = (permissions: string[]) => { userPermissions.value = Array.from(new Set((permissions || []).map(code => String(code)))) localStorage.setItem(USER_PERMISSIONS_STORAGE_KEY, JSON.stringify(userPermissions.value)) return userPermissions.value } +/** + * Purpose: clearStoredPermissions supports permission.ts by holding or executing the clear stored permissions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const clearStoredPermissions = () => { userPermissions.value = [] localStorage.removeItem(USER_PERMISSIONS_STORAGE_KEY) } +/** + * Purpose: fetchUserPermissionsStrict supports permission.ts by holding or executing the fetch user permissions strict page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const fetchUserPermissionsStrict = async () => { loadingPermissions.value = true try { @@ -53,6 +89,10 @@ export const fetchUserPermissionsStrict = async () => { } } +/** + * Purpose: usePermission supports permission.ts by holding or executing the use permission page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const usePermission = () => { const hasPermission = (permissionCode: string) => { if (isBootstrapAdminUser(loadCachedAdminUserInfo())) { diff --git a/YumiNail-Frontend/src/utils/platform-admin-permissions.ts b/YumiNail-Frontend/src/utils/platform-admin-permissions.ts index d4d64554..970cc070 100644 --- a/YumiNail-Frontend/src/utils/platform-admin-permissions.ts +++ b/YumiNail-Frontend/src/utils/platform-admin-permissions.ts @@ -1,9 +1,21 @@ +/** + * Purpose: SHOPLESS_ADMIN_ALLOWED_PREFIXES supports platform-admin-permissions.ts by holding or executing the shopless admin allowed prefixes page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const SHOPLESS_ADMIN_ALLOWED_PREFIXES = ['user:', 'shop:', 'permission:', 'message:', 'announcement:'] +/** + * Purpose: SHOPLESS_ADMIN_ALLOWED_PERMISSIONS supports platform-admin-permissions.ts by holding or executing the shopless admin allowed permissions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const SHOPLESS_ADMIN_ALLOWED_PERMISSIONS = [ 'messagehub:config:manage', 'legal_agreement:manage' ] +/** + * Purpose: isAllowedForShoplessPlatformAdmin supports platform-admin-permissions.ts by holding or executing the is allowed for shopless platform admin page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const isAllowedForShoplessPlatformAdmin = (permissionCode: string) => permissionCode === 'dashboard:view' || permissionCode.endsWith(':view') diff --git a/YumiNail-Frontend/src/utils/request-signature.ts b/YumiNail-Frontend/src/utils/request-signature.ts index 5b5dbc78..d5cb7659 100644 --- a/YumiNail-Frontend/src/utils/request-signature.ts +++ b/YumiNail-Frontend/src/utils/request-signature.ts @@ -1,37 +1,89 @@ import type { InternalAxiosRequestConfig } from 'axios' +/** + * Purpose: HEADER_TIMESTAMP supports request-signature.ts by holding or executing the header timestamp page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const HEADER_TIMESTAMP = 'X-Timestamp' +/** + * Purpose: HEADER_NONCE supports request-signature.ts by holding or executing the header nonce page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const HEADER_NONCE = 'X-Nonce' +/** + * Purpose: HEADER_SIGNATURE supports request-signature.ts by holding or executing the header signature page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const HEADER_SIGNATURE = 'X-Signature' +/** + * Purpose: HEADER_SIGNATURE_VERSION supports request-signature.ts by holding or executing the header signature version page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const HEADER_SIGNATURE_VERSION = 'X-Sign-Version' +/** + * Purpose: DEVICE_ID_HEADER supports request-signature.ts by holding or executing the device id header page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEVICE_ID_HEADER = 'X-Device-Id' +/** + * Purpose: DEVICE_ID_STORAGE_KEY supports request-signature.ts by holding or executing the device id storage key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEVICE_ID_STORAGE_KEY = 'yuminail-device-id' +/** + * Purpose: SIGNATURE_VERSION supports request-signature.ts by holding or executing the signature version page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const SIGNATURE_VERSION = 'v1' +/** + * Purpose: HeaderContainer supports request-signature.ts by holding or executing the header container page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ type HeaderContainer = Record & { set?: (name: string, value: string) => void get?: (name: string) => unknown } +/** + * Purpose: RequestSignatureOptions supports request-signature.ts by holding or executing the request signature options page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface RequestSignatureOptions { authFree?: boolean } +/** + * Purpose: isSafeMethod supports request-signature.ts by holding or executing the is safe method page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function isSafeMethod(method?: string) { return ['GET', 'HEAD', 'OPTIONS'].includes(String(method || 'GET').toUpperCase()) } +/** + * Purpose: toHex supports request-signature.ts by holding or executing the to hex page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function toHex(bytes: ArrayBuffer) { return Array.from(new Uint8Array(bytes)) .map(byte => byte.toString(16).padStart(2, '0')) .join('') } +/** + * Purpose: sha256Hex supports request-signature.ts by holding or executing the sha256 hex page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ async function sha256Hex(text: string) { const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(text)) return toHex(digest) } +/** + * Purpose: hmacSha256Hex supports request-signature.ts by holding or executing the hmac sha256 hex page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ async function hmacSha256Hex(secret: string, message: string) { const key = await crypto.subtle.importKey( 'raw', @@ -44,6 +96,10 @@ async function hmacSha256Hex(secret: string, message: string) { return toHex(signature) } +/** + * Purpose: randomNonce supports request-signature.ts by holding or executing the random nonce page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function randomNonce() { if (typeof crypto.randomUUID === 'function') { return `${Date.now()}-${crypto.randomUUID()}` @@ -51,6 +107,10 @@ function randomNonce() { return `${Date.now()}-${Math.random().toString(36).slice(2, 12)}` } +/** + * Purpose: getDeviceId supports request-signature.ts by holding or executing the get device id page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ export function getDeviceId() { try { const stored = localStorage.getItem(DEVICE_ID_STORAGE_KEY) @@ -65,6 +125,10 @@ export function getDeviceId() { } } +/** + * Purpose: setHeader supports request-signature.ts by holding or executing the set header page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function setHeader(config: InternalAxiosRequestConfig, name: string, value: string) { const headers = config.headers as HeaderContainer | undefined if (headers && typeof headers.set === 'function') { @@ -77,6 +141,10 @@ function setHeader(config: InternalAxiosRequestConfig, name: string, value: stri } as InternalAxiosRequestConfig['headers'] } +/** + * Purpose: getHeader supports request-signature.ts by holding or executing the get header page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function getHeader(config: InternalAxiosRequestConfig, name: string) { const headers = config.headers as HeaderContainer | undefined if (!headers) { @@ -91,6 +159,10 @@ function getHeader(config: InternalAxiosRequestConfig, name: string) { return String(headers[name] || headers[name.toLowerCase()] || '') } +/** + * Purpose: extractPath supports request-signature.ts by holding or executing the extract path page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function extractPath(value?: string) { if (!value) { return '' @@ -102,6 +174,10 @@ function extractPath(value?: string) { } } +/** + * Purpose: joinAxiosPath supports request-signature.ts by holding or executing the join axios path page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function joinAxiosPath(baseUrl?: string, requestUrl?: string) { if (requestUrl && /^[a-z][a-z\d+\-.]*:\/\//i.test(requestUrl)) { return extractPath(requestUrl) @@ -113,6 +189,10 @@ function joinAxiosPath(baseUrl?: string, requestUrl?: string) { return joined ? `/${joined}` : '/' } +/** + * Purpose: toBackendRequestPath supports request-signature.ts by holding or executing the to backend request path page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function toBackendRequestPath(baseUrl?: string, requestUrl?: string) { const path = joinAxiosPath(baseUrl, requestUrl) if (path === '/admin/api') { @@ -136,6 +216,10 @@ function toBackendRequestPath(baseUrl?: string, requestUrl?: string) { return path } +/** + * Purpose: appendParam supports request-signature.ts by holding or executing the append param page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function appendParam(target: Record, key: string, value: unknown) { if (value === undefined || value === null || value === '') { return @@ -150,6 +234,10 @@ function appendParam(target: Record, key: string, value: unkn target[key].push(value) } +/** + * Purpose: collectParams supports request-signature.ts by holding or executing the collect params page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function collectParams(source: unknown, target: Record) { if (!source) { return @@ -171,6 +259,10 @@ function collectParams(source: unknown, target: Record) { } } +/** + * Purpose: buildCanonicalParams supports request-signature.ts by holding or executing the build canonical params page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function buildCanonicalParams(...sources: unknown[]) { const params: Record = {} sources.forEach(source => collectParams(source, params)) @@ -186,6 +278,10 @@ function buildCanonicalParams(...sources: unknown[]) { .join('&') } +/** + * Purpose: buildJsonPayload supports request-signature.ts by holding or executing the build json payload page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function buildJsonPayload(data: unknown) { if (data === undefined || data === null || data === '') { return '' @@ -196,6 +292,10 @@ function buildJsonPayload(data: unknown) { return JSON.stringify(data) } +/** + * Purpose: resolvePayload supports request-signature.ts by holding or executing the resolve payload page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function resolvePayload(config: InternalAxiosRequestConfig) { const contentType = getHeader(config, 'Content-Type').toLowerCase() const jsonPayload = contentType.includes('application/json') ? buildJsonPayload(config.data) : '' @@ -205,6 +305,10 @@ function resolvePayload(config: InternalAxiosRequestConfig) { return buildCanonicalParams(config.params, config.data) } +/** + * Purpose: attachRequestSignature supports request-signature.ts by holding or executing the attach request signature page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ export async function attachRequestSignature( config: InternalAxiosRequestConfig, accessToken?: string | null, diff --git a/YumiNail-Frontend/src/utils/shop-theme.ts b/YumiNail-Frontend/src/utils/shop-theme.ts index 8b33f4a6..d37349b5 100644 --- a/YumiNail-Frontend/src/utils/shop-theme.ts +++ b/YumiNail-Frontend/src/utils/shop-theme.ts @@ -1,5 +1,13 @@ +/** + * Purpose: SHOP_THEME_CHANGED_EVENT supports shop-theme.ts by holding or executing the shop theme changed event page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ export const SHOP_THEME_CHANGED_EVENT = 'yumi-shop-theme-updated' +/** + * Purpose: ShopThemeSource supports shop-theme.ts by holding or executing the shop theme source page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ShopThemeSource { themePrimaryColor?: string | null themeSecondaryColor?: string | null @@ -9,6 +17,10 @@ export interface ShopThemeSource { themeBackgroundImageFileId?: string | number | null } +/** + * Purpose: ResolvedShopTheme supports shop-theme.ts by holding or executing the resolved shop theme page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ export interface ResolvedShopTheme { primaryColor: string secondaryColor: string @@ -25,14 +37,26 @@ export interface ResolvedShopTheme { cssVars: Record } +/** + * Purpose: HEX_COLOR_PATTERN supports shop-theme.ts by holding or executing the hex color pattern page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const HEX_COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/ export const DEFAULT_SHOP_THEME: ResolvedShopTheme = resolveShopThemeSource() +/** + * Purpose: resolveShopTheme supports shop-theme.ts by holding or executing the resolve shop theme page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ export function resolveShopTheme(source?: ShopThemeSource | null): ResolvedShopTheme { return resolveShopThemeSource(source) } +/** + * Purpose: applyShopTheme supports shop-theme.ts by holding or executing the apply shop theme page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ export function applyShopTheme(theme: ResolvedShopTheme, backgroundImageUrl?: string | null) { if (typeof document === 'undefined') { return @@ -44,6 +68,10 @@ export function applyShopTheme(theme: ResolvedShopTheme, backgroundImageUrl?: st root.style.setProperty('--theme-background-image', backgroundImageUrl ? `url("${backgroundImageUrl}")` : 'none') } +/** + * Purpose: notifyShopThemeChanged supports shop-theme.ts by holding or executing the notify shop theme changed page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ export function notifyShopThemeChanged() { if (typeof window === 'undefined') { return @@ -51,6 +79,10 @@ export function notifyShopThemeChanged() { window.dispatchEvent(new Event(SHOP_THEME_CHANGED_EVENT)) } +/** + * Purpose: resolveShopThemeSource supports shop-theme.ts by holding or executing the resolve shop theme source page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function resolveShopThemeSource(source?: ShopThemeSource | null): ResolvedShopTheme { const normalizedPrimaryColor = normalizeHexColor(source?.themePrimaryColor) const primaryColor = normalizedPrimaryColor || '#C6597D' @@ -107,6 +139,10 @@ function resolveShopThemeSource(source?: ShopThemeSource | null): ResolvedShopTh } } +/** + * Purpose: normalizeHexColor supports shop-theme.ts by holding or executing the normalize hex color page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function normalizeHexColor(value?: string | null): string | undefined { if (!value) { return undefined @@ -115,6 +151,10 @@ function normalizeHexColor(value?: string | null): string | undefined { return HEX_COLOR_PATTERN.test(normalized) ? normalized.toUpperCase() : undefined } +/** + * Purpose: mixColor supports shop-theme.ts by holding or executing the mix color page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function mixColor(foreground: string, background: string, backgroundWeight: number): string { const fg = hexToRgb(foreground) const bg = hexToRgb(background) @@ -126,15 +166,27 @@ function mixColor(foreground: string, background: string, backgroundWeight: numb }) } +/** + * Purpose: readableTextColor supports shop-theme.ts by holding or executing the readable text color page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function readableTextColor(background: string, preferred: string): string { return relativeLuminance(hexToRgb(background)) > 0.48 ? preferred : '#FFFFFF' } +/** + * Purpose: rgba supports shop-theme.ts by holding or executing the rgba page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function rgba(color: string, alpha: number): string { const rgb = hexToRgb(color) return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${clamp(alpha, 0, 1)})` } +/** + * Purpose: relativeLuminance supports shop-theme.ts by holding or executing the relative luminance page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function relativeLuminance(rgb: { r: number; g: number; b: number }): number { const toLinearChannel = (value: number) => { const channel = value / 255 @@ -146,6 +198,10 @@ function relativeLuminance(rgb: { r: number; g: number; b: number }): number { return 0.2126 * r + 0.7152 * g + 0.0722 * b } +/** + * Purpose: hexToRgb supports shop-theme.ts by holding or executing the hex to rgb page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function hexToRgb(color: string): { r: number; g: number; b: number } { const value = color.replace('#', '') return { @@ -155,14 +211,26 @@ function hexToRgb(color: string): { r: number; g: number; b: number } { } } +/** + * Purpose: rgbToHex supports shop-theme.ts by holding or executing the rgb to hex page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function rgbToHex(rgb: { r: number; g: number; b: number }): string { return `#${toHex(rgb.r)}${toHex(rgb.g)}${toHex(rgb.b)}` } +/** + * Purpose: toHex supports shop-theme.ts by holding or executing the to hex page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function toHex(value: number): string { return clamp(value, 0, 255).toString(16).padStart(2, '0').toUpperCase() } +/** + * Purpose: clamp supports shop-theme.ts by holding or executing the clamp page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function clamp(value: number, min: number, max: number): number { return Math.min(max, Math.max(min, value)) } diff --git a/YumiNail-Frontend/src/views/AccountSettingsView.vue b/YumiNail-Frontend/src/views/AccountSettingsView.vue index 7960d538..8d093216 100644 --- a/YumiNail-Frontend/src/views/AccountSettingsView.vue +++ b/YumiNail-Frontend/src/views/AccountSettingsView.vue @@ -188,6 +188,10 @@ import type { UserVO } from '@/api/user' import { buildDraftStorageKey, clearDraftRecord, loadDraftRecord, saveDraftRecord } from '@/utils/form-draft' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports AccountSettingsView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() // 用户信息 @@ -213,7 +217,15 @@ const hasPhone = ref(false) const bindPhoneModalVisible = ref(false) /** bindPhoneLoading is a reactive state variable used by the template and event handlers. */ const bindPhoneLoading = ref(false) +/** + * Purpose: bindPhoneDraftSavedAt supports AccountSettingsView.vue by holding or executing the bind phone draft saved at page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const bindPhoneDraftSavedAt = ref(null) +/** + * Purpose: bindPhoneForm supports AccountSettingsView.vue by holding or executing the bind phone form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const bindPhoneForm = reactive({ phone: '', verificationCode: '' @@ -224,7 +236,15 @@ const bindPhoneForm = reactive({ const changePhoneModalVisible = ref(false) /** changePhoneLoading is a reactive state variable used by the template and event handlers. */ const changePhoneLoading = ref(false) +/** + * Purpose: changePhoneDraftSavedAt supports AccountSettingsView.vue by holding or executing the change phone draft saved at page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changePhoneDraftSavedAt = ref(null) +/** + * Purpose: changePhoneForm supports AccountSettingsView.vue by holding or executing the change phone form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changePhoneForm = reactive({ newPhone: '', verificationCode: '' @@ -235,13 +255,25 @@ const changePhoneForm = reactive({ const changePasswordModalVisible = ref(false) /** changePasswordLoading is a reactive state variable used by the template and event handlers. */ const changePasswordLoading = ref(false) +/** + * Purpose: changePasswordDraftSavedAt supports AccountSettingsView.vue by holding or executing the change password draft saved at page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changePasswordDraftSavedAt = ref(null) +/** + * Purpose: changePasswordForm supports AccountSettingsView.vue by holding or executing the change password form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changePasswordForm = reactive({ verificationCode: '', password: '', confirmPassword: '' }) +/** + * Purpose: restoreSessionDraft supports AccountSettingsView.vue by holding or executing the restore session draft page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const restoreSessionDraft = >(key: string, target: T, savedAtRef: typeof bindPhoneDraftSavedAt) => { const draft = loadDraftRecord(key, 'session') if (!draft) { @@ -253,6 +285,10 @@ const restoreSessionDraft = >(key: string, target: message.success('已恢复暂存内容') } +/** + * Purpose: saveSessionDraft supports AccountSettingsView.vue by holding or executing the save session draft page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const saveSessionDraft = (key: string, payload: T, savedAtRef: typeof bindPhoneDraftSavedAt, successMessage = '已暂存到当前会话') => { const draft = saveDraftRecord(key, payload, 'session') savedAtRef.value = draft.savedAt @@ -268,8 +304,20 @@ const clearSessionDraft = (key: string, savedAtRef: typeof bindPhoneDraftSavedAt } } +/** + * Purpose: bindPhoneDraftKey supports AccountSettingsView.vue by holding or executing the bind phone draft key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const bindPhoneDraftKey = buildDraftStorageKey('account-settings', 'bind-phone') +/** + * Purpose: changePhoneDraftKey supports AccountSettingsView.vue by holding or executing the change phone draft key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changePhoneDraftKey = buildDraftStorageKey('account-settings', 'change-phone') +/** + * Purpose: changePasswordDraftKey supports AccountSettingsView.vue by holding or executing the change password draft key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changePasswordDraftKey = buildDraftStorageKey('account-settings', 'change-password') /** handleSaveBindPhoneDraft is a local helper used by this page script. */ diff --git a/YumiNail-Frontend/src/views/ArtistCalendarView.vue b/YumiNail-Frontend/src/views/ArtistCalendarView.vue index 3672e0b9..0b58d8b8 100644 --- a/YumiNail-Frontend/src/views/ArtistCalendarView.vue +++ b/YumiNail-Frontend/src/views/ArtistCalendarView.vue @@ -108,19 +108,39 @@ import { computed, onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { LeftOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' +/** + * Purpose: ArtistCalendarAppointment supports ArtistCalendarView.vue by holding or executing the artist calendar appointment page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { orderApi, type ArtistCalendarAppointment } from '@/api/order' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports ArtistCalendarView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) /** completing is a reactive state variable used by the template and event handlers. */ const completing = ref(false) +/** + * Purpose: appointments supports ArtistCalendarView.vue by holding or executing the appointments page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const appointments = ref([]) +/** + * Purpose: selected supports ArtistCalendarView.vue by holding or executing the selected page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selected = ref(null) /** detailOpen is a reactive state variable used by the template and event handlers. */ const detailOpen = ref(false) +/** + * Purpose: todayKey supports ArtistCalendarView.vue by holding or executing the today key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const todayKey = localDateKey(new Date()) /** todayCount is a reactive state variable used by the template and event handlers. */ const todayCount = computed(() => appointments.value.filter(item => dateKey(item.appointmentStartTime) === todayKey).length) @@ -203,6 +223,10 @@ const openSelectedOrder = () => { /** dateKey is a local helper used by this page script. */ const dateKey = (value: string) => value ? value.slice(0, 10) : '' +/** + * Purpose: localDateKey supports ArtistCalendarView.vue by holding or executing the local date key page or API role. + * Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow. + */ function localDateKey(value: Date) { const month = String(value.getMonth() + 1).padStart(2, '0') const day = String(value.getDate()).padStart(2, '0') diff --git a/YumiNail-Frontend/src/views/ArtistOrderView.vue b/YumiNail-Frontend/src/views/ArtistOrderView.vue index cac0d540..15a103ae 100644 --- a/YumiNail-Frontend/src/views/ArtistOrderView.vue +++ b/YumiNail-Frontend/src/views/ArtistOrderView.vue @@ -144,19 +144,75 @@ import type { OrderArtistChangeOptionsVO, OrderArtistChangeRequestVO } from '../ import type { IdType } from '@/utils/id' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports ArtistOrderView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: route supports ArtistOrderView.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() +/** + * Purpose: orders supports ArtistOrderView.vue by holding or executing the orders page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const orders = ref([]) +/** + * Purpose: imageIdCache supports ArtistOrderView.vue by holding or executing the image id cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageIdCache = ref>({}) +/** + * Purpose: orderRefs supports ArtistOrderView.vue by holding or executing the order refs page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const orderRefs = ref>({}) +/** + * Purpose: showCalendarEntry supports ArtistOrderView.vue by holding or executing the show calendar entry page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const showCalendarEntry = ref(false) +/** + * Purpose: currentUserId supports ArtistOrderView.vue by holding or executing the current user id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const currentUserId = ref() +/** + * Purpose: artistChangeModalOpen supports ArtistOrderView.vue by holding or executing the artist change modal open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const artistChangeModalOpen = ref(false) +/** + * Purpose: artistChangeSubmitting supports ArtistOrderView.vue by holding or executing the artist change submitting page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const artistChangeSubmitting = ref(false) +/** + * Purpose: artistChangeOptionsLoading supports ArtistOrderView.vue by holding or executing the artist change options loading page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const artistChangeOptionsLoading = ref(false) +/** + * Purpose: artistChangeOptions supports ArtistOrderView.vue by holding or executing the artist change options page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const artistChangeOptions = ref(null) +/** + * Purpose: activeArtistChangeOrder supports ArtistOrderView.vue by holding or executing the active artist change order page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const activeArtistChangeOrder = ref(null) +/** + * Purpose: activeArtistChangeItem supports ArtistOrderView.vue by holding or executing the active artist change item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const activeArtistChangeItem = ref(null) +/** + * Purpose: filters supports ArtistOrderView.vue by holding or executing the filters page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const filters = reactive({ keyword: '', source: 'all', @@ -165,6 +221,10 @@ const filters = reactive({ minAmount: undefined as number | undefined, maxAmount: undefined as number | undefined }) +/** + * Purpose: artistChangeForm supports ArtistOrderView.vue by holding or executing the artist change form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const artistChangeForm = reactive({ requestedArtistId: undefined as IdType | undefined, reason: '' @@ -233,10 +293,18 @@ const sourceClass = (source?: string) => { return 'source-service' } +/** + * Purpose: sameId supports ArtistOrderView.vue by holding or executing the same id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const sameId = (left: unknown, right: unknown) => { return left !== undefined && left !== null && right !== undefined && right !== null && String(left) === String(right) } +/** + * Purpose: pendingArtistChangeForItem supports ArtistOrderView.vue by holding or executing the pending artist change for item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pendingArtistChangeForItem = (order: any, item: any): OrderArtistChangeRequestVO | undefined => { const itemValue = item?.pendingArtistChangeRequest as OrderArtistChangeRequestVO | undefined if (itemValue) return itemValue @@ -250,11 +318,19 @@ const canComplete = (order: any) => { return order.status === 1 && order.artistOrderSource !== 'SELF' } +/** + * Purpose: canRequestArtistChange supports ArtistOrderView.vue by holding or executing the can request artist change page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const canRequestArtistChange = (order: any, item: any) => { const assignedToCurrentUser = !currentUserId.value || !item.artistId || sameId(item.artistId, currentUserId.value) return order.status === 1 && item.id && assignedToCurrentUser && !pendingArtistChangeForItem(order, item) } +/** + * Purpose: selectableArtistOptions supports ArtistOrderView.vue by holding or executing the selectable artist options page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectableArtistOptions = computed(() => { const options = artistChangeOptions.value?.artists || [] return options.filter(artist => !sameId(artist.artistId, artistChangeOptions.value?.currentArtistId)) @@ -318,6 +394,10 @@ const handleRefreshClick = async () => { await runWithGlobalLoading(() => loadOrders()) } +/** + * Purpose: openArtistChangeModal supports ArtistOrderView.vue by holding or executing the open artist change modal page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openArtistChangeModal = async (order: any, item: any) => { if (!canRequestArtistChange(order, item)) return activeArtistChangeOrder.value = order @@ -340,6 +420,10 @@ const openArtistChangeModal = async (order: any, item: any) => { } } +/** + * Purpose: closeArtistChangeModal supports ArtistOrderView.vue by holding or executing the close artist change modal page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const closeArtistChangeModal = () => { artistChangeModalOpen.value = false activeArtistChangeOrder.value = null @@ -349,6 +433,10 @@ const closeArtistChangeModal = () => { artistChangeForm.reason = '' } +/** + * Purpose: submitArtistChangeRequest supports ArtistOrderView.vue by holding or executing the submit artist change request page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const submitArtistChangeRequest = async () => { if (!activeArtistChangeOrder.value || !activeArtistChangeItem.value) return if (!artistChangeForm.requestedArtistId) { diff --git a/YumiNail-Frontend/src/views/AuthView.vue b/YumiNail-Frontend/src/views/AuthView.vue index e4ebca02..161c93a3 100644 --- a/YumiNail-Frontend/src/views/AuthView.vue +++ b/YumiNail-Frontend/src/views/AuthView.vue @@ -423,6 +423,10 @@ import { useRouter } from 'vue-router' import { InfoCircleOutlined, LockOutlined, UserOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' import type { Rule } from 'ant-design-vue/es/form' +/** + * Purpose: LegalAgreement supports AuthView.vue by holding or executing the legal agreement page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { authApi, legalAgreementApi, type LegalAgreement } from '@/api/auth' import { shopApi } from '@/api/shop' import { ACCOUNT_REGEX, ACCOUNT_RULE_MESSAGE, sanitizeAccountInput } from '@/utils/account' @@ -436,20 +440,52 @@ import { } from '@/api/user' import type { IdType } from '@/utils/id' +/** + * Purpose: router supports AuthView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: activeTab supports AuthView.vue by holding or executing the active tab page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const activeTab = ref<'login' | 'register'>('login') +/** + * Purpose: loginType supports AuthView.vue by holding or executing the login type page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loginType = ref<'password' | 'phone'>('password') /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) /** loadingShops is a reactive state variable used by the template and event handlers. */ const loadingShops = ref(false) +/** + * Purpose: shops supports AuthView.vue by holding or executing the shops page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const shops = ref([]) +/** + * Purpose: loginShops supports AuthView.vue by holding or executing the login shops page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loginShops = ref>([]) /** countdown is a reactive state variable used by the template and event handlers. */ const countdown = ref(0) +/** + * Purpose: loginAccountStatus supports AuthView.vue by holding or executing the login account status page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loginAccountStatus = ref(null) +/** + * Purpose: registerAccountStatus supports AuthView.vue by holding or executing the register account status page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const registerAccountStatus = ref(null) +/** + * Purpose: registerPhoneStatus supports AuthView.vue by holding or executing the register phone status page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const registerPhoneStatus = ref(null) /** loginShopMessage is a reactive state variable used by the template and event handlers. */ const loginShopMessage = ref('') @@ -462,17 +498,41 @@ const forgotPasswordVisible = ref(false) const forgotCountdown = ref(0) /** resettingPassword is a reactive state variable used by the template and event handlers. */ const resettingPassword = ref(false) +/** + * Purpose: agreementAccepted supports AuthView.vue by holding or executing the agreement accepted page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const agreementAccepted = ref(false) +/** + * Purpose: agreements supports AuthView.vue by holding or executing the agreements page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const agreements = ref([]) +/** + * Purpose: agreementModalOpen supports AuthView.vue by holding or executing the agreement modal open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const agreementModalOpen = ref(false) +/** + * Purpose: selectedAgreement supports AuthView.vue by holding or executing the selected agreement page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedAgreement = ref(null) +/** + * Purpose: forgotPasswordForm supports AuthView.vue by holding or executing the forgot password form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const forgotPasswordForm = reactive({ phone: '', verificationCode: '', newPassword: '' }) +/** + * Purpose: formData supports AuthView.vue by holding or executing the form data page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formData = reactive({ account: '', password: '', @@ -485,6 +545,10 @@ const formData = reactive({ rememberMe: false }) +/** + * Purpose: agreementVersions supports AuthView.vue by holding or executing the agreement versions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const agreementVersions = computed>(() => { return agreements.value.reduce((result, agreement) => { result[agreement.agreementType] = agreement.version @@ -492,6 +556,10 @@ const agreementVersions = computed>(() => { }, {} as Record) }) +/** + * Purpose: agreementPayload supports AuthView.vue by holding or executing the agreement payload page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const agreementPayload = () => ({ agreementAccepted: agreementAccepted.value, agreementVersions: agreementVersions.value, @@ -501,8 +569,20 @@ const agreementPayload = () => ({ let loginAccountCheckTimer: number | undefined let loginPhoneShopCheckTimer: number | undefined +/** + * Purpose: phoneRegex supports AuthView.vue by holding or executing the phone regex page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const phoneRegex = /^1[3-9]\d{9}$/ +/** + * Purpose: verificationCodeRegex supports AuthView.vue by holding or executing the verification code regex page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const verificationCodeRegex = /^\d{6}$/ +/** + * Purpose: loginShopUnsupportedMessage supports AuthView.vue by holding or executing the login shop unsupported message page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loginShopUnsupportedMessage = '可直接登录;如账号绑定多家门店,登录后可在个人中心切换当前门店。' /** loginShopPlaceholder is a reactive state variable used by the template and event handlers. */ const loginShopPlaceholder = computed(() => { @@ -636,6 +716,10 @@ const forgotPasswordRules: Record = { ] } +/** + * Purpose: currentRules supports AuthView.vue by holding or executing the current rules page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const currentRules = computed>(() => { if (activeTab.value === 'register') { return registerRules @@ -861,6 +945,10 @@ const checkRegisterPhoneAvailability = async (showWarning = true) => { return response.available } +/** + * Purpose: loadAgreements supports AuthView.vue by holding or executing the load agreements page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadAgreements = async () => { try { agreements.value = await legalAgreementApi.listCurrent() as unknown as LegalAgreement[] @@ -870,6 +958,10 @@ const loadAgreements = async () => { } } +/** + * Purpose: openAgreement supports AuthView.vue by holding or executing the open agreement page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openAgreement = async (type: 'USER_TERMS' | 'PRIVACY_POLICY') => { const cached = agreements.value.find(item => item.agreementType === type) if (cached) { diff --git a/YumiNail-Frontend/src/views/CartView.vue b/YumiNail-Frontend/src/views/CartView.vue index 3e1d3013..54e926e3 100644 --- a/YumiNail-Frontend/src/views/CartView.vue +++ b/YumiNail-Frontend/src/views/CartView.vue @@ -245,6 +245,10 @@ import { DeleteOutlined, RightOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' import type { ButtonProps } from 'ant-design-vue/es/button/buttonTypes' import { cartApi } from '../api/cart' +/** + * Purpose: UserCoupon supports CartView.vue by holding or executing the user coupon page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { couponApi, type UserCoupon } from '../api/coupon' import { fileApi } from '../api/index' import { orderApi } from '../api/order' @@ -253,14 +257,34 @@ import type { IdType } from '@/utils/id' import { sameId, toOptionalIdString } from '@/utils/id' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports CartView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: updateCartCount supports CartView.vue by holding or executing the update cart count page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const updateCartCount = inject<() => Promise>('updateCartCount', async () => {}) +/** + * Purpose: NO_COUPON_KEY supports CartView.vue by holding or executing the no coupon key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const NO_COUPON_KEY = 'NONE' +/** + * Purpose: ButtonPropsWithClass supports CartView.vue by holding or executing the button props with class page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ type ButtonPropsWithClass = ButtonProps & { class?: string } const couponModalOkButtonProps: ButtonPropsWithClass = { class: 'cart-coupon-modal__ok' } const couponModalCancelButtonProps: ButtonPropsWithClass = { class: 'cart-coupon-modal__cancel' } +/** + * Purpose: ArtistOption supports CartView.vue by holding or executing the artist option page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface ArtistOption { id: IdType name: string @@ -270,6 +294,10 @@ interface ArtistOption { participateProduction?: boolean } +/** + * Purpose: CartItem supports CartView.vue by holding or executing the cart item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface CartItem { id: IdType productId: IdType @@ -293,16 +321,40 @@ interface CartItem { artist?: ArtistOption } +/** + * Purpose: CheckoutIssue supports CartView.vue by holding or executing the checkout issue page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface CheckoutIssue { key: string message: string itemId?: IdType } +/** + * Purpose: cartItems supports CartView.vue by holding or executing the cart items page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const cartItems = ref([]) +/** + * Purpose: imageIdCache supports CartView.vue by holding or executing the image id cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageIdCache = ref>({}) +/** + * Purpose: itemRefs supports CartView.vue by holding or executing the item refs page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const itemRefs = ref>({}) +/** + * Purpose: availableCoupons supports CartView.vue by holding or executing the available coupons page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const availableCoupons = ref([]) +/** + * Purpose: selectedCoupon supports CartView.vue by holding or executing the selected coupon page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedCoupon = ref(null) /** couponSelectionKey is a reactive state variable used by the template and event handlers. */ const couponSelectionKey = ref(NO_COUPON_KEY) @@ -312,8 +364,20 @@ const couponSelectionTouched = ref(false) const showCouponModal = ref(false) /** showBookingModal is a reactive state variable used by the template and event handlers. */ const showBookingModal = ref(false) +/** + * Purpose: currentItem supports CartView.vue by holding or executing the current item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const currentItem = ref(null) +/** + * Purpose: availableArtists supports CartView.vue by holding or executing the available artists page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const availableArtists = ref([]) +/** + * Purpose: draftArtistId supports CartView.vue by holding or executing the draft artist id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const draftArtistId = ref() /** draftAppointmentTime is a reactive state variable used by the template and event handlers. */ const draftAppointmentTime = ref('') diff --git a/YumiNail-Frontend/src/views/CouponView.vue b/YumiNail-Frontend/src/views/CouponView.vue index 2db5baed..9e1a6f67 100644 --- a/YumiNail-Frontend/src/views/CouponView.vue +++ b/YumiNail-Frontend/src/views/CouponView.vue @@ -68,14 +68,26 @@ import { LeftOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' import { couponApi } from '@/api/coupon' +/** + * Purpose: router supports CouponView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) +/** + * Purpose: coupons supports CouponView.vue by holding or executing the coupons page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const coupons = ref([]) /** activeFilter is a reactive state variable used by the template and event handlers. */ const activeFilter = ref('all') +/** + * Purpose: filterOptions supports CouponView.vue by holding or executing the filter options page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const filterOptions = [ { label: '全部', value: 'all' }, { label: '未使用', value: 'available' }, diff --git a/YumiNail-Frontend/src/views/HomeView.vue b/YumiNail-Frontend/src/views/HomeView.vue index d926bff2..9eca3bf9 100644 --- a/YumiNail-Frontend/src/views/HomeView.vue +++ b/YumiNail-Frontend/src/views/HomeView.vue @@ -168,13 +168,29 @@ import { computed, onMounted, onUnmounted, ref } from 'vue' import { useRouter } from 'vue-router' import { message } from 'ant-design-vue' +/** + * Purpose: AnnouncementVO supports HomeView.vue by holding or executing the announcement vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { userApi, type AnnouncementVO, type UserVO } from '../api/user' +/** + * Purpose: ProductVO supports HomeView.vue by holding or executing the product vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { productApi, type ProductVO } from '../api/product' +/** + * Purpose: ShopVO supports HomeView.vue by holding or executing the shop vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { shopApi, type ShopVO } from '../api/shop' import { fileApi } from '../api/file' import { DEFAULT_AVATAR, DEFAULT_PRODUCT_IMAGE } from '@/constants' import type { IdType } from '@/utils/id' +/** + * Purpose: BannerImage supports HomeView.vue by holding or executing the banner image page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface BannerImage { id: string shopId: IdType @@ -183,6 +199,10 @@ interface BannerImage { url: string } +/** + * Purpose: ProductCardItem supports HomeView.vue by holding or executing the product card item page or API role. + * Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow. + */ interface ProductCardItem { id: IdType name: string @@ -193,17 +213,61 @@ interface ProductCardItem { bgColor: string } +/** + * Purpose: router supports HomeView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: userInfo supports HomeView.vue by holding or executing the user info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const userInfo = ref(null) +/** + * Purpose: publicShops supports HomeView.vue by holding or executing the public shops page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const publicShops = ref([]) +/** + * Purpose: bannerImages supports HomeView.vue by holding or executing the banner images page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const bannerImages = ref([]) +/** + * Purpose: featuredItems supports HomeView.vue by holding or executing the featured items page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const featuredItems = ref([]) +/** + * Purpose: popularSource supports HomeView.vue by holding or executing the popular source page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const popularSource = ref([]) +/** + * Purpose: popularItems supports HomeView.vue by holding or executing the popular items page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const popularItems = ref([]) +/** + * Purpose: announcements supports HomeView.vue by holding or executing the announcements page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const announcements = ref([]) +/** + * Purpose: selectedAnnouncement supports HomeView.vue by holding or executing the selected announcement page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedAnnouncement = ref(null) +/** + * Purpose: announcementDetailOpen supports HomeView.vue by holding or executing the announcement detail open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const announcementDetailOpen = ref(false) +/** + * Purpose: productImageCache supports HomeView.vue by holding or executing the product image cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const productImageCache = ref>({}) /** searchQuery is a reactive state variable used by the template and event handlers. */ const searchQuery = ref('') @@ -213,6 +277,10 @@ const loading = ref(false) const hasMore = ref(true) /** page is a reactive state variable used by the template and event handlers. */ const page = ref(1) +/** + * Purpose: pageSize supports HomeView.vue by holding or executing the page size page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pageSize = 8 /** isLoggedIn is a reactive state variable used by the template and event handlers. */ @@ -224,11 +292,19 @@ const displayName = computed(() => userInfo.value?.nickname || (isLoggedIn.value /** announcementLoop is a reactive state variable used by the template and event handlers. */ const announcementLoop = computed(() => [...announcements.value, ...announcements.value].map((item, index) => ({ ...item, loopKey: index }))) +/** + * Purpose: openAnnouncementDetail supports HomeView.vue by holding or executing the open announcement detail page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openAnnouncementDetail = (item: AnnouncementVO) => { selectedAnnouncement.value = item announcementDetailOpen.value = true } +/** + * Purpose: formatAnnouncementTime supports HomeView.vue by holding or executing the format announcement time page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formatAnnouncementTime = (value?: string) => { if (!value) return '' return value.replace('T', ' ').slice(0, 16) diff --git a/YumiNail-Frontend/src/views/NotFoundView.vue b/YumiNail-Frontend/src/views/NotFoundView.vue index 7881d1f0..0c9efde9 100644 --- a/YumiNail-Frontend/src/views/NotFoundView.vue +++ b/YumiNail-Frontend/src/views/NotFoundView.vue @@ -20,6 +20,10 @@ import { ref, onMounted, onUnmounted } from 'vue' import { useRouter } from 'vue-router' +/** + * Purpose: router supports NotFoundView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() /** countdown is a reactive state variable used by the template and event handlers. */ const countdown = ref(5) diff --git a/YumiNail-Frontend/src/views/NotificationsView.vue b/YumiNail-Frontend/src/views/NotificationsView.vue index 160d002c..a6b37afa 100644 --- a/YumiNail-Frontend/src/views/NotificationsView.vue +++ b/YumiNail-Frontend/src/views/NotificationsView.vue @@ -44,18 +44,38 @@ import { computed, onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { message } from 'ant-design-vue' +/** + * Purpose: SystemMessageVO supports NotificationsView.vue by holding or executing the system message vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { userApi, type SystemMessageVO } from '@/api/user' +/** + * Purpose: router supports NotificationsView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) +/** + * Purpose: messages supports NotificationsView.vue by holding or executing the messages page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const messages = ref([]) /** detailVisible is a reactive state variable used by the template and event handlers. */ const detailVisible = ref(false) +/** + * Purpose: currentMessage supports NotificationsView.vue by holding or executing the current message page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const currentMessage = ref(null) /** unreadCount is a reactive state variable used by the template and event handlers. */ const unreadCount = computed(() => messages.value.filter(item => item.readStatus !== 1).length) +/** + * Purpose: resolveSystemMessageActionPath supports NotificationsView.vue by holding or executing the resolve system message action path page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const resolveSystemMessageActionPath = (item: SystemMessageVO) => { const actionPath = String(item.actionPath || '').trim() if (!actionPath || !actionPath.startsWith('/') || actionPath.startsWith('//')) { @@ -64,6 +84,10 @@ const resolveSystemMessageActionPath = (item: SystemMessageVO) => { return actionPath } +/** + * Purpose: markMessageReadIfNeeded supports NotificationsView.vue by holding or executing the mark message read if needed page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const markMessageReadIfNeeded = async (item: SystemMessageVO) => { if (item.readStatus === 1) { return diff --git a/YumiNail-Frontend/src/views/OrderView.vue b/YumiNail-Frontend/src/views/OrderView.vue index b4c0e937..12d4b57e 100644 --- a/YumiNail-Frontend/src/views/OrderView.vue +++ b/YumiNail-Frontend/src/views/OrderView.vue @@ -141,18 +141,70 @@ import { userApi } from '@/api/user' import type { IdType } from '@/utils/id' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports OrderView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: orders supports OrderView.vue by holding or executing the orders page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const orders = ref([]) +/** + * Purpose: imageIdCache supports OrderView.vue by holding or executing the image id cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageIdCache = ref>({}) +/** + * Purpose: pendingReviews supports OrderView.vue by holding or executing the pending reviews page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pendingReviews = ref([]) +/** + * Purpose: orderReviews supports OrderView.vue by holding or executing the order reviews page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const orderReviews = ref>({}) +/** + * Purpose: pendingChangeRequests supports OrderView.vue by holding or executing the pending change requests page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pendingChangeRequests = ref([]) +/** + * Purpose: reviewModalOpen supports OrderView.vue by holding or executing the review modal open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const reviewModalOpen = ref(false) +/** + * Purpose: reviewSubmitting supports OrderView.vue by holding or executing the review submitting page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const reviewSubmitting = ref(false) +/** + * Purpose: activeReview supports OrderView.vue by holding or executing the active review page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const activeReview = ref(null) +/** + * Purpose: rejectModalOpen supports OrderView.vue by holding or executing the reject modal open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const rejectModalOpen = ref(false) +/** + * Purpose: changeProcessing supports OrderView.vue by holding or executing the change processing page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const changeProcessing = ref(false) +/** + * Purpose: activeChangeRequest supports OrderView.vue by holding or executing the active change request page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const activeChangeRequest = ref(null) +/** + * Purpose: filters supports OrderView.vue by holding or executing the filters page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const filters = reactive({ keyword: '', status: 'all' as 'all' | number, @@ -160,10 +212,18 @@ const filters = reactive({ minAmount: undefined as number | undefined, maxAmount: undefined as number | undefined }) +/** + * Purpose: reviewForm supports OrderView.vue by holding or executing the review form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const reviewForm = reactive({ rating: undefined as number | undefined, content: '' }) +/** + * Purpose: rejectForm supports OrderView.vue by holding or executing the reject form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const rejectForm = reactive({ rejectReason: '' }) @@ -201,10 +261,18 @@ const statusClass = (status: number) => { return 'cancelled' } +/** + * Purpose: sameId supports OrderView.vue by holding or executing the same id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const sameId = (left: unknown, right: unknown) => { return left !== undefined && left !== null && right !== undefined && right !== null && String(left) === String(right) } +/** + * Purpose: embeddedForItem supports OrderView.vue by holding or executing the embedded for item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const embeddedForItem = (order: any, item: any, field: string): T | undefined => { const itemValue = item?.[field] as T | undefined if (itemValue) return itemValue @@ -213,24 +281,40 @@ const embeddedForItem = (order: any, item: a return sameId(orderValue.orderItemId, item.id) || (order.items || []).length === 1 ? orderValue : undefined } +/** + * Purpose: pendingReviewForItem supports OrderView.vue by holding or executing the pending review for item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pendingReviewForItem = (order: any, item: any): OrderArtistReviewVO | undefined => { const embedded = embeddedForItem(order, item, 'pendingReview') if (embedded) return embedded return pendingReviews.value.find(review => sameId(review.orderId, order.id) && sameId(review.orderItemId, item.id)) } +/** + * Purpose: submittedReviewForItem supports OrderView.vue by holding or executing the submitted review for item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const submittedReviewForItem = (order: any, item: any): OrderArtistReviewVO | undefined => { const embedded = embeddedForItem(order, item, 'reviewSummary') if (embedded) return embedded return (orderReviews.value[String(order.id)] || []).find(review => sameId(review.orderItemId, item.id) && Number(review.status) === 1) } +/** + * Purpose: pendingChangeRequestForItem supports OrderView.vue by holding or executing the pending change request for item page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const pendingChangeRequestForItem = (order: any, item: any): OrderArtistChangeRequestVO | undefined => { const embedded = embeddedForItem(order, item, 'pendingArtistChangeRequest') if (embedded) return embedded return pendingChangeRequests.value.find(request => sameId(request.orderId, order.id) && sameId(request.orderItemId, item.id)) } +/** + * Purpose: formatRating supports OrderView.vue by holding or executing the format rating page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formatRating = (rating?: number) => { return Number(rating || 0).toFixed(1) } @@ -244,6 +328,10 @@ const resetFilters = () => { filters.maxAmount = undefined } +/** + * Purpose: copyOrderNo supports OrderView.vue by holding or executing the copy order no page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const copyOrderNo = async (orderNo: string) => { try { await navigator.clipboard.writeText(orderNo) @@ -253,6 +341,10 @@ const copyOrderNo = async (orderNo: string) => { } } +/** + * Purpose: loadPendingReviews supports OrderView.vue by holding or executing the load pending reviews page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadPendingReviews = async () => { try { pendingReviews.value = (await orderApi.getMyPendingReviews()) || [] @@ -261,6 +353,10 @@ const loadPendingReviews = async () => { } } +/** + * Purpose: loadOrderReviews supports OrderView.vue by holding or executing the load order reviews page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadOrderReviews = async () => { const orderIds = orders.value.map(order => order.id).filter(Boolean) const entries = await Promise.all(orderIds.map(async (orderId) => { @@ -273,6 +369,10 @@ const loadOrderReviews = async () => { orderReviews.value = Object.fromEntries(entries) } +/** + * Purpose: loadPendingArtistChangeRequests supports OrderView.vue by holding or executing the load pending artist change requests page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadPendingArtistChangeRequests = async () => { try { pendingChangeRequests.value = (await orderApi.getMyPendingArtistChangeRequests()) || [] @@ -281,6 +381,10 @@ const loadPendingArtistChangeRequests = async () => { } } +/** + * Purpose: refreshOrderExtensions supports OrderView.vue by holding or executing the refresh order extensions page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const refreshOrderExtensions = async () => { await Promise.all([ loadPendingReviews(), @@ -319,6 +423,10 @@ const loadOrders = async () => { } } +/** + * Purpose: openReviewModal supports OrderView.vue by holding or executing the open review modal page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openReviewModal = (review?: OrderArtistReviewVO) => { if (!review) return activeReview.value = review @@ -327,6 +435,10 @@ const openReviewModal = (review?: OrderArtistReviewVO) => { reviewModalOpen.value = true } +/** + * Purpose: closeReviewModal supports OrderView.vue by holding or executing the close review modal page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const closeReviewModal = () => { reviewModalOpen.value = false activeReview.value = null @@ -334,6 +446,10 @@ const closeReviewModal = () => { reviewForm.content = '' } +/** + * Purpose: submitReview supports OrderView.vue by holding or executing the submit review page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const submitReview = async () => { if (!activeReview.value) return const rating = Number(reviewForm.rating) @@ -363,6 +479,10 @@ const submitReview = async () => { } } +/** + * Purpose: approveArtistChange supports OrderView.vue by holding or executing the approve artist change page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const approveArtistChange = (request?: OrderArtistChangeRequestVO) => { if (!request) return Modal.confirm({ @@ -382,6 +502,10 @@ const approveArtistChange = (request?: OrderArtistChangeRequestVO) => { }) } +/** + * Purpose: openRejectArtistChange supports OrderView.vue by holding or executing the open reject artist change page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openRejectArtistChange = (request?: OrderArtistChangeRequestVO) => { if (!request) return activeChangeRequest.value = request @@ -389,12 +513,20 @@ const openRejectArtistChange = (request?: OrderArtistChangeRequestVO) => { rejectModalOpen.value = true } +/** + * Purpose: closeRejectArtistChange supports OrderView.vue by holding or executing the close reject artist change page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const closeRejectArtistChange = () => { rejectModalOpen.value = false activeChangeRequest.value = null rejectForm.rejectReason = '' } +/** + * Purpose: submitRejectArtistChange supports OrderView.vue by holding or executing the submit reject artist change page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const submitRejectArtistChange = async () => { if (!activeChangeRequest.value) return changeProcessing.value = true diff --git a/YumiNail-Frontend/src/views/PasswordSettingsView.vue b/YumiNail-Frontend/src/views/PasswordSettingsView.vue index db12aadc..52298838 100644 --- a/YumiNail-Frontend/src/views/PasswordSettingsView.vue +++ b/YumiNail-Frontend/src/views/PasswordSettingsView.vue @@ -106,22 +106,46 @@ import { userApi } from '@/api/user' import { buildDraftStorageKey, clearDraftRecord, loadDraftRecord, saveDraftRecord } from '@/utils/form-draft' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports PasswordSettingsView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: formRef supports PasswordSettingsView.vue by holding or executing the form ref page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formRef = ref() /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) /** countdown is a reactive state variable used by the template and event handlers. */ const countdown = ref(0) +/** + * Purpose: userInfo supports PasswordSettingsView.vue by holding or executing the user info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const userInfo = ref<{ phone?: string } | null>(null) +/** + * Purpose: draftSavedAt supports PasswordSettingsView.vue by holding or executing the draft saved at page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const draftSavedAt = ref(null) let countdownTimer: ReturnType | null = null +/** + * Purpose: formState supports PasswordSettingsView.vue by holding or executing the form state page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formState = reactive({ verificationCode: '', password: '', confirmPassword: '' }) +/** + * Purpose: draftKey supports PasswordSettingsView.vue by holding or executing the draft key page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const draftKey = buildDraftStorageKey('password-settings', 'set-password') /** restoreDraft is a local helper used by this page script. */ diff --git a/YumiNail-Frontend/src/views/ProductDetailView.vue b/YumiNail-Frontend/src/views/ProductDetailView.vue index 2bd4b14a..c4907ef7 100644 --- a/YumiNail-Frontend/src/views/ProductDetailView.vue +++ b/YumiNail-Frontend/src/views/ProductDetailView.vue @@ -141,10 +141,22 @@ import { } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' import { cartApi } from '@/api/cart' +/** + * Purpose: CommentVO supports ProductDetailView.vue by holding or executing the comment vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { commentApi, type CommentVO } from '@/api/comment' import { fileApi } from '@/api/file' +/** + * Purpose: ProductVO supports ProductDetailView.vue by holding or executing the product vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { productApi, type ProductVO } from '@/api/product' import { productLikeApi } from '@/api/productLike' +/** + * Purpose: ShopVO supports ProductDetailView.vue by holding or executing the shop vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { shopApi, type ShopVO } from '@/api/shop' import { wishlistApi } from '@/api/wishlist' import { DEFAULT_PRODUCT_IMAGE } from '@/constants' @@ -152,17 +164,53 @@ import type { IdType } from '@/utils/id' import { toOptionalIdString } from '@/utils/id' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: route supports ProductDetailView.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() +/** + * Purpose: router supports ProductDetailView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: updateCartCount supports ProductDetailView.vue by holding or executing the update cart count page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const updateCartCount = inject<() => Promise>('updateCartCount', async () => {}) +/** + * Purpose: product supports ProductDetailView.vue by holding or executing the product page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const product = ref({} as ProductVO) +/** + * Purpose: shopInfo supports ProductDetailView.vue by holding or executing the shop info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const shopInfo = ref(null) +/** + * Purpose: productImages supports ProductDetailView.vue by holding or executing the product images page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const productImages = ref([]) +/** + * Purpose: imageIdCache supports ProductDetailView.vue by holding or executing the image id cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageIdCache = ref>({}) +/** + * Purpose: comments supports ProductDetailView.vue by holding or executing the comments page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const comments = ref([]) /** commentText is a reactive state variable used by the template and event handlers. */ const commentText = ref('') +/** + * Purpose: replyTarget supports ProductDetailView.vue by holding or executing the reply target page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const replyTarget = ref(null) /** submittingComment is a reactive state variable used by the template and event handlers. */ const submittingComment = ref(false) @@ -187,6 +235,10 @@ const artistCountText = computed(() => artistCount.value > 0 ? `${artistCount.va /** earliestBookableText is a reactive state variable used by the template and event handlers. */ const earliestBookableText = computed(() => shopInfo.value?.businessHours || '以门店安排为准') +/** + * Purpose: copyShareLink supports ProductDetailView.vue by holding or executing the copy share link page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const copyShareLink = async () => { const url = `${window.location.origin}/product/${route.params.id}` try { diff --git a/YumiNail-Frontend/src/views/ProductListView.vue b/YumiNail-Frontend/src/views/ProductListView.vue index 141d1d82..51d37793 100644 --- a/YumiNail-Frontend/src/views/ProductListView.vue +++ b/YumiNail-Frontend/src/views/ProductListView.vue @@ -137,25 +137,61 @@ import { onMounted, ref, watch, inject, computed } from 'vue' import { useRouter, useRoute } from 'vue-router' import { CheckOutlined, LeftOutlined, SearchOutlined, ShoppingCartOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' +/** + * Purpose: ProductVO supports ProductListView.vue by holding or executing the product vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { productApi, type ProductVO } from '@/api/product' +/** + * Purpose: TagVO supports ProductListView.vue by holding or executing the tag vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { tagApi, type TagVO } from '@/api/tag' import { cartApi } from '@/api/cart' import { fileApi } from '@/api/file' import { runWithGlobalLoading } from '@/utils/action-loading' import { fetchCartProductIdSet, hasCartProduct, withAddedCartProduct } from '@/utils/cart-state' +/** + * Purpose: ProductListItem supports ProductListView.vue by holding or executing the product list item page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ type ProductListItem = ProductVO & { inCart?: boolean } +/** + * Purpose: router supports ProductListView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: route supports ProductListView.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() +/** + * Purpose: updateCartCount supports ProductListView.vue by holding or executing the update cart count page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const updateCartCount = inject<() => Promise>('updateCartCount', async () => {}) +/** + * Purpose: allTags supports ProductListView.vue by holding or executing the all tags page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const allTags = ref([]) +/** + * Purpose: categories supports ProductListView.vue by holding or executing the categories page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const categories = ref(['全部']) /** selectedCategory is a reactive state variable used by the template and event handlers. */ const selectedCategory = ref('全部') +/** + * Purpose: products supports ProductListView.vue by holding or executing the products page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const products = ref([]) /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) @@ -163,10 +199,22 @@ const loading = ref(false) const showSearch = ref(false) /** searchKeyword is a reactive state variable used by the template and event handlers. */ const searchKeyword = ref('') +/** + * Purpose: imageIdCache supports ProductListView.vue by holding or executing the image id cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageIdCache = ref>({}) +/** + * Purpose: imageUrls supports ProductListView.vue by holding or executing the image urls page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageUrls = ref>({}) /** cartProductIdSet is a reactive state variable used by the template and event handlers. */ const cartProductIdSet = ref(new Set()) +/** + * Purpose: useGlobalLoadingForNextRouteSync supports ProductListView.vue by holding or executing the use global loading for next route sync page or API role. + * Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow. + */ let useGlobalLoadingForNextRouteSync = false /** isLoggedIn is a reactive state variable used by the template and event handlers. */ @@ -182,6 +230,10 @@ const activeBannerText = computed(() => { return '' }) +/** + * Purpose: DEFAULT_PRODUCT_IMAGE supports ProductListView.vue by holding or executing the default product image page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCBmaWxsPSIjZjVmNWY1IiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIvPjx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBmaWxsPSIjYmZiZmJmIiBmb250LXNpemU9IjI0IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkeT0iLjNlbSI+YWFhPC90ZXh0Pjwvc3ZnPg==' /** ensureLoginForAction is a local helper used by this page script. */ diff --git a/YumiNail-Frontend/src/views/ProfileView.vue b/YumiNail-Frontend/src/views/ProfileView.vue index abc566a1..d2029e8a 100644 --- a/YumiNail-Frontend/src/views/ProfileView.vue +++ b/YumiNail-Frontend/src/views/ProfileView.vue @@ -213,7 +213,15 @@ import { authApi } from '@/api/auth' import { couponApi } from '@/api/coupon' import { fileApi } from '@/api/file' import { orderApi } from '@/api/order' +/** + * Purpose: UserVO supports ProfileView.vue by holding or executing the user vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { userApi, type UserVO } from '@/api/user' +/** + * Purpose: ChunkUploadTask supports ProfileView.vue by holding or executing the chunk upload task page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { createChunkUploadTask, type ChunkUploadTask } from '@/utils/chunk-upload' import { buildDraftStorageKey, clearDraftRecord, loadDraftRecord, saveDraftRecord } from '@/utils/form-draft' import { wishlistApi } from '@/api/wishlist' @@ -221,8 +229,16 @@ import { DEFAULT_AVATAR } from '@/constants' import { runWithGlobalLoading } from '@/utils/action-loading' import { notifyShopThemeChanged } from '@/utils/shop-theme' +/** + * Purpose: router supports ProfileView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: userInfo supports ProfileView.vue by holding or executing the user info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const userInfo = ref({ id: 0, nickname: '', @@ -256,14 +272,26 @@ const artistCalendarAccessible = ref(false) const shopSwitchVisible = ref(false) /** shopSwitchLoading is a reactive state variable used by the template and event handlers. */ const shopSwitchLoading = ref(false) +/** + * Purpose: selectedShopId supports ProfileView.vue by holding or executing the selected shop id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedShopId = ref() /** avatarUploadProgress is a reactive state variable used by the template and event handlers. */ const avatarUploadProgress = ref(0) /** avatarUploadPending is a reactive state variable used by the template and event handlers. */ const avatarUploadPending = ref(false) let avatarUploadTask: ChunkUploadTask | null = null +/** + * Purpose: draftSavedAt supports ProfileView.vue by holding or executing the draft saved at page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const draftSavedAt = ref(null) +/** + * Purpose: editForm supports ProfileView.vue by holding or executing the edit form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const editForm = reactive({ nickname: '', avatar: '', @@ -335,6 +363,10 @@ const shopSwitchTip = computed(() => { return '当前暂无可用门店' }) +/** + * Purpose: coreMenuItems supports ProfileView.vue by holding or executing the core menu items page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const coreMenuItems = [ { key: 'orders', @@ -401,6 +433,10 @@ const canViewArtistCalendar = computed(() => { return userType === 3 || (userType === 2 && artistCalendarAccessible.value) }) +/** + * Purpose: profileMenuItems supports ProfileView.vue by holding or executing the profile menu items page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const profileMenuItems = computed(() => { return coreMenuItems.filter((item: any) => !item.serviceOnly || canViewArtistCalendar.value) }) diff --git a/YumiNail-Frontend/src/views/SettingsView.vue b/YumiNail-Frontend/src/views/SettingsView.vue index f30f2b6a..eb1869aa 100644 --- a/YumiNail-Frontend/src/views/SettingsView.vue +++ b/YumiNail-Frontend/src/views/SettingsView.vue @@ -58,6 +58,10 @@ import { RightOutlined, } from '@ant-design/icons-vue' +/** + * Purpose: router supports SettingsView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() /** settingsSections is a reactive state variable used by the template and event handlers. */ diff --git a/YumiNail-Frontend/src/views/ShopDetailView.vue b/YumiNail-Frontend/src/views/ShopDetailView.vue index 5e2d3104..fe940de9 100644 --- a/YumiNail-Frontend/src/views/ShopDetailView.vue +++ b/YumiNail-Frontend/src/views/ShopDetailView.vue @@ -101,13 +101,33 @@ import { useRoute, useRouter } from 'vue-router' import { CopyOutlined, LeftOutlined, ShopOutlined } from '@ant-design/icons-vue' import { message } from 'ant-design-vue' import { fileApi } from '@/api/file' +/** + * Purpose: ShopVO supports ShopDetailView.vue by holding or executing the shop vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { shopApi, type ShopVO } from '@/api/shop' +/** + * Purpose: ContactInfoVO supports ShopDetailView.vue by holding or executing the contact info vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { userApi, type ContactInfoVO } from '@/api/user' import { toOptionalIdString } from '@/utils/id' +/** + * Purpose: router supports ShopDetailView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: route supports ShopDetailView.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() +/** + * Purpose: shopInfo supports ShopDetailView.vue by holding or executing the shop info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const shopInfo = ref({ id: '', shopName: '', @@ -122,31 +142,83 @@ const shopInfo = ref({ updateTime: '' }) +/** + * Purpose: shopImages supports ShopDetailView.vue by holding or executing the shop images page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const shopImages = ref([]) +/** + * Purpose: imageModalVisible supports ShopDetailView.vue by holding or executing the image modal visible page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageModalVisible = ref(false) +/** + * Purpose: selectedImage supports ShopDetailView.vue by holding or executing the selected image page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedImage = ref('') +/** + * Purpose: contactOpen supports ShopDetailView.vue by holding or executing the contact open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const contactOpen = ref(false) +/** + * Purpose: contactInfo supports ShopDetailView.vue by holding or executing the contact info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const contactInfo = ref({}) +/** + * Purpose: mapOpen supports ShopDetailView.vue by holding or executing the map open page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const mapOpen = ref(false) +/** + * Purpose: distanceText supports ShopDetailView.vue by holding or executing the distance text page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const distanceText = ref('') +/** + * Purpose: hasLocation supports ShopDetailView.vue by holding or executing the has location page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const hasLocation = computed(() => Boolean(shopInfo.value.longitude && shopInfo.value.latitude)) +/** + * Purpose: mapPreviewUrl supports ShopDetailView.vue by holding or executing the map preview url page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const mapPreviewUrl = computed(() => shopInfo.value.navigationUrls?.BROWSER || shopInfo.value.navigationUrls?.TENCENT || '') +/** + * Purpose: handleBackClick supports ShopDetailView.vue by holding or executing the handle back click page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const handleBackClick = () => { router.back() } +/** + * Purpose: showImageModal supports ShopDetailView.vue by holding or executing the show image modal page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const showImageModal = (imageUrl: string) => { selectedImage.value = imageUrl imageModalVisible.value = true } +/** + * Purpose: handleImageCancel supports ShopDetailView.vue by holding or executing the handle image cancel page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const handleImageCancel = () => { imageModalVisible.value = false selectedImage.value = '' } +/** + * Purpose: openManagerContact supports ShopDetailView.vue by holding or executing the open manager contact page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openManagerContact = async () => { try { contactInfo.value = await userApi.getShopManagerContact(shopInfo.value.id) @@ -156,6 +228,10 @@ const openManagerContact = async () => { } } +/** + * Purpose: openMapPreview supports ShopDetailView.vue by holding or executing the open map preview page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openMapPreview = () => { if (!mapPreviewUrl.value) { message.warning('店铺暂未设置地图位置') @@ -164,6 +240,10 @@ const openMapPreview = () => { mapOpen.value = true } +/** + * Purpose: openNavigation supports ShopDetailView.vue by holding or executing the open navigation page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const openNavigation = (provider: 'TENCENT' | 'AMAP') => { const url = shopInfo.value.navigationUrls?.[provider] if (!url) { @@ -173,6 +253,10 @@ const openNavigation = (provider: 'TENCENT' | 'AMAP') => { window.open(url, '_blank') } +/** + * Purpose: calculateDistanceText supports ShopDetailView.vue by holding or executing the calculate distance text page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const calculateDistanceText = (currentLat: number, currentLng: number) => { const shopLat = Number(shopInfo.value.latitude) const shopLng = Number(shopInfo.value.longitude) @@ -190,6 +274,10 @@ const calculateDistanceText = (currentLat: number, currentLng: number) => { distanceText.value = meters >= 1000 ? `距你约 ${(meters / 1000).toFixed(1)} km` : `距你约 ${Math.round(meters)} m` } +/** + * Purpose: loadCurrentDistance supports ShopDetailView.vue by holding or executing the load current distance page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadCurrentDistance = () => { if (!hasLocation.value || !navigator.geolocation) return navigator.geolocation.getCurrentPosition( @@ -201,6 +289,10 @@ const loadCurrentDistance = () => { ) } +/** + * Purpose: copyToClipboard supports ShopDetailView.vue by holding or executing the copy to clipboard page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const copyToClipboard = async (text: string, type: string) => { if (!text) return try { @@ -211,6 +303,10 @@ const copyToClipboard = async (text: string, type: string) => { } } +/** + * Purpose: loadShopImages supports ShopDetailView.vue by holding or executing the load shop images page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const loadShopImages = async () => { try { const imageFileIds = shopInfo.value.imageFileIds @@ -226,6 +322,10 @@ const loadShopImages = async () => { } } +/** + * Purpose: fetchShopDetail supports ShopDetailView.vue by holding or executing the fetch shop detail page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const fetchShopDetail = async () => { try { const shopId = toOptionalIdString(route.params.id || localStorage.getItem('userShopId')) diff --git a/YumiNail-Frontend/src/views/VipCenterView.vue b/YumiNail-Frontend/src/views/VipCenterView.vue index 4e392adb..f2fa3bfa 100644 --- a/YumiNail-Frontend/src/views/VipCenterView.vue +++ b/YumiNail-Frontend/src/views/VipCenterView.vue @@ -91,13 +91,33 @@ import { onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { message } from 'ant-design-vue' +/** + * Purpose: BalanceHistoryItem supports VipCenterView.vue by holding or executing the balance history item page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { userApi, type BalanceHistoryItem, type UserAssetVO, type VipRechargePlanVO } from '@/api/user' +/** + * Purpose: router supports VipCenterView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) +/** + * Purpose: asset supports VipCenterView.vue by holding or executing the asset page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const asset = ref(null) +/** + * Purpose: history supports VipCenterView.vue by holding or executing the history page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const history = ref([]) +/** + * Purpose: plans supports VipCenterView.vue by holding or executing the plans page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const plans = ref([]) /** rechargeOpen is a reactive state variable used by the template and event handlers. */ const rechargeOpen = ref(false) diff --git a/YumiNail-Frontend/src/views/WishlistView.vue b/YumiNail-Frontend/src/views/WishlistView.vue index dd6ce564..edc90c7e 100644 --- a/YumiNail-Frontend/src/views/WishlistView.vue +++ b/YumiNail-Frontend/src/views/WishlistView.vue @@ -57,6 +57,10 @@ import { ArrowLeft, Delete, StarFilled } from '@element-plus/icons-vue' import { useRouter } from 'vue-router' import { ElMessage } from 'element-plus' import 'element-plus/es/components/message/style/css' +/** + * Purpose: WishlistItem supports WishlistView.vue by holding or executing the wishlist item page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { wishlistApi, type WishlistItem } from '@/api/wishlist' import { cartApi } from '@/api/cart' import { fileApi } from '@/api/file' @@ -65,14 +69,38 @@ import { sameId } from '@/utils/id' import { runWithGlobalLoading } from '@/utils/action-loading' import { fetchCartProductIdSet, hasCartProduct, withAddedCartProduct } from '@/utils/cart-state' +/** + * Purpose: router supports WishlistView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: updateCartCount supports WishlistView.vue by holding or executing the update cart count page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const updateCartCount = inject<() => Promise>('updateCartCount', async () => {}) +/** + * Purpose: wishlistItems supports WishlistView.vue by holding or executing the wishlist items page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const wishlistItems = ref([]) +/** + * Purpose: imageIdCache supports WishlistView.vue by holding or executing the image id cache page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageIdCache = ref>({}) +/** + * Purpose: imageUrls supports WishlistView.vue by holding or executing the image urls page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const imageUrls = ref>({}) /** cartProductIdSet is a reactive state variable used by the template and event handlers. */ const cartProductIdSet = ref(new Set()) +/** + * Purpose: DEFAULT_PRODUCT_IMAGE supports WishlistView.vue by holding or executing the default product image page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const DEFAULT_PRODUCT_IMAGE = 'data:image/svg+xml;base64,PHN2ZyB3aW0dPSJodHRwOi8vd3d3Lm9yZy8yMDAwL3N2ZyI+Pjwvc3ZnPg==' /** handleBackClick is a local helper used by this page script. */ diff --git a/YumiNail-Frontend/src/views/admin/AdminLayout.vue b/YumiNail-Frontend/src/views/admin/AdminLayout.vue index e6dae830..aa755cb7 100644 --- a/YumiNail-Frontend/src/views/admin/AdminLayout.vue +++ b/YumiNail-Frontend/src/views/admin/AdminLayout.vue @@ -233,6 +233,10 @@ import { UserOutlined } from '@ant-design/icons-vue' import { message, Modal } from 'ant-design-vue' +/** + * Purpose: UserVO supports AdminLayout.vue by holding or executing the user vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { adminAuthApi, type UserVO } from '@/api/admin' import { DEFAULT_AVATAR } from '@/constants' import { usePermission } from '@/utils/permission' @@ -246,6 +250,10 @@ import { isBootstrapAdminUser } from './admin-helpers' +/** + * Purpose: AdminMenuItem supports AdminLayout.vue by holding or executing the admin menu item page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ type AdminMenuItem = { key: string icon: any @@ -253,7 +261,15 @@ type AdminMenuItem = { permissionCode: string } +/** + * Purpose: router supports AdminLayout.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: route supports AdminLayout.vue by holding or executing the route page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const route = useRoute() const { isMobile } = useAdminViewport() @@ -261,8 +277,20 @@ const { isMobile } = useAdminViewport() const collapsed = ref(false) /** mobileDrawerOpen is a reactive state variable used by the template and event handlers. */ const mobileDrawerOpen = ref(false) +/** + * Purpose: userInfo supports AdminLayout.vue by holding or executing the user info page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const userInfo = ref(null) +/** + * Purpose: selectedKeys supports AdminLayout.vue by holding or executing the selected keys page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedKeys = ref([route.path]) +/** + * Purpose: selectedShopId supports AdminLayout.vue by holding or executing the selected shop id page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const selectedShopId = ref() /** shopSwitchLoading is a reactive state variable used by the template and event handlers. */ const shopSwitchLoading = ref(false) @@ -288,6 +316,10 @@ const menuItems: AdminMenuItem[] = [ { key: '/admin/legal-agreements', icon: SafetyCertificateOutlined, label: '协议管理', permissionCode: 'legal_agreement:manage' } ] +/** + * Purpose: mobileTabs supports AdminLayout.vue by holding or executing the mobile tabs page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const mobileTabs = [ { key: 'workbench', label: '工作台', path: '/admin', icon: HomeOutlined }, { key: 'orders', label: '订单', path: '/admin/orders', icon: ShoppingOutlined }, diff --git a/YumiNail-Frontend/src/views/admin/AdminLoginView.vue b/YumiNail-Frontend/src/views/admin/AdminLoginView.vue index 4ab1930d..e4d981a6 100644 --- a/YumiNail-Frontend/src/views/admin/AdminLoginView.vue +++ b/YumiNail-Frontend/src/views/admin/AdminLoginView.vue @@ -86,18 +86,34 @@ import { useRouter } from 'vue-router' import { message } from 'ant-design-vue' import type { FormInstance } from 'ant-design-vue' import { UserOutlined, LockOutlined } from '@ant-design/icons-vue' +/** + * Purpose: LoginShopSelectionResponse supports AdminLoginView.vue by holding or executing the login shop selection response page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { adminAuthApi, type LoginShopSelectionResponse } from '@/api/admin' import { ACCOUNT_REGEX, ACCOUNT_RULE_MESSAGE, sanitizeAccountInput } from '@/utils/account' import type { IdType } from '@/utils/id' import { usePermission } from '@/utils/permission' import { runWithGlobalLoading } from '@/utils/action-loading' +/** + * Purpose: router supports AdminLoginView.vue by holding or executing the router page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const router = useRouter() +/** + * Purpose: formRef supports AdminLoginView.vue by holding or executing the form ref page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formRef = ref() /** loading is a reactive state variable used by the template and event handlers. */ const loading = ref(false) /** shopLoading is a reactive state variable used by the template and event handlers. */ const shopLoading = ref(false) +/** + * Purpose: shops supports AdminLoginView.vue by holding or executing the shops page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const shops = ref>([]) /** allowShoplessLogin is a reactive state variable used by the template and event handlers. */ const allowShoplessLogin = ref(false) @@ -105,6 +121,10 @@ const allowShoplessLogin = ref(false) const loginShopMessage = ref('') const { loadUserPermissions } = usePermission() +/** + * Purpose: formState supports AdminLoginView.vue by holding or executing the form state page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formState = reactive({ account: '', password: '', @@ -150,6 +170,10 @@ const shopPlaceholder = computed(() => { return '请先输入账号' }) +/** + * Purpose: formRules supports AdminLoginView.vue by holding or executing the form rules page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const formRules = { account: [ { required: true, message: '请输入用户名', trigger: 'blur' }, diff --git a/YumiNail-Frontend/src/views/admin/AnnouncementsView.vue b/YumiNail-Frontend/src/views/admin/AnnouncementsView.vue index db58aee0..93b86c2b 100644 --- a/YumiNail-Frontend/src/views/admin/AnnouncementsView.vue +++ b/YumiNail-Frontend/src/views/admin/AnnouncementsView.vue @@ -57,6 +57,10 @@ */ import { computed, onMounted, reactive, ref } from 'vue' import { message, Modal } from 'ant-design-vue' +/** + * Purpose: AnnouncementVO supports AnnouncementsView.vue by holding or executing the announcement vo page or API role. + * Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow. + */ import { adminAnnouncementApi, type AnnouncementVO, type MessageTargetOptionsVO } from '@/api/admin' /** loading is a reactive state variable used by the template and event handlers. */ @@ -65,10 +69,26 @@ const loading = ref(false) const saving = ref(false) /** formOpen is a reactive state variable used by the template and event handlers. */ const formOpen = ref(false) +/** + * Purpose: announcements supports AnnouncementsView.vue by holding or executing the announcements page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const announcements = ref([]) +/** + * Purpose: options supports AnnouncementsView.vue by holding or executing the options page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const options = ref({ shops: [], users: [] }) +/** + * Purpose: form supports AnnouncementsView.vue by holding or executing the form page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const form = reactive({ title: '', content: '', targetType: 'PLATFORM_ALL', shopIds: [], userIds: [], sortOrder: 0 }) +/** + * Purpose: columns supports AnnouncementsView.vue by holding or executing the columns page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const columns = [ { title: '标题', dataIndex: 'title', key: 'title' }, { title: '内容', dataIndex: 'content', key: 'content' }, @@ -79,6 +99,10 @@ const columns = [ { title: '操作', key: 'action', width: 150 } ] +/** + * Purpose: targetOptions supports AnnouncementsView.vue by holding or executing the target options page or API role. + * Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow. + */ const targetOptions = [ { label: '全平台', value: 'PLATFORM_ALL' }, { label: '当前门店全部用户', value: 'CURRENT_SHOP_ALL' }, diff --git a/YumiNail-Frontend/src/views/admin/CommentsView.vue b/YumiNail-Frontend/src/views/admin/CommentsView.vue index 9e70cff3..d3a52482 100644 --- a/YumiNail-Frontend/src/views/admin/CommentsView.vue +++ b/YumiNail-Frontend/src/views/admin/CommentsView.vue @@ -43,17 +43,53 @@