Authored by mali

详情页支持视频

@@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo; @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo;
6 import com.yohoufo.common.ApiResponse; 6 import com.yohoufo.common.ApiResponse;
7 import com.yohoufo.common.annotation.IgnoreSession; 7 import com.yohoufo.common.annotation.IgnoreSession;
8 import com.yohoufo.common.annotation.IgnoreSignature; 8 import com.yohoufo.common.annotation.IgnoreSignature;
  9 +import com.yohoufo.common.cache.Cachable;
9 import com.yohoufo.order.model.request.UfoLiveNotifyResp; 10 import com.yohoufo.order.model.request.UfoLiveNotifyResp;
10 import com.yohoufo.order.service.impl.QiniuLiveRecordService; 11 import com.yohoufo.order.service.impl.QiniuLiveRecordService;
11 import org.apache.commons.lang3.StringUtils; 12 import org.apache.commons.lang3.StringUtils;
@@ -57,6 +58,7 @@ public class UfoLiveAvthumbController { @@ -57,6 +58,7 @@ public class UfoLiveAvthumbController {
57 @RequestMapping(params = "method=ufo.order.videos") 58 @RequestMapping(params = "method=ufo.order.videos")
58 @IgnoreSession 59 @IgnoreSession
59 @IgnoreSignature 60 @IgnoreSignature
  61 + @Cachable(expire = 180)
60 public ApiResponse buyerModifyAddress(@RequestParam("product_id") int productId){ 62 public ApiResponse buyerModifyAddress(@RequestParam("product_id") int productId){
61 logger.info("in ufo.order.videos, product_id {}.", productId); 63 logger.info("in ufo.order.videos, product_id {}.", productId);
62 64
@@ -13,6 +13,8 @@ import com.yohoufo.dal.order.model.BuyerOrder; @@ -13,6 +13,8 @@ import com.yohoufo.dal.order.model.BuyerOrder;
13 import com.yohoufo.dal.order.model.QiniuLiveRecord; 13 import com.yohoufo.dal.order.model.QiniuLiveRecord;
14 import org.apache.commons.collections.CollectionUtils; 14 import org.apache.commons.collections.CollectionUtils;
15 import org.apache.commons.lang3.StringUtils; 15 import org.apache.commons.lang3.StringUtils;
  16 +import org.slf4j.Logger;
  17 +import org.slf4j.LoggerFactory;
16 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
18 20
@@ -27,6 +29,7 @@ import java.util.stream.Collectors; @@ -27,6 +29,7 @@ import java.util.stream.Collectors;
27 */ 29 */
28 @Service 30 @Service
29 public class QiniuLiveRecordService { 31 public class QiniuLiveRecordService {
  32 + private final Logger LOG = LoggerFactory.getLogger(QiniuLiveRecordService.class);
30 33
31 public static final String LIVE_VIDEO_DOMAIN = QNliveConstants.LIVE_VIDEO_DOMAIN; 34 public static final String LIVE_VIDEO_DOMAIN = QNliveConstants.LIVE_VIDEO_DOMAIN;
32 public static final String MP4_FILEKEY_PRE = QNliveConstants.MP4_FILEKEY_PRE; // mp4文件路径 35 public static final String MP4_FILEKEY_PRE = QNliveConstants.MP4_FILEKEY_PRE; // mp4文件路径
@@ -97,12 +100,16 @@ public class QiniuLiveRecordService { @@ -97,12 +100,16 @@ public class QiniuLiveRecordService {
97 return resps; 100 return resps;
98 } 101 }
99 102
  103 + LOG.info("method queryOrderVideos in orderCodeList is {}, productId is {}", orderCodeList, productId);
  104 +
100 Map<Long, QiniuLiveRecord> recordMap = qiNiuLiveRecords.stream().collect(Collectors.toMap(QiniuLiveRecord::getOrderCode, item -> item)); 105 Map<Long, QiniuLiveRecord> recordMap = qiNiuLiveRecords.stream().collect(Collectors.toMap(QiniuLiveRecord::getOrderCode, item -> item));
101 106
102 107
103 List<BuyerOrder> buyerOrders = buyerOrderMapper.selectByOrderCodes(orderCodeList, Lists.newArrayList(OrderStatus.WAITING_RECEIVE.getCode(), 108 List<BuyerOrder> buyerOrders = buyerOrderMapper.selectByOrderCodes(orderCodeList, Lists.newArrayList(OrderStatus.WAITING_RECEIVE.getCode(),
104 OrderStatus.DONE.getCode())); 109 OrderStatus.DONE.getCode()));
105 110
  111 + LOG.info("method selectByOrderCodes in buyerOrders size is {}, productId is {}", buyerOrders.size(), productId);
  112 +
106 buyerOrders.stream().forEach(item -> { 113 buyerOrders.stream().forEach(item -> {
107 OrderVideoResp orderVideoResp = new OrderVideoResp(); 114 OrderVideoResp orderVideoResp = new OrderVideoResp();
108 QiniuLiveRecord qiniuLiveRecord = recordMap.get(item.getOrderCode()); 115 QiniuLiveRecord qiniuLiveRecord = recordMap.get(item.getOrderCode());