fanli/src/main/java/com/yeshi/fanli/controller/client/v1/CommonContentController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
fanli/src/main/java/com/yeshi/fanli/exception/integral/IntegralGetException.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
fanli/src/main/java/com/yeshi/fanli/service/inter/integral/IntegralGetService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/CommonContentController.java
@@ -20,6 +20,7 @@ import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra; import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService; import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService; @@ -107,7 +108,13 @@ pro = new BigDecimal(100); List<TaoBaoGoodsBrief> goodsList = result.getGoodsList(); for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), ""))); TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, pro.toString(), ""); if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品 { extra.getTaoBaoHongBaoInfo().setRate("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief)); extra.getTaoBaoHongBaoInfo().setHongbao(TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief)); } array.add(gson.toJson(extra)); } root.put("goodsList", array); root.put("goodsCount", result.getCount()); fanli/src/main/java/com/yeshi/fanli/controller/client/v2/CommonContentControllerV2.java
@@ -35,6 +35,8 @@ import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; import com.yeshi.fanli.util.taobao.TaoBaoUtil; import com.yeshi.fanli.vo.goods.GoodsDetailVO; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -63,7 +65,6 @@ @Resource private PDDCommonTemplateContentService pddCommonTemplateContentService; /** * 通用模板导航 @@ -105,7 +106,8 @@ * @param out */ @RequestMapping(value = "getNavGoodsList", method = RequestMethod.POST) public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid, PrintWriter out) { public void getNavContent(AcceptData acceptData, String key, Integer type, Integer page, String cid, PrintWriter out) { if (StringUtil.isNullOrEmpty(key)) { out.print(JsonUtil.loadFalseResult(1, "请传入Key")); return; @@ -133,7 +135,6 @@ out.print(JsonUtil.loadFalseResult("goodsType参数不正确")); } private void getListTB(AcceptData acceptData, String key, Integer page, String cid, PrintWriter out) { CommonContentResult result = commonTemplateContentService.getContentList(CommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE); @@ -150,8 +151,15 @@ List<TaoBaoGoodsBrief> goodsList = result.getGoodsList(); BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); BigDecimal shareRate = hongBaoManageService.getShareRate(); for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { array.add(gson.toJson(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate))); GoodsDetailVO vo = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate); if (CommonContentTypeEnum.valueOf(key) == CommonContentTypeEnum.mianDan)// 免单商品 { vo.getMoneyInfo().setFanliMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief)); vo.getMoneyInfo().setShareMoney("¥" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoGoodsBrief)); } array.add(gson.toJson(vo)); } root.put("list", array); @@ -159,9 +167,9 @@ out.print(JsonUtil.loadTrueResult(root)); } /** * 京东通用专题模板 * * @param acceptData * @param key * @param page @@ -175,7 +183,8 @@ data.put("bannerList", new Gson().toJson(bannerList)); } JDSearchResult result = jdCommonTemplateContentService.getContentList(JDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE); JDSearchResult result = jdCommonTemplateContentService.getContentList(JDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE); JSONArray array = new JSONArray(); long count = 0; @@ -202,9 +211,9 @@ out.print(JsonUtil.loadTrueResult(data)); } /** * 拼多多通用专题模板 * * @param acceptData * @param key * @param page @@ -227,7 +236,8 @@ data.put("bannerList", new Gson().toJson(bannerList)); } PDDGoodsResult result = pddCommonTemplateContentService.getContentList(PDDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE); PDDGoodsResult result = pddCommonTemplateContentService.getContentList(PDDCommonContentTypeEnum.valueOf(key), cid, page, Constant.PAGE_SIZE); JSONArray array = new JSONArray(); long count = 0; if (result != null) { fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RecommendControllerV2.java
@@ -324,13 +324,12 @@ JSONObject root = new JSONObject(); JSONArray array = new JSONArray(); array.add( "https://gw.alicdn.com/bao/uploaded/i2/72768346/O1CN01rwRcUH2BWW6oc01hd_!!0-item_pic.jpg_180x180xz.jpg_.webp"); "http://img.flqapp.com/resource/integral/integral_home_icon_2.png"); array.add( "https://gw.alicdn.com/bao/uploaded/i2/479184430/O1CN01HjEq4j1iaz7HbWeX9_!!479184430.jpg_180x180xz.jpg_.webp"); "http://img.flqapp.com/resource/integral/integral_home_icon_1.png"); root.put("imgList", array); JSONObject params = new JSONObject(); params.put("url", configService.get("spike_goods_link")); params.put("balanceMore", true); root.put("params", params); root.put("jumpDetail", jumpDetailV2Service.getByTypeCache("integralExchange", Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()))); fanli/src/main/java/com/yeshi/fanli/exception/integral/IntegralGetException.java
New file @@ -0,0 +1,32 @@ package com.yeshi.fanli.exception.integral; public class IntegralGetException extends Exception { /** * */ private static final long serialVersionUID = 1L; private int code; private String msg; public int getCode() { return code; } public String getMsg() { return msg; } public IntegralGetException(int code, String msg) { this.code = code; this.msg = msg; } public IntegralGetException() { } @Override public String getMessage() { return this.msg; } } fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralGetServiceImpl.java
New file @@ -0,0 +1,89 @@ package com.yeshi.fanli.service.impl.integral; import org.springframework.stereotype.Service; import com.yeshi.fanli.exception.integral.IntegralGetException; import com.yeshi.fanli.service.inter.integral.IntegralGetService; import net.sf.json.JSONObject; @Service public class IntegralGetServiceImpl implements IntegralGetService { @Override public void addEventStatistic(Long uid, String event, JSONObject params) throws IntegralGetException { switch (event) { case "recommendSearch": break; case "shareInvite": break; case "inShop": break; case "scanPush": break; case "scanGoods": break; case "scanHomeBanner": break; case "scanSpecial": break; case "scanTBCart": break; } } @Override public void addRecommendSearch(Long uid) throws IntegralGetException { // TODO Auto-generated method stub } @Override public void addSearchResultScan(Long uid) throws IntegralGetException { // TODO Auto-generated method stub } @Override public void addShareInvite(Long uid) throws IntegralGetException { // TODO Auto-generated method stub } @Override public void addIntoShop(Long uid) throws IntegralGetException { // TODO Auto-generated method stub } @Override public void addScanPushHistory(Long uid) throws IntegralGetException { // TODO Auto-generated method stub } @Override public void addScanGoodsDetail(Long uid, int goodsType, Long goodsId) { // TODO Auto-generated method stub } @Override public void addScanRecommendBanner(Long uid) { // TODO Auto-generated method stub } @Override public void addScanRecommendSpecial(Long uid) { // TODO Auto-generated method stub } @Override public void addScanTaoBaoCart(Long uid) { // TODO Auto-generated method stub } } fanli/src/main/java/com/yeshi/fanli/service/inter/integral/IntegralGetService.java
New file @@ -0,0 +1,97 @@ package com.yeshi.fanli.service.inter.integral; import com.yeshi.fanli.exception.integral.IntegralGetException; import net.sf.json.JSONObject; /** * 金币获取服务 * * @author Administrator * */ public interface IntegralGetService { /** * 添加事件统计 * * @param uid * @param params * 事件相关参数 * @param event * 事件编码 * @throws IntegralGetException */ public void addEventStatistic(Long uid, String event, JSONObject params) throws IntegralGetException; /** * 从粘贴板推荐进入搜索结果 * * @param uid * @throws IntegralGetException */ public void addRecommendSearch(Long uid) throws IntegralGetException; /** * 搜索结果浏览 * * @param uid * @throws IntegralGetException */ public void addSearchResultScan(Long uid) throws IntegralGetException; /** * 分享邀请图 * * @param uid * @throws IntegralGetException */ public void addShareInvite(Long uid) throws IntegralGetException; /** * 进入店铺 * * @param uid * @throws IntegralGetException */ public void addIntoShop(Long uid) throws IntegralGetException; /** * 推送记录页浏览 * * @param uid * @throws IntegralGetException */ public void addScanPushHistory(Long uid) throws IntegralGetException; /** * 商品详情页浏览 * * @param uid * @param goodsType * @param goodsId */ public void addScanGoodsDetail(Long uid, int goodsType, Long goodsId); /** * 推荐banner浏览 * * @param uid */ public void addScanRecommendBanner(Long uid); /** * 推荐专题浏览 * * @param uid */ public void addScanRecommendSpecial(Long uid); /** * 淘宝购物车浏览 * * @param uid */ public void addScanTaoBaoCart(Long uid); }