mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:28:12 +00:00
(improvement)(chat) opt page query for show case (#278)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -13,4 +13,8 @@ public class PageQueryInfoReq {
|
|||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
private List<Long> ids;
|
private List<Long> ids;
|
||||||
|
|
||||||
|
public Integer getLimitStart() {
|
||||||
|
return this.pageSize * (this.current - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class ChatQueryRepositoryImpl implements ChatQueryRepository {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QueryResp> queryShowCase(PageQueryInfoReq pageQueryInfoReq, int agentId) {
|
public List<QueryResp> queryShowCase(PageQueryInfoReq pageQueryInfoReq, int agentId) {
|
||||||
return showCaseCustomMapper.queryShowCase(pageQueryInfoReq.getCurrent(),
|
return showCaseCustomMapper.queryShowCase(pageQueryInfoReq.getLimitStart(),
|
||||||
pageQueryInfoReq.getPageSize(), agentId, pageQueryInfoReq.getUserName())
|
pageQueryInfoReq.getPageSize(), agentId, pageQueryInfoReq.getUserName())
|
||||||
.stream().map(this::convertTo)
|
.stream().map(this::convertTo)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
@@ -169,8 +169,7 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
});
|
});
|
||||||
queryResps = new ArrayList<>(queryResps.stream()
|
queryResps = new ArrayList<>(queryResps.stream()
|
||||||
.collect(Collectors.toMap(QueryResp::getQueryText, Function.identity(),
|
.collect(Collectors.toMap(QueryResp::getQueryText, Function.identity(),
|
||||||
(existing, replacement) -> existing, LinkedHashMap::new))
|
(existing, replacement) -> existing, LinkedHashMap::new)).values());
|
||||||
.values());
|
|
||||||
fillParseInfo(queryResps);
|
fillParseInfo(queryResps);
|
||||||
Map<Long, List<QueryResp>> showCaseMap = queryResps.stream()
|
Map<Long, List<QueryResp>> showCaseMap = queryResps.stream()
|
||||||
.collect(Collectors.groupingBy(QueryResp::getChatId));
|
.collect(Collectors.groupingBy(QueryResp::getChatId));
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
from (
|
from (
|
||||||
select *
|
select *
|
||||||
from s2_chat_query
|
from s2_chat_query
|
||||||
where query_state = 1 and agent_id = ${agentId}
|
where query_state = 1 and agent_id = ${agentId} and (score is null or score > 1)
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
and user_name = #{userName}
|
and user_name = #{userName}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user