黄磊的项目,分享文件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

76 lines
2.4 KiB

package com.ruoyi.hl.forest.clients;
import com.dtflys.forest.annotation.*;
import com.ruoyi.hl.forest.interceptor.UnlimitedInterceptor;
import com.ruoyi.hl.forest.interceptor.WriteLogInterceptor;
import com.ruoyi.hl.forest.ptoto.WxMiniCode2SessionRes;
import com.ruoyi.hl.forest.ptoto.WxMiniTokenRes;
import com.ruoyi.hl.forest.ptoto.WxPublicCode2UserInfoRes;
import com.ruoyi.hl.forest.ptoto.WxUserInfoRes;
import java.util.Map;
@BaseRequest(baseURL = "${wechat_clients_url}")
public interface MiniWeChatClients {
/**
* 获取access_token
* @param appid
* @param secret
* @return
*/
@GetRequest(url = "/cgi-bin/token?grant_type=client_credential&appid=${appid}&secret=${secret}",
dataType ="json",interceptor = WriteLogInterceptor.class
)
WxMiniTokenRes token(@Var("appid") String appid, @Var("secret") String secret);
/**
* 获取信息
*
* @return
*/
@GetRequest(url = "/sns/userinfo?access_token=${token}&openid=${openid}&lang=zh_CN",
dataType ="json",interceptor = WriteLogInterceptor.class
)
WxUserInfoRes userInfo(@Var("token") String token, @Var("openid") String openid);
/**
* 获取用户信息
* @param appid
* @param secret
* @param code
* @return
*/
@GetRequest(
url = "/sns/jscode2session?appid=${appid}&secret=${secret}&js_code=${code}&grant_type=authorization_code",
interceptor = WriteLogInterceptor.class,dataType = "json"
)
WxMiniCode2SessionRes code2session(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
/**
* 获取信息
* @param appid
* @param secret
* @param code
* @return
*/
@GetRequest(
url = "/sns/oauth2/access_token?appid=${appid}&secret=${secret}&code=${code}&grant_type=authorization_code",
interceptor = WriteLogInterceptor.class,dataType = "json"
)
WxPublicCode2UserInfoRes code2userinfo(@Var("appid") String appid, @Var("secret") String secret, @Var("code") String code);
/**
* 获取分享码
* @param token
* @param params
*/
@PostRequest(url = "/wxa/getwxacodeunlimit?access_token=${token}",
contentType = "application/json",
interceptor = UnlimitedInterceptor.class)
byte[] getUnlimited(@Var("token")String token, @Body Map<String,String> params);
}