All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weiboclient4j.RemindService Maven / Gradle / Ivy

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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy