Skip to content

Commit

Permalink
Merge pull request #37 from tukcomCD2024/backend/feature/25-amadeus-api
Browse files Browse the repository at this point in the history
fix : Schedule API 수정 UPDATE
  • Loading branch information
Dayon-Hong authored Mar 5, 2024
2 parents b138681 + 7a6babe commit d8ec628
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
19 changes: 11 additions & 8 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'

// jwt
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
// AWS
implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2'

//AWS
implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.2'
// Open API
implementation "com.amadeus:amadeus-java:8.0.0"

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.isp.backend.domain.schedule.dto;


import com.isp.backend.domain.scheduleDetail.entity.ScheduleType;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -16,6 +17,8 @@ public class ScheduleDetailDTO {

private String place; // 장소

private ScheduleType type; // 일정 유형

private double budget; // 예산

private double latitude; // 위도
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,16 @@ public class ScheduleListResponseDTO {

private String imageUrl;

private String country;

private double latitude ;

private double longitude ;

private String country;

private double latitude ;

private double longitude ;

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.isp.backend.domain.schedule.dto.ScheduleListResponseDTO;
import com.isp.backend.domain.schedule.dto.ScheduleSaveRequestDTO;
import com.isp.backend.domain.schedule.entity.Schedule;
import com.isp.backend.domain.scheduleDetail.entity.ScheduleDetail;
import com.isp.backend.domain.scheduleDetail.entity.ScheduleType;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -51,7 +51,7 @@ public Schedule toSchedulesEntity(ScheduleSaveRequestDTO scheduleSaveRequestDTO,

// 일정 세부 DTO를 엔티티로 변환
private ScheduleDetail toScheduleDetailEntity(ScheduleDetailDTO scheduleDetailDTO, DailyScheduleDTO dailyScheduleDTO, Schedule schedule, int num) {
return ScheduleDetail.builder()
ScheduleDetail scheduleDetail = ScheduleDetail.builder()
.todo(scheduleDetailDTO.getTodo())
.place(scheduleDetailDTO.getPlace())
.budget(scheduleDetailDTO.getBudget())
Expand All @@ -61,6 +61,11 @@ private ScheduleDetail toScheduleDetailEntity(ScheduleDetailDTO scheduleDetailDT
.num(num) // 일정 순서 저장
.schedule(schedule)
.build();

// ScheduleDetailDTO에서 직접 ScheduleType을 가져와서 설정
scheduleDetail.setScheduleType(scheduleDetailDTO.getType());

return scheduleDetail;
}


Expand All @@ -74,7 +79,10 @@ public ScheduleListResponseDTO toScheduleListResponseDTO(Schedule schedule) {
schedule.getStartDate(),
schedule.getEndDate(),
schedule.getTotalPrice(),
schedule.getCountry().getImageUrl()
schedule.getCountry().getImageUrl(),
schedule.getCountry().getCity(),
schedule.getCountry().getLatitude(),
schedule.getCountry().getLongitude()
);
}

Expand Down Expand Up @@ -113,6 +121,7 @@ private ScheduleDetailDTO toScheduleDetailDTO(ScheduleDetail scheduleDetail) {
return new ScheduleDetailDTO(
scheduleDetail.getTodo(),
scheduleDetail.getPlace(),
scheduleDetail.getScheduleType(),
scheduleDetail.getBudget(),
scheduleDetail.getLatitude(),
scheduleDetail.getLongitude()
Expand Down

0 comments on commit d8ec628

Please sign in to comment.