| | |
| | |
|
| | |
|
| | | /**
|
| | | * 网页推送
|
| | | * 商品推送
|
| | | *
|
| | | * @param id 推送id
|
| | | * @param out
|
| | | * @throws Exception
|
| | | */
|
| | | @RequestMapping(value = "push")
|
| | | public void push(String callback, Long id, PrintWriter out) throws Exception {
|
| | | public void push(String callback, String idArray, PrintWriter out) throws Exception {
|
| | |
|
| | | if (id == null) {
|
| | | if (idArray == null || idArray.trim().length() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | pushGoodsService.executePush(id);
|
| | | |
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | |
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | for (Long id: list) {
|
| | | pushGoodsService.executePush(id);
|
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | |
|