1234567891011121314151617181920212223242526272829303132333435363738 |
- namespace Znaf.Application.Communication
- {
- /// <summary>
- /// 响应基类
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public abstract class BaseResponse<T>
- {
- /// <summary>
- /// 响应是否成功
- /// </summary>
- public bool Success { get; set; }
- /// <summary>
- /// 错误信息
- /// </summary>
- public string Message { get; set; }
- /// <summary>
- /// 响应数据源
- /// </summary>
- public T Resource { get; set; }
- protected BaseResponse(T resource)
- {
- Success = true;
- Message = string.Empty;
- Resource = resource;
- }
- protected BaseResponse(string message)
- {
- Success = false;
- Message = message;
- Resource = default;
- }
- }
- }
|