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

io.gitee.putaoo.easypay.feign.GzhApi Maven / Gradle / Ivy

package io.gitee.putaoo.easypay.feign;

import io.gitee.putaoo.easypay.constant.WxConstant;
import io.gitee.putaoo.easypay.domain.wx.AccessToken;
import io.gitee.putaoo.easypay.domain.wx.JsTicket;
import io.gitee.putaoo.easypay.domain.wx.UserAccessToken;
import io.gitee.putaoo.easypay.domain.wx.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "gzh",url = WxConstant.GZH_URL)
public interface GzhApi {

    @GetMapping("/cgi-bin/token?grant_type=client_credential&appid={appId}&secret={appSecret}")
    AccessToken accessToken(@PathVariable("appId") String appId, @PathVariable("appSecret") String appSecret);

    @GetMapping("/sns/oauth2/access_token?appid={appId}&secret={appSecret}&code={code}&grant_type=authorization_code")
    UserAccessToken userAccessToken(@PathVariable("appId") String appId, @PathVariable("appSecret") String appSecret,@PathVariable("code") String code);

    @GetMapping("/sns/userinfo?access_token={userAccessToken}&openid={openid}")
    UserInfo userInfo(@PathVariable("userAccessToken")String userAccessToken, @PathVariable("openid")String openId);

    @GetMapping("/sns/oauth2/refresh_token?appid={appId}D&grant_type=refresh_token&refresh_token={userAccessToken}")
    UserAccessToken refreshUserAccessToken(@PathVariable("appId") String appId,@PathVariable("userAccessToken")String userAccessToken);

    @GetMapping("/cgi-bin/ticket/getticket?access_token={accessToken}&type=jsapi")
    JsTicket jsTicket(@PathVariable("accessToken")String accessToken);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy