using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web; using QWPlatform.SystemLibrary.Utils; namespace PMS.WebUI { /// /// 创 建 人:王海洋 /// 创建日期:2018-12-10 /// 功能描述:JSON结果返回标准化结构 /// public class PmsJsonResoult { /// /// 实现化一个JSON返回结果 /// /// 是否成功 /// 返回消息 /// json数据 public PmsJsonResoult(bool isSuccess, string msg="",object json = null) { if (isSuccess) { this.code = HttpStatusCode.OK; } else { this.code = HttpStatusCode.InternalServerError; } this.msg = msg; this.obj = json; } /// /// 实例化一个JSON返回的结果 /// /// 权举代码 /// 说明消息 /// json数据 public PmsJsonResoult(HttpStatusCode code, string msg = "", object json = null) { this.code = code; this.msg = msg; this.obj = json; } /// /// 实例化一个JSON返回的结果 /// /// 权举代码 /// 说明消息 /// json数据 public PmsJsonResoult( string json = "") { this.url = json; } /// /// FormMakingFTP上传 /// public string url { get; set; } /// /// 返回的状态代码 /// public HttpStatusCode code { get; set; } /// /// 说明消息 /// public string msg { get; set; } /// /// 返回的json内容 /// public object obj { get; set; } /// /// 返回一个json对象字符串 /// /// public override string ToString() { return Strings.ObjectToJson(this); } } }