| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenIOS;
|
| | | import com.yeshi.fanli.entity.push.PushGoods;
|
| | |
| | | import com.yeshi.fanli.entity.push.PushGoodsRecord;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.exception.push.PushGoodsGroupException;
|
| | | import com.yeshi.fanli.goods.CommonGoods;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.JumpDetailParamsFactory;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping(value = "api/v1/push")
|
| | |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "/gethistory"/*, method = RequestMethod.POST*/)
|
| | | public void getHistory(AcceptData acceptData, String deviceToken, int page, PrintWriter out) {
|
| | | @RequestMapping(value = "/gethistory", method = RequestMethod.POST)
|
| | | public void getHistory(AcceptData acceptData, Long uid, String deviceToken, int page, PrintWriter out) {
|
| | |
|
| | | long count = 0;
|
| | | List<PushGoods> list = null;
|
| | |
| | |
|
| | | // 设备注册时间
|
| | | Date createTime = deviceActive.getCreateTime();
|
| | | count = PushGoodsService.countHistoryByPushTime(createTime);
|
| | | count = PushGoodsService.countHistoryByPushTime(uid, createTime);
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | list = PushGoodsService.listHistoryByPushTime((page - 1) * pageSize, pageSize, createTime);
|
| | | list = PushGoodsService.listHistoryByPushTime((page - 1) * pageSize, pageSize, uid, createTime);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (PushGoods pushGoods : list) {
|
| | | JSONObject result = new JSONObject();
|
| | |
| | |
|
| | | result.put("picture", picture);
|
| | |
|
| | | String fontColor1 = "#888888";
|
| | | String fontColor2 = "#F14242";
|
| | | String fontColor1 = "#666666";
|
| | | String fontColor2 = "#E5005C";
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | |
|
| | |
|
| | | JSONObject contentJson1 = new JSONObject();
|
| | | contentJson1.put("color", fontColor1);
|
| | | contentJson1.put("content", "本次推送共");
|
| | | contentJson1.put("content", "本次推荐共");
|
| | |
|
| | | JSONObject contentJson2 = new JSONObject();
|
| | | contentJson2.put("color", fontColor2);
|