weiboclient4j.RemindService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weiboclient4j Show documentation
Show all versions of weiboclient4j Show documentation
Java library for Sina Weibo
The newest version!
package weiboclient4j;
import weiboclient4j.model.UnreadCount;
import weiboclient4j.params.CountType;
import weiboclient4j.params.Uid;
/**
* @author Hover Ruan
*/
public class RemindService extends AbstractService {
public RemindService(WeiboClient client) {
super(client);
}
public UnreadCount getUnreadCount() throws WeiboClientException {
AccountService accountService = getClient().getAccountService();
Uid uid = new Uid(accountService.getUid());
return getUnreadCount(uid);
}
public UnreadCount getUnreadCount(Uid uid) throws WeiboClientException {
return doGet("remind/unread_count", withParams(uid), UnreadCount.class);
}
public boolean resetCount(CountType type) throws WeiboClientException {
ResultResponse response = doPost("https://rm.api.weibo.com/2/remind/set_count.json",
withParams(type), ResultResponse.class);
return response.isResult();
}
}