Skip to content
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

[refactor] 전체 DTO 수정 및 추가 #24

Merged
merged 4 commits into from
Sep 3, 2024
Merged

[refactor] 전체 DTO 수정 및 추가 #24

merged 4 commits into from
Sep 3, 2024

Conversation

K-0joo
Copy link
Contributor

@K-0joo K-0joo commented Sep 3, 2024

Issue

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 삭제
  • 기능 수정
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트

반영 브랜치

refactor/user_login -> dev

변경 사항

  • 전체 DTO 업데이트

Response Success 시 보이는 값을 수정합니다.

테스트 결과

회원가입 기능

Request

HTTP : POST
URL: http://localhost:8080/api/users/signup
  • body
{
  "id": "wanted",
  "password": "wanted"
}

Response : 성공시

{
    "message": "회원가입 성공",
    "userId": "5268b7a2-86ed-4539-abde-194f1ff3b260",
    "id": "wanted"
}

사용자 로그인

Request

HTTP : POST
URL: http://localhost:8080/api/users/login
  • body
{
  "id": "wanted",
  "password": "wanted"
}

Response : 성공시

{
    "userId": "5268b7a2-86ed-4539-abde-194f1ff3b260",
    "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ5b3VuZ2pvby5kZXZAZ21haWwuY29tIiwiaWF0IjoxNzI1MzQ0ODM1LCJleHAiOjE3MjUzNTIwMzUsInN1YiI6IndhbnRlZCJ9.OuzQxp9fAfpJeyglQnVrvqt7jUcUVno5YADjQRBjMCs",
    "refreshToken": "a39aa11f-8880-4114-94b4-4af2b4ef26e7"
}

Response : 실패시

  • 존재하지 않는 아이디일 때
{
    "status": 404,
    "message": "존재하지 않는 엔티티입니다."
}

사용자 설정 업데이트

Request

HTTP : PUT
URL: http://localhost:8080/api/users/settings/5268b7a2-86ed-4539-abde-194f1ff3b260
  • body
{
    "lat": 37.5128,
    "lon": 127.0057,
    "recommend": true
}
  • Headers
Key Value
Authorization Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ5b3VuZ2pvby5kZXZAZ21haWwuY29tIiwiaWF0IjoxNzI1MzQ0ODM1LCJleHAiOjE3MjUzNTIwMzUsInN1YiI6IndhbnRlZCJ9.OuzQxp9fAfpJeyglQnVrvqt7jUcUVno5YADjQRBjMCs

Response : 성공시

{
    "message": "위도, 경도, 추천 여부 변경 완료",
    "userId": "5268b7a2-86ed-4539-abde-194f1ff3b260",
    "lat": 37.5128,
    "lon": 127.0057,
    "recommend": true
}
  • 사용자 정보 조회

Request

HTTP : GET
URL: http://localhost:8080/api/users/profile/5268b7a2-86ed-4539-abde-194f1ff3
  • Headers
Key Value
Authorization Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ5b3VuZ2pvby5kZXZAZ21haWwuY29tIiwiaWF0IjoxNzI1MzQ0ODM1LCJleHAiOjE3MjUzNTIwMzUsInN1YiI6IndhbnRlZCJ9.OuzQxp9fAfpJeyglQnVrvqt7jUcUVno5YADjQRBjMCs

Response : 성공시

{
    "message": "회원 조회 성공",
    "id": "wanted",
    "lat": 37.5128,
    "lon": 127.0057,
    "recommend": true
}

Response : 실패시

{
    "status": 404,
    "message": "존재하지 않는 엔티티입니다."
}

@K-0joo K-0joo self-assigned this Sep 3, 2024
@K-0joo K-0joo added the refactor label Sep 3, 2024
Copy link
Contributor

@jw427 jw427 left a comment

Choose a reason for hiding this comment

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

수고하셨어요!

Copy link
Contributor

@rhaehf rhaehf left a comment

Choose a reason for hiding this comment

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

리팩토링 하느라 수고하셨어요!

build.gradle Outdated
@@ -35,7 +35,10 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'io.jsonwebtoken:jjwt:0.9.1' // 자바 JWT 라이브러리
implementation 'javax.xml.bind:jaxb-api:2.3.1' // XML 문서와 Java 객체 간 매핑 자동화
implementation 'javax.xml.bind:jaxb-api:2.3.1' // XML 문서와 Java 객체 간 매핑 자동화
annotationProcessor('org.projectlombok:lombok') // test를 위한 롬복 추가
Copy link
Contributor

Choose a reason for hiding this comment

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

56라인에 똑같은게 있어요. 확인 부탁드려요~

Copy link
Contributor

@jeongeungyeong jeongeungyeong left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

@jw427 jw427 merged commit 1beed68 into dev Sep 3, 2024
@jw427 jw427 deleted the refactor/user_login branch September 3, 2024 08:58
@rhaehf rhaehf linked an issue Sep 3, 2024 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

사용자 회원가입, 로그인, 사용자 조회(API) 리팩토링
4 participants