feat: 种类属性管理,支持定义属性模板和商品属性值
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Agent
2026-03-29 14:45:26 +00:00
parent 9a51e16fef
commit ac599762da
11 changed files with 397 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
package com.example.building.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 种类属性定义实体
*/
@Data
@TableName("category_attributes")
public class CategoryAttribute {
@TableId(type = IdType.ASSIGN_UUID)
private String attrId;
/**
* 种类ID
*/
private String categoryId;
/**
* 属性名称
*/
private String name;
/**
* 属性类型: number=数字, text=文本, formula=公式
*/
private String attrType;
/**
* 单位
*/
private String unit;
/**
* 公式表达式length*width
*/
private String formula;
/**
* 排序
*/
private Integer sortOrder;
/**
* 是否必填
*/
private Integer required;
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createdAt;
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updatedAt;
}

View File

@@ -0,0 +1,40 @@
package com.example.building.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 商品属性值实体
*/
@Data
@TableName("product_attributes")
public class ProductAttribute {
@TableId(type = IdType.ASSIGN_UUID)
private String id;
/**
* 商品ID
*/
private String productId;
/**
* 属性定义ID
*/
private String attrId;
/**
* 属性名称(冗余)
*/
private String attrName;
/**
* 属性值
*/
private String attrValue;
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createdAt;
}