package com.yutou.napcat.http;

import com.yutou.okhttp.HttpLoggingInterceptor;
import com.yutou.okhttp.api.BaseApi;
import com.yutou.qqbot.utlis.ConfigTools;

public class NapCatApi extends BaseApi {
    private static final String URL;
    static {
        URL= ConfigTools.load(ConfigTools.CONFIG,ConfigTools.NAPCAT_URL,String.class);
    }

    public static void setLog(boolean log){
        HttpLoggingInterceptor.setLog(log);
    }

    public static MessageAPI getMessageApi(){
        return new NapCatApi().setURL(URL).createApi(MessageAPI.class);
    }
    public static UtilsApi getUtilsApi(){
        return new NapCatApi().setURL(URL).createApi(UtilsApi.class);
    }
    public static GroupApi getGroupApi(){
        return new NapCatApi().setURL(URL).createApi(GroupApi.class);
    }
    public static FriendApi getFriendApi(){
        return new NapCatApi().setURL(URL).createApi(FriendApi.class);
    }
}
