using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using Newtonsoft.Json;
|
using Newtonsoft.Json.Linq;
|
|
namespace BatchService.Framework.Utility
|
{
|
public class JsonResultCommon
|
{
|
public int Id { get; set; }
|
public int ResultCode { get; set; }
|
public string Message { get; set; }
|
|
public JsonResultCommon OK(string message)
|
{
|
return new JsonResultCommon()
|
{
|
Id = 0,
|
ResultCode = 0,
|
Message = message == null ? "" : message,
|
};
|
}
|
public JsonResultCommon OK<T>(List<T> array)
|
{
|
string parseString = JsonConvert.SerializeObject(array);
|
return new JsonResultCommon()
|
{
|
Id = 0,
|
ResultCode = 0,
|
Message = parseString == null ? "" : parseString,
|
};
|
}
|
public JsonResultCommon Error(int resultCode, string message)
|
{
|
return new JsonResultCommon()
|
{
|
Id = -1,
|
ResultCode = resultCode,
|
Message = message == null ? "" : message,
|
};
|
}
|
}
|
}
|