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 { +}