Skip to content

Commit

Permalink
[BE/#17] Modify : 반복문에 쓰이는 임시변수를 전역 상수로 선언하여 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
hanurii committed Jun 11, 2020
1 parent 81c68e9 commit a668af9
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
public class IssueService {

private static final Logger logger = LoggerFactory.getLogger(IssueService.class);
private static final Long ZERO = 0L;

private IssueDao issueDao;

Expand All @@ -21,16 +22,18 @@ public IssueService(IssueDao issueDao) {
}

public List<IssuesDto> findAllIssues() {
List<IssuesDto> issuesDtos = new ArrayList<>();

for (long i = 0; i < 5; i++) {
issuesDtos.add((int)i,findIssuesByIssueId(i+1));
List<IssuesDto> ListTypeIssuesDto = new ArrayList<>();

for (long i = ZERO; i < issueDao.getCountOfIssues(); i++) {
ListTypeIssuesDto.add((int)i, findIssuesByIssueId(i+1)); // issue ID는 1부터 시작
}

return issuesDtos;
return ListTypeIssuesDto;
}

public IssuesDto findIssuesByIssueId(Long issueId) {

IssuesDto issuesDto = issueDao.findIssueByIssueId(issueId);
issuesDto.setAttachedLabels(issueDao.findLabelsByIssuesId(issueId));
issuesDto.setAllocatedAssignees(issueDao.findAssigneeByIssueId(issueId));
Expand Down

0 comments on commit a668af9

Please sign in to comment.