Skip to content

refactor(data): wire 모델 명명 -Dto 통일 (Response·ResponseDto·Data 표기 혼재 해소) #444

Closed

Description

@OnlyReadOneBook

📜 Overview (Required)

data 계층 wire 모델(서버 직렬화 클래스) 명명이 4가지 표기로 혼재되어 있어 -Dto 하나로 통일한다.

현재 분포 (2026-07-14 실측, top-level·중첩 data class 기준):

모듈 *Response *ResponseDto *Data *Dto
core:network 2 10 4 2
feature:afternote:data 12 0 0 0
feature:mindrecord:data 5 0 0 3
feature:timeletter:data 0 5 0 0

같은 파일 안에서도 갈린다 — UserApiService.kt 62줄은 BaseResponse<UserResponseDto>, 133줄은 BaseResponse<ReceiverDeliveryConditionResponse>.

왜 -Response가 아니라 -Dto인가: 모든 payload 는 BaseResponse<T>(status/code/message/data) 봉투의 data 필드 내용물이라 그 자체가 "응답"이 아니다. BaseResponse<XxxResponse>는 "응답 안의 응답"이라는 중복이자 부정확한 명명이 된다. DTO 접미사에 대한 공식 규정은 없으나(Android 아키텍처 가이드는 Repository·DataSource 명명만 규정 — https://developer.android.com/topic/architecture/data-layer#naming-conventions), Kotlin 공식 컨벤션의 약어 규칙(3글자 이상 약어는 첫 글자만 대문자)상 표기는 DTO가 아닌 Dto다 — https://kotlinlang.org/docs/coding-conventions.html#choose-good-names

통일 규칙:

  1. XxxResponse → XxxDto
  2. XxxResponseDto → XxxDto
  3. auth 의 SignUpData·LoginData·ReissueData → SignUpDto·LoginDto·ReissueDto
  4. 개념 명명 예외: AfternoteListResponse → AfternotePageDto(유일한 페이지네이션 래퍼), AfternoteIdResponse → AfternoteIdDto
  5. XxxRequestDto 유지 — 요청 body 는 봉투가 없어 중복 아님
  6. dto 패키지의 접미사 없는 중첩 @Serializable 모델(AfternoteCredentials, MusicTrack, *ListItem 등)도 -Dto 부여 — 최종 규칙은 "data 계층 @Serializable wire 모델이면 -Dto" 한 줄로 수렴

영향: 클래스 이름은 직렬화에 관여하지 않고 JSON 키는 전부 @SerialName 이 고정하므로 wire 동작 변경 0 인 기계적 rename 이다.

📍 Note (Optional)

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions