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

[feat] 대학교 추가 API 구현 #214

Merged
merged 8 commits into from
Nov 12, 2024
Merged

[feat] 대학교 추가 API 구현 #214

merged 8 commits into from
Nov 12, 2024

Conversation

PicturePark1101
Copy link
Contributor

@PicturePark1101 PicturePark1101 commented Nov 7, 2024

Related Issue 📌

close #213

Description ✔️

  • 대학교 추가 API를 구현하였습니다

To Reviewers

  • 우리만 접근하는 API라 입력과정에서 별도의 예외처리는 해주지 않음
  • university 에서 스펠링 오류가 있을 수 있는데 졸려서 낼 다시 확인해볼게여
  • record 안에 record 넣는 방식으로 구현했는데 이상하면 지적부탁드림니다
  • dto -> entity 변환과정은 dto에서 toEntity 메소드를 통해 처리하도록 함

입력데이터

{
    "universities": [
        {
            "name": "ㄱ대학교",
            "longitude": 126.951905,
            "latitude": 37.459882
        },
        {
            "name": "ㄴ대학교",
            "longitude": 126.938574,
            "latitude": 37.565784
        },
        {
            "name": "ㄷ대학교",
            "longitude": 127.033469,
            "latitude": 37.589562
        },
        {
            "name": "ㄹ대학교",
            "longitude": 127.363215,
            "latitude": 36.372713
        },
        {
            "name": "ㅁ대학교",
            "longitude": 129.323409,
            "latitude": 36.015084
        },
        {
            "name": "ㅂ대학교",
            "longitude": 129.079196,
            "latitude": 35.233481
        },
        {
            "name": "ㅅ대학교",
            "longitude": 128.611788,
            "latitude": 35.890318
        },
        {
            "name": "ㅇ대학교",
            "longitude": 127.129708,
            "latitude": 35.847513
        },
        {
            "name": "ㅈ대학교",
            "longitude": 127.743108,
            "latitude": 37.866338
        },
        {
            "name": "ㅊ대학교",
            "longitude": 124.544444,
            "latitude": 33.123133
        }
    ]
}

결과

스크린샷 2024-11-08 오전 1 39 03


public record UniversitiesPostRequest(List<UniversityRequest> universities) {
public record UniversityRequest(String name, double longitude, double latitude) { }
}
Copy link
Member

Choose a reason for hiding this comment

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

파일 끝 개행 누락됐어용

public void createUniversities(UniversitiesPostCommand universitiesPostCommand) {
universityUpdater.saveAll(universitiesPostCommand.toEntityList());
}
}
Copy link
Member

Choose a reason for hiding this comment

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

여기두

void saveAll(List<University> universities){
universityRepository.saveAll(universities);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

여기두!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

다 반영했음둥 👍

@PicturePark1101 PicturePark1101 merged commit 04e70b6 into develop Nov 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 대학교 등록 API 구현
2 participants