no message

main
HUOJIN\92525 2025-09-01 16:30:03 +08:00
parent c14eb21c74
commit 1f6228b58c
2 changed files with 4 additions and 4 deletions

View File

@ -6,14 +6,14 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class LesResult { public class LesResult {
public static JSONObject fail(String requestId, String displayMsg) { public static JSONObject fail(String requestId, String displayMsg) {
return result(requestId, 400, displayMsg, null); return result(requestId, "400", displayMsg, null);
} }
public static JSONObject success(String requestId) { public static JSONObject success(String requestId) {
return result(requestId, 2000, "", null); return result(requestId, "success", "", null);
} }
public static JSONObject result(String requestId, int resultCode, String displayMsg, Object data) { public static JSONObject result(String requestId, String resultCode, String displayMsg, Object data) {
JSONObject jsonObject = new JSONObject(true); // true 保持顺序 JSONObject jsonObject = new JSONObject(true); // true 保持顺序
jsonObject.put("requestId", requestId); jsonObject.put("requestId", requestId);
jsonObject.put("serverTime", System.currentTimeMillis()); // 数值类型时间戳 jsonObject.put("serverTime", System.currentTimeMillis()); // 数值类型时间戳

View File

@ -214,7 +214,7 @@ public class LesServiceImpl implements LesService {
String resultCode = resulObject.getString("resultCode"); String resultCode = resulObject.getString("resultCode");
String displayMsg = resulObject.getString("displayMsg"); String displayMsg = resulObject.getString("displayMsg");
if (!"2000".equals(resultCode)) { if (!"success".equals(resultCode)) {
throw new BadRequestException("LES返回消息:" + displayMsg); throw new BadRequestException("LES返回消息:" + displayMsg);
} }
} }