namespace EntrustSettle.Model
{
///
/// 通用返回信息类
///
public class MessageModel
{
///
/// 状态码
///
public int status { get; set; } = 200;
///
/// 操作是否成功
///
public bool success { get; set; } = false;
///
/// 返回信息
///
public string msg { get; set; } = "";
///
/// 开发者信息
///
public string msgDev { get; set; }
///
/// 返回数据集合
///
public T response { get; set; }
///
/// 返回成功
///
/// 消息
///
public static MessageModel Success(string msg) {
return Message(true, msg, default);
}
///
/// 返回成功
///
/// 消息
/// 数据
///
public static MessageModel Success(string msg, T response)
{
return Message(true, msg, response);
}
///
/// 返回失败
///
/// 消息
///
public static MessageModel Fail(string msg)
{
return Message(false, msg, default);
}
///
/// 返回失败
///
/// 消息
/// 数据
///
public static MessageModel Fail(string msg, T response)
{
return Message(false, msg, response);
}
///
/// 返回消息
///
/// 失败/成功
/// 消息
/// 数据
///
public static MessageModel Message(bool success,string msg, T response )
{
return new MessageModel() { msg = msg, response = response, success = success };
}
}
public class MessageModel
{
///
/// 状态码
///
public int status { get; set; } = 200;
///
/// 操作是否成功
///
public bool success { get; set; } = false;
///
/// 返回信息
///
public string msg { get; set; } = "";
///
/// 返回数据集合
///
public object response { get; set; }
}
}