| @@ -61,4 +61,7 @@ public interface TtCouponService { | |||||
| ResultData auditRejected(Long id); | ResultData auditRejected(Long id); | ||||
| int addSeeCount(Long id); | |||||
| int addSellCount(Long id); | |||||
| } | } | ||||
| @@ -276,4 +276,14 @@ public class TtCouponServiceImpl implements TtCouponService { | |||||
| ttCouponMapper.updateById(byId); | ttCouponMapper.updateById(byId); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @Override | |||||
| public int addSeeCount(Long id) { | |||||
| return ttCouponMapper.addSeeCount(id); | |||||
| } | |||||
| @Override | |||||
| public int addSellCount(Long id) { | |||||
| return ttCouponMapper.addSellCount(id); | |||||
| } | |||||
| } | } | ||||
| @@ -114,6 +114,7 @@ public class TtOrderServiceImpl implements TtOrderService { | |||||
| order.setCreateDate(now); | order.setCreateDate(now); | ||||
| order.setUpdateDate(now); | order.setUpdateDate(now); | ||||
| ttOrderMapper.insert(order); | ttOrderMapper.insert(order); | ||||
| ttCouponService.addSellCount(coupon.getId()); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -40,7 +40,8 @@ public class SignUtils { | |||||
| if ("MD5".equals(signMethod)) { | if ("MD5".equals(signMethod)) { | ||||
| return getMD5(signStr.toString()); | return getMD5(signStr.toString()); | ||||
| } else { | } else { | ||||
| return getSHA(signStr.toString()); | |||||
| // return getSHA(signStr.toString()); | |||||
| return encrypt(signStr.toString(),signMethod); | |||||
| } | } | ||||
| } | } | ||||
| @@ -147,27 +147,27 @@ | |||||
| </delete> | </delete> | ||||
| <update id="addSeeCount" parameterType="Long"> | <update id="addSeeCount" parameterType="Long"> | ||||
| update tt_coupon SET see_count = see_count+1, update_date=now() where id = #{id} | |||||
| update tt_coupon SET see_count = see_count+1,popularity = popularity+1, update_date=now() where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="addSellCount" parameterType="Long"> | <update id="addSellCount" parameterType="Long"> | ||||
| update tt_coupon SET sell_count = sell_count+1, false_sell_count = false_sell_count+1, update_date=now() where id = #{id} | |||||
| update tt_coupon SET sell_count = sell_count+1,popularity = popularity+20, false_sell_count = false_sell_count+1, update_date=now() where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="reduceSellCount" parameterType="Long"> | <update id="reduceSellCount" parameterType="Long"> | ||||
| update tt_coupon SET sell_count = sell_count-1, false_sell_count = false_sell_count-1, update_date=now() where id = #{id} | |||||
| update tt_coupon SET sell_count = sell_count-1,popularity = popularity-20, false_sell_count = false_sell_count-1, update_date=now() where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="addAssessCount" parameterType="Long"> | <update id="addAssessCount" parameterType="Long"> | ||||
| update tt_coupon SET assess_count = assess_count+1, update_date=now() where id = #{id} | |||||
| update tt_coupon SET assess_count = assess_count+1,popularity = popularity+10, update_date=now() where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="addCollectCount" parameterType="Long"> | <update id="addCollectCount" parameterType="Long"> | ||||
| update tt_coupon SET collect_count = collect_count+1, update_date=now() where id = #{id} | |||||
| update tt_coupon SET collect_count = collect_count+1,popularity = popularity+5, update_date=now() where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="reduceCollectCount" parameterType="Long"> | <update id="reduceCollectCount" parameterType="Long"> | ||||
| update tt_coupon SET collect_count = collect_count-1, update_date=now() where id = #{id} | |||||
| update tt_coupon SET collect_count = collect_count-1,popularity = popularity-5, update_date=now() where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="addPopularity" parameterType="java.util.HashMap"> | <update id="addPopularity" parameterType="java.util.HashMap"> | ||||
| @@ -72,7 +72,7 @@ public class VideoController extends BaseController { | |||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| @GetMapping(value = "/uploadProgress") | @GetMapping(value = "/uploadProgress") | ||||
| @ApiOperation("上传视频进度") | |||||
| @ApiOperation("上传视频进度大小") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData uploadProgress(String videoId) { | public ResultData uploadProgress(String videoId) { | ||||
| @@ -93,7 +93,7 @@ public class VideoController extends BaseController { | |||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| @GetMapping(value = "/videoContentLength") | @GetMapping(value = "/videoContentLength") | ||||
| @ApiOperation("上传视频进度") | |||||
| @ApiOperation("上传视频大小") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData videoContentLength(String videoId) { | public ResultData videoContentLength(String videoId) { | ||||
| @@ -114,7 +114,7 @@ public class VideoController extends BaseController { | |||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| @GetMapping(value = "/videoDetial") | @GetMapping(value = "/videoDetial") | ||||
| @ApiOperation("上传视频进度") | |||||
| @ApiOperation("上传视频详情") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData videoDetial(String videoId) { | public ResultData videoDetial(String videoId) { | ||||
| @@ -18,6 +18,12 @@ | |||||
| <version>1.0</version> | <version>1.0</version> | ||||
| </dependency> | </dependency> | ||||
| <dependency> | |||||
| <groupId>com.iformall</groupId> | |||||
| <artifactId>mallinkVideo</artifactId> | |||||
| <version>1.0</version> | |||||
| </dependency> | |||||
| </dependencies> | </dependencies> | ||||
| <build> | <build> | ||||
| <plugins> | <plugins> | ||||
| @@ -8,6 +8,8 @@ import com.iformall.enums.EnumTtCouponStatus; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.tt.TtCouponService; | import com.iformall.service.tt.TtCouponService; | ||||
| import com.iformall.video.VideoFactory; | |||||
| import com.iformall.video.entity.VideUploadResult; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -30,6 +32,12 @@ public class TtCouponController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| @Autowired | |||||
| private VideoFactory videoFactory; | |||||
| @Autowired | |||||
| String videoType; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -50,9 +58,25 @@ public class TtCouponController extends BaseController { | |||||
| if (id == null) { | if (id == null) { | ||||
| return new ResultData(ResultData.ERROR, "缺少id"); | return new ResultData(ResultData.ERROR, "缺少id"); | ||||
| } | } | ||||
| ttCouponService.addSeeCount(id); | |||||
| return new ResultData(ttCouponService.detail(id)); | return new ResultData(ttCouponService.detail(id)); | ||||
| } | } | ||||
| @GetMapping(value = "/videoDetial") | |||||
| @ApiOperation("上传视频详情") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | |||||
| public ResultData videoDetial(String videoId) { | |||||
| try { | |||||
| VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetail(videoId); | |||||
| return new ResultData(videoDetail); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||||
| } | |||||
| } | |||||
| @ApiOperation("是否收藏") | @ApiOperation("是否收藏") | ||||
| @GetMapping("/iscollect") | @GetMapping("/iscollect") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| @@ -160,10 +160,15 @@ alipay: | |||||
| callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | ||||
| video: | video: | ||||
| aliyun: | |||||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| regionId: cn-beijing | |||||
| aliyun: | |||||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| regionId: cn-beijing | |||||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||||
| corePoolSize: 6 | |||||
| maxPoolSize: 20 | |||||
| queueCapacity: 1000 | |||||
| namePrefix: aliyun-video-upload | |||||
| jasypt: | jasypt: | ||||
| encryptor: | encryptor: | ||||
| @@ -119,10 +119,15 @@ alipay: | |||||
| callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | callback: https://callbacktest.malls.iformall.com/api/alipay/notify/callback | ||||
| video: | video: | ||||
| aliyun: | |||||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| regionId: cn-beijing | |||||
| aliyun: | |||||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| regionId: cn-beijing | |||||
| endPoint: https://oss-cn-beijing.aliyuncs.com | |||||
| corePoolSize: 6 | |||||
| maxPoolSize: 20 | |||||
| queueCapacity: 1000 | |||||
| namePrefix: aliyun-video-upload | |||||
| fm: | fm: | ||||
| exception: true | exception: true | ||||