解决EqualsAvoidNullRule问题

This commit is contained in:
dftre 2025-01-07 11:27:58 +08:00
parent 9b284dd0e2
commit 7a855011ba
2 changed files with 4 additions and 4 deletions

View File

@ -67,7 +67,7 @@ public class DySmsUtil {
try {
// 复制代码运行请自行打印 API 的返回值
SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, new RuntimeOptions());
if (sendSmsResponse.getBody().getCode().equals("OK")) {
if ("OK".equals(sendSmsResponse.getBody().getCode())) {
logger.info("短信接口返回的数据--- {}", sendSmsResponse.getBody().getMessage());
} else {
logger.error("短信接口返回的数据--- {}", sendSmsResponse.getBody().getMessage());

View File

@ -84,7 +84,7 @@ public class SQBServiceImpl {
String result = httpPost(url, params.toString(), sign, sqbConfig.getVendorSn());
JSONObject retObj = JSON.parseObject(result);
String resCode = retObj.get("result_code").toString();
if (!resCode.equals("200"))
if (!"200".equals(resCode))
return null;
String responseStr = retObj.get("biz_response").toString();
JSONObject terminal = JSON.parseObject(responseStr);
@ -113,7 +113,7 @@ public class SQBServiceImpl {
String result = httpPost(url, params.toString(), sign, sqbConfig.getTerminalSn());
JSONObject retObj = JSON.parseObject(result);
String resCode = retObj.get("result_code").toString();
if (!resCode.equals("200"))
if (!"200".equals(resCode))
return null;
String responseStr = retObj.get("biz_response").toString();
JSONObject terminal = JSON.parseObject(responseStr);
@ -166,7 +166,7 @@ public class SQBServiceImpl {
String result = httpPost(url, params, sign, sqbConfig.getTerminalSn());
JSONObject retObj = JSON.parseObject(result);
String resCode = retObj.get("result_code").toString();
if (!resCode.equals("200"))
if (!"200".equals(resCode))
return null;
String responseStr = retObj.get("biz_response").toString();
return JSONObject.parseObject(responseStr);