|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectcom.sina.weibo.sdk.openapi.AbsOpenAPI
com.sina.weibo.sdk.openapi.CommentsAPI
public class CommentsAPI
此类封装了评论的接口。 详情请参考评论接口
字段摘要 | |
---|---|
static int |
AUTHOR_FILTER_ALL
作者筛选类型,0:全部、1:我关注的人、2:陌生人 |
static int |
AUTHOR_FILTER_ATTENTIONS
|
static int |
AUTHOR_FILTER_STRANGER
|
static int |
SRC_FILTER_ALL
来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论 |
static int |
SRC_FILTER_WEIBO
|
static int |
SRC_FILTER_WEIQUN
|
从类 com.sina.weibo.sdk.openapi.AbsOpenAPI 继承的字段 |
---|
API_SERVER, HTTPMETHOD_GET, HTTPMETHOD_POST, KEY_ACCESS_TOKEN, mAccessToken |
构造方法摘要 | |
---|---|
CommentsAPI(Oauth2AccessToken accessToken)
构造函数,使用各个 API 接口提供的服务前必须先获取 Token。 |
方法摘要 | |
---|---|
void |
byME(long since_id,
long max_id,
int count,
int page,
int sourceType,
com.sina.weibo.sdk.net.RequestListener listener)
获取当前登录用户所发出的评论列表。 |
java.lang.String |
byMESync(long since_id,
long max_id,
int count,
int page,
int sourceType)
|
void |
create(java.lang.String comment,
long id,
boolean comment_ori,
com.sina.weibo.sdk.net.RequestListener listener)
对一条微博进行评论。 |
java.lang.String |
createSync(java.lang.String comment,
long id,
boolean comment_ori)
|
void |
destroy(long cid,
com.sina.weibo.sdk.net.RequestListener listener)
删除一条评论。 |
void |
destroyBatch(long[] ids,
com.sina.weibo.sdk.net.RequestListener listener)
根据评论ID批量删除评论。 |
java.lang.String |
destroyBatchSync(long[] ids)
|
java.lang.String |
destroySync(long cid)
|
void |
mentions(long since_id,
long max_id,
int count,
int page,
int authorType,
int sourceType,
com.sina.weibo.sdk.net.RequestListener listener)
获取最新的提到当前登录用户的评论,即@我的评论 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0 |
java.lang.String |
mentionsSync(long since_id,
long max_id,
int count,
int page,
int authorType,
int sourceType)
|
void |
reply(long cid,
long id,
java.lang.String comment,
boolean without_mention,
boolean comment_ori,
com.sina.weibo.sdk.net.RequestListener listener)
回复一条评论。 |
java.lang.String |
replySync(long cid,
long id,
java.lang.String comment,
boolean without_mention,
boolean comment_ori)
|
void |
show(long id,
long since_id,
long max_id,
int count,
int page,
int authorType,
com.sina.weibo.sdk.net.RequestListener listener)
根据微博ID返回某条微博的评论列表。 |
void |
showBatch(long[] cids,
com.sina.weibo.sdk.net.RequestListener listener)
根据评论ID批量返回评论信息。 |
java.lang.String |
showBatchSync(long[] cids)
|
java.lang.String |
showSync(long id,
long since_id,
long max_id,
int count,
int page,
int authorType)
|
void |
timeline(long since_id,
long max_id,
int count,
int page,
boolean trim_user,
com.sina.weibo.sdk.net.RequestListener listener)
获取当前登录用户的最新评论包括接收到的与发出的。 |
java.lang.String |
timelineSync(long since_id,
long max_id,
int count,
int page,
boolean trim_user)
|
void |
toME(long since_id,
long max_id,
int count,
int page,
int authorType,
int sourceType,
com.sina.weibo.sdk.net.RequestListener listener)
获取当前登录用户所接收到的评论列表。 |
java.lang.String |
toMESync(long since_id,
long max_id,
int count,
int page,
int authorType,
int sourceType)
|
从类 com.sina.weibo.sdk.openapi.AbsOpenAPI 继承的方法 |
---|
requestAsync, requestSync |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
public static final int AUTHOR_FILTER_ALL
public static final int AUTHOR_FILTER_ATTENTIONS
public static final int AUTHOR_FILTER_STRANGER
public static final int SRC_FILTER_ALL
public static final int SRC_FILTER_WEIBO
public static final int SRC_FILTER_WEIQUN
构造方法详细信息 |
---|
public CommentsAPI(Oauth2AccessToken accessToken)
accesssToken
- 访问令牌方法详细信息 |
---|
public void show(long id, long since_id, long max_id, int count, int page, int authorType, com.sina.weibo.sdk.net.RequestListener listener)
id
- 需要查询的微博ID。since_id
- 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。max_id
- 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。count
- 单页返回的记录条数,默认为50page
- 返回结果的页码,默认为1。authorType
- 作者筛选类型,0:全部、1:我关注的人、2:陌生人 ,默认为0。可为以下几种 :
AUTHOR_FILTER_ALL
AUTHOR_FILTER_ATTENTIONS
AUTHOR_FILTER_STRANGER
listener
- 异步请求回调接口public void byME(long since_id, long max_id, int count, int page, int sourceType, com.sina.weibo.sdk.net.RequestListener listener)
since_id
- 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。max_id
- 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。count
- 单页返回的记录条数,默认为50。page
- 返回结果的页码,默认为1。sourceType
- 来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
SRC_FILTER_ALL
SRC_FILTER_WEIBO
SRC_FILTER_WEIQUN
listener
- 异步请求回调接口public void toME(long since_id, long max_id, int count, int page, int authorType, int sourceType, com.sina.weibo.sdk.net.RequestListener listener)
since_id
- 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。max_id
- 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。count
- 单页返回的记录条数,默认为50。page
- 返回结果的页码,默认为1。authorType
- 作者筛选类型,0:全部、1:我关注的人、2:陌生人 ,默认为0。可为以下几种 :
AUTHOR_FILTER_ALL
AUTHOR_FILTER_ATTENTIONS
AUTHOR_FILTER_STRANGER
sourceType
- 来源筛选类型,0:全部、1:来自微博的评论、2:来自微群的评论,默认为0。
SRC_FILTER_ALL
SRC_FILTER_WEIBO
SRC_FILTER_WEIQUN
listener
- 异步请求回调接口public void timeline(long since_id, long max_id, int count, int page, boolean trim_user, com.sina.weibo.sdk.net.RequestListener listener)
since_id
- 若指定此参数,则返回ID比since_id大的评论(即比since_id时间晚的评论),默认为0。max_id
- 若指定此参数,则返回ID小于或等于max_id的评论,默认为0。count
- 单页返回的记录条数,默认为50。page
- 返回结果的页码,默认为1。trim_user
- 返回值中user字段开关,false:返回完整user字段、true:user字段仅返回user_id,默认为false。listener
- 异步请求回调接口public void mentions(long since_id, long max_id, int count, int page, int authorType, int sourceType, com.sina.weibo.sdk.net.RequestListener listener)
since_id
- 若指定此参数,则返回ID小于或等于max_id的评论,默认为0max_id
- 若指定此参数,则返回ID小于或等于max_id的评论,默认为0count
- 单页返回的记录条数,默认为50page
- 返回结果的页码,默认为1authorType
- 作者筛选类型,0:全部,1:我关注的人, 2:陌生人,默认为0
AUTHOR_FILTER_ALL
AUTHOR_FILTER_ATTENTIONS
AUTHOR_FILTER_STRANGER
sourceType
- 来源筛选类型,0:全部,1:来自微博的评论,2:来自微群的评论,默认为0
SRC_FILTER_ALL
SRC_FILTER_WEIBO
SRC_FILTER_WEIQUN
listener
- 异步请求回调接口public void showBatch(long[] cids, com.sina.weibo.sdk.net.RequestListener listener)
cids
- 需要查询的批量评论ID数组,最大50listener
- 异步请求回调接口public void create(java.lang.String comment, long id, boolean comment_ori, com.sina.weibo.sdk.net.RequestListener listener)
comment
- 评论内容,内容不超过140个汉字。id
- 需要评论的微博ID。comment_ori
- 当评论转发微博时,是否评论给原微博listener
- 异步请求回调接口public void destroy(long cid, com.sina.weibo.sdk.net.RequestListener listener)
cid
- 要删除的评论ID,只能删除登录用户自己发布的评论。listener
- 异步请求回调接口public void destroyBatch(long[] ids, com.sina.weibo.sdk.net.RequestListener listener)
ids
- 需要删除的评论ID数组,最多20个。listener
- 异步请求回调接口public void reply(long cid, long id, java.lang.String comment, boolean without_mention, boolean comment_ori, com.sina.weibo.sdk.net.RequestListener listener)
cid
- 需要回复的评论IDid
- 需要评论的微博IDcomment
- 回复评论内容,内容不超过140个汉字without_mention
- 回复中是否自动加入“回复@用户名”,true:是、false:否,默认为falsecomment_ori
- 当评论转发微博时,是否评论给原微博,false:否、true:是,默认为falselistener
- 异步请求回调接口public java.lang.String showSync(long id, long since_id, long max_id, int count, int page, int authorType)
show(long, long, long, int, int, int, RequestListener)
public java.lang.String byMESync(long since_id, long max_id, int count, int page, int sourceType)
byME(long, long, int, int, int, RequestListener)
public java.lang.String toMESync(long since_id, long max_id, int count, int page, int authorType, int sourceType)
toME(long, long, int, int, int, int, RequestListener)
public java.lang.String timelineSync(long since_id, long max_id, int count, int page, boolean trim_user)
timeline(long, long, int, int, boolean, RequestListener)
public java.lang.String mentionsSync(long since_id, long max_id, int count, int page, int authorType, int sourceType)
mentions(long, long, int, int, int, int, RequestListener)
public java.lang.String showBatchSync(long[] cids)
showBatch(long[], RequestListener)
public java.lang.String createSync(java.lang.String comment, long id, boolean comment_ori)
create(String, long, boolean, RequestListener)
public java.lang.String destroySync(long cid)
destroyBatch(long[], RequestListener)
public java.lang.String destroyBatchSync(long[] ids)
destroyBatchSync(long[])
public java.lang.String replySync(long cid, long id, java.lang.String comment, boolean without_mention, boolean comment_ori)
reply(long, long, String, boolean, boolean, RequestListener)
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |