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

io.gitee.huangguiming.Imcode.service.IMService Maven / Gradle / Ivy

package io.gitee.huangguiming.Imcode.service;


import com.google.gson.JsonObject;
import io.gitee.huangguiming.Imcode.apiUrl.IMAPiAddressUrl;
import io.gitee.huangguiming.Imcode.exception.IMException;
import io.gitee.huangguiming.Imcode.imconfig.IMDefaultConfigImpl;
import io.gitee.huangguiming.Imcode.utils.RequestExecutor;

/**
 * 即使通讯主要服务
 */
public interface IMService extends WxService{

    /**
     * 获取群组相关服务
     */
    GroupService getGroupService();


     T execute(RequestExecutor executor, String url, E data) throws IMException;

    /**
     * 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的GET请求.
     *
     * @param url        请求接口地址
     * @param queryParam 参数
     * @return 接口响应字符串 string
     */
    String get(IMAPiAddressUrl url, String queryParam);

    /**
     * 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的POST请求.
     *
     * @param url      请求接口地址
     * @param postData 请求参数json值
     * @return 接口响应字符串 string
     *
     */
    String post( IMAPiAddressUrl url, String postData);

    /**
     * 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的POST请求.
     *
     * @param url 请求接口地址
     * @param obj 请求参数
     * @return 接口响应字符串 string
     */
    String post(IMAPiAddressUrl url, Object obj) throws IMException;

    /**
     * 当本Service没有实现某个API的时候,可以用这个,针对所有微信API中的POST请求.
     *
     * @param url        请求接口地址
     * @param jsonObject 请求参数json对象
     * @return 接口响应字符串 string
     */
    String post(IMAPiAddressUrl url, JsonObject jsonObject);

    /**
     * 
     * Service没有实现某个API的时候,可以用这个,
     * 比{@link #get}和{@link #post}方法更灵活,可以自己构造RequestExecutor用来处理不同的参数和不同的返回类型。
     * 
* * @param the type parameter * @param the type parameter * @param executor 执行器 * @param url 接口地址 * @param data 参数数据 * @return 结果 t */ T execute(RequestExecutor executor, IMAPiAddressUrl url, E data) throws IMException; /** * 初始化http */ void initHttp(); /** * 设置1个IM应用 */ void setIMConfigStorage(IMDefaultConfigImpl imConfigStorage); /** * 获取UserSig * @param appUserid 你app的用户id * @return 加密后的东西 */ String getUserSig(String appUserid); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy