Commit 3ab6e756 authored by shengnan hu's avatar shengnan hu
Browse files

init

parents
Pipeline #294 passed with stage
in 2 minutes and 13 seconds
package com.mall4j.cloud.api.feign;
import com.mall4j.cloud.api.dto.EsPageDTO;
import com.mall4j.cloud.api.dto.ProductSearchDTO;
import com.mall4j.cloud.api.vo.EsPageVO;
import com.mall4j.cloud.api.vo.search.ProductSearchVO;
import com.mall4j.cloud.api.vo.search.SpuSearchVO;
import com.mall4j.cloud.common.feign.FeignInsideAuthConfig;
import com.mall4j.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 商品搜索feign连接
* @author YXF
* @date 2020/12/07
*/
@FeignClient(value = "mall4cloud-search",contextId = "searchSpu")
public interface SearchSpuFeignClient {
/**
* 商品搜索
* @param pageDTO
* @param productSearchDTO
* @return
*/
@GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDE_URL_PREFIX + "/insider/searchSpu/search")
ServerResponseEntity<EsPageVO<ProductSearchVO>> search(@RequestParam("pageDTO") EsPageDTO pageDTO, @RequestParam("productSearchDTO") ProductSearchDTO productSearchDTO);
/**
* 根据spuId列表, 获取spu列表信息
* @param spuIds 商品id列表
* @return 商品列表
*/
@GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDE_URL_PREFIX + "/insider/searchSpu/getSpusBySpuIds")
ServerResponseEntity<List<SpuSearchVO>> getSpusBySpuIds(@RequestParam("spuIds") List<Long> spuIds);
/**
* 根据店铺,获取商品分页信息
* @param pageNum 分页数
* @param pageSize 每页大小
* @param shopId 店铺id
* @return
*/
@GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDE_URL_PREFIX + "/insider/searchSpu/spuPage")
ServerResponseEntity<EsPageVO<ProductSearchVO>> spuPage(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam("shopId") Long shopId);
/**
* 根据店铺id列表获取每个店铺的spu列表
* @param shopIds 店铺id列表
* @param size 每个店铺返回的商品数量
* @return
*/
@GetMapping(value = FeignInsideAuthConfig.FEIGN_INSIDE_URL_PREFIX + "/insider/searchSpu/limitSizeListByShopIds")
ServerResponseEntity<List<SpuSearchVO>> limitSizeListByShopIds(@RequestParam("shopIds") List<Long> shopIds, @RequestParam("size") Integer size);
}
package com.mall4j.cloud.api.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
* @author FrozenWatermelon
* @date 2020/11/16
*/
public class EsPageVO<T> {
@Schema(description = "总页数" )
private Integer pages;
@Schema(description = "总条目数" )
private Long total;
@Schema(description = "结果集" )
private List<T> list;
public Integer getPages() {
return pages;
}
public void setPages(Integer pages) {
this.pages = pages;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
@Override
public String toString() {
return "EsPageVO{" +
", pages=" + pages +
", total=" + total +
", list=" + list +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
* @author FrozenWatermelon
* @date 2020/11/17
*/
public class AttrSearchVO {
@Schema(description = "规格id" )
private Long attrId;
@Schema(description = "规格名" )
private String attrName;
@Schema(description = "规格值列表" )
private List<AttrValueSearchVO> attrValues;
public Long getAttrId() {
return attrId;
}
public void setAttrId(Long attrId) {
this.attrId = attrId;
}
public String getAttrName() {
return attrName;
}
public void setAttrName(String attrName) {
this.attrName = attrName;
}
public List<AttrValueSearchVO> getAttrValues() {
return attrValues;
}
public void setAttrValues(List<AttrValueSearchVO> attrValues) {
this.attrValues = attrValues;
}
@Override
public String toString() {
return "AttrVO{" +
"attrId=" + attrId +
", attrName='" + attrName + '\'' +
", attrValues=" + attrValues +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* @author FrozenWatermelon
* @date 2020/11/17
*/
public class AttrValueSearchVO {
@Schema(description = "规格值id" )
private Long attrValueId;
@Schema(description = "规格值名称" )
private String attrValueName;
public Long getAttrValueId() {
return attrValueId;
}
public void setAttrValueId(Long attrValueId) {
this.attrValueId = attrValueId;
}
public String getAttrValueName() {
return attrValueName;
}
public void setAttrValueName(String attrValueName) {
this.attrValueName = attrValueName;
}
@Override
public String toString() {
return "AttrValueVO{" +
"attrValueId=" + attrValueId +
", attrValueName='" + attrValueName + '\'' +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* @author FrozenWatermelon
* @date 2020/11/17
*/
public class BrandSearchVO {
@Schema(description = "品牌名称" )
private String brandName;
@Schema(description = "品牌id" )
private Long brandId;
@Schema(description = "品牌图片" )
private String brandImg;
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName;
}
public Long getBrandId() {
return brandId;
}
public void setBrandId(Long brandId) {
this.brandId = brandId;
}
public String getBrandImg() {
return brandImg;
}
public void setBrandImg(String brandImg) {
this.brandImg = brandImg;
}
@Override
public String toString() {
return "BrandVO{" +
"brandName='" + brandName + '\'' +
", brandId=" + brandId +
", brandImg='" + brandImg + '\'' +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* 分类信息VO
*
* @author YXF
* @date 2020-1-05 15:37:24
*/
public class CategorySearchVO{
private static final long serialVersionUID = 1L;
@Schema(description = "分类id" )
private Long categoryId;
@Schema(description = "分类名称" )
private String name;
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "CategorySearchVO{" +
"categoryId=" + categoryId +
", name='" + name + '\'' +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mall4j.cloud.common.serializer.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;
/**
* @author FrozenWatermelon
* @date 2021/2/5
*/
public class EsOrderItemVO {
@Schema(description = "商品图片" , requiredMode = Schema.RequiredMode.REQUIRED)
@JsonSerialize(using = ImgJsonSerializer.class)
private String pic;
@Schema(description = "商品名称" , requiredMode = Schema.RequiredMode.REQUIRED)
private String spuName;
@Schema(description = "商品数量" , requiredMode = Schema.RequiredMode.REQUIRED)
private Integer count;
@Schema(description = "商品价格" , requiredMode = Schema.RequiredMode.REQUIRED)
private Long price;
@Schema(description = "skuId" , requiredMode = Schema.RequiredMode.REQUIRED)
private Long skuId;
@Schema(description = "skuName" , requiredMode = Schema.RequiredMode.REQUIRED)
private String skuName;
@Schema(description = "订单项id" , requiredMode = Schema.RequiredMode.REQUIRED)
private Long orderItemId;
@Schema(description = "商品id" , requiredMode = Schema.RequiredMode.REQUIRED)
private Long spuId;
/**
* 店铺id
*/
private Long shopId;
/**
* 用户Id
*/
private Long userId;
/**
* 单个orderItem的配送类型 3:无需快递
*/
private Integer deliveryType;
/**
* 加入购物车时间
*/
private Date shopCartTime;
/**
* 商品总金额
*/
private Long spuTotalAmount;
public String getPic() {
return pic;
}
public void setPic(String pic) {
this.pic = pic;
}
public String getSpuName() {
return spuName;
}
public void setSpuName(String spuName) {
this.spuName = spuName;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Long getPrice() {
return price;
}
public void setPrice(Long price) {
this.price = price;
}
public Long getSkuId() {
return skuId;
}
public void setSkuId(Long skuId) {
this.skuId = skuId;
}
public String getSkuName() {
return skuName;
}
public void setSkuName(String skuName) {
this.skuName = skuName;
}
public Long getOrderItemId() {
return orderItemId;
}
public void setOrderItemId(Long orderItemId) {
this.orderItemId = orderItemId;
}
public Long getSpuId() {
return spuId;
}
public void setSpuId(Long spuId) {
this.spuId = spuId;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Integer getDeliveryType() {
return deliveryType;
}
public void setDeliveryType(Integer deliveryType) {
this.deliveryType = deliveryType;
}
public Date getShopCartTime() {
return shopCartTime;
}
public void setShopCartTime(Date shopCartTime) {
this.shopCartTime = shopCartTime;
}
public Long getSpuTotalAmount() {
return spuTotalAmount;
}
public void setSpuTotalAmount(Long spuTotalAmount) {
this.spuTotalAmount = spuTotalAmount;
}
@Override
public String toString() {
return "EsOrderItemVO{" +
"pic='" + pic + '\'' +
", spuName='" + spuName + '\'' +
", count=" + count +
", price=" + price +
", skuId=" + skuId +
", skuName='" + skuName + '\'' +
", orderItemId=" + orderItemId +
", spuId=" + spuId +
", shopId=" + shopId +
", userId=" + userId +
", deliveryType=" + deliveryType +
", shopCartTime=" + shopCartTime +
", spuTotalAmount=" + spuTotalAmount +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;
import java.util.List;
/**
* @author FrozenWatermelon
* @date 2021/2/5
*/
public class EsOrderVO {
@Schema(description = "订单项" ,requiredMode = Schema.RequiredMode.REQUIRED)
private List<EsOrderItemVO> orderItems;
@Schema(description = "订单号" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Long orderId;
@Schema(description = "总价" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Long actualTotal;
@Schema(description = "订单状态" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Integer status;
@Schema(description = "配送类型 3:无需快递" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Integer deliveryType;
@Schema(description = "店铺名称" ,requiredMode = Schema.RequiredMode.REQUIRED)
private String shopName;
@Schema(description = "店铺id" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Long shopId;
@Schema(description = "订单创建时间" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Date createTime;
@Schema(description = "商品总数" ,requiredMode = Schema.RequiredMode.REQUIRED)
private Integer allCount;
@Schema(description = "收货人姓名" )
private String consignee;
@Schema(description = "收货人手机号" )
private String mobile;
/**
* 用户订单地址Id
*/
private Long orderAddrId;
/**
* 总值
*/
private Long total;
/**
* 订单关闭原因 1-超时未支付4-买家取消 15-已通过货到付款交易
*/
private Integer closeType;
/**
* 付款时间
*/
private Date payTime;
/**
* 发货时间
*/
private Date deliveryTime;
/**
* 完成时间
*/
private Date finallyTime;
/**
* 取消时间
*/
private Date cancelTime;
/**
* 是否已支付,1.已支付0.未支付
*/
private Integer isPayed;
/**
* 用户订单删除状态,0:没有删除, 1:回收站, 2:永久删除
*/
private Integer deleteStatus;
public Long getOrderAddrId() {
return orderAddrId;
}
public void setOrderAddrId(Long orderAddrId) {
this.orderAddrId = orderAddrId;
}
public List<EsOrderItemVO> getOrderItems() {
return orderItems;
}
public void setOrderItems(List<EsOrderItemVO> orderItems) {
this.orderItems = orderItems;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getActualTotal() {
return actualTotal;
}
public void setActualTotal(Long actualTotal) {
this.actualTotal = actualTotal;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getDeliveryType() {
return deliveryType;
}
public void setDeliveryType(Integer deliveryType) {
this.deliveryType = deliveryType;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getAllCount() {
return allCount;
}
public void setAllCount(Integer allCount) {
this.allCount = allCount;
}
public String getConsignee() {
return consignee;
}
public void setConsignee(String consignee) {
this.consignee = consignee;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public Integer getCloseType() {
return closeType;
}
public void setCloseType(Integer closeType) {
this.closeType = closeType;
}
public Date getPayTime() {
return payTime;
}
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
public Date getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(Date deliveryTime) {
this.deliveryTime = deliveryTime;
}
public Date getFinallyTime() {
return finallyTime;
}
public void setFinallyTime(Date finallyTime) {
this.finallyTime = finallyTime;
}
public Date getCancelTime() {
return cancelTime;
}
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
public Integer getIsPayed() {
return isPayed;
}
public void setIsPayed(Integer isPayed) {
this.isPayed = isPayed;
}
public Integer getDeleteStatus() {
return deleteStatus;
}
public void setDeleteStatus(Integer deleteStatus) {
this.deleteStatus = deleteStatus;
}
@Override
public String toString() {
return "EsOrderVO{" +
"orderItems=" + orderItems +
", orderId=" + orderId +
", actualTotal=" + actualTotal +
", status=" + status +
", deliveryType=" + deliveryType +
", shopName='" + shopName + '\'' +
", shopId=" + shopId +
", createTime=" + createTime +
", allCount=" + allCount +
", consignee='" + consignee + '\'' +
", mobile='" + mobile + '\'' +
", orderAddrId=" + orderAddrId +
", total=" + total +
", closeType=" + closeType +
", payTime=" + payTime +
", deliveryTime=" + deliveryTime +
", finallyTime=" + finallyTime +
", cancelTime=" + cancelTime +
", isPayed=" + isPayed +
", deleteStatus=" + deleteStatus +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
/**
* @author FrozenWatermelon
* @date 2020/11/16
*/
public class ProductSearchVO {
@Schema(description = "店铺信息" )
private ShopInfoSearchVO shopInfo;
@Schema(description = "规格属性列表" )
private List<AttrSearchVO> attrs;
@Schema(description = "品牌列表信息" )
private List<BrandSearchVO> brands;
@Schema(description = "spu列表信息" )
private List<SpuSearchVO> spus;
@Schema(description = "分类列表信息" )
private List<CategorySearchVO> categorys;
public ShopInfoSearchVO getShopInfo() {
return shopInfo;
}
public void setShopInfo(ShopInfoSearchVO shopInfo) {
this.shopInfo = shopInfo;
}
public List<AttrSearchVO> getAttrs() {
return attrs;
}
public void setAttrs(List<AttrSearchVO> attrs) {
this.attrs = attrs;
}
public List<BrandSearchVO> getBrands() {
return brands;
}
public void setBrands(List<BrandSearchVO> brands) {
this.brands = brands;
}
public List<SpuSearchVO> getSpus() {
return spus;
}
public void setSpus(List<SpuSearchVO> spus) {
this.spus = spus;
}
public List<CategorySearchVO> getCategorys() {
return categorys;
}
public void setCategorys(List<CategorySearchVO> categorys) {
this.categorys = categorys;
}
@Override
public String toString() {
return "ProductSearchVO{" +
"shopInfo=" + shopInfo +
", attrs=" + attrs +
", brands=" + brands +
", spus=" + spus +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mall4j.cloud.common.serializer.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* @author FrozenWatermelon
* @date 2020/11/17
*/
public class ShopInfoSearchVO {
@Schema(description = "店铺名称 搜索华为的时候,可以把华为的旗舰店搜索出来" )
private String shopName;
@Schema(description = "店铺id" )
private Long shopId;
@Schema(description = "店铺logo" )
@JsonSerialize(using =ImgJsonSerializer.class)
private String shopLogo;
@Schema(description = "店铺类型1自营店 2普通店" )
private Integer type;
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public String getShopLogo() {
return shopLogo;
}
public void setShopLogo(String shopLogo) {
this.shopLogo = shopLogo;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
return "ShopInfoSearchVO{" +
"shopName='" + shopName + '\'' +
", shopId=" + shopId +
", type=" + type +
", shopLogo='" + shopLogo + '\'' +
'}';
}
}
package com.mall4j.cloud.api.vo.search;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* @author FrozenWatermelon
* @date 2020/11/17
*/
public class SpuSearchVO {
@Schema(description = "商品id" )
private Long spuId;
@Schema(description = "商品名称" )
private String spuName;
@Schema(description = "卖点" )
private String sellingPoint;
@Schema(description = "店铺id" )
private Long shopId;
@Schema(description = "商品售价" )
private Long priceFee;
@Schema(description = "市场价,整数方式保存" )
private Long marketPriceFee;
@Schema(description = "是否有库存" )
private Boolean hasStock;
@Schema(description = "销量" )
private Integer saleNum;
@Schema(description = "商品介绍主图" )
private String mainImgUrl;
public String getMainImgUrl() {
return mainImgUrl;
}
public void setMainImgUrl(String mainImgUrl) {
this.mainImgUrl = mainImgUrl;
}
public Long getSpuId() {
return spuId;
}
public void setSpuId(Long spuId) {
this.spuId = spuId;
}
public String getSpuName() {
return spuName;
}
public void setSpuName(String spuName) {
this.spuName = spuName;
}
public String getSellingPoint() {
return sellingPoint;
}
public void setSellingPoint(String sellingPoint) {
this.sellingPoint = sellingPoint;
}
public Long getShopId() {
return shopId;
}
public void setShopId(Long shopId) {
this.shopId = shopId;
}
public Long getPriceFee() {
return priceFee;
}
public void setPriceFee(Long priceFee) {
this.priceFee = priceFee;
}
public Long getMarketPriceFee() {
return marketPriceFee;
}
public void setMarketPriceFee(Long marketPriceFee) {
this.marketPriceFee = marketPriceFee;
}
public Boolean getHasStock() {
return hasStock;
}
public void setHasStock(Boolean hasStock) {
this.hasStock = hasStock;
}
public Integer getSaleNum() {
return saleNum;
}
public void setSaleNum(Integer saleNum) {
this.saleNum = saleNum;
}
@Override
public String toString() {
return "SpuVO{" +
"spuId=" + spuId +
", spuName='" + spuName + '\'' +
", sellingPoint='" + sellingPoint + '\'' +
", priceFee=" + priceFee +
", marketPriceFee=" + marketPriceFee +
", hasStock=" + hasStock +
", saleNum=" + saleNum +
", mainImgUrl='" + mainImgUrl + '\'' +
'}';
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment