添加了商品信息的qo参数,和dao层信息
This commit is contained in:
parent
6fbb29ed74
commit
6655ed64c5
11
src/main/java/com/xkrs/dao/ProductContentPhotoDao.java
Normal file
11
src/main/java/com/xkrs/dao/ProductContentPhotoDao.java
Normal 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> {
|
||||
}
|
18
src/main/java/com/xkrs/dao/ProductDao.java
Normal file
18
src/main/java/com/xkrs/dao/ProductDao.java
Normal 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);
|
||||
}
|
68
src/main/java/com/xkrs/model/qo/ProductQo.java
Normal file
68
src/main/java/com/xkrs/model/qo/ProductQo.java
Normal 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;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.xkrs.model.validation;
|
||||
|
||||
/**
|
||||
* @Author: XinYi Song
|
||||
* @Date: 2021/12/15 15:29
|
||||
*/
|
||||
public interface ProductQoInsert {
|
||||
}
|
Loading…
Reference in New Issue
Block a user