package com.cyksj.service.wechat;


import com.cyksj.model.dto.MiniProgramSession;
import com.cyksj.model.dto.WeChatAccessToken;

/**
 * @author valor.
 * @date 2019/12/3 18:33
 */
public interface MiniProgramOps {

    public static MiniProgramOps create() {
        return MiniProgramOperator.getInstance();
    }

    /**
     * 根据code 换取session
     * https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html
     */
    MiniProgramSession code2session(String appid, String secret, String code) throws Exception;

    /**
     * 获取access_token
     * https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html
     */
    WeChatAccessToken access_token(String appid, String secret) throws Exception;

}
