记得上下班打卡 | git大法好,push需谨慎

Commit 26abcd55 authored by 胡佳晨's avatar 胡佳晨

提交 nft搜索

parent 2a24fed6
package com.liquidnet.service.goblin.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "GoblinSkusSearchDto", description = "Sku搜素")
@Data
public class GoblinSkusSearchDto implements Serializable, Cloneable {
private static final long serialVersionUID = 8425727558228094904L;
@ApiModelProperty(position = 11, value = "店铺id")
private String spuId;
@ApiModelProperty(position = 11, value = "店铺名称")
private String spuName;
private static final GoblinSkusSearchDto obj = new GoblinSkusSearchDto();
public static GoblinSkusSearchDto getNew() {
try {
return (GoblinSkusSearchDto) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinSkusSearchDto();
}
}
}
......@@ -42,9 +42,20 @@ public class GoblinCommonController extends BaseController {
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"),
})
@ResponseBody
public AjaxResult storeSearch(String title, Integer type) {
public AjaxResult goodsSearch(String title, Integer type) {
return AjaxResult.success(goblinCommonService.goodsSearch(title, type));
}
@Log(title = "商品搜索", businessType = BusinessType.LIST)
@GetMapping("sku")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "title", value = "商品名称[模糊]"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "type", value = "商品类型[0-常规|1-数字藏品]"),
})
@ResponseBody
public AjaxResult skuSearch(String title, Integer type) {
return AjaxResult.success(goblinCommonService.skuSearch(title, type));
}
/** ------------------------------------------------------------------------ **/
}
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.goblin.dto.GoblinGoodsSearchDto;
import com.liquidnet.service.goblin.dto.GoblinSkusSearchDto;
import com.liquidnet.service.goblin.dto.GoblinStoreSearchDto;
import java.util.List;
......@@ -13,4 +14,6 @@ public interface IGoblinCommonService {
List<GoblinStoreSearchDto> storeSearch(String name,List<String> status);
List<GoblinGoodsSearchDto> goodsSearch(String name, Integer type);
List<GoblinSkusSearchDto> skuSearch(String name, Integer type);
}
......@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinCommonService;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.dto.GoblinGoodsSearchDto;
import com.liquidnet.service.goblin.dto.GoblinSkusSearchDto;
import com.liquidnet.service.goblin.dto.GoblinStoreSearchDto;
import com.liquidnet.service.goblin.entity.GoblinGoods;
import com.liquidnet.service.goblin.entity.GoblinGoodsSku;
import com.liquidnet.service.goblin.entity.GoblinStoreInfo;
import com.liquidnet.service.goblin.mapper.GoblinGoodsMapper;
import com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper;
import com.liquidnet.service.goblin.mapper.GoblinStoreInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -33,6 +36,8 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
GoblinStoreInfoMapper goblinStoreInfoMapper;
@Autowired
GoblinGoodsMapper goblinGoodsMapper;
@Autowired
GoblinGoodsSkuMapper goblinGoodsSkuMapper;
@Override
public List<GoblinStoreSearchDto> storeSearch(String name, List<String> status) {
......@@ -68,7 +73,31 @@ public class GoblinCommonServiceImpl implements IGoblinCommonService {
List<GoblinGoodsSearchDto> dtoList = new ArrayList<>();
for (GoblinGoods item : list) {
GoblinGoodsSearchDto dto = GoblinGoodsSearchDto.getNew();
dto.setSpuId(item.getStoreId());
dto.setSpuId(item.getSpuId());
dto.setSpuName(item.getName());
dtoList.add(dto);
}
return dtoList;
}
@Override
public List<GoblinSkusSearchDto> skuSearch(String name, Integer type) {
if (type == null) {//普通商品
type = 1;
}
LambdaQueryWrapper<GoblinGoodsSku> queryWrapper = Wrappers.lambdaQuery(GoblinGoodsSku.class);
queryWrapper.ne(GoblinGoodsSku::getDelFlg, "1");
queryWrapper.eq(GoblinGoodsSku::getShelvesStatus, "3");
// queryWrapper.eq(GoblinGoodsSku::getSpuAppear, "0");
queryWrapper.eq(GoblinGoodsSku::getSkuType, type);
if (StringUtil.isNotBlank(name)) {
queryWrapper.like(GoblinGoodsSku::getName, name);
}
List<GoblinGoodsSku> list = goblinGoodsSkuMapper.selectList(queryWrapper.last("limit 20"));
List<GoblinSkusSearchDto> dtoList = new ArrayList<>();
for (GoblinGoodsSku item : list) {
GoblinSkusSearchDto dto = GoblinSkusSearchDto.getNew();
dto.setSpuId(item.getSkuId());
dto.setSpuName(item.getName());
dtoList.add(dto);
}
......
......@@ -18,7 +18,7 @@ liquidnet:
url-banner:
url6: "/kylin/performances/recommend/performance/status?pageNum=1&pageSize=50&status=(3,6,7,8,9,10)" #票务
url7: "/goblin/common/goods?type=0" #商品
url9: "/goblin/common/goods?type=1" #NFT
url9: "/goblin/common/sku?type=1" #NFT
url14: "${liquidnet.client.admin.phpMallUrl}/admin/good/collective/quick?page=1&per_page=50" #商品集合
# 开发环境配置
......
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