Examples of MultipartEntity


Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean 参数
   * @return 接口地址
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getInterfaceParam(WeiBoAddIdolParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 要收听的用户的账户名列表
    if (oqu.isNotNull(paramBean.getName())) {
      reqEntity.addPart("name", new StringBody(paramBean.getName(), Charset.forName("UTF-8")));
    }
   
    // 要收听的用户的openid列表
    if (oqu.isNotNull(paramBean.getFopenIds())) {
      reqEntity.addPart("fopenids", new StringBody(paramBean.getFopenIds()));
    }
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean
   * @return 发布微博的数据
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getAddWeiBoData(WeiBoAddParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 微博内容
    reqEntity.addPart("content", new StringBody(paramBean.getContent(), Charset.forName("UTF-8")));
   
    // 用户ip
    if (oqu.isNotNull(paramBean.getClientIp())) {
      reqEntity.addPart("clientip", new StringBody(paramBean.getClientIp()));
    }
   
    // 用户所在地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("jing", new StringBody(paramBean.getLongitude()));
    }
   
    // 用户所在地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("wei", new StringBody(paramBean.getLatitude()));
    }
   
    // 同步到QQ空间标识   0:同步 1:不同步
    if (oqu.isNotNull(paramBean.getSyncFlag())) {
      reqEntity.addPart("syncflag", new StringBody(paramBean.getSyncFlag()));
    }
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean
   * @return 发布微博的数据
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getAddWeiBoData(WeiBoAddParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 微博内容
    reqEntity.addPart("content", new StringBody(paramBean.getContent(), Charset.forName("UTF-8")));
   
    // 用户ip
    if (oqu.isNotNull(paramBean.getClientIp())) {
      reqEntity.addPart("clientip", new StringBody(paramBean.getClientIp()));
    }
   
    // 用户所在地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("jing", new StringBody(paramBean.getLongitude()));
    }
   
    // 用户所在地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("wei", new StringBody(paramBean.getLatitude()));
    }
   
    // 同步到QQ空间标识   0:同步 1:不同步
    if (oqu.isNotNull(paramBean.getSyncFlag())) {
      reqEntity.addPart("syncflag", new StringBody(paramBean.getSyncFlag()));
    }
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean 参数
   * @return post参数
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getInterfaceData(WeiBoAddPicTParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(paramBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));
     
      // 表示要发表的微博内容
      reqEntity.addPart("content", new StringBody(paramBean.getContent(), Charset.forName("UTF-8")));
     
      // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 图片的内容
    FileBody fileBody = new FileBody(new File(paramBean.getPicPath()));
    reqEntity.addPart("pic", fileBody);
     
      // 用户ip
      if (oqu.isNotNull(paramBean.getClientIp())) {
        reqEntity.addPart("clientip", new StringBody(paramBean.getClientIp()));
    }
   
    // 用户所在地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("jing", new StringBody(paramBean.getLongitude()));
    }
   
    // 用户所在地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("wei", new StringBody(paramBean.getLatitude()));
    }
   
    // 同步到QQ空间标识   0:同步 1:不同步
    if (oqu.isNotNull(paramBean.getSyncFlag())) {
      reqEntity.addPart("syncflag", new StringBody(paramBean.getSyncFlag()));
    }
     
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean 参数
   * @return 接口地址
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getInterfaceParam(WeiBoDelIdolParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 要收听的用户的账户名列表
    if (oqu.isNotNull(paramBean.getName())) {
      reqEntity.addPart("name", new StringBody(paramBean.getName(), Charset.forName("UTF-8")));
    }
   
    // 要收听的用户的openid列表
    if (oqu.isNotNull(paramBean.getFopenIds())) {
      reqEntity.addPart("fopenids", new StringBody(paramBean.getFopenIds()));
    }
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean 参数
   * @return 接口地址
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getInterfaceParam(WeiBoAddIdolParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 要收听的用户的账户名列表
    if (oqu.isNotNull(paramBean.getName())) {
      reqEntity.addPart("name", new StringBody(paramBean.getName(), Charset.forName("UTF-8")));
    }
   
    // 要收听的用户的openid列表
    if (oqu.isNotNull(paramBean.getFopenIds())) {
      reqEntity.addPart("fopenids", new StringBody(paramBean.getFopenIds()));
    }
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @return 参数
   * @throws UnsupportedEncodingException
   * @throws Exception
   */
  private MultipartEntity getUpdatePicParam(QqUpdatePicParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(paramBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));
   
      // 照片描述
    if (oqu.isNotNull(paramBean.getPhotoDesc())) {
      reqEntity.addPart("photodesc", new StringBody(paramBean.getPhotoDesc(),Charset.forName("UTF-8")));
    }

    // 照片的命名
    if (oqu.isNotNull(paramBean.getTitle())) {
      reqEntity.addPart("title", new StringBody(paramBean.getTitle(),Charset.forName("UTF-8")));
    }
   
    // 相册id
    if (oqu.isNotNull(paramBean.getAlbumId())) {
      reqEntity.addPart("albumid", new StringBody(paramBean.getAlbumId()));
    }
   
    // 照片拍摄时的地理位置的经度
    if (oqu.isNotNull(paramBean.getLongitude())) {
      reqEntity.addPart("x", new StringBody(paramBean.getLongitude()));
    }
   
    // 照片拍摄时的地理位置的纬度
    if (oqu.isNotNull(paramBean.getLatitude())) {
      reqEntity.addPart("y", new StringBody(paramBean.getLatitude()));
    }
   
    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 标识上传照片时是否要发feed
    reqEntity.addPart("needfeed", new StringBody(String.valueOf(paramBean.getNeedFeed())));
   
    // 已成功上传的张数
    if (paramBean.getSuccessNum() > 0) {
      reqEntity.addPart("successnum", new StringBody(String.valueOf(paramBean.getSuccessNum())));
    }
   
    // 批量上传照片的总张数
    if (paramBean.getPicNum() > 0) {
      reqEntity.addPart("picnum", new StringBody(String.valueOf(paramBean.getPicNum())));
    }
   
    // 图片的内容
    FileBody fileBody = new FileBody(new File(paramBean.getPicPath()));
    reqEntity.addPart("picture", fileBody);
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param addTopicBean 参数
   * @return  Post请求参数
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getAddTopicParam(QqAddTopicParamBean addTopicBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(addTopicBean
        .getAccessToken()));
   
    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
   
    // OpenId
    reqEntity.addPart("openid", new StringBody(addTopicBean.getOpenId()));
   
    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 发布的心情的内容
    reqEntity.addPart("con", new StringBody(addTopicBean.getCon(), Charset.forName("UTF-8")));
   
    // 发布心情时引用的信息的类型
    if (addTopicBean.getRichtype() > 0) {
      // 1表示图片; 2表示网页; 3表示视频
      reqEntity.addPart("richtype", new StringBody(String.valueOf(addTopicBean.getRichtype())));
    }
   
    // 发布心情时引用的信息的值
    if (oqu.isNotNull(addTopicBean.getRichval())) {
      reqEntity.addPart("richval", new StringBody(addTopicBean.getRichval()));
    }
   
    // 发布心情时引用的地址
    if (oqu.isNotNull(addTopicBean.getLbsNm())) {
      reqEntity.addPart("lbs_nm", new StringBody(addTopicBean.getLbsNm()));
    }
   
    // 发布心情时引用的经度
    if (oqu.isNotNull(addTopicBean.getLbsX())) {
      reqEntity.addPart("lbs_x", new StringBody(addTopicBean.getLbsX()));
    }
   
    // 发布心情时引用的纬度
    if (oqu.isNotNull(addTopicBean.getLbsY())) {
      reqEntity.addPart("lbs_y", new StringBody(addTopicBean.getLbsY()));
    }
   
    // 第三方应用的平台类型
    if (oqu.isNotNull(addTopicBean.getLbsY())) {
      // 1表示QQ空间; 2表示腾讯朋友; 3表示腾讯微博平台; 4表示腾讯Q+平台
      reqEntity.addPart("third_source", new StringBody(addTopicBean.getThirdSource()));
    }
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param paramBean 参数
   * @return 接口数据
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getInterfaceData(WeiBoDelParamBean paramBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
    reqEntity.addPart("access_token", new StringBody(paramBean
        .getAccessToken()));

    // AppId
    reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));

    // Openid
    reqEntity.addPart("openid", new StringBody(paramBean.getOpenId()));

    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    // 微博消息的ID
    reqEntity.addPart("id", new StringBody(paramBean.getId()));
   
    return reqEntity;
  }
View Full Code Here

Examples of org.apache.http.entity.mime.MultipartEntity

   * @param addAlbumBean 创建相册参数Bean
   * @return 创建相册的参数和数据
   * @throws UnsupportedEncodingException
   */
  private MultipartEntity getAddAlbumParam(QqAddAlbumParamBean addAlbumBean) throws UnsupportedEncodingException {
    MultipartEntity reqEntity = new MultipartEntity();
   
    // AccessToken
      reqEntity.addPart("access_token", new StringBody(addAlbumBean.getAccessToken()));
     
      // AppId
      reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
     
      // OpenId
      reqEntity.addPart("openid", new StringBody(addAlbumBean.getOpenId()));
   
    // 相册名
      reqEntity.addPart("albumname", new StringBody(addAlbumBean.getAlbumName(), Charset.forName("UTF-8")));
   
      // 相册描述
    if (oqu.isNotNull(addAlbumBean.getAlbumDesc())) {
      reqEntity.addPart("albumdesc", new StringBody(addAlbumBean.getAlbumDesc(), Charset.forName("UTF-8")));
    }
   
    // 相册权限
    if (addAlbumBean.getAlbumPriv() > 0) {
      reqEntity.addPart("priv", new StringBody(String.valueOf(addAlbumBean.getAlbumPriv())));
    }
   
    // 定义API返回的数据格式
    reqEntity.addPart("format", new StringBody("json"));
   
    return reqEntity;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.