mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 17:08:40 +08:00
Merge pull request !37 from 风如歌/revert-merge-36-master
This commit is contained in:
commit
f60e1b433e
2
pom.xml
2
pom.xml
@ -56,7 +56,7 @@
|
||||
<json.version>2.0.15</json.version>
|
||||
<okhttp.version>3.14.9</okhttp.version>
|
||||
<forest.version>1.5.30</forest.version>
|
||||
<hutool.version>5.8.18</hutool.version>
|
||||
<hutool.version>5.8.16</hutool.version>
|
||||
<okhttp.version>3.14.9</okhttp.version>
|
||||
<xmlblend.version>2.3.0</xmlblend.version>
|
||||
<activation.version>1.1.1</activation.version>
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
package org.dromara.sms4j.aliyun.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* AlibabaResponse
|
||||
* <p> 阿里响应参数
|
||||
*
|
||||
* @author :handy
|
||||
* 2023/5/19 16:23
|
||||
**/
|
||||
@Data
|
||||
public class AlibabaResponse {
|
||||
|
||||
/**
|
||||
* 请求返回的结果码
|
||||
*/
|
||||
private String Code;
|
||||
|
||||
/**
|
||||
* 请求返回的结果码描述
|
||||
*/
|
||||
private String Message;
|
||||
|
||||
private String RequestId;
|
||||
|
||||
private String BizId;
|
||||
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
package org.dromara.sms4j.aliyun.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dtflys.forest.config.ForestConfiguration;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sms4j.aliyun.config.AlibabaConfig;
|
||||
import org.dromara.sms4j.aliyun.entity.AlibabaResponse;
|
||||
import org.dromara.sms4j.aliyun.utils.AliyunUtils;
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.callback.CallBack;
|
||||
@ -98,16 +98,12 @@ public class AlibabaSmsImpl implements SmsBlend {
|
||||
.addHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||
.addBody(paramStr)
|
||||
.onSuccess(((data, req, res) -> {
|
||||
AlibabaResponse alibabaResponse = res.get(AlibabaResponse.class);
|
||||
smsResponse.setCode(alibabaResponse.getCode());
|
||||
smsResponse.setMessage(alibabaResponse.getMessage());
|
||||
smsResponse.setBizId(alibabaResponse.getBizId());
|
||||
smsResponse.setData(alibabaResponse);
|
||||
JSONObject jsonBody = res.get(JSONObject.class);
|
||||
log.info(jsonBody.toJSONString());
|
||||
}))
|
||||
.onError((ex, req, res) -> {
|
||||
AlibabaResponse alibabaResponse = res.get(AlibabaResponse.class);
|
||||
smsResponse.setErrMessage(alibabaResponse.getMessage());
|
||||
smsResponse.setErrorCode(alibabaResponse.getCode());
|
||||
JSONObject jsonBody = res.get(JSONObject.class);
|
||||
log.info(jsonBody.toJSONString());
|
||||
})
|
||||
.execute();
|
||||
return smsResponse;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user