Authored by mali

详情页支持视频

... ... @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.common.cache.Cachable;
import com.yohoufo.order.model.request.UfoLiveNotifyResp;
import com.yohoufo.order.service.impl.QiniuLiveRecordService;
import org.apache.commons.lang3.StringUtils;
... ... @@ -57,6 +58,7 @@ public class UfoLiveAvthumbController {
@RequestMapping(params = "method=ufo.order.videos")
@IgnoreSession
@IgnoreSignature
@Cachable(expire = 180)
public ApiResponse buyerModifyAddress(@RequestParam("product_id") int productId){
logger.info("in ufo.order.videos, product_id {}.", productId);
... ...
... ... @@ -13,6 +13,8 @@ import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.QiniuLiveRecord;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
... ... @@ -27,6 +29,7 @@ import java.util.stream.Collectors;
*/
@Service
public class QiniuLiveRecordService {
private final Logger LOG = LoggerFactory.getLogger(QiniuLiveRecordService.class);
public static final String LIVE_VIDEO_DOMAIN = QNliveConstants.LIVE_VIDEO_DOMAIN;
public static final String MP4_FILEKEY_PRE = QNliveConstants.MP4_FILEKEY_PRE; // mp4文件路径
... ... @@ -97,12 +100,16 @@ public class QiniuLiveRecordService {
return resps;
}
LOG.info("method queryOrderVideos in orderCodeList is {}, productId is {}", orderCodeList, productId);
Map<Long, QiniuLiveRecord> recordMap = qiNiuLiveRecords.stream().collect(Collectors.toMap(QiniuLiveRecord::getOrderCode, item -> item));
List<BuyerOrder> buyerOrders = buyerOrderMapper.selectByOrderCodes(orderCodeList, Lists.newArrayList(OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.DONE.getCode()));
LOG.info("method selectByOrderCodes in buyerOrders size is {}, productId is {}", buyerOrders.size(), productId);
buyerOrders.stream().forEach(item -> {
OrderVideoResp orderVideoResp = new OrderVideoResp();
QiniuLiveRecord qiniuLiveRecord = recordMap.get(item.getOrderCode());
... ...