Commit 43bccb7c by Ren Ping

消息模块开发

1 parent be67cdc4
......@@ -50,5 +50,6 @@ public interface MsgDao extends JpaRepository<MsgEntity, Long> {
") t"
, nativeQuery = true // 开启原生sql
)
List<Map<String, Objects>> getList(@Param("req") MsgDTO.Request req, @Param("msgGroupResp") MsgGroupResp msgGroupResp, Pageable pageable);
List<Map<String, Objects>> getList(@Param("req") MsgDTO.Request req
, @Param("msgGroupResp") MsgGroupResp msgGroupResp, Pageable pageable);
}
......@@ -59,9 +59,9 @@ public class MsgServiceImpl implements MsgService {
msgGroupResp.setGroupName(clusterDao.getByClusterId(msgGroupResp.getBranchId()).getName());
}
Sort sort2 = Sort.by("asc".equalsIgnoreCase(request.getSortType()) ? Sort.Direction.ASC : Sort.Direction.DESC, request.getSort());
Pageable pageable2 = PageRequest.of(0, Integer.MAX_VALUE, sort2);
List<Map<String, Objects>> msgMapList = msgDao.getList(request, msgGroupResp, pageable2);
List<Map<String, Objects>> msgMapList = msgDao.getList(request,
msgGroupResp,
PageRequest.of(0, Integer.MAX_VALUE, sort));
List<MsgResp> msgList = msgMapList.stream().map(msgMap -> {
MsgResp msgResp = JSONObject.parseObject(JSONObject.toJSONString(msgMap), MsgResp.class);
msgResp.setTypeName(MsgTypeEnum.getNameByValue(msgResp.getType()));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!