添加了商品信息的qo参数,和dao层信息

This commit is contained in:
XinYi Song 2021-12-15 15:37:39 +08:00
parent 6fbb29ed74
commit 6655ed64c5
4 changed files with 105 additions and 0 deletions

View File

@ -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<ProductContentPhotoEntity,Long> {
}

View File

@ -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<ProductEntity,Long> {
/**
* 根据商品名称查询商品信息
* @param productName
* @return
*/
ProductEntity findByProductName(String productName);
}

View File

@ -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;
}
}

View File

@ -0,0 +1,8 @@
package com.xkrs.model.validation;
/**
* @Author: XinYi Song
* @Date: 2021/12/15 15:29
*/
public interface ProductQoInsert {
}