| | |
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.UserMsgVO;
|
| | |
| | | contentList.add(new ClientTextStyleVO("206089388856584237", "#000000"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", "#888888"), contentList));
|
| | |
|
| | | contentList.clear();
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("共", "#000000"));
|
| | | contentList.add(new ClientTextStyleVO("1", "#E5005C"));
|
| | | contentList.add(new ClientTextStyleVO("件商品", "#000000"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("商品数量", "#888888"), contentList));
|
| | |
|
| | | contentList.clear();
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("邀请订单", "#000000"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单类型", "#888888"), contentList));
|
| | |
|
| | | contentList.clear();
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("已付款", "#E5005C"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单状态", "#888888"), contentList));
|
| | |
|
| | | contentList.clear();
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥58", "#E5005C"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("付款金额", "#888888"), contentList));
|
| | |
|
| | | contentList.clear();
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("¥0.36", "#E5005C"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("邀请奖金", "#888888"), contentList));
|
| | |
|
| | | contentList.clear();
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO("无", "#000000"));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", "#888888"), contentList));
|
| | |
|
| | | list.add(new UserMsgVO("http://ec-1255749512.file.myqcloud.com/resource/portrait.png", "订单消息", new Date(),
|
| | | items));
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<Date>() {
|
| | | builder.registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | | return new JsonPrimitive("今天 10:25");
|
| | | }
|
| | | }
|
| | | });
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("data", builder.create().toJson(list));
|
| | | root.put("count", 1);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请消息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param page
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "getInviteMsgList", method = RequestMethod.POST)
|
| | | public void getInviteMsgList(AcceptData acceptData, Long uid, int page, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<UserMsgVO> list = new ArrayList<>();
|
| | |
|
| | | for (int i = 0; i < 20; i++) {
|
| | | MsgInviteDetail detail = new MsgInviteDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | ThreeSale ts = new ThreeSale();
|
| | | UserInfo worker = new UserInfo(438965L);
|
| | | worker.setPortrait("https://g2.ykimg.com/051400005A38ADC2ADBAC3A4BB0C648E");
|
| | | worker.setNickName("呵呵");
|
| | | ts.setWorker(worker);
|
| | | detail.setInviteUser(ts);
|
| | | detail.setDesc("恭喜你,有新队员加入你的队列,若对方60天内未激活将会与你脱离邀请关系");
|
| | | detail.setBeiZhu("无");
|
| | | detail.setMsgType(MsgTypeInviteTypeEnum.invite);
|
| | | list.add(UserMsgVOFactory.create(detail));
|
| | | }
|
| | |
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|