|
@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiSort;
|
|
import io.swagger.annotations.ApiSort;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.result.R;
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.second.vo.SecondGoodsRecommendVo;
|
|
import shop.alien.entity.second.vo.SecondGoodsRecommendVo;
|
|
@@ -73,7 +74,7 @@ public class SecondRecommendController {
|
|
|
@RequestParam(value = "longitude", required = false) String longitude,
|
|
@RequestParam(value = "longitude", required = false) String longitude,
|
|
|
@RequestParam(value = "latitude", required = false) String latitude) throws Exception {
|
|
@RequestParam(value = "latitude", required = false) String latitude) throws Exception {
|
|
|
log.info("LifeCollectController.cancelCollect?goodsId={},longitude={},latitude={}", goodsId, longitude, latitude);
|
|
log.info("LifeCollectController.cancelCollect?goodsId={},longitude={},latitude={}", goodsId, longitude, latitude);
|
|
|
- return R.data(service.querySecondGoodsDetail(goodsId, longitude + "," + latitude), "查询成功");
|
|
|
|
|
|
|
+ return R.data(service.querySecondGoodsDetail(goodsId, buildUserPosition(longitude, latitude)), "查询成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value = "商品详情(匿名/带手机号)", notes = "需传当前用户 phoneId(可为裸手机号或 user_ 前缀),与 collect/addCollect 写入的 life_collect.user_id 一致;响应 collectStatus:0=未收藏,1=已收藏")
|
|
@ApiOperation(value = "商品详情(匿名/带手机号)", notes = "需传当前用户 phoneId(可为裸手机号或 user_ 前缀),与 collect/addCollect 写入的 life_collect.user_id 一致;响应 collectStatus:0=未收藏,1=已收藏")
|
|
@@ -87,4 +88,11 @@ public class SecondRecommendController {
|
|
|
return R.data(service.querySecondGoodsDetailWithOutJWT(phoneId, goodsId, longitude + "," + latitude), "查询成功");
|
|
return R.data(service.querySecondGoodsDetailWithOutJWT(phoneId, goodsId, longitude + "," + latitude), "查询成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private static String buildUserPosition(String longitude, String latitude) {
|
|
|
|
|
+ if (!StringUtils.hasText(longitude) || !StringUtils.hasText(latitude)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ return longitude.trim() + "," + latitude.trim();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|