🎨 修复完善获取 NFC 的小程序 scheme 接口

This commit is contained in:
四叶草
2023-07-31 14:16:24 +00:00
committed by Binary Wang
parent 51b14f9a89
commit ece6604fb1
4 changed files with 97 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.scheme.WxMaGenerateNfcSchemeRequest;
import cn.binarywang.wx.miniapp.bean.scheme.WxMaGenerateSchemeRequest;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -27,5 +28,5 @@ public interface WxMaSchemeService {
* @param request 请求参数
* @throws WxErrorException 生成失败时抛出,具体错误码请看文档
*/
String generateNFC(WxMaGenerateSchemeRequest request) throws WxErrorException;
String generateNFC(WxMaGenerateNfcSchemeRequest request) throws WxErrorException;
}

View File

@@ -2,6 +2,7 @@ package cn.binarywang.wx.miniapp.api.impl;
import cn.binarywang.wx.miniapp.api.WxMaSchemeService;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.scheme.WxMaGenerateNfcSchemeRequest;
import cn.binarywang.wx.miniapp.bean.scheme.WxMaGenerateSchemeRequest;
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
@@ -47,7 +48,7 @@ public class WxMaSchemeServiceImpl implements WxMaSchemeService {
* @throws WxErrorException 生成失败时抛出,具体错误码请看文档
*/
@Override
public String generateNFC(WxMaGenerateSchemeRequest request) throws WxErrorException {
public String generateNFC(WxMaGenerateNfcSchemeRequest request) throws WxErrorException {
String responseContent = this.wxMaService.post(GENERATE_NFC_SCHEME_URL, request.toJson());
JsonObject jsonObject = GsonParser.parse(responseContent);
if (jsonObject.get(WxConsts.ERR_CODE).getAsInt() != 0) {