| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil; |
| | | import com.yeshi.fanli.vo.common.WXXCXJumpInfoVO; |
| | | import com.yeshi.fanli.vo.pdd.PDDConvertLinkResultVO; |
| | | import com.yeshi.fanli.vo.pdd.PDDJumpLinkVO; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.JsonUtil; |
| | |
| | | * 热销榜 |
| | | * |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Controller |
| | | @RequestMapping("api/v2/pdd") |
| | |
| | | private PDDGoodsService pddGoodsService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 拼多多专题分类 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getClass") |
| | | public void getJDClass(AcceptData acceptData, PrintWriter out) { |
| | | public void getClass(AcceptData acceptData, PrintWriter out) { |
| | | JSONObject root = new JSONObject(); |
| | | root.put("list", pddGoodsService.getSpecialClass()); |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | |
| | | |
| | | /** |
| | | * 拼多多专题 |
| | | * |
| | | * @param acceptData |
| | | * @param out |
| | | */ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "getAuthJumpInfo") |
| | | public void getAuthJumpInfo(AcceptData acceptData, Long uid, int type, PrintWriter out) { |
| | | if (uid == null || uid == 0L) { |
| | | out.print(JsonUtil.loadFalseResult("请先登录")); |
| | | return; |
| | | } |
| | | String pid = null; |
| | | //自购 |
| | | if (type == 1) { |
| | | pid = PinDuoDuoApiUtil.PID_FANLI; |
| | | } else {//分享 |
| | | pid = PinDuoDuoApiUtil.PID_SHARE; |
| | | } |
| | | |
| | | PDDConvertLinkResultVO authLink = PinDuoDuoApiUtil.getAuthLink(pid, PinDuoDuoUtil.getCustomParams(uid)); |
| | | |
| | | PDDJumpLinkVO pddJumpLinkVO = new PDDJumpLinkVO(); |
| | | |
| | | pddJumpLinkVO.set_native(true); |
| | | pddJumpLinkVO.setJumpLink(authLink.getMobile_url()); |
| | | pddJumpLinkVO.setNativeJumpLink(PinDuoDuoUtil.getAndroidNativeURI(authLink.getMobile_url())); |
| | | if (authLink.getWe_app_info() != null) { |
| | | WXXCXJumpInfoVO wxxcxJumpInfoVO = new WXXCXJumpInfoVO(); |
| | | wxxcxJumpInfoVO.setUserName(authLink.getWe_app_info().getUser_name()); |
| | | wxxcxJumpInfoVO.setPath(authLink.getWe_app_info().getPage_path()); |
| | | pddJumpLinkVO.setWxxcxJumpInfo(wxxcxJumpInfoVO); |
| | | } |
| | | |
| | | JSONObject data = JSONObject.fromObject(new Gson().toJson(pddJumpLinkVO)); |
| | | data.put("native", pddJumpLinkVO.is_native()); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | } |