Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/sopt/push/dto/ApiGatewayRequestDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

import java.util.Map;

public record ApiGatewayRequestDto(RegisterHeaderDto header, Map<String, Object> body) {}
public record ApiGatewayRequestDto(RequestHeaderDto header, Map<String, Object> body) {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
import com.sopt.push.enums.Platform;
import com.sopt.push.enums.Services;

public record RegisterHeaderDto(
public record RequestHeaderDto(
String transactionId, Services service, Platform platform, Actions action) {}
13 changes: 9 additions & 4 deletions src/main/java/com/sopt/push/lambda/ApiGatewayHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import com.sopt.push.domain.DeviceTokenEntity;
import com.sopt.push.dto.ApiGatewayRequestDto;
import com.sopt.push.dto.CreateHistoryDto;
import com.sopt.push.dto.RegisterHeaderDto;
import com.sopt.push.dto.RequestDeleteTokenDto;
import com.sopt.push.dto.RequestHeaderDto;
import com.sopt.push.dto.RequestRegisterUserDto;
import com.sopt.push.dto.RequestSendAllPushMessageDto;
import com.sopt.push.dto.RequestSendPushMessageDto;
Expand Down Expand Up @@ -114,9 +114,14 @@ private ApiGatewayRequestDto extractRequest(APIGatewayProxyRequestEvent event) {
String transactionId = headers.get(HEADER_TRANSACTION_ID);
String serviceStr = headers.get(HEADER_SERVICE);
Actions action = Actions.fromValue(actionStr);
Platform platform = Platform.fromValue(platformStr);
RegisterHeaderDto header =
new RegisterHeaderDto(transactionId, Services.fromValue(serviceStr), platform, action);
Platform platform = null;

if (action == Actions.REGISTER || action == Actions.CANCEL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저번에 조건 2개 이상이면 따로 변수로 빼기로 했던 거 맞나영 ?? 컨벤션으로 정했는지 궁금합니당

platform = Platform.fromValue(platformStr);
}

RequestHeaderDto header =
new RequestHeaderDto(transactionId, Services.fromValue(serviceStr), platform, action);

return new ApiGatewayRequestDto(header, body);
} catch (Exception e) {
Expand Down