Skip to content

Commit

Permalink
refactor: 잔디 응답 데이터의 날짜 데이터 구조 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
마현우 committed Nov 28, 2023
1 parent d87cd22 commit fade7a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import thisiscomedy.nodamnodam.server.domain.smoke.presentation.dto.response.GrassGetResponse;
import thisiscomedy.nodamnodam.server.domain.smoke.presentation.dto.response.UserSmokedAtResponse;
import thisiscomedy.nodamnodam.server.domain.smoke.presentation.dto.response.SmokeCauseResponse;
import thisiscomedy.nodamnodam.server.domain.smoke.repository.SmokeRepository;
import thisiscomedy.nodamnodam.server.domain.user.application.UserGetService;
import thisiscomedy.nodamnodam.server.domain.user.domain.User;
import thisiscomedy.nodamnodam.server.global.entity.BaseTimeEntity;

import java.time.LocalDate;
import java.util.List;

@Service
Expand All @@ -21,8 +22,8 @@ public class SmokeGetService {
public GrassGetResponse getGrass() {
User user = userGetService.getUser();

List<UserSmokedAtResponse> smoked = smokeRepository.findByUser(user).stream()
.map(UserSmokedAtResponse::new)
List<LocalDate> smoked = smokeRepository.findByUser(user).stream()
.map(BaseTimeEntity::getCreatedAt)
.toList();

return new GrassGetResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

public record GrassGetResponse(
LocalDate userCreatedAt,
List<UserSmokedAtResponse> userSmokedAtResponses
List<LocalDate> userSmokedAtResponses
) {}

0 comments on commit fade7a5

Please sign in to comment.