From 10b7451f28c186a2927f7a0bb48bd373015ef585 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Thu, 23 Jan 2025 14:18:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E8=A1=A5=E5=85=85ware=20tags?= =?UTF-8?q?=E7=9A=84=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gringotts/web/domain/controller/WareController.java | 4 ++++ .../java/com/eshore/gringotts/web/domain/entity/Ware.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/controller/WareController.java b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/controller/WareController.java index 100657f..589a8e1 100644 --- a/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/controller/WareController.java +++ b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/controller/WareController.java @@ -14,6 +14,7 @@ import java.time.LocalDateTime; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.extern.slf4j.Slf4j; +import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.list.ImmutableList; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -54,6 +55,7 @@ public class WareController extends CheckingController tags; } @Data diff --git a/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/entity/Ware.java b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/entity/Ware.java index 2a082db..2e5c75f 100644 --- a/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/entity/Ware.java +++ b/gringotts-web/src/main/java/com/eshore/gringotts/web/domain/entity/Ware.java @@ -3,10 +3,13 @@ package com.eshore.gringotts.web.domain.entity; import com.eshore.gringotts.core.Constants; import com.eshore.gringotts.web.domain.base.entity.CheckingNeededEntity; import com.eshore.gringotts.web.domain.base.entity.LogicDeleteEntity; +import java.util.List; import javax.persistence.Basic; import javax.persistence.CascadeType; +import javax.persistence.CollectionTable; import javax.persistence.Column; import javax.persistence.ConstraintMode; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.EntityListeners; import javax.persistence.FetchType; @@ -66,4 +69,7 @@ public class Ware extends CheckingNeededEntity { @ToString.Exclude @Column(nullable = false) private String content; + @ElementCollection(fetch = FetchType.EAGER) + @CollectionTable(name = Constants.TABLE_PREFIX + "ware_tag", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) + private List tags; }