1 changed files with 31 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||||
|
package cn.chjyj.szwh.utils; |
||||
|
|
||||
|
import com.alibaba.fastjson2.JSONObject; |
||||
|
|
||||
|
public class AjaxResult { |
||||
|
/** |
||||
|
* 接口返回数据 |
||||
|
* @param msg |
||||
|
* @param resultJson |
||||
|
* @return |
||||
|
*/ |
||||
|
public static JSONObject success(String msg,JSONObject resultJson){ |
||||
|
JSONObject result = new JSONObject(); |
||||
|
result.put("code",200); |
||||
|
result.put("msg",msg); |
||||
|
result.put("data",resultJson); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 异常信息 |
||||
|
* @param msg |
||||
|
* @return |
||||
|
*/ |
||||
|
public static JSONObject error(String msg){ |
||||
|
JSONObject result = new JSONObject(); |
||||
|
result.put("code",400); |
||||
|
result.put("msg",msg); |
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue