File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/main/java/com/moplus/moplus_server/domain/problemset Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 22
33import com .moplus .moplus_server .domain .problem .domain .problem .Problem ;
44import jakarta .validation .constraints .NotNull ;
5- import java .util .List ;
5+ import java .util .Set ;
66import lombok .Builder ;
77
88@ Builder
@@ -15,9 +15,9 @@ public record ProblemSummaryResponse(
1515 String memo ,
1616 String mainProblemImageUrl ,
1717 @ NotNull (message = "컬렉션 값은 필수입니다." )
18- List <String > tagNames
18+ Set <String > tagNames
1919) {
20- public static ProblemSummaryResponse of (Problem problem , List <String > tagNames ) {
20+ public static ProblemSummaryResponse of (Problem problem , Set <String > tagNames ) {
2121
2222 return ProblemSummaryResponse .builder ()
2323 .problemId (problem .getId ())
Original file line number Diff line number Diff line change 1414import com .moplus .moplus_server .global .error .exception .ErrorCode ;
1515import java .time .LocalDate ;
1616import java .util .ArrayList ;
17+ import java .util .HashSet ;
1718import java .util .List ;
19+ import java .util .Set ;
1820import lombok .RequiredArgsConstructor ;
1921import org .springframework .stereotype .Service ;
2022import org .springframework .transaction .annotation .Transactional ;
@@ -41,7 +43,7 @@ public ProblemSetGetResponse getProblemSet(Long problemSetId) {
4143 List <ProblemSummaryResponse > problemSummaries = new ArrayList <>();
4244 for (Long problemId : problemSet .getProblemIds ()) {
4345 Problem problem = problemRepository .findByIdElseThrow (problemId );
44- List <String > tagNames = new ArrayList <>(
46+ Set <String > tagNames = new HashSet <>(
4547 conceptTagRepository .findAllByIdsElseThrow (problem .getConceptTagIds ())
4648 .stream ()
4749 .map (ConceptTag ::getName )
You can’t perform that action at this time.
0 commit comments