Skip to content

[FEAT] 네트워크 베이스 모듈 설계#7

Open
duthd3 wants to merge 3 commits intomainfrom
feat/#3
Open

[FEAT] 네트워크 베이스 모듈 설계#7
duthd3 wants to merge 3 commits intomainfrom
feat/#3

Conversation

@duthd3
Copy link
Copy Markdown
Collaborator

@duthd3 duthd3 commented Apr 14, 2026

구현 내용 요약

  1. NetworkManager
    • request​<​T: ​Decodable>(_ end​Point:) async -> ​T? 제네릭 메서드로 호출부에서 원하는 타입으로 디코딩 가능
    • make​Data​Request에서 APITask case별 Alamofire 요청 생성 (plain, JSON body, parameters, without interceptor)

  2. Interceptor
    • adapt: 키체인에서 accessToken을 읽어 Bearer 헤더 자동 추가. 토큰 없으면 is​Login = false 설정
    • retry: 401 응답 시 refresh​Access​Token() 호출 후 성공하면 retry, 실패하면 is​Login = false 설정
    • refresh​Access​Token(): 토큰 갱신 함수 (TODO: 실제 API 연동 필요)

  3. APITask
    • request​Plain: 파라미터 없는 단순 요청
    • request​JSONEncodable(body:): JSON Body 요청
    • request​Parameters(parameters:): URL 쿼리 파라미터 요청
    • request​Without​Interceptor(body:): 인터셉터 없는 요청 (로그인/회원가입 등 토큰 불필요 API용)

  4. EndPoint
    /// API 서버 기본 URL (e.g., "https://api.bangawo.com")
    • baseURL: String { get }
    /// API 경로 (e.g., "/users/login")
    • var path: String { get }
    /// HTTP 메서드 (GET, POST, PUT, DELETE 등)
    • var method: HTTPMethod { get }
    /// HTTP 헤더
    • var headers: HTTPHeaders? { get }
    /// 요청 파라미터 방식 (body, query 등)
    • var task: APITask { get }

  5. BaseResponse
    • status
    • message
    • data

duthd3 and others added 3 commits April 13, 2026 23:43
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@duthd3 duthd3 self-assigned this Apr 14, 2026
@duthd3 duthd3 added the feature New feature or request label Apr 14, 2026
@khyeji98 khyeji98 self-requested a review April 14, 2026 16:57
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.

1 participant