|
@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -45,24 +46,48 @@ public class HeheApi {
|
|
*/
|
|
*/
|
|
@ApiOperation("商品列表")
|
|
@ApiOperation("商品列表")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
- @ApiImplicitParam(required = false, name = "listType", value = "列表类型:1首页搜索商品列表,2首页分类商品列表,3首页楼层商品列表.4二级分类商品列表,5活动商品列表"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "homeTypeId", value = "首页分类id"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "homeFloorId", value = "首页楼层id"),
|
|
|
|
- @ApiImplicitParam(required = false, name = "smallTypeId", value = "二级分类id"),
|
|
|
|
|
|
+ @ApiImplicitParam(required = false, name = "listType", value = "列表类型:1首页搜索商品列表,2首页分类商品列表," +
|
|
|
|
+ "3首页楼层商品列表.4二级分类商品列表,5优惠券商品列表,6活动商品列表"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "name", value = "搜索商品名称(1)"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "homeTypeId", value = "首页分类id(2)"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "homeFloorId", value = "首页楼层id(3)"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "smallTypeId", value = "二级分类id(4)"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "couponId", value = "优惠券id(5)"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "activityId", value = "活动id(6)"),
|
|
@ApiImplicitParam(required = false, name = "userId", value = "用户id"),
|
|
@ApiImplicitParam(required = false, name = "userId", value = "用户id"),
|
|
- @ApiImplicitParam(required = false, name = "productName", value = "搜索商品名称"),
|
|
|
|
@ApiImplicitParam(required = false, name = "sortType", value = "排序类型:1综合,2价格升序,3价格降序,4最新"),
|
|
@ApiImplicitParam(required = false, name = "sortType", value = "排序类型:1综合,2价格升序,3价格降序,4最新"),
|
|
@ApiImplicitParam(required = false, name = "productIds", value = "综合排序已查出的商品id,以,隔开"),
|
|
@ApiImplicitParam(required = false, name = "productIds", value = "综合排序已查出的商品id,以,隔开"),
|
|
@ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
@ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
@ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
@ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
})
|
|
})
|
|
@GetMapping("/product/list")
|
|
@GetMapping("/product/list")
|
|
- public ResponseJson<PaginationVo<HeheProductVo>> getProductList(Integer listType, Integer homeTypeId, Integer homeFloorId, Integer smallTypeId,
|
|
|
|
- Integer userId, String productName, String productIds,
|
|
|
|
|
|
+ public ResponseJson<Map<String,Object>> getProductList(Integer listType, Integer homeTypeId, Integer homeFloorId, Integer smallTypeId,
|
|
|
|
+ Integer userId, String name, Integer couponId, Integer activityId, String productIds,
|
|
Integer sortType,
|
|
Integer sortType,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
- return heheService.getProductList(listType, homeTypeId, homeFloorId, smallTypeId, userId, productName, productIds, sortType, pageNum, pageSize);
|
|
|
|
|
|
+ if (null == listType) {
|
|
|
|
+ return ResponseJson.error("列表类型不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (1 == listType && StringUtils.isEmpty(name)) {
|
|
|
|
+ return ResponseJson.error("搜索关键词不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (2 == listType && (null == homeTypeId || 0 == homeTypeId)) {
|
|
|
|
+ return ResponseJson.error("首页分类id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (3 == listType && (null == homeFloorId || 0 == homeFloorId)) {
|
|
|
|
+ return ResponseJson.error("首页楼层id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (4 == listType && (null == smallTypeId || 0 == smallTypeId)) {
|
|
|
|
+ return ResponseJson.error("二级分类id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (5 == listType && (null == couponId || 0 == couponId)) {
|
|
|
|
+ return ResponseJson.error("优惠券id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (6 == listType && (null == activityId || 0 == activityId)) {
|
|
|
|
+ return ResponseJson.error("活动id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return heheService.getProductList(listType, homeTypeId, homeFloorId, smallTypeId, couponId, activityId, userId, name, productIds, sortType, pageNum, pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("首页楼层数据")
|
|
@ApiOperation("首页楼层数据")
|
|
@@ -91,7 +116,7 @@ public class HeheApi {
|
|
return heheService.getActivityList(userId, pageNum, pageSize);
|
|
return heheService.getActivityList(userId, pageNum, pageSize);
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation("活动详情")
|
|
|
|
|
|
+ /*@ApiOperation("活动详情")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "userId", value = "分销者用户id", required = true),
|
|
@ApiImplicitParam(name = "userId", value = "分销者用户id", required = true),
|
|
@ApiImplicitParam(name = "activityId", value = "活动id", required = true),
|
|
@ApiImplicitParam(name = "activityId", value = "活动id", required = true),
|
|
@@ -106,7 +131,7 @@ public class HeheApi {
|
|
return ResponseJson.error("参数异常", null);
|
|
return ResponseJson.error("参数异常", null);
|
|
}
|
|
}
|
|
return heheService.getActivityDetails(userId, activityId, pageNum, pageSize);
|
|
return heheService.getActivityDetails(userId, activityId, pageNum, pageSize);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
@ApiOperation("商品详情")
|
|
@ApiOperation("商品详情")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|