Skip to content

Commit

Permalink
[BE/#58] Fix : 레이블 DTO, VO 변경사항 적용 완료
Browse files Browse the repository at this point in the history
- LabelInformation의 경우 description을 인자로 추가하여 생성 하도록 수정
  • Loading branch information
MuseopKim committed Jun 22, 2020
1 parent 889072c commit f3d1e4d
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import com.codesquad.issuetracker.ragdoll.domain.Label;
import com.codesquad.issuetracker.ragdoll.dto.request.LabelRequestDto;
import com.codesquad.issuetracker.ragdoll.vo.labelVO.LabelInformation;
import com.codesquad.issuetracker.ragdoll.vo.labelVO.LabelSummary;
import com.codesquad.issuetracker.ragdoll.vo.labelVO.LabelDetails;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Service
Expand All @@ -21,20 +20,21 @@ public LabelService_Ragdoll(LabelDao_Ragdoll labelDaoRagdoll) {
this.labelDaoRagdoll = labelDaoRagdoll;
}

public List<LabelSummary> findAttachedLabelsByIssueId(Long issueId) {
public List<LabelDetails> findAttachedLabelsByIssueId(Long issueId) {
return labelDaoRagdoll.findAttachedLabelsByIssueId(issueId);
}

public LabelInformation findAllLabels() {
List<Label> labels = labelDaoRagdoll.findAllLabels();
List<LabelSummary> labelSummaries = labels.stream()
.map(label -> new LabelSummary.Builder()
.id(label.getId())
.name(label.getName())
.backgroundColor(label.getBackgroundColor())
.color(label.getColor())
.build()).collect(Collectors.toList());
return LabelInformation.create(labelSummaries.size(), labelSummaries);
List<LabelDetails> labelsForDetails = labels.stream()
.map(label -> new LabelDetails.Builder()
.id(label.getId())
.name(label.getName())
.description(label.getDescription())
.backgroundColor(label.getBackgroundColor())
.color(label.getColor())
.build()).collect(Collectors.toList());
return LabelInformation.of(labelsForDetails.size(), labelsForDetails);
}

public String updateLabel(Integer labelId, String labelName, String description, String backgroundColor, String color) {
Expand Down

0 comments on commit f3d1e4d

Please sign in to comment.