mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-03 12:17:46 +08:00
🎨 优化部分代码,提供链式方法支持
This commit is contained in:
parent
04bb23b75c
commit
5e84544ae7
@ -340,12 +340,13 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
|
||||
* @throws WxErrorException 异常
|
||||
*/
|
||||
protected String extractAccessToken(String resultContent) throws WxErrorException {
|
||||
log.info("resultContent: " + resultContent);
|
||||
log.debug("access-token response: {}", resultContent);
|
||||
WxMaConfig config = this.getWxMaConfig();
|
||||
WxError error = WxError.fromJson(resultContent, WxType.MiniApp);
|
||||
if (error.getErrorCode() != 0) {
|
||||
throw new WxErrorException(error);
|
||||
}
|
||||
|
||||
WxAccessToken accessToken = WxAccessToken.fromJson(resultContent);
|
||||
config.updateAccessTokenProcessor(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
||||
return accessToken.getAccessToken();
|
||||
@ -666,10 +667,12 @@ public abstract class BaseWxMaServiceImpl<H, P> implements WxMaService, RequestH
|
||||
public WxMaOpenApiService getWxMaOpenApiService() {
|
||||
return this.wxMaOpenApiService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxMaVodService getWxMaVodService() {
|
||||
return this.wxMaVodService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxMaXPayService getWxMaXPayService() {
|
||||
return this.wxMaXPayService;
|
||||
|
@ -3,14 +3,15 @@ package cn.binarywang.wx.miniapp.bean;
|
||||
import cn.binarywang.wx.miniapp.constant.WxMaConstants;
|
||||
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订阅消息.
|
||||
* https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html
|
||||
* 订阅消息
|
||||
* <a href="https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html">点击查阅文档</a>
|
||||
*
|
||||
* @author S
|
||||
*/
|
||||
@ -19,6 +20,7 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
public class WxMaSubscribeMessage implements Serializable {
|
||||
private static final long serialVersionUID = 6846729898251286686L;
|
||||
|
||||
|
@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -17,6 +18,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GenerateUrlLinkRequest implements Serializable {
|
||||
|
Loading…
Reference in New Issue
Block a user