[♻️] 푸시 API 내의 변수 이름 통일화

This commit is contained in:
김선규 2025-03-10 17:04:39 +09:00
parent e6672ed630
commit a0beed0415

View File

@ -243,7 +243,7 @@ public class PushController : ControllerBase
[HttpPost("create")] [HttpPost("create")]
[CustomOperation("푸시 생성", "새로운 푸시 양식을 생성한다.", "푸시")] [CustomOperation("푸시 생성", "새로운 푸시 양식을 생성한다.", "푸시")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus<object>))] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus<object>))]
public async Task<IActionResult> CreatePush(string token, string refresh, [FromBody] CreatePush createPush) public async Task<IActionResult> CreatePush(string token, string refresh, [FromBody] CreatePush request)
{ {
string uid = ""; string uid = "";
if (token == "System") uid = "System"; if (token == "System") uid = "System";
@ -267,18 +267,18 @@ public class PushController : ControllerBase
try { try {
summary = _repositoryService.ReadSummary(typeof(PushController), "CreatePush"); 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 DBPayload payload = new DBPayload
{ {
bid = createPush.bid, bid = request.bid,
pid = $"AP{DateTime.Now:yyyyMMdd}{frontLetters}{DateTime.Now:HHmmss}{afterLetters}", pid = $"AP{DateTime.Now:yyyyMMdd}{frontLetters}{DateTime.Now:HHmmss}{afterLetters}",
title = createPush.title, title = request.title,
subtitle = createPush.subtitle, subtitle = request.subtitle,
body = createPush.body, body = request.body,
alert_yn = createPush.alert_yn, alert_yn = request.alert_yn,
category = createPush.category, category = request.category,
content = createPush.content, content = request.content,
}; };
if (await _repositoryService.SaveData<DBPayload>(payload)) if (await _repositoryService.SaveData<DBPayload>(payload))
@ -419,7 +419,7 @@ public class PushController : ControllerBase
[HttpPost("list")] [HttpPost("list")]
[CustomOperation("사용자 푸시 목록 조회", "해당 사용자가 받은 푸시의 정보를 조회한다.", "푸시")] [CustomOperation("사용자 푸시 목록 조회", "해당 사용자가 받은 푸시의 정보를 조회한다.", "푸시")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus<object>))] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(APIResponseStatus<object>))]
public async Task<IActionResult> SearchToUserPush(string token, string refresh, int size, [FromBody] PushCabinet? pushData) public async Task<IActionResult> SearchToUserPush(string token, string refresh, int size, [FromBody] PushCabinet? request)
{ {
string uid = ""; string uid = "";
if (token == "System") uid = "System"; if (token == "System") uid = "System";
@ -436,7 +436,7 @@ public class PushController : ControllerBase
try try
{ {
summary = _repositoryService.ReadSummary(typeof(PushController), "SearchToUserPush"); summary = _repositoryService.ReadSummary(typeof(PushController), "SearchToUserPush");
if (pushData == null) if (request == null)
{ {
var pagedData = await _dbContext.PushCabinet.Where(c => c.uid == uid) var pagedData = await _dbContext.PushCabinet.Where(c => c.uid == uid)
.OrderBy(c=> c.send_date) .OrderBy(c=> c.send_date)
@ -447,7 +447,7 @@ public class PushController : ControllerBase
} }
else 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(); .Select(p => p.send_date).FirstOrDefaultAsync();
var query = _dbContext.PushCabinet.OrderBy(c => c.send_date).AsQueryable(); var query = _dbContext.PushCabinet.OrderBy(c => c.send_date).AsQueryable();
query = query.Where(c => c.send_date > sort); query = query.Where(c => c.send_date > sort);