1. add jsonb handler
This commit is contained in:
2026-02-05 21:19:15 +08:00
parent efce3f5efb
commit ddf504fa25
3 changed files with 73 additions and 3 deletions

View File

@@ -10,15 +10,15 @@
<result column="main_image_urls" property="mainImageUrls" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
<result column="detail_image_urls" property="detailImageUrls" typeHandler="org.springblade.common.handler.PgStringArrayToListTypeHandler"/>
<result column="thumb_image_url" property="thumbImageUrl"/>
<result column="specs" property="specs"/>
<result column="specs" property="specs" typeHandler="org.springblade.common.handler.PgLongArrayToListTypeHandler"/>
<result column="unit" property="unit"/>
<result column="category_id" property="categoryId"/>
<result column="category_path" property="categoryPath" typeHandler="org.springblade.common.handler.PgLongArrayToListTypeHandler"/>
<result column="category_path" property="categoryPath" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
<result column="original_price" property="originalPrice"/>
<result column="retail_price" property="retailPrice"/>
<result column="sales" property="sales"/>
<result column="stock" property="stock"/>
<result column="tags" property="tags"/>
<result column="tags" property="tags" typeHandler="org.springblade.common.handler.PgJsonbTypeHandler"/>
<result column="status" property="status"/>
<result column="create_user" property="createUser"/>
<result column="create_dept" property="createDept"/>

View File

@@ -31,6 +31,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import lombok.EqualsAndHashCode;
import org.springblade.common.handler.PgJsonbTypeHandler;
import org.springblade.common.handler.PgLongArrayToListTypeHandler;
import org.springblade.common.handler.PgStringArrayToListTypeHandler;
import org.springblade.core.mp.base.BaseEntity;
@@ -83,6 +84,7 @@ public class MallProductEntity extends BaseEntity {
/**
* 规格详情,JSONB数组 [{"attr":"颜色","value":"红"}]
*/
@TableField(typeHandler = PgJsonbTypeHandler.class)
@Schema(description = "规格详情")
private List<Map<String, Object>> specs;
/**
@@ -124,6 +126,7 @@ public class MallProductEntity extends BaseEntity {
/**
* 标签列表,JSONB数组格式,如 ["热销","包邮"]
*/
@TableField(typeHandler = PgJsonbTypeHandler.class)
@Schema(description = "标签")
private List<String> tags;