Skip to content

Commit

Permalink
Merge pull request #16 from kduoh99/Feat/#11
Browse files Browse the repository at this point in the history
Fix: νŒŒμ‹± 였λ₯˜ μˆ˜μ •
  • Loading branch information
kduoh99 authored Nov 1, 2024
2 parents 2a746e9 + 4f37632 commit 2c0a733
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,22 @@ private List<TeamInfo> parseResToTeamInfo(String resContent, List<TeamBuilding>
TeamInfo currentTeam = null;

for (String line : lines) {
if (line.startsWith("νŒ€ 이름: ")) {
line = line.trim();

if (line.equals("- νŒ€ μ‹œμž‘ -")) {
if (currentTeam != null) {
teamInfos.add(currentTeam);
}
currentTeam = TeamInfo.builder().build();

} else if (line.startsWith("νŒ€ 이름: ")) {
String teamName = line.replace("νŒ€ 이름: ", "").trim();
currentTeam = TeamInfo.builder()
.teamName(teamName)
.build();
if (currentTeam != null) {
currentTeam = TeamInfo.builder()
.teamName(teamName)
.build();
}

} else if (line.startsWith("νŒ€ μ„€λͺ…: ")) {
String description = line.replace("νŒ€ μ„€λͺ…: ", "").trim();
if (currentTeam != null) {
Expand All @@ -123,17 +131,23 @@ private List<TeamInfo> parseResToTeamInfo(String resContent, List<TeamBuilding>
.description(description)
.build();
}

} else if (line.startsWith("- 이메일: ")) {
String email = line.replace("- 이메일: ", "").trim();
if (currentTeam != null) {
for (TeamBuilding request : requests) {
if (request.getMember().getEmail().equals(email)) {
request.assignTeamInfo(currentTeam);
request.updateStatus(Status.COMPLETED);
currentTeam.addTeamBuilding(request);
request.updateStatus(Status.COMPLETED);
}
}
}

} else if (line.equals("- νŒ€ 끝 -")) {
if (currentTeam != null) {
teamInfos.add(currentTeam);
currentTeam = null;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private TeamBuilding(LocalDate startDate, LocalDate endDate, int teamSize, Strin
this.member = member;
}

public void assignTeamInfo(TeamInfo teamInfo) {
protected void setTeamInfo(TeamInfo teamInfo) {
this.teamInfo = teamInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ private TeamInfo(String teamName, String description) {

public void addTeamBuilding(TeamBuilding teamBuilding) {
this.teamBuildings.add(teamBuilding);
teamBuilding.assignTeamInfo(this);
teamBuilding.setTeamInfo(this);
}
}

0 comments on commit 2c0a733

Please sign in to comment.