62 lines
1.5 KiB
C#
62 lines
1.5 KiB
C#
namespace AcaMate.Common.Models;
|
|
|
|
public class APIResponseStatus<T>
|
|
{
|
|
public Status Status { get; set; }
|
|
public T data { get; set; }
|
|
}
|
|
|
|
public class Status
|
|
{
|
|
public string Code { get; set; }
|
|
public string Message { get; set; }
|
|
}
|
|
|
|
public static class ErrorResponse
|
|
{
|
|
// private static readonly Lazy<ErrorResponse> _instance = new Lazy<ErrorResponse>();
|
|
// public static ErrorResponse Instace => _instance.Value;
|
|
|
|
// private ErrorResponse()
|
|
// {
|
|
// // 외부 초기화 방지
|
|
// }
|
|
|
|
public static readonly APIResponseStatus<string> InvalidInputError = new APIResponseStatus<string>
|
|
{
|
|
Status = new Status()
|
|
{
|
|
Code = "001",
|
|
Message = "입력 값이 유효하지 않습니다."
|
|
}
|
|
};
|
|
|
|
public static readonly APIResponseStatus<string> NotFoundError = new APIResponseStatus<string>
|
|
{
|
|
Status = new Status()
|
|
{
|
|
Code = "002",
|
|
Message = "알맞은 값을 찾을 수 없습니다."
|
|
}
|
|
};
|
|
|
|
public static readonly APIResponseStatus<string> InternalSeverError = new APIResponseStatus<string>
|
|
{
|
|
Status = new Status()
|
|
{
|
|
Code = "003",
|
|
Message = "통신에 오류가 발생하였습니다."
|
|
}
|
|
};
|
|
|
|
|
|
public static readonly APIResponseStatus<string> UnknownError = new APIResponseStatus<string>
|
|
{
|
|
Status = new Status()
|
|
{
|
|
Code = "999",
|
|
Message = "알 수 없는 오류가 발생하였습니다.."
|
|
}
|
|
};
|
|
}
|