-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] 유저 및 반려견 정보 수정 API 구현 #201
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
Open
daeun-han
wants to merge
17
commits into
develop
Choose a base branch
from
feat/#200
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dcaa0b7
[feat] 온보딩 시 기존 임시 유저 정보 업데이트 로직 구현 (중복 생성 방지)
daeun-han b0ee6d9
[chore] import문 최적화
daeun-han fc7d56b
[del] petTrait 관련 코드 삭제
daeun-han 70d5411
[refactor] JPA 성능 최적화 적용
daeun-han c14fa85
[del] traits 관련 코드 일괄 제거
daeun-han f41471a
[refactor] codeRabbit comment 적용
daeun-han 3e8ca81
[refactor] 견주 상세 정보 조회 API
daeun-han 40cf38e
[refactor] 반려견 프로필 조회 API
daeun-han 93ce25b
[refactor] codeRabbit comment 적용
daeun-han 22439f5
[feat] 유저(견주) 정보 수정 API
daeun-han eb3623c
[refactor] 코드 정리
daeun-han 01c89c5
[feat] 반려견 정보 수정 API
daeun-han 27c439b
[refactor] 클래스 내 메서드 순서 재배치
daeun-han 161648b
[chore] import문 최적화
daeun-han 09eefb0
[refactor] 통일성 확보 및 주석 처리
daeun-han 7e53476
[fix] PetEntity에서 walkCount 제외
daeun-han 37c30ef
[refactor] User 도메인에 있던 petService 코드를 Pet 도메인으로 이동
daeun-han File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...ain/java/org/sopt/pawkey/backendapi/domain/Post/domain/repository/PostLikeRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...java/org/sopt/pawkey/backendapi/domain/Post/infra/persistence/entity/PostImageEntity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...pt/pawkey/backendapi/domain/Post/infra/persistence/repository/PostLikeRepositoryImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...key/backendapi/domain/Post/infra/persistence/repository/SpringDataPostLikeRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 19 additions & 17 deletions
36
...y/backendapi/domain/auth/application/service/login/verifier/apple/AppleTokenVerifier.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
src/main/java/org/sopt/pawkey/backendapi/domain/pet/api/dto/request/PetRequestDto.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,25 @@ | ||
| package org.sopt.pawkey.backendapi.domain.pet.api.dto.request; | ||
|
|
||
| import java.util.List; | ||
| import java.time.LocalDate; | ||
|
|
||
| import org.sopt.pawkey.backendapi.domain.pet.application.dto.SelectedOptionForPetTraitCategory; | ||
| import org.sopt.pawkey.backendapi.domain.pet.application.dto.request.CreatePetCommand; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Pattern; | ||
| import jakarta.validation.constraints.Positive; | ||
|
|
||
| public record PetRequestDto( | ||
| @NotBlank(message = "반려동물 이름은 필수값입니다.") String name, | ||
| @NotBlank(message = "성별은 필수값입니다.") @Pattern(regexp = "^(M|F)$", message = "성별은 M 또는 F이어야 합니다.") String gender, | ||
| @Positive(message = "나이는 양수여야 합니다.") int age, | ||
| boolean isAgeKnown, | ||
| @NotBlank(message = "성별은 필수값입니다.") | ||
| @Pattern(regexp = "^(M|F)$", message = "성별은 M 또는 F이어야 합니다.") String gender, | ||
| @NotNull(message = "생년월일은 필수값입니다.") | ||
| @JsonFormat(pattern = "yyyy-MM-dd") LocalDate birth, | ||
| boolean isNeutered, | ||
| @NotBlank(message = "품종은 필수값입니다.") String breed, | ||
| @NotNull(message = "반려동물 성향은 필수값입니다.") List<SelectedOptionForPetTraitCategory> petTraits | ||
| @NotBlank(message = "품종은 필수값입니다.") String breed | ||
| ) { | ||
| public CreatePetCommand toCommand() { | ||
| return CreatePetCommand.of(name, gender, age, isAgeKnown, isNeutered, breed, petTraits); | ||
| return CreatePetCommand.of(name, gender, birth, isNeutered, breed); | ||
| } | ||
| } |
28 changes: 28 additions & 0 deletions
28
src/main/java/org/sopt/pawkey/backendapi/domain/pet/api/dto/request/UpdatePetRequestDto.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package org.sopt.pawkey.backendapi.domain.pet.api.dto.request; | ||
|
|
||
| import java.time.LocalDate; | ||
|
|
||
| import org.sopt.pawkey.backendapi.domain.pet.application.dto.request.UpdatePetCommand; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.PastOrPresent; | ||
| import jakarta.validation.constraints.Pattern; | ||
|
|
||
| public record UpdatePetRequestDto( | ||
| @NotBlank String name, | ||
|
|
||
| @PastOrPresent(message = "생년월일은 현재 또는 과거 날짜여야 합니다") | ||
| @NotNull LocalDate birth, | ||
|
|
||
| @Pattern(regexp = "^(M|F)$", message = "성별은 M 또는 F이어야 합니다.") | ||
| @NotBlank String gender, | ||
|
|
||
| @NotNull Boolean isNeutered, | ||
|
|
||
| @NotBlank String breed | ||
| ) { | ||
| public UpdatePetCommand toCommand() { | ||
| return new UpdatePetCommand(name, birth, gender, isNeutered, breed); | ||
| } | ||
| } |
51 changes: 41 additions & 10 deletions
51
...in/java/org/sopt/pawkey/backendapi/domain/pet/api/dto/response/PetProfileResponseDto.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,53 @@ | ||
| package org.sopt.pawkey.backendapi.domain.pet.api.dto.response; | ||
|
|
||
| import java.util.List; | ||
| import java.time.LocalDate; | ||
| import java.time.temporal.ChronoUnit; | ||
|
|
||
| import org.sopt.pawkey.backendapi.domain.pet.infra.persistence.entity.PetEntity; | ||
|
|
||
| public record PetProfileResponseDto( | ||
| Long petId, | ||
| String imageUrl, | ||
| String name, | ||
| LocalDate birth, | ||
| long age, | ||
| String gender, | ||
| boolean isNeutered, | ||
| int age, | ||
| boolean isAgeKnown, | ||
| String breed, | ||
| String imageUrl, | ||
| List<TraitDto> traits, | ||
| int walkCount | ||
|
|
||
| // 추후 dbti 엔티티 생성 시에, dbti 소개 문구로 변경할 예정 | ||
| String dbti | ||
| ) { | ||
| public record TraitDto( | ||
| String category, | ||
| String option | ||
| ) { | ||
| public static PetProfileResponseDto from(PetEntity pet) { | ||
| return new PetProfileResponseDto( | ||
| pet.getPetId(), | ||
| pet.getProfileImage() != null ? pet.getProfileImage().getImageUrl() : null, | ||
| pet.getName(), | ||
| pet.getBirth(), | ||
| calculateAgeInMonths(pet.getBirth()), | ||
| convertGender(pet.getGender()), | ||
| pet.isNeutered(), | ||
| pet.getBreed(), | ||
| parseDbti(pet.getDbti()) | ||
| ); | ||
| } | ||
|
|
||
| private static long calculateAgeInMonths(LocalDate birth) { | ||
| if (birth == null) | ||
| return 0; | ||
| return ChronoUnit.MONTHS.between(birth, LocalDate.now()); | ||
| } | ||
|
|
||
| private static String convertGender(String gender) { | ||
| if ("M".equals(gender)) { | ||
| return "남아"; | ||
| } else if ("F".equals(gender)) { | ||
| return "여아"; | ||
| } | ||
| throw new IllegalArgumentException("올바르지 않은 성별 값입니다: " + gender); | ||
| } | ||
|
|
||
| private static String parseDbti(String dbti) { | ||
| return (dbti == null || dbti.isBlank()) ? "DBTI 검사 미완료" : dbti; | ||
| } | ||
| } |
17 changes: 0 additions & 17 deletions
17
...g/sopt/pawkey/backendapi/domain/pet/api/dto/response/PetTraitCategoryListResponseDto.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.