| | |
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.suning.SuningUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopUtil;
|
| | | import com.yeshi.fanli.vo.elme.ElemeConvertInfoResultVO;
|
| | | import com.yeshi.fanli.vo.homemodule.FloatImgDetailVO;
|
| | |
|
| | |
| | | if (uid != null && uid == 0L)
|
| | | uid = null;
|
| | |
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg();
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg(acceptData.getSystem());
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) {
|
| | | appHomeFloatImg = null;
|
| | | }
|
| | |
| | | data.put("floatImg", appHomeFloatImg);
|
| | | }
|
| | |
|
| | | String notifyImg = configService.getAppHomeFloatNotifyImg();
|
| | | String notifyImg = configService.getAppHomeFloatNotifyImg(acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.get(ConfigKeyEnum.taobaoCouponHelp.getKey());
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(),acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | |
|
| | | // 底部网页链接
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | data.put("htmlLink", configService.get(ConfigKeyEnum.indexHtmlLinkAndroid.getKey()));
|
| | | data.put("htmlLink", configService.getValue(ConfigKeyEnum.indexHtmlLinkAndroid.getKey(),acceptData.getSystem()));
|
| | | }
|
| | |
|
| | | // 判断新老用户
|
| | |
| | | data.put("userTimeType", 1);
|
| | | }
|
| | | data.put("hotFuctionLink", configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform,
|
| | | Integer.parseInt(acceptData.getVersion())));
|
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | List<FloatAD> listAD = new ArrayList<FloatAD>();
|
| | | List<FloatImgDetailVO> listVO = new ArrayList<FloatImgDetailVO>();
|
| | | List<FloatAD> list = floatADService.getValidFloatADCache(FloatAD.POSITION_INDEX, null, platform,
|
| | | Integer.parseInt(version));
|
| | | Integer.parseInt(version),acceptData.getSystem());
|
| | | if (list != null && !list.isEmpty())
|
| | | listAD.addAll(list);
|
| | |
|
| | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("listAD", JsonUtil.getApiCommonGson().toJson(listVO));
|
| | | data.put("protocol", configService.get(ConfigKeyEnum.userProtocolHomeData.getKey()));
|
| | | data.put("protocol", configService.getValue(ConfigKeyEnum.userProtocolHomeData.getKey(),acceptData.getSystem()));
|
| | |
|
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.get(ConfigKeyEnum.taobaoCouponHelp.getKey());
|
| | | String couponHelp = configService.getValue(ConfigKeyEnum.taobaoCouponHelp.getKey(),acceptData.getSystem());
|
| | | data.put("couponHelpUrl", couponHelp);
|
| | |
|
| | | // 判断新老用户 显示热门功能按钮滑动
|
| | |
| | |
|
| | | // 是否显示热门功能按钮
|
| | | data.put("hotFuctionLink",
|
| | | configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(version)));
|
| | | configService.getByVersion(ConfigKeyEnum.hotFunctionUrl.getKey(), platform, Integer.parseInt(version),acceptData.getSystem()));
|
| | | if (StringUtil.isNullOrEmpty(callback))
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | else
|
| | |
| | | }
|
| | |
|
| | | // 是否需要购物城转链
|
| | | boolean convert = "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoCartConvert.getKey())) ? false
|
| | | boolean convert = "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoCartConvert.getKey(),acceptData.getSystem())) ? false
|
| | | : true;
|
| | |
|
| | | if (!"cart".equalsIgnoreCase(position) && !convert) {
|
| | |
| | | clientTBPid = tbPidService.getAndroidDefault();
|
| | | }
|
| | |
|
| | | String cartJS = configService.get(ConfigKeyEnum.taobaoCartJS.getKey());
|
| | | String cartUrl = configService.get(ConfigKeyEnum.taobaoCartLink.getKey());
|
| | | String cartJS = configService.getValue(ConfigKeyEnum.taobaoCartJS.getKey(),acceptData.getSystem());
|
| | | String cartUrl = configService.getValue(ConfigKeyEnum.taobaoCartLink.getKey(),acceptData.getSystem());
|
| | | if (!convert)// 不转链
|
| | | {
|
| | | cartUrl = "http://";
|
| | |
| | |
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | |
|
| | | } else if (url != null && (url.contains(".vip.com"))) {// 唯品会
|
| | | String goodsId = VipShopUtil.parseGoodsIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(goodsId))// 不能拦截详情页面,防止前端进入死循环
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && (url.contains(".suning.com"))) {// 苏宁
|
| | | String goodsId = SuningUtil.parseGoodsIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(goodsId))// 不能拦截详情页面,防止前端进入死循环
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && ((url.contains("yangkeduo.com") && !url.contains("yangkeduo.com/goods.html?")
|
| | | && !url.contains("yangkeduo.com/duo_coupon_landing.html?"))
|
| | | || (url.startsWith("https://p.pinduoduo.com/")))) {
|
| | |
| | | @RequestMapping(value = "getWebJS", method = RequestMethod.POST)
|
| | | public void getWebJS(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | String urlIdJS = configService.get("url_extract_id");
|
| | | String urlIdJS = configService.getValue("url_extract_id",acceptData.getSystem());
|
| | | data.put("urlIdJSMD5", StringUtil.Md5(urlIdJS));
|
| | | data.put("urlIdJS", AESUtil.encrypt(urlIdJS, Constant.UIDAESKEY));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | * 获取账号绑定中的配置信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "getBindAccountConfig", method = RequestMethod.POST)
|
| | | public void getBindAccountConfig(AcceptData acceptData, PrintWriter out) {
|
| | | String alipayHelpUrl = configService.get(ConfigKeyEnum.alipayHelp.getKey());// 支付宝帮助
|
| | | String alipayBindFailUrl = configService.get(ConfigKeyEnum.alipayBindFailReason.getKey());// 支付宝绑定失败原因
|
| | | String alipayHelpUrl = configService.getValue(ConfigKeyEnum.alipayHelp.getKey(),acceptData.getSystem());// 支付宝帮助
|
| | | String alipayBindFailUrl = configService.getValue(ConfigKeyEnum.alipayBindFailReason.getKey(),acceptData.getSystem());// 支付宝绑定失败原因
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("alipayHelp", alipayHelpUrl);
|
| | | data.put("alipayBindFailReason", alipayBindFailUrl);
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | // 测试
|
| | | data.put("showTaoBaoOrder",
|
| | | "0".equalsIgnoreCase(configService.get(ConfigKeyEnum.showTaobaoOrder.getKey()).trim()) ? false : true);
|
| | | "0".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.showTaobaoOrder.getKey(),acceptData.getSystem()).trim()) ? false : true);
|
| | | data.put("taoBaoOrderUrl", "https://main.m.taobao.com/olist/index.html");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | @RequestMapping(value = "getKeFuConfig", method = RequestMethod.POST)
|
| | | public void getKeFuConfig(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.get(ConfigKeyEnum.kefuMeiqia.getKey())) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | data.put("meiqia", "1".equalsIgnoreCase(configService.getValue(ConfigKeyEnum.kefuMeiqia.getKey(),acceptData.getSystem())) ? true : false);// 是否跳转美洽,不跳转美洽就用原来的
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // 设置消息已读
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
| | | @RequestMapping(value = "getInviteCodeInputHelp", method = RequestMethod.POST)
|
| | | public void getInviteCodeInputHelp(AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("helpUrl", configService.get(ConfigKeyEnum.inviteCodeInputHelp.getKey()));
|
| | | data.put("helpUrl", configService.getValue(ConfigKeyEnum.inviteCodeInputHelp.getKey(),acceptData.getSystem()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | else
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @RequestMapping(value = "getKouBeiLink")
|
| | | public void getKouBeiLink(AcceptData acceptData, Long uid, String activityId, boolean share, boolean shareImg,
|
| | | String callback, PrintWriter out) {
|
| | |
| | |
|
| | | if (dto != null) {
|
| | | if (share) {// 生成口令
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑",dto.getClick_url() );
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑", dto.getClick_url());
|
| | | dto.setToken(TaoBaoUtil.filterTaoToken(token));
|
| | | }
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(dto), 60 * 60);// 缓存1个小时
|
| | |
| | | public void userProtocolListen(AcceptData acceptData, Long uid, int type, PrintWriter out) {
|
| | | LogHelper.userProtocolListen(String.format("%s#%s#%s", acceptData.getDevice(), uid, type));
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 是否显示广告
|
| | | * @Title: showAd
|
| | | * @Description: |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out |
| | | * void 返回类型
|
| | | * @throws
|
| | | */
|
| | | @RequestMapping(value = "getShowAd")
|
| | | public void showAd(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | String value = configService.getValue(ConfigKeyEnum.showSplashAd.getKey(),acceptData.getSystem());
|
| | | boolean huaweiShowAd = true;
|
| | | if ("huawei".equalsIgnoreCase(acceptData.getChannel())) {
|
| | | String version = configService.getValue(ConfigKeyEnum.huaweiOnLineVersionCode.getKey(),acceptData.getSystem());
|
| | | if (!StringUtil.isNullOrEmpty(version)) {
|
| | | if (Integer.parseInt(version) == Integer.parseInt(acceptData.getVersion())) {
|
| | | huaweiShowAd = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if ("0".equalsIgnoreCase(value.trim())) {
|
| | | data.put("show", false);
|
| | | } else {
|
| | | if (huaweiShowAd)
|
| | | data.put("show", true);
|
| | | else
|
| | | data.put("show", false);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取注销协议
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getLogoutProtocol")
|
| | | public void getLogoutProtocol(String callback, AcceptData acceptData, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", configService.getValue(ConfigKeyEnum.accountLogoutProtocolLink.getKey(),acceptData.getSystem()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|