mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(improvement)(chat) show case filter by user name (#245)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -7,6 +7,6 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface ShowCaseCustomMapper {
|
||||
|
||||
List<ChatQueryDO> queryShowCase(int start, int limit, int agentId);
|
||||
List<ChatQueryDO> queryShowCase(int start, int limit, int agentId, String userName);
|
||||
|
||||
}
|
||||
|
||||
@@ -78,9 +78,10 @@ public class ChatQueryRepositoryImpl implements ChatQueryRepository {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QueryResp> queryShowCase(PageQueryInfoReq pageQueryInfoCommend, int agentId) {
|
||||
return showCaseCustomMapper.queryShowCase(pageQueryInfoCommend.getCurrent(),
|
||||
pageQueryInfoCommend.getPageSize(), agentId).stream().map(this::convertTo)
|
||||
public List<QueryResp> queryShowCase(PageQueryInfoReq pageQueryInfoReq, int agentId) {
|
||||
return showCaseCustomMapper.queryShowCase(pageQueryInfoReq.getCurrent(),
|
||||
pageQueryInfoReq.getPageSize(), agentId, pageQueryInfoReq.getUserName())
|
||||
.stream().map(this::convertTo)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@@ -137,14 +137,14 @@ public class ChatServiceImpl implements ChatService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShowCaseResp queryShowCase(PageQueryInfoReq pageQueryInfoCommend, int agentId) {
|
||||
public ShowCaseResp queryShowCase(PageQueryInfoReq pageQueryInfoReq, int agentId) {
|
||||
ShowCaseResp showCaseResp = new ShowCaseResp();
|
||||
List<QueryResp> queryResps = chatQueryRepository.queryShowCase(pageQueryInfoCommend, agentId);
|
||||
List<QueryResp> queryResps = chatQueryRepository.queryShowCase(pageQueryInfoReq, agentId);
|
||||
Map<Long, List<QueryResp>> showCaseMap = queryResps.stream()
|
||||
.collect(Collectors.groupingBy(QueryResp::getChatId));
|
||||
showCaseResp.setShowCaseMap(showCaseMap);
|
||||
showCaseResp.setCurrent(pageQueryInfoCommend.getCurrent());
|
||||
showCaseResp.setPageSize(pageQueryInfoCommend.getPageSize());
|
||||
showCaseResp.setCurrent(pageQueryInfoReq.getCurrent());
|
||||
showCaseResp.setPageSize(pageQueryInfoReq.getPageSize());
|
||||
return showCaseResp;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
select distinct chat_id
|
||||
from s2_chat_query
|
||||
where query_state = 1 and agent_id = ${agentId}
|
||||
<if test="userName != null and userName != ''">
|
||||
and user_name = #{userName}
|
||||
</if>
|
||||
order by chat_id desc
|
||||
limit #{start}, #{limit}
|
||||
) q2
|
||||
|
||||
Reference in New Issue
Block a user