Skip to content

Commit

Permalink
Merge pull request #158 from Team-Shaka/develop
Browse files Browse the repository at this point in the history
브리핑 목록 조회 방식 변경
  • Loading branch information
swa07016 authored Jan 11, 2024
2 parents 1acc546 + 4b9d34e commit db5c682
Show file tree
Hide file tree
Showing 25 changed files with 24 additions and 740 deletions.
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

0 comments on commit db5c682

Please sign in to comment.