From dc31792dc1b8ad1658e49ba8fce9a1be924e6fbb Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期四, 30 十一月 2023 08:44:04 +0800 Subject: [PATCH] 理片笼测试修改 --- springboot-vue3/src/main/java/com/example/springboot/entity/Category.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/Category.java b/springboot-vue3/src/main/java/com/example/springboot/entity/Category.java new file mode 100644 index 0000000..5e74722 --- /dev/null +++ b/springboot-vue3/src/main/java/com/example/springboot/entity/Category.java @@ -0,0 +1,44 @@ +package com.example.springboot.entity; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +@EqualsAndHashCode(callSuper = true) +@Data +@TableName("`category`") +@ApiModel("鍒嗙被") +public class Category extends BaseEntity implements Serializable { + private static final long serialVersionUID = -5888981197198625157L; + + @ApiModelProperty("鐖剁骇id") + private Long parentId; + @TableField("`path`") + @ApiModelProperty("璺緞") + private String path; + @ApiModelProperty("绛夌骇") + private Integer level; + @ApiModelProperty("鍚嶇О") + private String name; + @ApiModelProperty("鍒涘缓浜�") + private Long creator; + @ApiModelProperty("鐘舵�� 0/涓嬫灦 1/涓婃灦 榛樿涓婃灦") + private Integer state; // 鐘舵�� 0/涓嬫灦 1/涓婃灦 榛樿涓婃灦 + + @TableField(exist = false) + private List<Category> Categorys; + + public final void parent(@NotNull Category category) { + this.parentId = category.getId(); + this.path = (category.getPath() == null ? "" : category.getPath()) + category.getId() + "-"; + this.level = StrUtil.count(this.path, "-"); + } +} \ No newline at end of file -- Gitblit v1.8.0