Package com.appspot.piment.api.tqq

Examples of com.appspot.piment.api.tqq.TqqWeiboApi


  private TqqWeiboApi tqqWeiboApi = null;
  private SinaWeiboApi sinaWeiboApi = null;

  public SinaMessageSync(Map<String, String> configMap) {
  this.configMap = configMap;
  this.tqqRobotWeiboApi = new TqqWeiboApi(this.configMap);
  this.tqqTempWeiboApi = new TqqWeiboApi(this.configMap);
  this.tqqWeiboApi = new TqqWeiboApi(this.configMap);
  this.sinaWeiboApi = new SinaWeiboApi(this.configMap);
  this.weiboMapDao = new WeiboMapDao();
  this.commentMapDao = new CommentMapDao();
  this.userMapDao = new UserMapDao();
  this.authTokenDao = new AuthTokenDao();
View Full Code Here


    if (weiboMap != null && StringUtils.isNotBlank(String.valueOf(weiboMap.getTqqWeiboId()))) {

    Response response = null;
    Throwable throwable = null;

    TqqWeiboApi tqqApi = null;

    String commentUserId = String.valueOf(comment.getUser().getId());
    String tqqWeiboId = String.valueOf(weiboMap.getTqqWeiboId());
    String commentMsg = comment.getText();

    if (commentUserId.equals(this.tqqWeiboApi.getUsetId())) {
      tqqApi = this.tqqWeiboApi;
    } else {
      UserMap userMap = this.userMapDao.getUserMap(commentUserId);
      if (userMap != null && StringUtils.isNotBlank(userMap.getTqqUserId())) {
      AuthToken tempAuthToken = this.authTokenDao.getByUserId(userMap.getTqqUserId(), WeiboSource.Tqq);
      this.tqqTempWeiboApi.setAuthToken(tempAuthToken);
      tqqApi = this.tqqTempWeiboApi;
      } else {
      tqqApi = this.tqqRobotWeiboApi;
      commentMsg = "Sina @" + comment.getUser().getScreenName() + "//" + commentMsg;
      }
    }

    try {
      response = tqqApi.sendComment(tqqWeiboId, commentMsg, null);
    } catch (Exception e) {
      throwable = e;
    }

    // 処理成功ならば、同期化レコードをデータストアへ保存する
View Full Code Here

  public TqqMessageSync(Map<String, String> configMap) {
  this.configMap = configMap;
  this.sinaRobotWeiboApi = new SinaWeiboApi(this.configMap);
  this.sinaTempWeiboApi = new SinaWeiboApi(this.configMap);
  this.sinaWeiboApi = new SinaWeiboApi(this.configMap);
  this.tqqWeiboApi = new TqqWeiboApi(this.configMap);
  this.weiboMapDao = new WeiboMapDao();
  this.commentMapDao = new CommentMapDao();
  this.userMapDao = new UserMapDao();
  this.authTokenDao = new AuthTokenDao();
  }
View Full Code Here

TOP

Related Classes of com.appspot.piment.api.tqq.TqqWeiboApi

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.