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 List<Long> ids;
|
||||
|
||||
public Integer getLimitStart() {
|
||||
return this.pageSize * (this.current - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ChatQueryRepositoryImpl implements ChatQueryRepository {
|
||||
|
||||
@Override
|
||||
public List<QueryResp> queryShowCase(PageQueryInfoReq pageQueryInfoReq, int agentId) {
|
||||
return showCaseCustomMapper.queryShowCase(pageQueryInfoReq.getCurrent(),
|
||||
return showCaseCustomMapper.queryShowCase(pageQueryInfoReq.getLimitStart(),
|
||||
pageQueryInfoReq.getPageSize(), agentId, pageQueryInfoReq.getUserName())
|
||||
.stream().map(this::convertTo)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -169,8 +169,7 @@ public class ChatServiceImpl implements ChatService {
|
||||
});
|
||||
queryResps = new ArrayList<>(queryResps.stream()
|
||||
.collect(Collectors.toMap(QueryResp::getQueryText, Function.identity(),
|
||||
(existing, replacement) -> existing, LinkedHashMap::new))
|
||||
.values());
|
||||
(existing, replacement) -> existing, LinkedHashMap::new)).values());
|
||||
fillParseInfo(queryResps);
|
||||
Map<Long, List<QueryResp>> showCaseMap = queryResps.stream()
|
||||
.collect(Collectors.groupingBy(QueryResp::getChatId));
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
from (
|
||||
select *
|
||||
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 != ''">
|
||||
and user_name = #{userName}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user