-
Notifications
You must be signed in to change notification settings - Fork 6
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 #270 from kssumin/main
[BE/FEAT] 팀빌딩 완료 시 AI 서버에게 요청하기 구현
- Loading branch information
Showing
27 changed files
with
515 additions
and
71 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
BE/eeos/src/main/java/com/blackcompany/eeos/common/persistence/IntegerArrayConverter.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,26 @@ | ||
package com.blackcompany.eeos.common.persistence; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import javax.persistence.AttributeConverter; | ||
import javax.persistence.Converter; | ||
|
||
@Converter | ||
public class IntegerArrayConverter implements AttributeConverter<List<Long>, String> { | ||
|
||
private static final String SPLIT_CHAR = ","; | ||
|
||
@Override | ||
public String convertToDatabaseColumn(List<Long> attribute) { | ||
return attribute.stream().map(String::valueOf).collect(Collectors.joining(SPLIT_CHAR)); | ||
} | ||
|
||
@Override | ||
public List<Long> convertToEntityAttribute(String dbData) { | ||
return Arrays.stream(dbData.split(SPLIT_CHAR)) | ||
.map(String::trim) | ||
.map(Long::parseLong) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
.../src/main/java/com/blackcompany/eeos/target/persistence/TeamBuildingTargetRepository.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,10 +1,13 @@ | ||
package com.blackcompany.eeos.target.persistence; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface TeamBuildingTargetRepository | ||
extends JpaRepository<TeamBuildingTargetEntity, Long> { | ||
Optional<TeamBuildingTargetEntity> findByTeamBuildingIdAndMemberId( | ||
Long teamBuildingId, Long memberId); | ||
|
||
List<TeamBuildingTargetEntity> findByTeamBuildingId(Long teamBuildingId); | ||
} |
15 changes: 15 additions & 0 deletions
15
.../src/main/java/com/blackcompany/eeos/teamBuilding/application/dto/EachMemberResponse.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 com.blackcompany.eeos.teamBuilding.application.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder(toBuilder = true) | ||
public class EachMemberResponse { | ||
private Long memberId; | ||
private String name; | ||
} |
17 changes: 17 additions & 0 deletions
17
...n/java/com/blackcompany/eeos/teamBuilding/application/dto/ResultTeamBuildingResponse.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,17 @@ | ||
package com.blackcompany.eeos.teamBuilding.application.dto; | ||
|
||
import com.blackcompany.eeos.common.support.dto.AbstractResponseDto; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Builder(toBuilder = true) | ||
public class ResultTeamBuildingResponse implements AbstractResponseDto { | ||
private String accessRights; | ||
private List<List<EachMemberResponse>> results; | ||
} |
14 changes: 14 additions & 0 deletions
14
...pany/eeos/teamBuilding/application/dto/converter/ResultTeamBuildingResponseConverter.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,14 @@ | ||
package com.blackcompany.eeos.teamBuilding.application.dto.converter; | ||
|
||
import com.blackcompany.eeos.teamBuilding.application.dto.EachMemberResponse; | ||
import com.blackcompany.eeos.teamBuilding.application.dto.ResultTeamBuildingResponse; | ||
import java.util.List; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ResultTeamBuildingResponseConverter { | ||
public ResultTeamBuildingResponse from( | ||
String accessRight, List<List<EachMemberResponse>> results) { | ||
return ResultTeamBuildingResponse.builder().accessRights(accessRight).results(results).build(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ava/com/blackcompany/eeos/teamBuilding/application/exception/NotFoundResultException.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 com.blackcompany.eeos.teamBuilding.application.exception; | ||
|
||
import com.blackcompany.eeos.common.exception.BusinessException; | ||
import org.springframework.http.HttpStatus; | ||
|
||
/** 조회할 팀빌딩이 존재하지 않을 때 발생하는 예외 */ | ||
public class NotFoundResultException extends BusinessException { | ||
private static final String FAIL_CODE = "6009"; | ||
|
||
public NotFoundResultException() { | ||
super(FAIL_CODE, HttpStatus.NOT_FOUND); | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return "결과를 조회할 팀빌딩이 존재하지 않습니다."; | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...n/java/com/blackcompany/eeos/teamBuilding/application/model/TeamBuildingAccessRights.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,17 @@ | ||
package com.blackcompany.eeos.teamBuilding.application.model; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum TeamBuildingAccessRights { | ||
/** 읽기, 수정 권한 있음 */ | ||
EDIT("edit"), | ||
/** 읽기 권한 있음 */ | ||
READ_ONLY("read_only"); | ||
|
||
private final String accessRight; | ||
|
||
TeamBuildingAccessRights(String accessRight) { | ||
this.accessRight = accessRight; | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
...ackcompany/eeos/teamBuilding/application/model/converter/TeamBuildingResultConverter.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,16 @@ | ||
package com.blackcompany.eeos.teamBuilding.application.model.converter; | ||
|
||
import com.blackcompany.eeos.teamBuilding.persistence.TeamBuildingResultEntity; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class TeamBuildingResultConverter { | ||
public TeamBuildingResultEntity from(List<String> memberIds, Long teamBuildinId) { | ||
return TeamBuildingResultEntity.builder() | ||
.teamBuildingId(teamBuildinId) | ||
.memberIds(memberIds.stream().map(Long::parseLong).collect(Collectors.toList())) | ||
.build(); | ||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
...va/com/blackcompany/eeos/teamBuilding/application/service/CommandTeamBuildingService.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.