bug修复

This commit is contained in:
张锐 committed 2026-11-24 14:49:58 +08:00
1 parent 529c255e5b
commit 3893b25848
9 files changed
+2548 -247

No files matched your search

@@ -0,0 +1,12 @@
package com.shoplix.admin.modules.category.constants;
/** 分类层级路径校验常量。 */
public final class CategoryPathConstants {
/** 分类路径格式:每一级仅允许小写字母、数字和中划线,级别之间使用斜杠分隔。 */
public static final String PATTERN = "^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$";
/** 工具类不允许实例化。 */
private CategoryPathConstants() {
}
}
@@ -1,6 +1,7 @@
package com.shoplix.admin.modules.content.req;
import com.shoplix.modules.common.enums.PublishStatusEnum;
import com.shoplix.admin.modules.category.constants.CategoryPathConstants;
import com.shoplix.modules.content.enums.ContentTypeEnum;
import jakarta.validation.constraints.*;
@@ -11,7 +12,7 @@ public record SaveContentCategoryAdminReq(
/** 内容类型。 */ @NotNull ContentTypeEnum contentType,
/** 父分类业务编号,顶级为空。 */ @Size(max = 16) String parentCategoryCode,
/** 英文分类名称。 */ @NotBlank @Size(max = 100) String categoryName,
/** 英文路径标识。 */ @NotBlank @Pattern(regexp = "^[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(max = 100) String slug,
/** 英文层级路径。 */ @NotBlank @Pattern(regexp = CategoryPathConstants.PATTERN) @Size(max = 100) String slug,
/** 英文分类描述。 */ @Size(max = 500) String description,
/** 封面媒体业务编号。 */ @Size(max = 16) String coverMediaCode,
/** 排序值。 */ @NotNull Integer sortNo,
@@ -1,6 +1,7 @@
package com.shoplix.admin.modules.product.req;
import com.shoplix.modules.common.enums.PublishStatusEnum;
import com.shoplix.admin.modules.category.constants.CategoryPathConstants;
import jakarta.validation.constraints.*;
/** 运营后台保存产品分类请求。 */
@@ -9,7 +10,7 @@ public record SaveProductCategoryAdminReq(
/** 所属站点业务编号。 */ @NotBlank @Size(max = 16) String siteCode,
/** 父分类业务编号,顶级为空。 */ @Size(max = 16) String parentCategoryCode,
/** 英文分类名称。 */ @NotBlank @Size(max = 100) String categoryName,
/** 英文路径标识。 */ @NotBlank @Pattern(regexp = "^[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(max = 100) String slug,
/** 英文层级路径。 */ @NotBlank @Pattern(regexp = CategoryPathConstants.PATTERN) @Size(max = 100) String slug,
/** 英文分类描述。 */ @Size(max = 500) String description,
/** 封面媒体业务编号。 */ @Size(max = 16) String coverMediaCode,
/** 排序值。 */ @NotNull Integer sortNo,