package com.njzscloud.common.wechat;

import com.njzscloud.common.http.annotation.GetEndpoint;
import com.njzscloud.common.http.annotation.QueryParam;
import com.njzscloud.common.http.annotation.RemoteServer;
import com.njzscloud.common.wechat.param.Code2SessionParam;
import com.njzscloud.common.wechat.param.GetAccessTokenParam;
import com.njzscloud.common.wechat.result.Code2SessionResult;
import com.njzscloud.common.wechat.result.GetAccessTokenResult;

@RemoteServer(value = "${wechat.base-url}")
public interface WechatApi {

    /**
     * 获取access_token
     */
    @GetEndpoint("/cgi-bin/token")
    GetAccessTokenResult getAccessToken(@QueryParam GetAccessTokenParam getAccessTokenParam);

    /**
     * 小程序登录
     */
    @GetEndpoint("/sns/jscode2session")
    Code2SessionResult code2Session(@QueryParam Code2SessionParam code2SessionParam);
}
