diff --git a/.gitignore b/.gitignore
index 0a9fcf5..2400df5 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,14 @@
# 특정 환경에 따라 추가
+/private/
+/publish/
+/bin/
+/obj/
+
./private/
./privacy/
./publish/
-publish/
./bin/
-/private/
+
diff --git a/Program/Common/JWTToken/JwtTokenService.cs b/Program/Common/JWTToken/JwtTokenService.cs
index 250fc0e..0cfd7b5 100644
--- a/Program/Common/JWTToken/JwtTokenService.cs
+++ b/Program/Common/JWTToken/JwtTokenService.cs
@@ -64,8 +64,7 @@ public class JwtTokenService
{
rng.GetBytes(randomNumber);
}
-
- // return Convert.ToBase64String(randomNumber);
+
return new RefreshToken()
{
uid = uid,
@@ -77,6 +76,9 @@ public class JwtTokenService
}
+ ///
+ /// 여기는 엑세스 토큰의 확인을 위한 jwt 서비스 내의 인증 메서드
+ ///
public ClaimsPrincipal ValidateToken(string token)
{
if (string.IsNullOrWhiteSpace(token)) return null;
diff --git a/Program/Common/Model/Status.cs b/Program/Common/Model/Status.cs
index 593d759..acbf040 100644
--- a/Program/Common/Model/Status.cs
+++ b/Program/Common/Model/Status.cs
@@ -2,7 +2,7 @@ using System.Text.Json;
namespace AcaMate.Common.Models;
-public class APIResponseStatus
+public class APIResponseStatus
{
public Status status { get; set; }
public T? data { get; set; }
@@ -20,59 +20,103 @@ public class Status
}
-public static class DefaultResponse
+public static class APIResponse
{
- // private static readonly Lazy _instance = new Lazy();
- // public static ErrorResponse Instace => _instance.Value;
+ public static APIResponseStatus Send(string code, string message, T data)
+ {
+ return new APIResponseStatus
+ {
+ status = new Status()
+ {
+ code = code,
+ message = message
+ },
+ data = data
+ };
+ }
- // private ErrorResponse()
- // {
- // // 외부 초기화 방지
- // }
+ ///
+ /// 반환값 없는 API 정상 동작시
+ ///
+ public static APIResponseStatus Success (){
+ return Send("000", "정상", "");
+ }
- public static APIResponseStatus Success = new APIResponseStatus
+ public static APIResponseStatus InvalidInputError()
{
- status = new Status()
- {
- code = "000",
- message = "정상"
- }
- };
+ return Send("001", "입력 값이 유효하지 않습니다.", "");
+ }
- public static APIResponseStatus InvalidInputError = new APIResponseStatus
+ public static APIResponseStatus NotFoundError()
{
- status = new Status()
- {
- code = "001",
- message = "입력 값이 유효하지 않습니다."
- }
- };
+ return Send("002", "알맞은 값을 찾을 수 없습니다.", "");
+ }
- public static APIResponseStatus NotFoundError = new APIResponseStatus
+ public static APIResponseStatus InternalSeverError()
{
- status = new Status()
- {
- code = "002",
- message = "알맞은 값을 찾을 수 없습니다."
- }
- };
+ return Send("003", "통신에 오류가 발생하였습니다.", "");
+ }
- public static APIResponseStatus InternalSeverError = new APIResponseStatus
+ public static APIResponseStatus UnknownError()
{
- status = new Status
- {
- code = "003",
- message = "통신에 오류가 발생하였습니다."
- }
- };
-
-
- public static APIResponseStatus UnknownError = new APIResponseStatus
- {
- status = new Status()
- {
- code = "999",
- message = "알 수 없는 오류가 발생하였습니다.."
- }
- };
+ return Send("999", "알 수 없는 오류가 발생하였습니다.", "");
+ }
}
+//
+// public static class DefaultResponse
+// {
+// // private static readonly Lazy _instance = new Lazy();
+// // public static ErrorResponse Instace => _instance.Value;
+//
+// // private ErrorResponse()
+// // {
+// // // 외부 초기화 방지
+// // }
+//
+//
+// public static APIResponseStatus Success = new APIResponseStatus
+// {
+// status = new Status()
+// {
+// code = "000",
+// message = "정상"
+// }
+// };
+//
+// public static APIResponseStatus InvalidInputError = new APIResponseStatus
+// {
+// status = new Status()
+// {
+// code = "001",
+// message = "입력 값이 유효하지 않습니다."
+// }
+// };
+//
+// public static APIResponseStatus NotFoundError = new APIResponseStatus
+// {
+// status = new Status()
+// {
+// code = "002",
+// message = "알맞은 값을 찾을 수 없습니다."
+// }
+// };
+//
+// public static APIResponseStatus InternalSeverError = new APIResponseStatus
+// {
+// status = new Status
+// {
+// code = "003",
+// message = "통신에 오류가 발생하였습니다."
+// }
+// };
+//
+//
+// public static APIResponseStatus UnknownError = new APIResponseStatus
+// {
+// status = new Status()
+// {
+// code = "999",
+// message = "알 수 없는 오류가 발생하였습니다."
+// }
+// };
+// }
diff --git a/Program/V1/Controllers/AppController.cs b/Program/V1/Controllers/AppController.cs
index f202268..c4bd71e 100644
--- a/Program/V1/Controllers/AppController.cs
+++ b/Program/V1/Controllers/AppController.cs
@@ -25,7 +25,7 @@ public class AppController : ControllerBase
{
if (string.IsNullOrEmpty(type))
{
- return BadRequest(DefaultResponse.InvalidInputError);
+ return BadRequest(APIResponse.InvalidInputError);
}
try
@@ -34,7 +34,7 @@ public class AppController : ControllerBase
if (version == null)
{
- return NotFound(DefaultResponse.NotFoundError);
+ return NotFound(APIResponse.NotFoundError);
}
var response = new APIResponseStatus
@@ -62,7 +62,7 @@ public class AppController : ControllerBase
catch (Exception ex)
{
Console.WriteLine($"{ex.Message}\n{ex.StackTrace}");
- return StatusCode(500, DefaultResponse.UnknownError);
+ return StatusCode(500, APIResponse.UnknownError);
}
}
}
\ No newline at end of file
diff --git a/Program/V1/Controllers/PushController.cs b/Program/V1/Controllers/PushController.cs
index 7cc0d10..a6c7afe 100644
--- a/Program/V1/Controllers/PushController.cs
+++ b/Program/V1/Controllers/PushController.cs
@@ -25,6 +25,7 @@ public class PushController : ControllerBase
public IActionResult GetPushData()
{
return Ok("SEND");
+
}
@@ -39,66 +40,74 @@ public class PushController : ControllerBase
/// Internal server error occurred.
/// Service unavailable.
[HttpPost("send")]
- [CustomOperation("푸시전송", "저장된 양식으로, 사용자에게 푸시를 전송한다.", "푸시")]
+ [CustomOperation("푸시전송", "저장된 양식으로, 사용자에게 푸시를 전송한다.(로컬 테스트 불가)", "푸시")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus