Skip to content

[Feat] 토큰 관련된 반환값 변경#22

Merged
parkji1on merged 2 commits intodevfrom
feat/#21-dto
Nov 11, 2025
Merged

[Feat] 토큰 관련된 반환값 변경#22
parkji1on merged 2 commits intodevfrom
feat/#21-dto

Conversation

@parkji1on
Copy link
Contributor

@parkji1on parkji1on commented Nov 11, 2025

요약

  • 이 PR의 목적과 배경을 한 줄로 설명해주세요.

주요 변경 사항

  • 변경 요약 1
  • 변경 요약 2

관련 이슈

closes #21

테스트/검증

  • 어떻게 검증했는지, 영향 범위는 어디인지 간략히 적어주세요.

확인 사항

  • 자기 리뷰 완료
  • 빌드/테스트 통과 확인
  • 문서/주석 업데이트(필요 시)
  • 브레이킹 체인지 없음 또는 마이그레이션 안내 포함

스크린샷/로그(선택)

  • 필요 시 첨부

@parkji1on parkji1on requested a review from Copilot November 11, 2025 03:43
@parkji1on parkji1on linked an issue Nov 11, 2025 that may be closed by this pull request
4 tasks
@github-actions
Copy link

PR 검증 성공

브랜치: feat/#21-dtodev
커밋: 3723305

모든 검증을 통과했습니다. 리뷰를 요청해주세요.

워크플로우 로그 확인

@parkji1on parkji1on merged commit 7d78667 into dev Nov 11, 2025
11 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the DeviceTokenController to use a standardized ApiResponse wrapper for all endpoint return values, replacing the previous inconsistent response formats (HashMap for register, direct DTOs for other endpoints).

Key changes:

  • All endpoint methods now return ResponseEntity<ApiResponse<T>> instead of varied return types
  • Removed HashMap-based response construction in favor of ApiResponse.success()
  • Added consistent success messages for all operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/
@PostMapping("/register")
public ResponseEntity<Map<String, String>> registerToken(
public ResponseEntity<ApiResponse<UserDeviceInfo>> registerToken(
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

Inconsistent API response pattern across controllers. AlarmController returns ApiResponse<T> directly without wrapping in ResponseEntity, while this controller wraps it in ResponseEntity<ApiResponse<T>>. Both NotificationController and this controller use ResponseEntity<ApiResponse<T>>, but AlarmController doesn't. Consider standardizing the approach across all controllers for consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +67
"FCM 토큰이 성공적으로 등록되었습니다.",
HttpStatus.OK
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The HttpStatus.OK parameter is redundant when already using ResponseEntity.ok(). Since ResponseEntity.ok() sets the status to 200 OK, passing HttpStatus.OK to the ApiResponse creates duplication. Consider using a different constructor or removing the status parameter from ApiResponse.success() for 200 OK responses, or use ResponseEntity.status(status).body() if you need to vary the status code.

Suggested change
"FCM 토큰이 성공적으로 등록되었습니다.",
HttpStatus.OK
"FCM 토큰이 성공적으로 등록되었습니다."

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 토큰 등록에 대한 반환값 변경

2 participants