-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
REF: 로그인 성공시 배포링크로 redirect(#170)
- Loading branch information
Showing
6 changed files
with
186 additions
and
2 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/main/java/com/soongsil/CoffeeChat/config/S3Config.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,34 @@ | ||
package com.soongsil.CoffeeChat.config; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import com.amazonaws.auth.AWSStaticCredentialsProvider; | ||
import com.amazonaws.auth.BasicAWSCredentials; | ||
import com.amazonaws.services.s3.AmazonS3; | ||
import com.amazonaws.services.s3.AmazonS3ClientBuilder; | ||
|
||
@Configuration | ||
public class S3Config { | ||
@Value("${cloud.aws.credentials.access-key}") // AWS 액세스 키를 application.properties 또는 application.yml 파일에서 가져옵니다. | ||
private String awsAccessKey; | ||
|
||
@Value("${cloud.aws.credentials.secret-key}") // AWS 비밀 키를 application.properties 또는 application.yml 파일에서 가져옵니다. | ||
private String awsSecretKey; | ||
|
||
@Value("${cloud.aws.region.static}") // AWS 리전을 application.properties 또는 application.yml 파일에서 가져옵니다. | ||
private String region; | ||
|
||
@Bean // 이 어노테이션은 이 메소드가 Spring Bean을 생성하는 팩토리 메소드임을 나타냅니다. | ||
public AmazonS3 s3client() { | ||
BasicAWSCredentials awsCredentials = new BasicAWSCredentials(awsAccessKey, awsSecretKey); // AWS 액세스 키와 비밀 키를 사용하여 AWS 자격 증명을 생성합니다. | ||
|
||
// AmazonS3 클라이언트를 생성합니다. 이 클라이언트는 AWS S3 서비스와 상호 작용하는 데 사용됩니다. | ||
// 클라이언트는 설정된 리전과 자격 증명을 사용합니다. | ||
return AmazonS3ClientBuilder.standard() | ||
.withRegion(region) | ||
.withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) | ||
.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
49 changes: 49 additions & 0 deletions
49
src/main/java/com/soongsil/CoffeeChat/dto/ApplicationCreateRequest.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,49 @@ | ||
package com.soongsil.CoffeeChat.dto; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.soongsil.CoffeeChat.entity.Application; | ||
import com.soongsil.CoffeeChat.entity.Mentee; | ||
import com.soongsil.CoffeeChat.entity.Mentor; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
public class ApplicationCreateRequest { | ||
@JsonProperty("date") | ||
@JsonFormat(pattern = "yyyy-MM-dd") | ||
private LocalDate date; | ||
|
||
@JsonProperty("start_time") | ||
@JsonFormat(pattern = "HH:mm") | ||
private LocalTime startTime; | ||
|
||
@JsonProperty("end_time") | ||
@JsonFormat(pattern = "HH:mm") | ||
private LocalTime endTime; | ||
|
||
@JsonProperty("mentor_id") | ||
private Long mentorId; | ||
|
||
public ApplicationCreateRequest(LocalDate date, LocalTime startTime, LocalTime endTime, Long mentorId) { | ||
this.date=date; | ||
this.startTime=startTime; | ||
this.endTime=endTime; | ||
this.mentorId=mentorId; | ||
} | ||
|
||
public Application toEntity(Mentor mentor, Mentee mentee) { | ||
return Application.builder() | ||
|
||
|
||
|
||
.mentor(mentor) | ||
.mentee(mentee) | ||
.build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/soongsil/CoffeeChat/dto/ApplicationCreateResponse.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,22 @@ | ||
package com.soongsil.CoffeeChat.dto; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
import com.soongsil.CoffeeChat.entity.Application; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Builder | ||
@Getter | ||
public class ApplicationCreateResponse { | ||
private LocalDate date; | ||
private LocalTime startTime; | ||
private LocalTime endTime; | ||
|
||
public static ApplicationCreateResponse from(Application application) { | ||
return ApplicationCreateResponse.builder() | ||
|
||
.build(); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/soongsil/CoffeeChat/dto/PossibleDateRequestDto.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,43 @@ | ||
package com.soongsil.CoffeeChat.dto; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
import com.soongsil.CoffeeChat.entity.PossibleDate; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@Data | ||
public class PossibleDateRequestDto { | ||
@JsonFormat(pattern = "yyyy-MM-dd") | ||
private LocalDate date; | ||
|
||
@JsonFormat(pattern = "HH:mm") | ||
private LocalTime startTime; | ||
|
||
@JsonFormat(pattern = "HH:mm") | ||
private LocalTime endTime; | ||
|
||
private Long possibleDateId; | ||
|
||
@QueryProjection | ||
public PossibleDateRequestDto(LocalDate date, LocalTime startTime, LocalTime endTime, Long possibleDateId) { | ||
this.date = date; | ||
this.startTime = startTime; | ||
this.endTime = endTime; | ||
this.possibleDateId=possibleDateId; | ||
} | ||
|
||
public static PossibleDateRequestDto toDto(PossibleDate possibleDate) { | ||
return PossibleDateRequestDto.builder() | ||
.date(possibleDate.getDate()) | ||
.startTime(possibleDate.getStartTime()) | ||
.endTime(possibleDate.getEndTime()) | ||
.build(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/com/soongsil/CoffeeChat/dto/ResponseMentorListInfo.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,36 @@ | ||
package com.soongsil.CoffeeChat.dto; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import com.soongsil.CoffeeChat.entity.Mentor; | ||
import com.soongsil.CoffeeChat.entity.User; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Builder | ||
@Getter | ||
@Setter | ||
@Data | ||
public class ResponseMentorListInfo { | ||
private String picture; | ||
private String mentorName; | ||
private int part; | ||
private int club; | ||
private String username; | ||
|
||
|
||
@QueryProjection | ||
public ResponseMentorListInfo(String picture, String mentorName, int part, int club, String username) { | ||
this.picture = picture; | ||
this.mentorName = mentorName; | ||
this.part=part; | ||
this.club=club; | ||
this.username = username; | ||
} | ||
|
||
} |