using System; using Newtonsoft.Json; namespace SDKCSharp.Response { /// /// 返回的Response,新建Response要继承这个类 /// public abstract class BaseResponse { /// /// 状态码,0表示成功,其它都是失败 /// [JsonProperty("code")] public string Code { get; set; } /// /// 消息,如果有错误则为错误信息 /// [JsonProperty("msg")] public string Msg { get; set; } /// /// 错误状态码 /// /// The sub code. [JsonProperty("sub_code")] public string SubCode { get; set; } /// /// 错误消息 /// /// The sub message. [JsonProperty("sub_msg")] public string SubMsg { get; set; } /// /// 数据 /// [JsonProperty("body")] public string Body { get; set; } /// /// 是否成功 /// /// public bool IsSuccess() { return string.IsNullOrEmpty(SubCode); } } }