杂务:新增声明级注释覆盖率

This commit is contained in:
xiaowang
2026-05-23 18:44:57 +08:00
parent 8f038894e7
commit 844516988b
234 changed files with 8356 additions and 0 deletions
@@ -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);
}
@@ -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();
@@ -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 "";
@@ -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) {
@@ -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();
@@ -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;
}
@@ -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<Void> 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<Void> 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<Void> 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<Void> 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<Void> 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<Void> 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<Void> 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<Void> 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<Void> 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) {
@@ -18,22 +18,50 @@ import java.io.Serializable;
@AllArgsConstructor
public class Result<T> 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 <T> Result<T> 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 <T> Result<T> 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 <T> Result<T> 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 <T> Result<T> error(Integer code, String message) {
return new Result<>(code, message, null);
}
@@ -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() {
@@ -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");
@@ -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());
@@ -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;
}
@@ -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<LocalDateTime> {
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()) {
@@ -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;
}
@@ -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)
@@ -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();
}
@@ -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());
@@ -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);
}
@@ -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() {
@@ -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<String, Object> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
template.setConnectionFactory(factory);
@@ -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");
@@ -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;
}
@@ -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;
}
@@ -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<String> allowedMimeTypes = new ArrayList<>(List.of(
@@ -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("/**")
@@ -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;
}
@@ -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")
@@ -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<LegalAgreementVO>> 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<Long> 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<Boolean> 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<Boolean> 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<Boolean> disable(HttpServletRequest request, @PathVariable Long id) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
Boolean result = legalAgreementService.disableAgreement(currentUser, id);
@@ -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.
@@ -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<OrderVO> getOrderDetail(HttpServletRequest request, @PathVariable Long id) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
List<OrderVO> allOrders;
@@ -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")
@@ -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;
@@ -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;
}
}
@@ -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<List<InviteCodeVO>> listInviteCodes(HttpServletRequest request, @RequestParam(required = false) Long shopId) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
return Result.success(shopRoleService.listInviteCodes(currentUser, shopId));
@@ -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<List<UserRelationVO>> 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;
}
}
@@ -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")
@@ -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<ContactInfoVO> 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));
@@ -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<UserDO> 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<OrderDO> listScopedOrders(Long shopId, Long artistId, Integer status, LocalDateTime from, LocalDateTime to) {
LambdaQueryWrapper<OrderDO> 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<Long> listOrderIdsByArtist(Long artistId) {
List<OrderItemDO> items = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
.select(OrderItemDO::getOrderId)
@@ -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;
}
@@ -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<List<LegalAgreementVO>> 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<LegalAgreementVO> 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<List<LegalAgreementVO>> 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<Long> 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<Boolean> 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<Boolean> 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<Boolean> 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<UserAgreementConsentVO> getMyConsent(HttpServletRequest request) {
Long userId = (Long) request.getAttribute("userId");
return Result.success(legalAgreementService.getMyConsent(userId));
@@ -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;
/**
@@ -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")
@@ -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<List<OrderArtistReviewVO>> 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<List<OrderArtistReviewVO>> 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<List<OrderArtistChangeRequestVO>> listMyPendingArtistChangeRequests(HttpServletRequest request) {
Long userId = (Long) request.getAttribute("userId");
Integer userType = (Integer) request.getAttribute("userType");
@@ -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<List<ProductVO>> searchProducts(HttpServletRequest request, @RequestParam("keyword") String keyword) {
List<ProductVO> 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;
@@ -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;
}
}
@@ -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<Boolean> 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<Map<String, String>> getTencentMapKey(HttpServletRequest request) {
adminScopeHelper.getCurrentUser(request);
Map<String, String> 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<Map<String, String>> getMapConfig(HttpServletRequest request) {
adminScopeHelper.getCurrentUser(request);
Map<String, String> result = new HashMap<>();
@@ -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<String> 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.
@@ -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<List<VipRechargePlanVO>> 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<List<String>> listVipLevelOptions(HttpServletRequest request, @RequestParam(required = false) Long shopId) {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
return Result.success(vipRechargePlanService.listVipLevelOptions(currentUser, shopId));
@@ -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<String, Long> 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<String, Long> 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<Boolean> 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<List<WishlistDTO>> getWishlist(@RequestAttribute("userId") Long userId) {
List<WishlistDTO> wishlist = wishlistService.getWishlistByUserId(userId);
return Result.success(wishlist);
@@ -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();
@@ -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;
}
@@ -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<String, String> 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;
}
@@ -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;
}
@@ -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;
}
@@ -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<Long> imageFileIds;
}
@@ -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<String, String> 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;
}
@@ -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<String, String> 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;
}
@@ -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;
/**
@@ -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;
}
@@ -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;
}
@@ -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<String, String> 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;
}
@@ -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<String, String> 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;
}
@@ -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;
/**
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
/**
@@ -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")
@@ -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;
}
@@ -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;
}
@@ -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)) {
@@ -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<BusinessEventOutboxDO> {
@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}")
@@ -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<LegalAgreementDO> {
}
@@ -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<OrderArtistChangeRequestDO> {
@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")
@@ -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<OrderArtistReviewDO> {
@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")
@@ -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<SecurityAuditLogDO> {
}
@@ -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<SystemParameterConfigDO> {
}
@@ -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<UserAgreementConsentDO> {
}
@@ -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);
@@ -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<LegalAgreementVO> listAdminAgreements(UserDO currentUser);
@@ -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);
@@ -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);
@@ -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<SystemParameterConfigVO> listConfigs(UserDO currentUser, String configGroup);
@@ -38,10 +38,30 @@ import java.util.stream.Collectors;
*/
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, AnnouncementDO> 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.
@@ -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<BusinessEventOutboxDO> 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;
@@ -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.
@@ -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
@@ -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.
@@ -43,9 +43,25 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class CouponServiceImpl extends ServiceImpl<CouponMapper, CouponDO> 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<VipAutoCouponTemplate> DEFAULT_SHOP_VIP_AUTO_COUPONS = List.of(
@@ -53,6 +69,10 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, CouponDO> 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<CouponMapper, CouponDO> 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,
@@ -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<LegalAgreementVO> listAdminAgreements(UserDO currentUser) {
ensurePlatformAdmin(currentUser);
return agreementMapper.selectList(new LambdaQueryWrapper<LegalAgreementDO>()
@@ -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<LegalAgreementVO> 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<String, String> versions = consentMapper.selectList(new LambdaQueryWrapper<UserAgreementConsentDO>()
.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<String, String> 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<LegalAgreementDO>()
.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());
@@ -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<String, String> buildNavigationUrls(String shopName, String address, BigDecimal longitude, BigDecimal latitude) {
Map<String, String> 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);
}
@@ -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
@@ -27,12 +27,24 @@ import java.util.List;
public class NailArtistInfoServiceImpl extends ServiceImpl<NailArtistInfoMapper, NailArtistInfoDO> 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
@@ -35,6 +35,10 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class ObjectStorageFileServiceImpl extends ServiceImpl<ObjectStorageFileMapper, ObjectStorageFileDO> 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.
@@ -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<DateTimeFormatter> 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<Long> RELEASE_LOCK_SCRIPT = new DefaultRedisScript<>();
private static final DefaultRedisScript<Long> 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<OrderArtistReviewVO> 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<OrderArtistReviewVO> 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<OrderArtistChangeRequestVO> listMyPendingArtistChangeRequests(Long userId, Integer userType) {
expireDueArtistChangeRequests();
List<OrderArtistChangeRequestDO> 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<Long> 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<Long> 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.
@@ -497,6 +497,10 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
return true;
}
/**
* Purpose: hasShopRolePermission supports PermissionServiceImpl.java by holding or executing the has shop role permission business role.
* Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state.
*/
private boolean hasShopRolePermission(List<UserShopRoleDO> activeShopRoles, String permissionCode) {
List<Long> permissionIds = listPermissionIdsByShopRoles(activeShopRoles);
if (permissionIds.isEmpty()) {
@@ -552,6 +556,10 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
.collect(Collectors.toSet());
}
/**
* Purpose: listActiveShopRoles supports PermissionServiceImpl.java by holding or executing the list active shop roles business role.
* Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state.
*/
private List<UserShopRoleDO> listActiveShopRoles(Long userId) {
if (userId == null) {
return List.of();
@@ -571,6 +579,10 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
.collect(Collectors.toList());
}
/**
* Purpose: listPermissionIdsByShopRoles supports PermissionServiceImpl.java by holding or executing the list permission ids by shop roles business role.
* Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state.
*/
private List<Long> listPermissionIdsByShopRoles(List<UserShopRoleDO> activeShopRoles) {
if (activeShopRoles == null || activeShopRoles.isEmpty()) {
return List.of();
@@ -596,6 +608,10 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
.collect(Collectors.toList());
}
/**
* Purpose: listPermissionsByIds supports PermissionServiceImpl.java by holding or executing the list permissions by ids business role.
* Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state.
*/
private List<PermissionVO> listPermissionsByIds(List<Long> permissionIds) {
if (permissionIds == null || permissionIds.isEmpty()) {
return List.of();
@@ -610,10 +626,18 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
.collect(Collectors.toList());
}
/**
* Purpose: usesShopRoleEffectivePermissions supports PermissionServiceImpl.java by holding or executing the uses shop role effective permissions business role.
* Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state.
*/
private boolean usesShopRoleEffectivePermissions(UserDO userDO, List<UserShopRoleDO> 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<PermissionMapper, Permiss
return PermissionPolicy.getDefaultPermissionCodeSet(userDO.getType()).contains(permissionCode);
}
/**
* Purpose: isPlatformAdmin supports PermissionServiceImpl.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.
*/
private boolean isPlatformAdmin(UserDO userDO) {
return userDO != null && Integer.valueOf(4).equals(userDO.getType());
}
@@ -21,6 +21,10 @@ import org.springframework.transaction.annotation.Transactional;
public class ProductLikeServiceImpl extends ServiceImpl<ProductLikeMapper, ProductLikeDO> 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
@@ -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<ProductMapper, ProductDO> 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<ProductMapper, ProductDO> 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<ProductVO> listProductsByTag(String tag, Long shopId) {
AppCacheProperties.CacheSpec cacheSpec = appCacheProperties.getProductList();
String normalizedTag = normalizeOptionalKeyword(tag);
@@ -349,6 +373,10 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> 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<ProductVO> searchProducts(String keyword, Long shopId) {
if (!StringUtils.hasText(keyword)) {
return new ArrayList<>();
@@ -497,6 +525,10 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> 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<ProductVO> pageProducts(Integer page, Integer size, String keyword, Long shopId, Long tagId, java.math.BigDecimal minPrice, java.math.BigDecimal maxPrice, String createdFrom, String createdTo) {
Page<ProductDO> pageParam = new Page<>(page, size);
@@ -539,6 +571,10 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> 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<ProductMapper, ProductDO> 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<ProductVO> 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<ProductMapper, ProductDO> 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<ProductDO> buildFrontQuery(String keyword, String tag, Set<String> exactTagIds, Long shopId) {
LambdaQueryWrapper<ProductDO> wrapper = Wrappers.lambdaQuery(ProductDO.class)
.eq(ProductDO::getIsDelete, 0);
@@ -1064,10 +1108,18 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> 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<ProductMapper, ProductDO> 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<Long, String> shopNames,
Map<Long, TagDO> tags,

Some files were not shown because too many files have changed in this diff Show More