package com.oying.modules.pc.category.domain; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.oying.base.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; /** * @author lzp * @date 2025-04-28 **/ @Getter @Setter @TableName("pc_platform_category") public class PlatformCategory extends BaseEntity implements Serializable { @TableId(value = "category_id", type = IdType.AUTO) @ApiModelProperty(value = "类目ID") private Long categoryId; @NotNull @ApiModelProperty(value = "父类目ID") private Long parentId; @NotBlank @ApiModelProperty(value = "类目名称") private String name; @NotNull @ApiModelProperty(value = "类目层级:1-级类目 ") private Integer level; @NotNull @ApiModelProperty(value = "排序权重") private Integer sortWeight; @ApiModelProperty(value = "类目图标ID") private Long iconId; @ApiModelProperty(value = "类目图标Url") private String iconUrl; @NotNull @ApiModelProperty(value = "状态") private Integer status; @NotNull @ApiModelProperty(value = "是否启用(0-否 1-是)") private Integer active; public void copy(PlatformCategory source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } }