Authored by caoyan

视频图片

package com.yohoufo.dal.product;
import org.apache.ibatis.annotations.Param;
import com.yohoufo.dal.product.model.ProductExt;
public interface ProductExtMapper {
ProductExt selectByProductId(@Param("productId") Integer productId);
}
\ No newline at end of file
... ...
package com.yohoufo.dal.product.model;
import lombok.Data;
@Data
public class ProductExt {
private Integer productId;
private String vedioImageUrl;
private String vedioUrl;
}
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yohoufo.dal.product.ProductExtMapper">
<resultMap id="BaseResultMap" type="com.yohoufo.dal.product.model.ProductExt">
<result column="product_id" jdbcType="INTEGER" property="productId" />
<result column="vedio_image_url" jdbcType="VARCHAR" property="vedioImageUrl" />
<result column="vedio_url" jdbcType="INTEGER" property="vedioUrl" />
</resultMap>
<sql id="Base_Column_List">
product_id, vedio_image_url, vedio_url
</sql>
<select id="selectByProductId" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from product_ext
where product_id = #{productId,jdbcType=VARCHAR}
limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -38,6 +38,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
import com.yohobuy.ufo.model.response.VedioImageResp;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
... ... @@ -1022,4 +1023,13 @@ public class ProductController {
SizeImageResp result = productService.getSizeImage(productId, brandId);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getSizeImage success").build();
}
@ApiOperation(name = "ufo.product.vedioImage", desc = "查询视频图片")
@RequestMapping(params = "method=ufo.product.vedioImage")
@Cachable(expire = 300)
public ApiResponse getVedioImage(@RequestParam(value = "product_id") Integer productId) {
LOG.info("in method=ufo.product.vedioImage product_id is {}", productId);
VedioImageResp result = productService.getVedioImage(productId);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("getVedioImage success").build();
}
}
\ No newline at end of file
... ...
... ... @@ -17,6 +17,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
import com.yohobuy.ufo.model.response.VedioImageResp;
import com.yohoufo.dal.product.model.StoragePrice;
import com.yohoufo.product.model.SkupInfo;
import com.yohoufo.product.response.ProductSeriesTemplateResp;
... ... @@ -164,4 +165,6 @@ public interface ProductService {
ProductDetailResp queryProductDetail3ById(Integer productId);
SizeImageResp getSizeImage(Integer productId, Integer brandId);
VedioImageResp getVedioImage(Integer productId);
}
... ...
... ... @@ -54,6 +54,7 @@ import com.yohobuy.ufo.model.response.SizeImageResp;
import com.yohobuy.ufo.model.response.StorageCheckResp;
import com.yohobuy.ufo.model.response.StorageDataResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
import com.yohobuy.ufo.model.response.VedioImageResp;
import com.yohobuy.ufo.model.response.store.StoreInfoBo;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.caller.UfoServiceCaller;
... ... @@ -68,6 +69,7 @@ import com.yohoufo.dal.product.GoodsImagesMapper;
import com.yohoufo.dal.product.GoodsMapper;
import com.yohoufo.dal.product.PriceTrendDayMapper;
import com.yohoufo.dal.product.PriceTrendMonthMapper;
import com.yohoufo.dal.product.ProductExtMapper;
import com.yohoufo.dal.product.ProductLimitSaleMapper;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.ProductProfitMapper;
... ... @@ -90,6 +92,7 @@ import com.yohoufo.dal.product.model.Goods;
import com.yohoufo.dal.product.model.GoodsImages;
import com.yohoufo.dal.product.model.PriceTrendModel;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.dal.product.model.ProductExt;
import com.yohoufo.dal.product.model.ProductLimitSale;
import com.yohoufo.dal.product.model.ProductProfit;
import com.yohoufo.dal.product.model.ProductSales;
... ... @@ -229,6 +232,9 @@ public class ProductServiceImpl implements ProductService {
@Autowired
private SizePoolDetailMapper sizePoolDetailMapper;
@Autowired
private ProductExtMapper productExtMapper;
@Override
public ProductDetailResp queryProductDetailById(Integer productId) {
... ... @@ -2002,6 +2008,20 @@ public class ProductServiceImpl implements ProductService {
return resp;
}
@Override
public VedioImageResp getVedioImage(Integer productId) {
VedioImageResp resp = new VedioImageResp();
ProductExt ext = productExtMapper.selectByProductId(productId);
if(null == ext) {
return resp;
}
resp.setProductId(productId);
resp.setVedioImageUrl(ImageUrlAssist.getUrlWhitImageView2(ext.getVedioImageUrl()));
return resp;
}
private List<Integer> buildSizeIdList(String[] sizeIdArr){
List<Integer> sizeIdList = Lists.newArrayList();
for(int i=0; i<sizeIdArr.length; i++) {
... ...
... ... @@ -53,6 +53,7 @@ datasources:
- com.yohoufo.dal.product.BidStoragePriceMapper
- com.yohoufo.dal.product.SizePoolMapper
- com.yohoufo.dal.product.SizePoolDetailMapper
- com.yohoufo.dal.product.ProductExtMapper
ufo_order:
... ...
... ... @@ -55,6 +55,7 @@ datasources:
- com.yohoufo.dal.product.BidStoragePriceMapper
- com.yohoufo.dal.product.SizePoolMapper
- com.yohoufo.dal.product.SizePoolDetailMapper
- com.yohoufo.dal.product.ProductExtMapper
ufo_order:
username: ${jdbc.mysql.cobar.username}
... ...