WxClient.java 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.fdkankan.pay.httpClient.client;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.dtflys.forest.annotation.*;
  4. import org.springframework.web.bind.annotation.RequestHeader;
  5. /**
  6. * 获取,调用4dkk服务
  7. */
  8. @BaseRequest(sslProtocol = "TLS")
  9. public interface WxClient {
  10. /**
  11. * 获取 access_token
  12. */
  13. @Get("https://open.weixin.qq.com/connect/oauth2/authorize?" +
  14. "appid={appid}&redirect_uri={redirectUri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect")
  15. JSONObject getCode(@Query("appid") String app_id, @Query("redirectUri") String redirectUri);
  16. /**
  17. * 获取 access_token
  18. */
  19. @Get("https://api.weixin.qq.com/sns/oauth2/access_token?appid={appid}&secret={secret}&code={code}&grant_type=authorization_code")
  20. JSONObject getToken(@Query("appid") String app_id, @Query("secret") String app_secret,@Query("code") String code);
  21. /**
  22. * 申请账单
  23. */
  24. @Get(value = "https://api.mch.weixin.qq.com/v3/bill/fundflowbill",headers = {
  25. "Accept:application/json",
  26. "Content-Type: application/json"
  27. })
  28. JSONObject tradeBill(@Query("bill_date") String bill_date,
  29. @Query("bill_type") String bill_type,
  30. @Query("tar_type") String tar_type,
  31. @Header("Authorization") String authorization);
  32. }