Skip to content

[FEAT] 회원가입 플로우 api 연동#55

Merged
duthd3 merged 13 commits into
developfrom
feat/#40
Jun 2, 2026
Merged

[FEAT] 회원가입 플로우 api 연동#55
duthd3 merged 13 commits into
developfrom
feat/#40

Conversation

@duthd3
Copy link
Copy Markdown
Collaborator

@duthd3 duthd3 commented May 27, 2026

작업 내용

  • 회원가입 플로우 API 연동

    • 소셜 로그인 결과에 추천 닉네임을 포함하도록 확장
    • 약관 조회 API 연동 및 약관 동의 화면 데이터 바인딩
    • 닉네임 검증 API 연동 후 성공 시에만 다음 화면으로 이동하도록 처리
  • 닉네임 입력 검증 개선

    • 한글 2~7자만 허용
    • 영문, 숫자/특수문자, 2자 미만 케이스별 helper 메시지 처리
    • 서버 닉네임 검증 실패 시 에러 UI 표시
    • TextInput maxLength modifier 추가
  • 약관 화면 개선

    • 약관 목록 서버 응답 기반 표시
    • 필수 약관 동의 여부에 따라 다음 버튼 활성화 처리
  • 네트워크/데이터 계층 추가

    • 닉네임 검증 Endpoint, DTO, Repository, UseCase, TCA Dependency Client 추가
    • 약관 조회 Endpoint, DTO, Repository, UseCase, TCA Dependency Client 추가
    • 회원가입 완료 Endpoint, DTO, Repository, UseCase, TCA Dependency Client 추가
    • 빈 body 응답 처리를 위한 requestVoid 추가
  • 앱 설정 및 DI 조립

    • SignupTermsFactory, NicknameFactory 추가
    • BangawoApp.prepareDependencies에 신규 client 주입
    • 환경별 서버 URL 설정 추가
    • Factory 패턴 수정
    • RegisterMemberFactory 추가

@duthd3 duthd3 changed the base branch from main to develop May 27, 2026 04:46
@duthd3 duthd3 self-assigned this May 27, 2026
@duthd3 duthd3 added the feature New feature or request label May 27, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

전반적으로 TCA, 모듈 아키텍처, SwiftUI 컨벤션을 잘 준수하고 있습니다. 특히 소셜 로그인 시 추천 닉네임 연동, 약관 API 연동, 닉네임 검증 로직 추가 및 requestVoid와 같은 네트워크 계층 확장은 PR의 내용을 잘 반영하고 있습니다.

다만, 일부 긴 코드 라인과 함수 시그니처, 그리고 TermClausedisplayTitle 계산 로직에서 중요한 버그가 발견되어 수정이 필요합니다. 또한, 로깅 관련 잠재적 민감 정보 노출과 테스트 코드의 프로덕션 코드 잔류 문제도 개선하면 좋겠습니다.

Comment thread Projects/Core/CoreDependencies/Sources/Auth/RegisterMemberClient.swift Outdated
Comment thread Projects/Data/Model/Sources/AuthDTO.swift
Comment thread Projects/Data/Repository/Sources/AuthRepositoryImpl.swift Outdated
Comment thread Projects/Data/Repository/Sources/AuthRepositoryImpl.swift Outdated
Comment thread Projects/Domain/DataInterface/Sources/Auth/AuthRepositoryProtocol.swift Outdated
Comment thread Projects/Network/Networking/Sources/NetworkManager.swift
Comment thread Projects/Presentation/AuthFlowFeature/Sources/Common/TermClause.swift Outdated
get: { store.imagePicker != nil },
set: { if !$0 { store.send(.imagePicker(.dismiss)) } }
set: {
if !$0, store.imagePicker != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P5] Nitpick

if !$0, store.imagePicker != nil 조건에서 store.imagePicker != nil은 불필요합니다. isPresented 바인딩이 false로 설정되는 시점에는 이미 시트가 닫히고 있거나 닫혔음을 의미하므로, if !$0만으로도 충분합니다.

Comment thread Projects/Presentation/RootFeature/Sources/Root/RootFeature.swift Outdated
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

회원가입 플로우 API 연동 및 관련 기능 개선 작업에 대한 코드 리뷰입니다. TCA 의존성 주입, 모듈 간 역할 분리, SwiftUI 컴포넌트 개선, 닉네임 유효성 검사 로직 등이 전반적으로 잘 구현되었습니다.

몇 가지 사소한 가독성 개선점과 임시 구현에 대한 코멘트가 있습니다.

Comment thread Projects/Core/CoreDependencies/Sources/Auth/RegisterMemberClient.swift Outdated
Comment thread Projects/Data/DataUseCase/Sources/Auth/RegisterMemberUseCaseImpl.swift Outdated
Comment thread Projects/Data/Model/Sources/AuthDTO.swift
Comment thread Projects/Data/Repository/Sources/AuthRepositoryImpl.swift
Comment thread Projects/Domain/UseCase/Sources/Auth/RegisterMemberUseCase.swift Outdated
public let isRequired: Bool

public init(id: String, title: String, body: String) {
public init(id: Int, title: String, body: String, isRequired: Bool = true) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 [P4] Readability

isRequired 파라미터에 true라는 기본값을 할당했습니다. 이 값은 항상 서버 응답에서 제공되는 것으로 예상되므로, Presentation 계층의 TermClause 이니셜라이저에는 기본값을 제거하는 것이 더 명확하고 데이터 소스의 신뢰성을 높일 수 있습니다. 만약 스토리보드나 프리뷰를 위한 값이라면, 별도의 static var preview 등을 만들어서 사용하는 것을 권장합니다.

// TermPDFViewer.swift
// Presentation
//
// TermClause 본문 텍스트를 PDFKit으로 표시하는 임시 placeholder 뷰어
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P5] Nitpick

텍스트를 PDF로 렌더링하는 현재 방식은 간단한 텍스트에는 적합하지만, 복잡한 레이아웃이나 대량의 텍스트에는 비효율적일 수 있습니다. 주석에 언급된 대로, 추후 실제 PDF URL을 기반으로 PDFDocument(url:)을 사용하거나, UITextView 또는 WKWebView를 통해 더 유연하게 콘텐츠를 표시하는 방향으로 확장하는 것이 좋습니다.

Comment thread Projects/Presentation/RootFeature/Sources/Root/RootFeature.swift Outdated
@github-actions
Copy link
Copy Markdown

회원가입 플로우 API 연동 및 관련 기능 개선 작업에 대한 코드 리뷰입니다. 전반적으로 TCA 컨벤션, 모듈 아키텍처, Swift 코드 품질 등 제시된 모든 가이드라인을 잘 준수하고 있습니다. 특히, 비동기 작업 처리, 상태 관리, 의존성 주입(@Dependency), DTO-Entity 매핑 등 핵심적인 요구사항들이 모범적으로 구현되었습니다. 특별히 수정이 필요한 부분은 발견되지 않았습니다.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

전반적으로 잘 구현되었습니다. 회원가입 플로우 API 연동, 닉네임 검증, 약관 화면 개선 등 요청된 모든 기능이 반영되었고, TCA 컨벤션과 모듈 아키텍처도 잘 준수되었습니다. 몇 가지 사소한 코드 스타일 및 가독성 개선 사항이 있습니다.

Comment thread Projects/Data/API/Sources/Terms/TermsEndPoint.swift
Comment thread Projects/Data/Repository/Sources/AuthRepositoryImpl.swift
Comment thread Projects/Network/Networking/Sources/TokenService.swift
Comment thread Projects/Network/Networking/Sources/TokenService.swift
Copy link
Copy Markdown
Collaborator

@khyeji98 khyeji98 left a comment

Choose a reason for hiding this comment

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

우선순위가 높은 코멘트들은 아니지만 확인 한번 부탁드려용!
그리고 TokenRefreshService의 경우 별도 모듈로 분리하는 방식을 제안드리긴 했는데, 한번 고민해보시고 올려주셔도 좋고 아니면 해당 pr은 일단 머지해주시고 추가 작업으로 가져가주셔도 좋습니당👍

Comment thread Projects/Shared/DesignSystem/Sources/Extension/TextField+.swift Outdated
Comment thread Projects/Presentation/RootFeature/Sources/Root/RootFeature.swift Outdated
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

회원가입 플로우 API 연동 및 관련 로직 개선이 전반적으로 잘 구현되었습니다. TCA 및 클린 아키텍처 원칙을 준수하며, 새로운 엔드포인트, DTO, 리포지토리, 유즈케이스 및 TCA 의존성 클라이언트가 추가되었습니다. UI/UX 개선사항(닉네임 검증, 약관 화면)도 잘 반영되었습니다. 일부 UserDefaults 사용 방식에 대한 일관성 개선이 제안됩니다.

// 직접 키체인에 접근하는 것이 아닌 repository를 통해 접근하도록
repository.saveAuthTokens(loginResult.tokens)
repository.saveRegistrationCompleted(loginResult.registrationCompleted)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 [P4] Readability

UserDefaults.standard.set(true, forKey: UserDefaultsKey.isLogin)는 로그인 성공 시 isLogin 상태를 true로 설정하는 로직입니다. 이 로직은 RootFeatureonAppear에서 hasTokenregistrationCompleted를 함께 확인하는 로직과 밀접하게 관련되어 있어, 로그인 성공 후 AuthRepositoryProtocol을 통해 registrationCompleted와 같은 영구 저장소에 저장하는 것이 일관성을 유지하고 책임 분리에 더 적합합니다. isLogin 또한 Repository에 위임하여 처리하는 것이 좋습니다.

Suggested change
repository.saveRegistrationCompleted(loginResult.registrationCompleted)
repository.saveIsLogin(true) // 새로운 메서드 추가 제안

do {
let decodedData = try JSONDecoder().decode(T.self, from: data)
Log.debug("✅ [Decode Success] \(T.self)")
Log.debug("✅ [Decode Success] \(decodedData)")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 [P3] Minor

디코드 성공 시 디버그 로그에 decodedData를 직접 출력하면 민감한 정보가 포함될 수 있습니다. T.self와 같이 타입 정보를 로그하거나, Decodable 프로토콜에 debugDescription을 추가하여 제어하는 것이 좋습니다.

Suggested change
Log.debug("✅ [Decode Success] \(decodedData)")
Log.debug("✅ [Decode Success] \(T.self)")


case .registerMemberResponse(.success):
state.isRegistering = false
UserDefaults.standard.set(true, forKey: UserDefaultsKey.registrationCompleted) // 회원가입 완료시에 true로 갱신
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 [P4] Readability

AuthFlowFeature에서 UserDefaults.standard.set을 직접 호출하는 대신, registrationCompleted 저장 로직을 AuthRepositoryProtocol에 위임하는 것이 좋습니다. 이는 데이터 계층이 영구 저장소 관련 책임을 전담하도록 하여 아키텍처의 일관성을 유지하고 테스트 용이성을 높일 수 있습니다.

Suggested change
UserDefaults.standard.set(true, forKey: UserDefaultsKey.registrationCompleted) // 회원가입 완료시에 true로 갱신
// AuthRepository 또는 AuthUseCase에 위임하여 처리
// repository.saveRegistrationCompleted(result.registrationCompleted)

case .registerMemberResponse(.success):
state.isRegistering = false
UserDefaults.standard.set(true, forKey: UserDefaultsKey.registrationCompleted) // 회원가입 완료시에 true로 갱신
UserDefaults.standard.set(true, forKey: UserDefaultsKey.isLogin)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 [P4] Readability

AuthFlowFeature에서 UserDefaults.standard.set(true, forKey: UserDefaultsKey.isLogin)을 직접 호출하는 대신, isLogin 상태 저장 로직을 AuthRepositoryProtocol에 위임하는 것이 좋습니다. 이는 SignInWithSocialUseCaseImpl에서 이미 isLogin을 설정하고 있으므로, 모든 로그인/회원가입 관련 영구 저장 로직을 데이터 계층에서 일관되게 관리할 수 있습니다.

Suggested change
UserDefaults.standard.set(true, forKey: UserDefaultsKey.isLogin)
// AuthRepository 또는 AuthUseCase에 위임하여 처리
// repository.saveIsLogin(true) // 이미 로그인 시 설정되므로 불필요할 수 있음

@duthd3 duthd3 merged commit 152ca09 into develop Jun 2, 2026
1 check passed
@duthd3 duthd3 deleted the feat/#40 branch June 2, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants