-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#437 알림 전체 조회 API 구현 #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
6a4c564
23d3ef2
41ab7ec
ab1284d
863544a
a59529b
944801b
7907672
1a6a86c
a21e497
10e7d9c
8e1277e
2e29eb1
f1b6327
10207ea
5f40a43
78be1cd
4cf0b31
cf9eb09
7c82b60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // | ||
| // NotificationType+Data.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by 더스틴 on 6/7/26. | ||
| // | ||
|
|
||
| extension NotificationType { | ||
|
|
||
| var responseKey: String { | ||
| switch self { | ||
| case .questOpen: | ||
| "QUEST_OPEN" | ||
| case .comment: | ||
| "COMMENT" | ||
| case .like: | ||
| "LIKE" | ||
| } | ||
| } | ||
|
|
||
| static func keyToEnum(_ key: String) -> Self? { | ||
| allCases.first { $0.responseKey == key } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // | ||
| // NotificationListResponseDTO.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by 더스틴 on 6/5/26. | ||
| // | ||
|
|
||
| struct NotificationListResponseDTO: Decodable { | ||
| let notifications: [NotificationResponseDTO] | ||
| } | ||
|
|
||
| struct NotificationResponseDTO: Decodable { | ||
| let notificationID: Int | ||
| let notificationType: String | ||
| let title: String | ||
| let content: String | ||
| let isRead: Bool | ||
| let createdAt: String | ||
| let landingURL: String | ||
| } | ||
|
Comment on lines
+12
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# NetworkService의 JSONDecoder 설정 확인
rg -n "keyDecodingStrategy|convertFromSnakeCase" --type swiftRepository: 36-APPJAM-HEARTZ/BYEBOO-iOS Length of output: 53 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Inspect the targeted DTO file around the reported lines
FILE="ByeBoo-iOS/ByeBoo-iOS/Data/Model/NotificationListReponseDTO.swift"
echo "---- ${FILE} ----"
nl -ba "$FILE" | sed -n '1,200p'
# 2) Check whether CodingKeys exists for NotificationResponseDTO (and nearby)
echo "---- CodingKeys in file ----"
rg -n "CodingKeys|notificationID|landingURL|NotificationResponseDTO" "$FILE"
# 3) Find JSONDecoder usage/config anywhere else
echo "---- JSONDecoder initialization/usages ----"
rg -n "JSONDecoder\(" --type swift
# 4) Look for any decode patterns that set decoder.keyDecodingStrategy explicitly
echo "---- keyDecodingStrategy assignments ----"
rg -n "keyDecodingStrategy" --type swift
# 5) Also search for CodingKeys implementations anywhere (to gauge existing approach)
echo "---- Any CodingKeys usage ----"
rg -n "enum CodingKeys" --type swiftRepository: 36-APPJAM-HEARTZ/BYEBOO-iOS Length of output: 208 🏁 Script executed: #!/bin/bash
set -euo pipefail
FILE="ByeBoo-iOS/ByeBoo-iOS/Data/Model/NotificationListReponseDTO.swift"
echo "== File exists? =="
ls -la "$FILE" || true
echo "== First 200 lines with numbers (using cat -n) =="
cat -n "$FILE" | sed -n '1,200p'
echo "== CodingKeys / NotificationResponseDTO in this file =="
rg -n "CodingKeys|enum CodingKeys|NotificationResponseDTO|notificationID|landingURL" "$FILE" || true
echo "== JSONDecoder initialization/usages across repo =="
rg -n "JSONDecoder\(" --type swift . || true
echo "== keyDecodingStrategy usage across repo =="
rg -n "keyDecodingStrategy|convertFromSnakeCase" --type swift . || true
echo "== Any enum CodingKeys usage across repo (spot check) =="
rg -n "enum CodingKeys" --type swift . | head -n 50 || trueRepository: 36-APPJAM-HEARTZ/BYEBOO-iOS Length of output: 2643 JSON 키 매핑(CodingKeys / snake_case 변환) 설정이 없어 디코딩 실패 가능
[resolve_review_comment in comment context not applicable] 🤖 Prompt for AI Agents |
||
|
|
||
| extension NotificationListResponseDTO { | ||
| func toEntity() -> NotificationListEntity { | ||
| let notifications = notifications.map { $0.toEntity() } | ||
| return .init(notifications: notifications) | ||
| } | ||
| } | ||
|
|
||
| extension NotificationResponseDTO { | ||
| func toEntity() -> NotificationEntity { | ||
| .init( | ||
| notificationID: notificationID, | ||
| notificationType: NotificationType.keyToEnum(notificationType), | ||
| title: title, | ||
| content: content, | ||
| isRead: isRead, | ||
| createdAt: createdAt, | ||
| landingURL: landingURL | ||
| ) | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,68 +2,62 @@ | |
| // NotificationAPI.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 11/22/25. | ||
| // Created by 더스틴 on 6/5/26. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 더스틴 하이 |
||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| import Alamofire | ||
|
|
||
| enum NotificationAPI { | ||
| case saveToken(dto: FCMTokenDTO) | ||
| case updateToken(dto: FCMTokenDTO) | ||
| case deleteToken(dto: FCMTokenDTO) | ||
| case fetchNotificationList | ||
| } | ||
|
|
||
| extension NotificationAPI: EndPoint { | ||
|
|
||
| var basePath: String { | ||
| return "/api/v1/notification-tokens" | ||
| return "/api/v1/notifications" | ||
| } | ||
|
|
||
| var path: String { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return "" | ||
| case .fetchNotificationList: | ||
| "" | ||
| } | ||
| } | ||
|
|
||
| var method: HTTPMethod { | ||
| switch self { | ||
| case .saveToken: | ||
| return .post | ||
| case .updateToken: | ||
| return .patch | ||
| case .deleteToken: | ||
| return .put | ||
| case .fetchNotificationList: | ||
| .get | ||
| } | ||
| } | ||
|
|
||
| var headers: HeaderType { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return .withAuth | ||
| case .fetchNotificationList: | ||
| .withAuth | ||
| } | ||
| } | ||
|
|
||
| var parameterEncoding: ParameterEncoding { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return JSONEncoding.default | ||
| case .fetchNotificationList: | ||
| JSONEncoding.default | ||
| } | ||
| } | ||
|
|
||
| var queryParameters: [String : String]? { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return nil | ||
| case .fetchNotificationList: | ||
| nil | ||
| } | ||
| } | ||
|
|
||
| var bodyParameters: Parameters? { | ||
| switch self { | ||
| case .saveToken(let dto), .updateToken(let dto), .deleteToken(let dto): | ||
| return try? dto.toDictionary() | ||
| case .fetchNotificationList: | ||
| nil | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // | ||
| // NotificationTokenAPI.swift | ||
| // ByeBoo-iOS | ||
| // | ||
| // Created by APPLE on 11/22/25. | ||
| // | ||
|
dev-domo marked this conversation as resolved.
|
||
|
|
||
| import Foundation | ||
|
|
||
| import Alamofire | ||
|
|
||
| enum NotificationTokenAPI { | ||
| case saveToken(dto: FCMTokenDTO) | ||
| case updateToken(dto: FCMTokenDTO) | ||
| case deleteToken(dto: FCMTokenDTO) | ||
| } | ||
|
|
||
| extension NotificationTokenAPI: EndPoint { | ||
|
|
||
| var basePath: String { | ||
| return "/api/v1/notification-tokens" | ||
| } | ||
|
|
||
| var path: String { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return "" | ||
| } | ||
| } | ||
|
|
||
| var method: HTTPMethod { | ||
| switch self { | ||
| case .saveToken: | ||
| return .post | ||
| case .updateToken: | ||
| return .patch | ||
| case .deleteToken: | ||
| return .put | ||
| } | ||
| } | ||
|
|
||
| var headers: HeaderType { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return .withAuth | ||
| } | ||
| } | ||
|
|
||
| var parameterEncoding: ParameterEncoding { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return JSONEncoding.default | ||
| } | ||
| } | ||
|
|
||
| var queryParameters: [String : String]? { | ||
| switch self { | ||
| case .saveToken, .updateToken, .deleteToken: | ||
| return nil | ||
| } | ||
| } | ||
|
|
||
| var bodyParameters: Parameters? { | ||
| switch self { | ||
| case .saveToken(let dto), .updateToken(let dto), .deleteToken(let dto): | ||
| return try? dto.toDictionary() | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release 서명이 Development 프로필로 설정되어 배포 아카이브가 실패할 수 있습니다.
Line 352와 Line 375이 Release(iPhoneOS)에서
iPhone Developer+match Development ...를 사용하고 있어, Line 350의 Prod entitlements와 함께 배포용 서명 체인이 깨질 가능성이 큽니다. Release는 배포용 인증서/프로필로 분리해 주세요.수정 예시
Also applies to: 375-375
🤖 Prompt for AI Agents