admin
2020-05-06 24a8d17e007545f7426c48352109aa1a9c6587ee
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java
@@ -28,10 +28,11 @@
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO("",ClientTextStyleVO.COLOR_CONTENT, portrait));
      contentList.add(new ClientTextStyleVO("、" + nickName, ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("直接粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
      contentList.add(new ClientTextStyleVO("&" + nickName, ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("粉丝信息", ClientTextStyleVO.COLOR_TITLE),contentList));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("粉丝类别", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("直接粉丝", ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("加入时间", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
@@ -60,11 +61,11 @@
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("恭喜你!团队增加直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO("",ClientTextStyleVO.COLOR_CONTENT, portrait));
      contentList.add(new ClientTextStyleVO("、" + nickName, ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("间接粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
      contentList.add(new ClientTextStyleVO("&" + nickName, ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("粉丝信息", ClientTextStyleVO.COLOR_TITLE),contentList));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("粉丝类别", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("间接粉丝", ClientTextStyleVO.COLOR_CONTENT)));
      List<ClientTextStyleVO> contentList2 = new ArrayList<>();
      contentList2.add(new ClientTextStyleVO("由直接粉丝", ClientTextStyleVO.COLOR_CONTENT));
      contentList2.add(new ClientTextStyleVO(inviteName,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
@@ -94,12 +95,12 @@
    * @param time
    * @return
    */
   public static MsgInviteDetail fansUpgrade(Long uid, String relation, String rankName, String nickName, String item,   Date time) {
   public static MsgInviteDetail fansUpgrade(Long uid, String rankName, String nickName, String item, Date time) {
      if (nickName == null || uid == null || item == null || time == null)
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("恭喜你!你的" + relation + ":", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO("恭喜你!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
      contentList.add(new ClientTextStyleVO("已升级为", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(rankName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
@@ -117,159 +118,6 @@
      MsgInviteDetail detail = new MsgInviteDetail();
      detail.setCreateTime(new Date());
      detail.setMsgType(MsgTypeInviteTypeEnum.fansUpgrade);
      detail.setRead(false);
      detail.setUser(new UserInfo(uid));
      detail.setExtraInfo(new Gson().toJson(listMsg));
      return detail;
   }
   /**
    * 直接粉丝脱离-开始脱离提醒
    * @param uid
    * @param rankName
    * @param nickName
    * @param item
    * @param time
    * @return
    */
   public static MsgInviteDetail fansPreDivorced(Long uid, String rankName, String nickName, String item, Date time) {
      if (nickName == null || uid == null || item == null || time == null)
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("很抱歉!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
      contentList.add(new ClientTextStyleVO("已升级为", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(rankName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("你还不是会员,即日起你需要在60天内升级为任意会员", ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("可在【\"我的-我的粉丝\"】中查看脱离剩余时间", ClientTextStyleVO.COLOR_CONTENT)));
      MsgInviteDetail detail = new MsgInviteDetail();
      detail.setCreateTime(new Date());
      detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
      detail.setRead(false);
      detail.setUser(new UserInfo(uid));
      detail.setExtraInfo(new Gson().toJson(listMsg));
      return detail;
   }
   /**
    * 间接粉丝脱离-开始脱离提醒
    * @param uid
    * @param rankName
    * @param nickName
    * @param fansName
    * @param item
    * @param time
    * @return
    */
   public static MsgInviteDetail fansPredivorcedIndirect(Long uid, String rankName, String nickName, String fansName,
         String item, Date time) {
      if (nickName == null || uid == null || item == null || time == null)
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(String.format("很抱歉!你的间接粉丝:%s已升级为%s", nickName, rankName), ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("升级时间", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("你的直接粉丝", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(fansName,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
      contentList.add(new ClientTextStyleVO("还不是会员,即日起你需要在60天内助力他成长为任意会员", ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),contentList));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("可在【\"我的-我的粉丝\"】中查看脱离剩余时间", ClientTextStyleVO.COLOR_CONTENT)));
      MsgInviteDetail detail = new MsgInviteDetail();
      detail.setCreateTime(new Date());
      detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
      detail.setRead(false);
      detail.setUser(new UserInfo(uid));
      detail.setExtraInfo(new Gson().toJson(listMsg));
      return detail;
   }
   /**
    * 直接粉丝脱离-已经脱离提醒
    * @param uid
    * @param rankName
    * @param nickName
    * @param item
    * @param time
    * @return
    */
   public static MsgInviteDetail fansDivorced(Long uid, String nickName, Date time) {
      if (nickName == null || uid == null || time == null)
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("很抱歉!你的直接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
      contentList.add(new ClientTextStyleVO("已经脱离了你", ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离时间", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("你未能在60天内升级为任意会员", ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
      MsgInviteDetail detail = new MsgInviteDetail();
      detail.setCreateTime(new Date());
      detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
      detail.setRead(false);
      detail.setUser(new UserInfo(uid));
      detail.setExtraInfo(new Gson().toJson(listMsg));
      return detail;
   }
   /**
    * 直接粉丝脱离-已经脱离提醒
    * @param uid
    * @param rankName
    * @param nickName
    * @param item
    * @param time
    * @return
    */
   public static MsgInviteDetail fansDivorcedIndirect(Long uid, String nickName, String fansName, Date time) {
      if (nickName == null || uid == null || time == null)
         return null;
      List<CommonMsgItemVO> listMsg = new ArrayList<>();
      List<ClientTextStyleVO> contentList = new ArrayList<>();
      contentList.add(new ClientTextStyleVO("很抱歉!你的间接粉丝:", ClientTextStyleVO.COLOR_CONTENT));
      contentList.add(new ClientTextStyleVO(nickName ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
      contentList.add(new ClientTextStyleVO("已经脱离了你", ClientTextStyleVO.COLOR_CONTENT));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离粉丝", ClientTextStyleVO.COLOR_TITLE),contentList));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离时间", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(TimeUtil.formatDate(time), ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("脱离原因", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO(String.format("你的直接粉丝%s未能在60天内升级为任意会员", fansName), ClientTextStyleVO.COLOR_CONTENT)));
      listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE),
            new ClientTextStyleVO("如有疑问请联系人工客服", ClientTextStyleVO.COLOR_CONTENT)));
      MsgInviteDetail detail = new MsgInviteDetail();
      detail.setCreateTime(new Date());
      detail.setMsgType(MsgTypeInviteTypeEnum.fansDivorced);
      detail.setRead(false);
      detail.setUser(new UserInfo(uid));
      detail.setExtraInfo(new Gson().toJson(listMsg));