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

Commit 57e83a52 authored by zhengfuxin's avatar zhengfuxin

商品详情接口开发

parent 45fd51a0
package com.liquidnet.service.goblin.dto.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* 轮播图
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@ApiModel(value = "GoblinFrontBannerBuildParam", description = "轮播图param")
@Data
public class GoblinFrontGoodDetailVo implements Serializable {
//spu
GoblinGoodsInfoVo goblinGoodsInfoVo;
//sku
List<GoblinGoodsSkuInfoVo> goblinGoodsSkuInfoVolist;
private static final long serialVersionUID = 1L;
private static final GoblinFrontGoodDetailVo obj = new GoblinFrontGoodDetailVo();
public static GoblinFrontGoodDetailVo getNew() {
try {
return (GoblinFrontGoodDetailVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinFrontGoodDetailVo();
}
}
}
......@@ -9,13 +9,13 @@ import java.util.List;
/**
* <p>
* 轮播图
* 精选商品列表
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@ApiModel(value = "GoblinFrontBannerBuildParam", description = "轮播图param")
@ApiModel(value = "GoblinFrontSelectGoodVo", description = "精选商品列表")
@Data
public class GoblinFrontSelectGoodVo implements Serializable {
/**
......
......@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.controller;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinFrontGoodDetailVo;
import com.liquidnet.service.goblin.service.impl.GoblinFrontServiceImpl;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import io.swagger.annotations.Api;
......@@ -57,6 +58,12 @@ public class GoblinFrontController {
public ResponseDto getSelectGoods(@RequestParam(name = "pageSize", required = true) int pageSize, @RequestParam(name = "pageNumber", required = true)int pageNumber) throws ParseException {
return ResponseDto.success( goblinFrontService.getSelectGoods(pageNumber,pageSize));
}
@GetMapping("getGoodsDetail")
@ApiOperation("获得商品详情")
public ResponseDto<GoblinFrontGoodDetailVo> getGoodsDetail(@RequestParam(name = "spuId", required = true) String spuId) throws ParseException {
return ResponseDto.success( goblinFrontService.getGoodsDetail(spuId));
}
......
......@@ -187,6 +187,16 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
return goblinFrontSeckillVo;
}
/**
* 获得商品详情
*/
public GoblinFrontGoodDetailVo getGoodsDetail(String spuId){
GoblinFrontGoodDetailVo goblinFrontGoodDetailVo=GoblinFrontGoodDetailVo.getNew();
GoblinGoodsInfoVo goblinGoodsInfoVo=goblinRedisUtils.getGoodsInfoVo(spuId);
goblinFrontGoodDetailVo.setGoblinGoodsInfoVo(goblinGoodsInfoVo);
return goblinFrontGoodDetailVo;
}
/**
* @author zhangfuxin
......
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