Пример #1
0
  /** 准备发微博 */
  public String toPublish() {
    try {

    } catch (Exception e) {
      data.fail(Constant.ResultMessage.ERROR);
      logger.error("{}", data.getDesc(), e);
    }
    return SUCCESS;
  }
Пример #2
0
 /** 准备转发微博 */
 public String toForward() {
   try {
     setWeiboMsg(messageService.getWeiboById(postId));
     if (weiboMsg == null) {
       data.fail(Constant.ResultMessage.FORWARD_FAIL_POST);
       return SUCCESS;
     }
   } catch (Exception e) {
     data.fail(Constant.ResultMessage.ERROR);
     logger.error("{}", data.getDesc(), e);
   }
   return SUCCESS;
 }
Пример #3
0
  @Override
  public PageResult<WeiboMsgVO> findHotDiscussByDate(
      long uid, RecentDateType recentDateType, PageRequest pageRequest) {
    String key = Keys.discussKey(recentDateType);
    PageResult<WeiboMsg> modelResult = listSortedSetDesc(key, WeiboMsg.class, pageRequest);
    PageResult<WeiboMsgVO> voResult = fillVOPageResult(modelResult, WeiboMsgVO.class);

    if (null != voResult && voResult.getResults() != null) {
      for (WeiboMsgVO vo : voResult.getResults()) {
        vo.setTags(tagDao.getTagListByWeiboId(vo.getId()));
      }
    }

    // 检查话题对应的微博是否被自己“收藏”和“赞”过
    voResult = checkFavoriateAndLike(uid, voResult);
    return voResult;
  }
Пример #4
0
  /** 提到我的列表 */
  public String load() {
    try {
      setData(atUserService.findAtMeList(getUserLaicaiWeiboId(), pageRequest));
      data.setUserId(getUserLaicaiWeiboId());

      // 用户查看提到我的列表时,清除用户未读‘提到我的’时间线上的数据
      notificationService.clearUnreadMetionsTimeline(getUserLaicaiWeiboId());
    } catch (Exception e) {
      logger.error("用户={}, 查询提到我的出错!", getUserLaicaiWeiboId(), e);
    }
    return SUCCESS;
  }
Пример #5
0
 /** 发微博 */
 public String publish() {
   try {
     long uid = getUserLaicaiWeiboId();
     if (uid < 1) {
       data.fail(Constant.ResultMessage.PUBLISH_FAIL_LOGIN);
       logger.info(data.getDesc());
       return SUCCESS;
     }
     if (weiboMsg == null) {
       data.fail(Constant.ResultMessage.PUBLISH_FAIL);
       logger.info(data.getDesc());
       return SUCCESS;
     }
     weiboMsg.setOwnerId(uid);
     messageService.publish(weiboMsg);
   } catch (Exception e) {
     data.fail(Constant.ResultMessage.PUBLISH_FAIL);
     logger.error("{}", data.getDesc(), e);
   }
   return SUCCESS;
 }