-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
640 additions
and
153 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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/ggang/be/api/facade/SignupRequestFacade.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,37 @@ | ||
package com.ggang.be.api.facade; | ||
|
||
import com.ggang.be.api.common.ResponseError; | ||
import com.ggang.be.api.exception.GongBaekException; | ||
import com.ggang.be.api.user.NicknameValidator; | ||
import com.ggang.be.api.user.dto.SignupRequest; | ||
import com.ggang.be.api.user.service.UserService; | ||
import com.ggang.be.domain.group.IntroductionValidator; | ||
import com.ggang.be.global.annotation.Facade; | ||
import com.ggang.be.global.util.TimeValidator; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Facade | ||
@RequiredArgsConstructor | ||
public class SignupRequestFacade { | ||
|
||
private final UserService userService; | ||
|
||
public void validateSignupRequest(SignupRequest request) { | ||
userService.duplicateCheckNickname(request.nickname()); | ||
IntroductionValidator.isIntroductionValid(request.introduction()); | ||
NicknameValidator.validate(request.nickname()); | ||
TimeValidator.hasDuplicateInfo(request.timeTable()); | ||
TimeValidator.isTimeVoValidTime(request.timeTable()); | ||
|
||
isValidSchoolGrade(request.schoolGrade()); | ||
TimeValidator.isYearAfterNow(request.enterYear()); | ||
} | ||
|
||
private void isValidSchoolGrade(Integer schoolGrade) { | ||
if (schoolGrade < 1 || schoolGrade > 4) { | ||
throw new GongBaekException(ResponseError.BAD_REQUEST); | ||
} | ||
} | ||
|
||
|
||
} |
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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/ggang/be/api/group/dto/FinalMyGroupResponse.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,8 @@ | ||
package com.ggang.be.api.group.dto; | ||
|
||
import java.util.List; | ||
|
||
public record FinalMyGroupResponse( | ||
List<MyGroupResponse> groups | ||
) { | ||
} |
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/ggang/be/api/group/dto/LatestResponse.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,40 @@ | ||
package com.ggang.be.api.group.dto; | ||
|
||
import com.ggang.be.domain.constant.Category; | ||
import com.ggang.be.domain.constant.GroupType; | ||
import com.ggang.be.domain.constant.WeekDay; | ||
import com.ggang.be.domain.group.dto.GroupVo; | ||
|
||
import java.time.LocalDate; | ||
|
||
public record LatestResponse( | ||
long groupId, | ||
Category category, | ||
int coverImg, | ||
int profileImg, | ||
String nickname, | ||
GroupType groupType, | ||
String groupTitle, | ||
WeekDay weekDay, | ||
LocalDate weekDate, | ||
double startTime, | ||
double endTime, | ||
String location | ||
) { | ||
public static LatestResponse fromGroupVo(GroupVo groupVo) { | ||
return new LatestResponse( | ||
groupVo.groupId(), | ||
groupVo.category(), | ||
groupVo.coverImg(), | ||
groupVo.profileImg(), | ||
groupVo.nickname(), | ||
groupVo.groupType(), | ||
groupVo.groupTitle(), | ||
groupVo.weekDay(), | ||
groupVo.weekDate(), | ||
groupVo.startTime(), | ||
groupVo.endTime(), | ||
groupVo.location() | ||
); | ||
} | ||
} |
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.