package com.yeshi.buwan.util;
|
|
import com.google.gson.Gson;
|
import net.sf.json.JSONObject;
|
|
import javax.persistence.Entity;
|
|
@Entity
|
public class JsonUtilV2 {
|
|
private static Gson baseGson = new Gson();
|
|
public static String loadTrueJson(String data) {
|
JSONObject root = new JSONObject();
|
root.put("code", 0);
|
root.put("data", data);
|
root.put("msg", "");
|
String st = DESUtil.encode(root.toString());
|
return st;
|
}
|
|
public static String loadFalseJson(int code, String msg) {
|
JSONObject root = new JSONObject();
|
root.put("code", code);
|
root.put("msg", msg);
|
String st = DESUtil.encode(root.toString());
|
return st;
|
}
|
|
public static String loadFalseJson(String msg) {
|
return loadFalseJson(1, msg);
|
}
|
|
|
}
|