-
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.
Merge pull request #77 from study-hub-inu/feat/SH-219-my-study
Feat/sh 219 my study
- Loading branch information
Showing
29 changed files
with
160 additions
and
35 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
25 changes: 25 additions & 0 deletions
25
src/main/java/kr/co/studyhubinu/studyhubserver/apply/dto/data/ParticipateApplyData.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 kr.co.studyhubinu.studyhubserver.apply.dto.data; | ||
|
||
import kr.co.studyhubinu.studyhubserver.apply.enums.Inspection; | ||
import kr.co.studyhubinu.studyhubserver.user.enums.MajorType; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ParticipateApplyData { | ||
|
||
private String major; | ||
private String title; | ||
private String content; | ||
private String chatUrl; | ||
private String inspection; | ||
private Long postId; | ||
|
||
public ParticipateApplyData(MajorType major, String title, String content, String chatUrl, Inspection inspection, Long postId) { | ||
this.major = major.getValue(); | ||
this.title = title; | ||
this.content = content; | ||
this.chatUrl = chatUrl; | ||
this.inspection = inspection.getValue(); | ||
this.postId = postId; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...ava/kr/co/studyhubinu/studyhubserver/apply/dto/response/FindParticipateApplyResponse.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,15 @@ | ||
package kr.co.studyhubinu.studyhubserver.apply.dto.response; | ||
|
||
import kr.co.studyhubinu.studyhubserver.apply.dto.data.ParticipateApplyData; | ||
import lombok.Getter; | ||
import org.springframework.data.domain.Slice; | ||
|
||
@Getter | ||
public class FindParticipateApplyResponse { | ||
private Long totalCount; | ||
Slice<ParticipateApplyData> participateStudyData; | ||
public FindParticipateApplyResponse(Long totalCount, Slice<ParticipateApplyData> participateStudyData) { | ||
this.totalCount = totalCount; | ||
this.participateStudyData = participateStudyData; | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
src/main/java/kr/co/studyhubinu/studyhubserver/apply/repository/ApplyRepositoryCustom.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,11 +1,14 @@ | ||
package kr.co.studyhubinu.studyhubserver.apply.repository; | ||
|
||
import kr.co.studyhubinu.studyhubserver.apply.dto.data.ApplyUserData; | ||
import kr.co.studyhubinu.studyhubserver.apply.dto.data.ParticipateApplyData; | ||
import org.springframework.data.domain.Pageable; | ||
|
||
import java.util.List; | ||
|
||
public interface ApplyRepositoryCustom { | ||
|
||
List<ApplyUserData> findByStudy(Long studyId, Pageable pageable); | ||
|
||
List<ParticipateApplyData> findByUserIdAndInspection(Long userId, Pageable pageable); | ||
} |
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
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,7 +1,7 @@ | ||
package kr.co.studyhubinu.studyhubserver.email.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import kr.co.studyhubinu.studyhubserver.email.validate.InuEmail; | ||
import kr.co.studyhubinu.studyhubserver.email.validate.NormalEmail; | ||
import lombok.Getter; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
|
@@ -17,7 +17,7 @@ public class QuestionRequest { | |
private String content; | ||
|
||
@Schema(description = "답변 받을 이메일", example = "[email protected]") | ||
@InuEmail | ||
@NormalEmail | ||
@NotBlank(message = "이메일값은 필수 입니다") | ||
private String toEmail; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/kr/co/studyhubinu/studyhubserver/email/validate/EmailValidator.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,15 @@ | ||
package kr.co.studyhubinu.studyhubserver.email.validate; | ||
|
||
import javax.validation.ConstraintValidator; | ||
import javax.validation.ConstraintValidatorContext; | ||
import java.util.regex.Pattern; | ||
|
||
public class EmailValidator implements ConstraintValidator<NormalEmail, String> { | ||
|
||
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)*(\\.[a-zA-Z]{2,})$"); | ||
|
||
@Override | ||
public boolean isValid(String value, ConstraintValidatorContext context) { | ||
return value != null && EMAIL_PATTERN.matcher(value).matches(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/kr/co/studyhubinu/studyhubserver/email/validate/NormalEmail.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,18 @@ | ||
package kr.co.studyhubinu.studyhubserver.email.validate; | ||
|
||
import javax.validation.Constraint; | ||
import javax.validation.Payload; | ||
import java.lang.annotation.*; | ||
|
||
@Documented | ||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Constraint(validatedBy = EmailValidator.class) | ||
public @interface NormalEmail { | ||
|
||
String message() default "이메일 형식에 맞지 않습니다."; | ||
|
||
Class<?>[] groups() default {}; | ||
|
||
Class<? extends Payload>[] payload() default {}; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...studyhubserver/study/StudyRepository.java → ...ver/study/repository/StudyRepository.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
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
Oops, something went wrong.