| | |
| | | */
|
| | | @RequestMapping(value = "push")
|
| | | public void push(String callback, String idArray, PrintWriter out) throws Exception {
|
| | |
|
| | | if (idArray == null || idArray.trim().length() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | |
| | | 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.handPush(id);
|
| | | }
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("推送成功"));
|
| | | |
| | | } catch (PushException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (PushGoodsException e) {
|