forked from AcaMate/AcaMate_API
71 lines
1.8 KiB
C#
71 lines
1.8 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 DefaultResponse
|
|
{
|
|
// private static readonly Lazy<ErrorResponse> _instance = new Lazy<ErrorResponse>();
|
|
// public static ErrorResponse Instace => _instance.Value;
|
|
|
|
// private ErrorResponse()
|
|
// {
|
|
// // 외부 초기화 방지
|
|
// }
|
|
|
|
public static readonly APIResponseStatus<string> Success = new APIResponseStatus<string>
|
|
{
|
|
status = new Status()
|
|
{
|
|
code = "000",
|
|
message = "정상"
|
|
}
|
|
};
|
|
|
|
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 = "알 수 없는 오류가 발생하였습니다.."
|
|
}
|
|
};
|
|
}
|