*/
private MultipartEntity getAddSharParam(QqAddShareParamBean addShareBean) throws UnsupportedEncodingException {
MultipartEntity reqEntity = new MultipartEntity();
// AccessToken
reqEntity.addPart("access_token", new StringBody(addShareBean.getAccessToken()));
// AppId
reqEntity.addPart("oauth_consumer_key", new StringBody(oqu.getConfigValue("qq.appid")));
// OpenId
reqEntity.addPart("openid", new StringBody(addShareBean.getOpenId()));
// 定义API返回的数据格式
reqEntity.addPart("format", new StringBody("json"));
// feeds的标题
reqEntity.addPart("title", new StringBody(addShareBean.getTitle(), Charset.forName("UTF-8")));
// 分享所在网页资源的链接
reqEntity.addPart("url", new StringBody(addShareBean.getUrl()));
// 用户评论内容,也叫发表分享时的分享理由
if (oqu.isNotNull(addShareBean.getComment())) {
reqEntity.addPart("comment", new StringBody(addShareBean.getComment(), Charset.forName("UTF-8")));
}
// 所分享的网页资源的摘要内容
if (oqu.isNotNull(addShareBean.getSummary())) {
reqEntity.addPart("summary", new StringBody(addShareBean.getSummary(), Charset.forName("UTF-8")));
}
// 所分享的网页资源的代表性图片链接
if (oqu.isNotNull(addShareBean.getImages())) {
reqEntity.addPart("images", new StringBody(addShareBean.getImages()));
}
// 分享的场景
if (oqu.isNotNull(addShareBean.getSource())) {
// 取值说明:1.通过网页 2.通过手机 3.通过软件 4.通过IPHONE 5.通过 IPAD
reqEntity.addPart("source", new StringBody(addShareBean.getSource()));
}
// 分享内容的类型
if (oqu.isNotNull(addShareBean.getType())) {
// 4表示网页;5表示视频(type=5时,必须传入playurl)
reqEntity.addPart("type", new StringBody(addShareBean.getType()));
}
// 长度限制为256字节。仅在type=5的时候有效。
if (oqu.isNotNull(addShareBean.getPlayUrl())) {
reqEntity.addPart("playurl", new StringBody(addShareBean.getPlayUrl()));
}
// 值为1时,表示分享不默认同步到微博,其他值或者不传此参数表示默认同步到微博。
if (oqu.isNotNull(addShareBean.getNswb())) {
reqEntity.addPart("nswb", new StringBody(addShareBean.getNswb()));
}
return reqEntity;
}