forked from AcaMate/AcaMate_API
[♻️] 푸시 API 내의 변수 이름 통일화
This commit is contained in:
parent
e6672ed630
commit
a0beed0415
|
@ -243,7 +243,7 @@ public class PushController : ControllerBase
|
|||
[HttpPost("create")]
|
||||
[CustomOperation("푸시 생성", "새로운 푸시 양식을 생성한다.", "푸시")]
|
||||
[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 = "";
|
||||
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<DBPayload>(payload))
|
||||
|
@ -419,7 +419,7 @@ public class PushController : ControllerBase
|
|||
[HttpPost("list")]
|
||||
[CustomOperation("사용자 푸시 목록 조회", "해당 사용자가 받은 푸시의 정보를 조회한다.", "푸시")]
|
||||
[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 = "";
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user