Authored by caoyan

视频图片

  1 +package com.yohoufo.dal.product;
  2 +
  3 +import org.apache.ibatis.annotations.Param;
  4 +
  5 +import com.yohoufo.dal.product.model.ProductExt;
  6 +
  7 +public interface ProductExtMapper {
  8 + ProductExt selectByProductId(@Param("productId") Integer productId);
  9 +
  10 +}
  1 +package com.yohoufo.dal.product.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class ProductExt {
  7 + private Integer productId;
  8 + private String vedioImageUrl;
  9 + private String vedioUrl;
  10 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.yohoufo.dal.product.ProductExtMapper">
  4 + <resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.ProductExt">
  5 + <result column="product_id" jdbcType="INTEGER" property="productId" />
  6 + <result column="vedio_image_url" jdbcType="VARCHAR" property="vedioImageUrl" />
  7 + <result column="vedio_url" jdbcType="INTEGER" property="vedioUrl" />
  8 + </resultMap>
  9 + <sql id="Base_Column_List">
  10 + product_id, vedio_image_url, vedio_url
  11 + </sql>
  12 + <select id="selectByProductId" resultMap="BaseResultMap">
  13 + select <include refid="Base_Column_List"/>
  14 + from product_ext
  15 + where product_id = #{productId,jdbcType=VARCHAR}
  16 + limit 1
  17 + </select>
  18 +</mapper>
@@ -38,6 +38,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp; @@ -38,6 +38,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp;
38 import com.yohobuy.ufo.model.response.StorageCheckResp; 38 import com.yohobuy.ufo.model.response.StorageCheckResp;
39 import com.yohobuy.ufo.model.response.StorageDataResp; 39 import com.yohobuy.ufo.model.response.StorageDataResp;
40 import com.yohobuy.ufo.model.response.StorageInfoResp; 40 import com.yohobuy.ufo.model.response.StorageInfoResp;
  41 +import com.yohobuy.ufo.model.response.VedioImageResp;
41 import com.yohoufo.common.ApiResponse; 42 import com.yohoufo.common.ApiResponse;
42 import com.yohoufo.common.annotation.IgnoreSession; 43 import com.yohoufo.common.annotation.IgnoreSession;
43 import com.yohoufo.common.annotation.IgnoreSignature; 44 import com.yohoufo.common.annotation.IgnoreSignature;
@@ -1022,4 +1023,13 @@ public class ProductController { @@ -1022,4 +1023,13 @@ public class ProductController {
1022 SizeImageResp result = productService.getSizeImage(productId, brandId); 1023 SizeImageResp result = productService.getSizeImage(productId, brandId);
1023 return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build(); 1024 return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build();
1024 } 1025 }
  1026 +
  1027 + @ApiOperation(name = "ufo.product.vedioImage", desc = "查询视频图片")
  1028 + @RequestMapping(params = "method=ufo.product.vedioImage")
  1029 + @Cachable(expire = 300)
  1030 + public ApiResponse getVedioImage(@RequestParam(value = "product_id") Integer productId) {
  1031 + LOG.info("in method=ufo.product.vedioImage product_id is {}", productId);
  1032 + VedioImageResp result = productService.getVedioImage(productId);
  1033 + return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getVedioImage success").build();
  1034 + }
1025 } 1035 }
@@ -17,6 +17,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp; @@ -17,6 +17,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp;
17 import com.yohobuy.ufo.model.response.StorageCheckResp; 17 import com.yohobuy.ufo.model.response.StorageCheckResp;
18 import com.yohobuy.ufo.model.response.StorageDataResp; 18 import com.yohobuy.ufo.model.response.StorageDataResp;
19 import com.yohobuy.ufo.model.response.StorageInfoResp; 19 import com.yohobuy.ufo.model.response.StorageInfoResp;
  20 +import com.yohobuy.ufo.model.response.VedioImageResp;
20 import com.yohoufo.dal.product.model.StoragePrice; 21 import com.yohoufo.dal.product.model.StoragePrice;
21 import com.yohoufo.product.model.SkupInfo; 22 import com.yohoufo.product.model.SkupInfo;
22 import com.yohoufo.product.response.ProductSeriesTemplateResp; 23 import com.yohoufo.product.response.ProductSeriesTemplateResp;
@@ -164,4 +165,6 @@ public interface ProductService { @@ -164,4 +165,6 @@ public interface ProductService {
164 ProductDetailResp queryProductDetail3ById(Integer productId); 165 ProductDetailResp queryProductDetail3ById(Integer productId);
165 166
166 SizeImageResp getSizeImage(Integer productId, Integer brandId); 167 SizeImageResp getSizeImage(Integer productId, Integer brandId);
  168 +
  169 + VedioImageResp getVedioImage(Integer productId);
167 } 170 }
@@ -54,6 +54,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp; @@ -54,6 +54,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp;
54 import com.yohobuy.ufo.model.response.StorageCheckResp; 54 import com.yohobuy.ufo.model.response.StorageCheckResp;
55 import com.yohobuy.ufo.model.response.StorageDataResp; 55 import com.yohobuy.ufo.model.response.StorageDataResp;
56 import com.yohobuy.ufo.model.response.StorageInfoResp; 56 import com.yohobuy.ufo.model.response.StorageInfoResp;
  57 +import com.yohobuy.ufo.model.response.VedioImageResp;
57 import com.yohobuy.ufo.model.response.store.StoreInfoBo; 58 import com.yohobuy.ufo.model.response.store.StoreInfoBo;
58 import com.yohoufo.common.ApiResponse; 59 import com.yohoufo.common.ApiResponse;
59 import com.yohoufo.common.caller.UfoServiceCaller; 60 import com.yohoufo.common.caller.UfoServiceCaller;
@@ -68,6 +69,7 @@ import com.yohoufo.dal.product.GoodsImagesMapper; @@ -68,6 +69,7 @@ import com.yohoufo.dal.product.GoodsImagesMapper;
68 import com.yohoufo.dal.product.GoodsMapper; 69 import com.yohoufo.dal.product.GoodsMapper;
69 import com.yohoufo.dal.product.PriceTrendDayMapper; 70 import com.yohoufo.dal.product.PriceTrendDayMapper;
70 import com.yohoufo.dal.product.PriceTrendMonthMapper; 71 import com.yohoufo.dal.product.PriceTrendMonthMapper;
  72 +import com.yohoufo.dal.product.ProductExtMapper;
71 import com.yohoufo.dal.product.ProductLimitSaleMapper; 73 import com.yohoufo.dal.product.ProductLimitSaleMapper;
72 import com.yohoufo.dal.product.ProductMapper; 74 import com.yohoufo.dal.product.ProductMapper;
73 import com.yohoufo.dal.product.ProductProfitMapper; 75 import com.yohoufo.dal.product.ProductProfitMapper;
@@ -90,6 +92,7 @@ import com.yohoufo.dal.product.model.Goods; @@ -90,6 +92,7 @@ import com.yohoufo.dal.product.model.Goods;
90 import com.yohoufo.dal.product.model.GoodsImages; 92 import com.yohoufo.dal.product.model.GoodsImages;
91 import com.yohoufo.dal.product.model.PriceTrendModel; 93 import com.yohoufo.dal.product.model.PriceTrendModel;
92 import com.yohoufo.dal.product.model.Product; 94 import com.yohoufo.dal.product.model.Product;
  95 +import com.yohoufo.dal.product.model.ProductExt;
93 import com.yohoufo.dal.product.model.ProductLimitSale; 96 import com.yohoufo.dal.product.model.ProductLimitSale;
94 import com.yohoufo.dal.product.model.ProductProfit; 97 import com.yohoufo.dal.product.model.ProductProfit;
95 import com.yohoufo.dal.product.model.ProductSales; 98 import com.yohoufo.dal.product.model.ProductSales;
@@ -229,6 +232,9 @@ public class ProductServiceImpl implements ProductService { @@ -229,6 +232,9 @@ public class ProductServiceImpl implements ProductService {
229 232
230 @Autowired 233 @Autowired
231 private SizePoolDetailMapper sizePoolDetailMapper; 234 private SizePoolDetailMapper sizePoolDetailMapper;
  235 +
  236 + @Autowired
  237 + private ProductExtMapper productExtMapper;
232 238
233 @Override 239 @Override
234 public ProductDetailResp queryProductDetailById(Integer productId) { 240 public ProductDetailResp queryProductDetailById(Integer productId) {
@@ -2002,6 +2008,20 @@ public class ProductServiceImpl implements ProductService { @@ -2002,6 +2008,20 @@ public class ProductServiceImpl implements ProductService {
2002 return resp; 2008 return resp;
2003 } 2009 }
2004 2010
  2011 + @Override
  2012 + public VedioImageResp getVedioImage(Integer productId) {
  2013 + VedioImageResp resp = new VedioImageResp();
  2014 + ProductExt ext = productExtMapper.selectByProductId(productId);
  2015 + if(null == ext) {
  2016 + return resp;
  2017 + }
  2018 +
  2019 + resp.setProductId(productId);
  2020 + resp.setVedioImageUrl(ImageUrlAssist.getUrlWhitImageView2(ext.getVedioImageUrl()));
  2021 +
  2022 + return resp;
  2023 + }
  2024 +
2005 private List<Integer> buildSizeIdList(String[] sizeIdArr){ 2025 private List<Integer> buildSizeIdList(String[] sizeIdArr){
2006 List<Integer> sizeIdList = Lists.newArrayList(); 2026 List<Integer> sizeIdList = Lists.newArrayList();
2007 for(int i=0; i<sizeIdArr.length; i++) { 2027 for(int i=0; i<sizeIdArr.length; i++) {
@@ -53,6 +53,7 @@ datasources: @@ -53,6 +53,7 @@ datasources:
53 - com.yohoufo.dal.product.BidStoragePriceMapper 53 - com.yohoufo.dal.product.BidStoragePriceMapper
54 - com.yohoufo.dal.product.SizePoolMapper 54 - com.yohoufo.dal.product.SizePoolMapper
55 - com.yohoufo.dal.product.SizePoolDetailMapper 55 - com.yohoufo.dal.product.SizePoolDetailMapper
  56 + - com.yohoufo.dal.product.ProductExtMapper
56 57
57 58
58 ufo_order: 59 ufo_order:
@@ -55,6 +55,7 @@ datasources: @@ -55,6 +55,7 @@ datasources:
55 - com.yohoufo.dal.product.BidStoragePriceMapper 55 - com.yohoufo.dal.product.BidStoragePriceMapper
56 - com.yohoufo.dal.product.SizePoolMapper 56 - com.yohoufo.dal.product.SizePoolMapper
57 - com.yohoufo.dal.product.SizePoolDetailMapper 57 - com.yohoufo.dal.product.SizePoolDetailMapper
  58 + - com.yohoufo.dal.product.ProductExtMapper
58 59
59 ufo_order: 60 ufo_order:
60 username: ${jdbc.mysql.cobar.username} 61 username: ${jdbc.mysql.cobar.username}