Skip to content

Commit

Permalink
refactor: else 예약어 제거 및 변수명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdozzi committed Jul 8, 2024
1 parent 62d1424 commit 0e9e6a5
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ public class TopicFacadeImpl implements TopicFacade {

@Override
public Page<TopicPagingResponse> findTopics(Pageable pageable) {
Page<Topic> allTopicById = topicService.findTopics(pageable);
return allTopicById.map(this::convertToTopicPagingResponseDto);
Page<Topic> findTopics = topicService.findTopics(pageable);
return findTopics.map(this::convertToTopicPagingResponseDto);
}

@Override
public TopicDetailResponse findOne(Long id) {
Topic topic = topicService.findOne(id);
FileResponse fileResponse = filesService.convertToFileResponse(topic.getFiles());
return TopicDetailResponse.of(topic, fileResponse);
Topic findTopic = topicService.findOne(id);
FileResponse fileResponse = filesService.convertToFileResponse(findTopic.getFiles());
return TopicDetailResponse.of(findTopic, fileResponse);
}

@Override
public Long create(TopicCreateRequest topicCreateRequest) {
Topic byTopicCreateDto = topicService.createTopicByTopicCreateRequest(topicCreateRequest);
return topicService.create(byTopicCreateDto);
Topic topic = topicService.createTopicByTopicCreateRequest(topicCreateRequest);
return topicService.create(topic);
}

@Override
public Long update(Long id, TopicUpdateRequest topicUpdateRequest) {
Topic topic = topicService.findOne(id);

boolean hasInstance = !topic.getInstanceList().isEmpty();
if (hasInstance) {
if (!topic.getInstanceList().isEmpty()) {
topic.updateExistInstance(topicUpdateRequest.description());
} else {
topic.updateNotExistInstance(topicUpdateRequest.title(), topicUpdateRequest.description(),
topicUpdateRequest.tags(), topicUpdateRequest.notice(), topicUpdateRequest.pointPerPerson());
return topicService.create(topic);
}

topic.updateNotExistInstance(topicUpdateRequest.title(), topicUpdateRequest.description(),
topicUpdateRequest.tags(), topicUpdateRequest.notice(), topicUpdateRequest.pointPerPerson());
return topicService.create(topic);
}

Expand Down

0 comments on commit 0e9e6a5

Please sign in to comment.