From a0beed0415f091fa121cfa989630bbc7b03b33e9 Mon Sep 17 00:00:00 2001 From: Seonkyu_Kim Date: Mon, 10 Mar 2025 17:04:39 +0900 Subject: [PATCH] =?UTF-8?q?[=E2=99=BB=EF=B8=8F]=20=ED=91=B8=EC=8B=9C=20API?= =?UTF-8?q?=20=EB=82=B4=EC=9D=98=20=EB=B3=80=EC=88=98=20=EC=9D=B4=EB=A6=84?= =?UTF-8?q?=20=ED=86=B5=EC=9D=BC=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program/V1/Controllers/PushController.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Program/V1/Controllers/PushController.cs b/Program/V1/Controllers/PushController.cs index db88fd2..467ca58 100644 --- a/Program/V1/Controllers/PushController.cs +++ b/Program/V1/Controllers/PushController.cs @@ -243,7 +243,7 @@ public class PushController : ControllerBase [HttpPost("create")] [CustomOperation("푸시 생성", "새로운 푸시 양식을 생성한다.", "푸시")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus))] - public async Task CreatePush(string token, string refresh, [FromBody] CreatePush createPush) + public async Task CreatePush(string token, string refresh, [FromBody] CreatePush request) { string uid = ""; if (token == "System") uid = "System"; @@ -267,18 +267,18 @@ public class PushController : ControllerBase try { summary = _repositoryService.ReadSummary(typeof(PushController), "CreatePush"); - if (await _dbContext.Academy.AnyAsync(a => a.bid == createPush.bid)) + if (await _dbContext.Academy.AnyAsync(a => a.bid == request.bid)) { DBPayload payload = new DBPayload { - bid = createPush.bid, + bid = request.bid, pid = $"AP{DateTime.Now:yyyyMMdd}{frontLetters}{DateTime.Now:HHmmss}{afterLetters}", - title = createPush.title, - subtitle = createPush.subtitle, - body = createPush.body, - alert_yn = createPush.alert_yn, - category = createPush.category, - content = createPush.content, + title = request.title, + subtitle = request.subtitle, + body = request.body, + alert_yn = request.alert_yn, + category = request.category, + content = request.content, }; if (await _repositoryService.SaveData(payload)) @@ -419,7 +419,7 @@ public class PushController : ControllerBase [HttpPost("list")] [CustomOperation("사용자 푸시 목록 조회", "해당 사용자가 받은 푸시의 정보를 조회한다.", "푸시")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus))] - public async Task SearchToUserPush(string token, string refresh, int size, [FromBody] PushCabinet? pushData) + public async Task SearchToUserPush(string token, string refresh, int size, [FromBody] PushCabinet? request) { string uid = ""; if (token == "System") uid = "System"; @@ -436,7 +436,7 @@ public class PushController : ControllerBase try { summary = _repositoryService.ReadSummary(typeof(PushController), "SearchToUserPush"); - if (pushData == null) + if (request == null) { var pagedData = await _dbContext.PushCabinet.Where(c => c.uid == uid) .OrderBy(c=> c.send_date) @@ -447,7 +447,7 @@ public class PushController : ControllerBase } else { - var sort = await _dbContext.PushCabinet.Where(p=> p.id == pushData.id) + var sort = await _dbContext.PushCabinet.Where(p=> p.id == request.id) .Select(p => p.send_date).FirstOrDefaultAsync(); var query = _dbContext.PushCabinet.OrderBy(c => c.send_date).AsQueryable(); query = query.Where(c => c.send_date > sort);