You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
846 B
40 lines
846 B
using LitJson;
|
|
|
|
namespace Operation
|
|
{
|
|
public class ResultUtils
|
|
{
|
|
|
|
public static JsonData Success(int code = 200, string message = "success")
|
|
{
|
|
|
|
var json = new JsonData();
|
|
json["ret"] = code;
|
|
json["message"] = message;
|
|
return json;
|
|
}
|
|
public static void Success(JsonData json)
|
|
{
|
|
json["ret"] = 200;
|
|
json["message"] = "success";
|
|
}
|
|
|
|
public static JsonData Error(int code = -1, string message = "error")
|
|
{
|
|
|
|
var json = new JsonData();
|
|
json["ret"] = code;
|
|
json["message"] = message;
|
|
return json;
|
|
}
|
|
|
|
public static void Error(JsonData json)
|
|
{
|
|
json["ret"] = -1;
|
|
json["message"] = "error";
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|