From 6655ed64c5360f6dd78cf06422dca9725f6c2637 Mon Sep 17 00:00:00 2001 From: XinYi Song <2037158277@qq.com> Date: Wed, 15 Dec 2021 15:37:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84qo=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E5=92=8Cdao=E5=B1=82=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xkrs/dao/ProductContentPhotoDao.java | 11 +++ src/main/java/com/xkrs/dao/ProductDao.java | 18 +++++ .../java/com/xkrs/model/qo/ProductQo.java | 68 +++++++++++++++++++ .../model/validation/ProductQoInsert.java | 8 +++ 4 files changed, 105 insertions(+) create mode 100644 src/main/java/com/xkrs/dao/ProductContentPhotoDao.java create mode 100644 src/main/java/com/xkrs/dao/ProductDao.java create mode 100644 src/main/java/com/xkrs/model/qo/ProductQo.java create mode 100644 src/main/java/com/xkrs/model/validation/ProductQoInsert.java diff --git a/src/main/java/com/xkrs/dao/ProductContentPhotoDao.java b/src/main/java/com/xkrs/dao/ProductContentPhotoDao.java new file mode 100644 index 0000000..ff10837 --- /dev/null +++ b/src/main/java/com/xkrs/dao/ProductContentPhotoDao.java @@ -0,0 +1,11 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.ProductContentPhotoEntity; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @Author: XinYi Song + * @Date: 2021/12/15 15:21 + */ +public interface ProductContentPhotoDao extends JpaRepository { +} diff --git a/src/main/java/com/xkrs/dao/ProductDao.java b/src/main/java/com/xkrs/dao/ProductDao.java new file mode 100644 index 0000000..eff0fcd --- /dev/null +++ b/src/main/java/com/xkrs/dao/ProductDao.java @@ -0,0 +1,18 @@ +package com.xkrs.dao; + +import com.xkrs.model.entity.ProductEntity; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * @Author: XinYi Song + * @Date: 2021/12/15 15:21 + */ +public interface ProductDao extends JpaRepository { + + /** + * 根据商品名称查询商品信息 + * @param productName + * @return + */ + ProductEntity findByProductName(String productName); +} diff --git a/src/main/java/com/xkrs/model/qo/ProductQo.java b/src/main/java/com/xkrs/model/qo/ProductQo.java new file mode 100644 index 0000000..4dc6111 --- /dev/null +++ b/src/main/java/com/xkrs/model/qo/ProductQo.java @@ -0,0 +1,68 @@ +package com.xkrs.model.qo; + +import com.xkrs.model.validation.ProductQoInsert; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; + +/** + * @Author: XinYi Song + * @Date: 2021/12/15 15:29 + */ +public class ProductQo { + + /** + * 商品名称 + */ + @NotBlank(message = "{Product.productName.null}",groups={ProductQoInsert.class}) + private String productName; + + /** + * 商品描述 + */ + @NotBlank(message = "{Product.productDescription.null}",groups={ProductQoInsert.class}) + private String productDescription; + + /** + * 商品分类 + */ + private Integer productCategories; + + /** + * 商品价格 + */ + @NotBlank(message = "{Product.productPrice.null}",groups={ProductQoInsert.class}) + private BigDecimal productPrice; + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductDescription() { + return productDescription; + } + + public void setProductDescription(String productDescription) { + this.productDescription = productDescription; + } + + public Integer getProductCategories() { + return productCategories; + } + + public void setProductCategories(Integer productCategories) { + this.productCategories = productCategories; + } + + public BigDecimal getProductPrice() { + return productPrice; + } + + public void setProductPrice(BigDecimal productPrice) { + this.productPrice = productPrice; + } +} diff --git a/src/main/java/com/xkrs/model/validation/ProductQoInsert.java b/src/main/java/com/xkrs/model/validation/ProductQoInsert.java new file mode 100644 index 0000000..368050c --- /dev/null +++ b/src/main/java/com/xkrs/model/validation/ProductQoInsert.java @@ -0,0 +1,8 @@ +package com.xkrs.model.validation; + +/** + * @Author: XinYi Song + * @Date: 2021/12/15 15:29 + */ +public interface ProductQoInsert { +}