添加srms接口
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package com.jero.modules.docking.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 14:45
|
||||
*/
|
||||
public class ResponsesUtil {
|
||||
|
||||
|
||||
public static JSONObject getJsonResult(Object jsonMessageHeader,JSONObject jsonResponses) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("MessageHeader",jsonMessageHeader);
|
||||
json.put("Responses",jsonResponses);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static JSONObject getJsonOk() {
|
||||
return getJsonOk("");
|
||||
}
|
||||
|
||||
public static JSONObject getJsonOk(String message) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("srmsCode",CommonConstant.SC_OK_200);
|
||||
jsonResponses.put("message",message);
|
||||
jsonResponses.put("success",true);
|
||||
jsonResponses.put("timestamp",System.currentTimeMillis());
|
||||
return jsonResponses;
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErr() {
|
||||
return getJsonErr("");
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErr(String message) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("srmsCode",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
jsonResponses.put("message",message);
|
||||
jsonResponses.put("success",false);
|
||||
jsonResponses.put("timestamp",System.currentTimeMillis());
|
||||
return jsonResponses;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user