-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from kakao-tech-campus-2nd-step3/week9
weekly: 9주차 작업 내용 최종 병합
- Loading branch information
Showing
25 changed files
with
1,203 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
62 changes: 62 additions & 0 deletions
62
src/main/java/com/gamsa/activity/dto/ActivityApiResponse.java
This file contains 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,62 @@ | ||
package com.gamsa.activity.dto; | ||
|
||
import com.gamsa.activity.constant.Category; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@Builder | ||
@RequiredArgsConstructor | ||
public class ActivityApiResponse { | ||
|
||
private final Long actId; | ||
private final String actTitle; | ||
private final String actLocation; | ||
private final String description; | ||
private final LocalDateTime noticeStartDate; | ||
private final LocalDateTime noticeEndDate; | ||
private final LocalDateTime actStartDate; | ||
private final LocalDateTime actEndDate; | ||
private final int actStartTime; | ||
private final int actEndTime; | ||
private final int recruitTotalNum; | ||
private final boolean adultPossible; | ||
private final boolean teenPossible; | ||
private final boolean groupPossible; | ||
private final int actWeek; | ||
private final String actManager; | ||
private final String actPhone; | ||
private final String url; | ||
private final Category category; | ||
private final String instituteName; | ||
private final Integer sidoGunguCode; | ||
|
||
public ActivitySaveRequest toSaveRequest(long instituteId) { | ||
return ActivitySaveRequest.builder() | ||
.actId(actId) | ||
.actTitle(actTitle) | ||
.actLocation(actLocation) | ||
.description(description) | ||
.noticeStartDate(noticeStartDate) | ||
.noticeEndDate(noticeEndDate) | ||
.actStartDate(actStartDate) | ||
.actEndDate(actEndDate) | ||
.actStartTime(actStartTime) | ||
.actEndTime(actEndTime) | ||
.recruitTotalNum(recruitTotalNum) | ||
.adultPossible(adultPossible) | ||
.teenPossible(teenPossible) | ||
.groupPossible(groupPossible) | ||
.actWeek(actWeek) | ||
.actManager(actManager) | ||
.actPhone(actPhone) | ||
.url(url) | ||
.category(category) | ||
.instituteId(instituteId) | ||
.sidoGunguCode(sidoGunguCode) | ||
.build(); | ||
} | ||
} |
21 changes: 14 additions & 7 deletions
21
src/main/java/com/gamsa/activity/dto/DistrictSaveRequest.java
This file contains 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,28 +1,35 @@ | ||
package com.gamsa.activity.dto; | ||
|
||
import com.gamsa.activity.domain.District; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Getter | ||
@Builder | ||
@RequiredArgsConstructor | ||
@AllArgsConstructor | ||
public class DistrictSaveRequest { | ||
|
||
private final int sidoGunguCode; | ||
private final int sidoCode; | ||
private final String sidoName; | ||
private final String gunguName; | ||
private BigDecimal latitude; | ||
private BigDecimal longitude; | ||
private final boolean sido; | ||
|
||
public District toModel() { | ||
return District.builder() | ||
.sidoGunguCode(sidoGunguCode) | ||
.sidoCode(sidoCode) | ||
.sidoName(sidoName) | ||
.gunguName(gunguName) | ||
.sido(sido) | ||
.build(); | ||
.sidoGunguCode(sidoGunguCode) | ||
.sidoCode(sidoCode) | ||
.sidoName(sidoName) | ||
.gunguName(gunguName) | ||
.latitude(latitude) | ||
.longitude(longitude) | ||
.sido(sido) | ||
.build(); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/gamsa/activity/dto/InstituteApiResponse.java
This file contains 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,35 @@ | ||
package com.gamsa.activity.dto; | ||
|
||
import com.gamsa.activity.domain.District; | ||
import com.gamsa.activity.domain.Institute; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.Map; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
public class InstituteApiResponse { | ||
|
||
private String name; | ||
private String location; | ||
private int sidoCode; | ||
private int sidoGunguCode; | ||
private String phone; | ||
|
||
public InstituteSaveRequest toSaveRequest(Map<String, BigDecimal> coordinates) { | ||
return InstituteSaveRequest.builder() | ||
.name(name) | ||
.location(location) | ||
.sidoCode(sidoCode) | ||
.sidoGunguCode(sidoGunguCode) | ||
.longitude(coordinates.get("longitude")) | ||
.latitude(coordinates.get("latitude")) | ||
.phone(phone) | ||
.build(); | ||
} | ||
} |
This file contains 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 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 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 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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/gamsa/dataupdate/DataUpdateErrorCode.java
This file contains 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.gamsa.dataupdate; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum DataUpdateErrorCode { | ||
// 1365 API 오류 | ||
OPENAPI_NOT_RESPOND(504, "Open API가 응답하지 않습니다."), | ||
OPENAPI_ERROR(504, "Open API의 반환 값을 처리할 수 없습니다."), | ||
|
||
|
||
// 카카오 API 오류 | ||
KAKAOLOCALAPI_NOT_RESPOND(504, "카카오 API가 정상적으로 응답하지 않습니다."), | ||
KAKAOLOCALAPT_ERROR(504, "카카오 API의 반환 값을 처리할 수 없습니다."), | ||
|
||
// 내부 처리 오류 | ||
INVALID_CSV(500, "주어진 CSV 파일을 처리할 수 없습니다"), | ||
INVALID_FILE_SOURCE(500, "주어진 파일 경로가 올바르지 않습니다."); | ||
|
||
|
||
private final int ststus; | ||
private final String msg; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/gamsa/dataupdate/DataUpdateException.java
This file contains 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,10 @@ | ||
package com.gamsa.dataupdate; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public class DataUpdateException extends RuntimeException { | ||
private final DataUpdateErrorCode errorCode; | ||
} |
Oops, something went wrong.