| | |
| | | public final static int URL = 2; // 网页推送
|
| | | public final static int DETAIL = 3; // 详情推送
|
| | | public final static int ZNX = 4; // 站内推送
|
| | | public final static int WEEX = 5; // 站内推送
|
| | | public final static int BAICHUAN = 6; // 站内推送
|
| | |
|
| | | @Resource
|
| | | private PushRecordService pushRecordService;
|
| | |
| | | * @param out
|
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "convertLink", method = RequestMethod.POST)
|
| | | public void convertLink(String url, PrintWriter out) throws Exception {
|
| | | @RequestMapping(value = "convertLink")
|
| | | public void convertLink(String callback, String url, PrintWriter out) {
|
| | |
|
| | | String shortLink = org.yeshi.utils.HttpUtil.getShortLink(url);
|
| | | if (StringUtil.isNullOrEmpty(url)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("转链数据不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | String shortLink = org.yeshi.utils.HttpUtil.getShortLink(url);
|
| | |
|
| | | JSONObject jsonData = new JSONObject();
|
| | | jsonData.put("url", url);
|
| | | jsonData.put("shortLink", shortLink);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(jsonData));
|
| | |
|
| | | JSONObject jsonData = new JSONObject();
|
| | | jsonData.put("url", url);
|
| | | jsonData.put("shortLink", shortLink);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(jsonData));
|
| | | |
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("转换失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * |
| | | * 方法说明: 百川推送 -(新后台)
|
| | | * |
| | | * @param uId
|
| | | * @param title
|
| | | * @param content
|
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "pushBaiChuan")
|
| | | public void pushBaiChuan(String callback, Long uid, String title, String content, String url, |
| | | PrintWriter out) {
|
| | | |
| | | if (StringUtil.isNullOrEmpty(title) || StringUtil.isNullOrEmpty(content)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请填写标题与内容"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | pushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | | |
| | | } catch (PushException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("推送失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | }
|