-
Notifications
You must be signed in to change notification settings - Fork 1
[FEATURE] 봉사활동 모집글 생성 기능 #16
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
183e212
chore(test): test 관련 yml 설정 파일 작성
leebs0521 2845a9e
test(init): 테스트를 위한 초기 설정
leebs0521 4938cb8
feat(location): Location 엔티티, 레포지토리 추가
leebs0521 926d2f8
feat(location): Location 생성 usecase interface, Dto 추가 및 구현체 작성
leebs0521 fb111e7
test(location): Location 생성 기능 테스트
leebs0521 f5d3c11
feat(recruit-board): recruitBoard 엔티티 및 레포지토리 추가
leebs0521 6c593c9
feat(recruit-board): recruitBoard 생성 UseCase, Dto 추가 및 Service 구현
leebs0521 69f47fe
test(recruit-board): recruitBoard 생성 기능 테스트 작성
leebs0521 9613cd0
chore: 불필요한 import 제거
leebs0521 23c0cd6
refactor(location): BaseEntity 추가 및 불필요한 import 제거
leebs0521 4629198
fix: WARNING 발생 제거
leebs0521 cd7c862
chore: 기본 테스트 클래스 제거
leebs0521 c2ca944
refactor(location, recruit-board): 테스트 코드 수정
leebs0521 2bcd131
feat(location): 위도 경도 자료형 변경
leebs0521 8eb4a2a
test(location): 위도 경도 자료형 변경에 따른 테스트 작성 및 변경
leebs0521 9ed48e6
refactor: usecase, service 패키지 세분화
leebs0521 2841533
refactor: 불필요한 import 제거
leebs0521 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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/somemore/location/dto/request/LocationCreateRequestDto.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,32 @@ | ||
| package com.somemore.location.dto.request; | ||
|
|
||
|
|
||
| import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; | ||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| import com.somemore.location.domain.Location; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import lombok.Builder; | ||
|
|
||
| @JsonNaming(SnakeCaseStrategy.class) | ||
| @Builder | ||
| public record LocationCreateRequestDto( | ||
| @Schema(description = "도로명 주소", example = "서울특별시 서초구 반포대로 45, 4층(서초동, 명정빌딩)") | ||
| @NotBlank(message = "주소는 필수 입력 값입니다.") | ||
| String address, | ||
| @Schema(description = "주소에 해당하는 위도 정보", example = "37.4845373748015") | ||
| @NotBlank(message = "위도는 필수 입력 값입니다.") | ||
| String latitude, | ||
| @Schema(description = "주소에 해당하는 경도 정보", example = "127.010842267696") | ||
| @NotBlank(message = "경도는 필수 입력 값입니다.") | ||
| String longitude | ||
| ) { | ||
|
|
||
| public Location toEntity() { | ||
| return Location.builder() | ||
| .address(address) | ||
| .latitude(latitude) | ||
| .longitude(longitude) | ||
| .build(); | ||
| } | ||
| } | ||
25 changes: 25 additions & 0 deletions
25
src/main/java/com/somemore/location/service/CreateLocationService.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,25 @@ | ||
| package com.somemore.location.service; | ||
|
|
||
| import com.somemore.location.domain.Location; | ||
| import com.somemore.location.dto.request.LocationCreateRequestDto; | ||
| import com.somemore.location.repository.LocationRepository; | ||
| import com.somemore.location.usecase.CreateLocationUseCase; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| @RequiredArgsConstructor | ||
| @Transactional | ||
| @Service | ||
| public class CreateLocationService implements CreateLocationUseCase { | ||
|
|
||
| private final LocationRepository locationRepository; | ||
|
|
||
| @Override | ||
| public Long createLocation(LocationCreateRequestDto requestDto) { | ||
| Location location = requestDto.toEntity(); | ||
| locationRepository.save(location); | ||
| return location.getId(); | ||
| } | ||
|
|
||
| } |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/somemore/location/usecase/CreateLocationUseCase.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,9 @@ | ||
| package com.somemore.location.usecase; | ||
|
|
||
| import com.somemore.location.dto.request.LocationCreateRequestDto; | ||
|
|
||
| public interface CreateLocationUseCase { | ||
|
|
||
| Long createLocation(LocationCreateRequestDto requestDto); | ||
|
|
||
| } |
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.