using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWare.Authorize
|
{
|
/// <summary>
|
/// 方法返回实体
|
/// </summary>
|
public class AuthorizeFunRetEntity
|
{
|
/// <summary>
|
/// 方法返回结果
|
/// </summary>
|
public bool result { get; set; }
|
|
/// <summary>
|
/// 方法返回消息
|
/// </summary>
|
public string resMsg { get; set; }
|
|
/// <summary>
|
/// 方法警告消息
|
/// </summary>
|
public string warnMsg { get; set; }
|
|
public object resData { get; set; }
|
|
|
/// <summary>
|
/// 剩余天数
|
/// </summary>
|
public double? remainingDays { get; set; }
|
|
/// <summary>
|
/// 到期日期
|
/// </summary>
|
public string expiryDate { get; set; }
|
|
/// <summary>
|
/// 授权日期
|
/// </summary>
|
public string issueDate { get; set; }
|
|
/// <summary>
|
/// 项目名称
|
/// </summary>
|
public string projectId { get; set; }
|
|
/// <summary>
|
/// 授权类型
|
/// </summary>
|
public string type { get; set; }
|
|
/// <summary>
|
/// 绑定MAC
|
/// </summary>
|
public string macAddress { get; set; }
|
|
/// <summary>
|
/// 返回成功
|
/// </summary>
|
/// <param name="_resMsg"></param>
|
/// <returns></returns>
|
public static AuthorizeFunRetEntity Success(string _resMsg, AuthorizeFunRetEntity newFun)
|
{
|
return new AuthorizeFunRetEntity()
|
{
|
result = true,
|
resMsg = _resMsg,
|
|
expiryDate = newFun?.expiryDate,
|
issueDate = newFun?.issueDate,
|
macAddress = newFun?.macAddress,
|
projectId = newFun?.projectId,
|
type = newFun?.type
|
};
|
}
|
/// <summary>
|
/// 返回成功
|
/// </summary>
|
/// <param name="_resMsg"></param>
|
/// <returns></returns>
|
public static AuthorizeFunRetEntity Success(string _resMsg, double _remainingDays, AuthorizeFunRetEntity newFun)
|
{
|
return new AuthorizeFunRetEntity()
|
{
|
result = true,
|
resMsg = _resMsg,
|
remainingDays = _remainingDays,
|
|
expiryDate = newFun.expiryDate,
|
issueDate = newFun.issueDate,
|
macAddress = newFun.macAddress,
|
projectId = newFun.projectId,
|
type = newFun.type
|
};
|
}
|
|
/// <summary>
|
/// 返回成功
|
/// </summary>
|
/// <param name="_resMsg"></param>
|
/// <returns></returns>
|
public static AuthorizeFunRetEntity Success(string _resMsg, double _remainingDays, string _warnMsg)
|
{
|
return new AuthorizeFunRetEntity()
|
{
|
result = true,
|
resMsg = _resMsg,
|
remainingDays = _remainingDays,
|
warnMsg = _warnMsg
|
};
|
}
|
|
/// <summary>
|
/// 返回失败
|
/// </summary>
|
/// <param name="_resMsg"></param>
|
/// <returns></returns>
|
public static AuthorizeFunRetEntity Fail(string _resMsg, object _resData = null)
|
{
|
return new AuthorizeFunRetEntity()
|
{
|
result = false,
|
resMsg = _resMsg,
|
resData = _resData
|
};
|
}
|
|
/// <summary>
|
/// 返回失败
|
/// </summary>
|
/// <param name="_resMsg"></param>
|
/// <returns></returns>
|
public static AuthorizeFunRetEntity Fail(string _resMsg, double _remainingDays, AuthorizeFunRetEntity newFun)
|
{
|
return new AuthorizeFunRetEntity()
|
{
|
result = false,
|
resMsg = _resMsg,
|
remainingDays = _remainingDays,
|
|
expiryDate = newFun.expiryDate,
|
issueDate = newFun.issueDate,
|
macAddress = newFun.macAddress,
|
projectId = newFun.projectId,
|
type = newFun.type
|
};
|
}
|
}
|
}
|