Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

브리핑 목록 조회 방식 변경 #158

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/generated/briefing/briefing/domain/QBriefing.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class QBriefing extends EntityPathBase<Briefing> {
//inherited
public final DateTimePath<java.time.LocalDateTime> createdAt = _super.createdAt;

public final EnumPath<briefing.chatting.domain.GptModel> gptModel = createEnum("gptModel", briefing.chatting.domain.GptModel.class);
public final EnumPath<briefing.common.enums.GptModel> gptModel = createEnum("gptModel", briefing.common.enums.GptModel.class);

public final NumberPath<Long> id = createNumber("id", Long.class);

Expand Down
50 changes: 0 additions & 50 deletions src/main/generated/briefing/chatting/domain/QChatting.java

This file was deleted.

57 changes: 0 additions & 57 deletions src/main/generated/briefing/chatting/domain/QMessage.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import briefing.briefing.domain.BriefingType;
import briefing.briefing.domain.TimeOfDay;
import briefing.chatting.domain.GptModel;
import briefing.common.enums.GptModel;
import lombok.Getter;

public class BriefingRequestDTO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import briefing.briefing.domain.BriefingType;
import briefing.briefing.domain.TimeOfDay;
import briefing.chatting.domain.GptModel;
import briefing.common.enums.GptModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/briefing/briefing/domain/Briefing.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import jakarta.persistence.*;

import briefing.base.BaseDateTimeEntity;
import briefing.chatting.domain.GptModel;
import briefing.common.enums.GptModel;
import lombok.*;

@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;

import org.springframework.stereotype.Repository;
Expand Down Expand Up @@ -79,17 +77,23 @@ public List<Briefing> findTop10ByTypeOrderByCreatedAtDesc(BriefingType type) {
.where(briefing.type.eq(type))
.groupBy(briefing)
.orderBy(date.desc(), briefing.ranks.asc())
.limit(10)
.limit(20)
.fetch();

return results.stream()
.map(
tuple -> {
Briefing b = tuple.get(briefing);
b.setScrapCount(Math.toIntExact(tuple.get(scrap.count())));
return b;
})
.collect(Collectors.toCollection(ArrayList::new));
List<Briefing> briefingList =
results.stream()
.map(
tuple -> {
Briefing b = tuple.get(briefing);
b.setScrapCount(Math.toIntExact(tuple.get(scrap.count())));
return b;
})
.collect(Collectors.toCollection(ArrayList::new));

Map<Integer, Briefing> briefingMap = new HashMap<>();
briefingList.forEach(candidate -> briefingMap.putIfAbsent(candidate.getRanks(), candidate));

return briefingMap.values().stream().toList();
}

@Override
Expand Down
60 changes: 0 additions & 60 deletions src/main/java/briefing/chatting/api/ChattingApi.java

This file was deleted.

80 changes: 0 additions & 80 deletions src/main/java/briefing/chatting/api/ChattingConverter.java

This file was deleted.

Loading
Loading