Commit 028654f7 authored by jiaorz's avatar jiaorz

Merge branch 'master-im-list' into dev

parents 8f5148bc 432c9e4a
......@@ -3,6 +3,7 @@ package com.xxfc.platform.im.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
......@@ -13,6 +14,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.RandomUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Lists;
import com.mongodb.client.result.DeleteResult;
import com.mongodb.client.result.UpdateResult;
import com.xxfc.platform.im.dto.CommentVo;
......@@ -88,9 +90,7 @@ public class MsgBiz {
goodPageInfo.setPageSize(totalSize % limit == 0 ? totalSize / limit : totalSize / limit + 1);
return ObjectRestResponse.succ(goodPageInfo);
} else {
List<Integer> ids = new ArrayList<>();
ids.add(2);
ids.add(4);
List<Integer> ids = getType();
query = new Query(Criteria.where("body.type").in(ids).and("visible").is(1));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
......@@ -113,9 +113,7 @@ public class MsgBiz {
page = page == null ? 1 : page;
limit = limit == null ? 10 : limit;
Pageable pageable = PageRequest.of(--page, limit);
List<Integer> ids = new ArrayList<>();
ids.add(2);
ids.add(4);
List<Integer> ids = getType();
Query query = new Query(Criteria.where("body.type").in(ids).and("count.praise").gt(getNumber()).and("visible").is(1));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
......@@ -370,6 +368,17 @@ public class MsgBiz {
}
public List<Integer> getType() {
List<Integer> list = Lists.newArrayList();
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(IM_TYPE, DictionaryKey.IM_MSG_TYPE_LIST);
if (dictionary != null && StringUtils.isNotBlank(dictionary.getDetail())) {
log.info("查询IM限制数为字典表的结果为: dictionary = {}", dictionary.toString());
list = JSONArray.parseArray( dictionary.getDetail(), Integer.class);
}
return list;
}
/**
* 后台管理接口
*/
......@@ -427,9 +436,7 @@ public class MsgBiz {
goodPageInfo.setTotal(totalSize);
return ObjectRestResponse.succ(goodPageInfo);
} else {
List<Integer> ids = new ArrayList<>();
ids.add(2);
ids.add(4);
List<Integer> ids = getType();
query = new Query(Criteria.where("body.type").in(ids));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
......
......@@ -37,6 +37,12 @@ public class DictionaryKey {
* IM限制条数
*/
public static final String MSG_LIMIT_NUMBER = "MSG_LIMIT_NUMBER";
/**
*
*/
public static final String IM_MSG_TYPE_LIST = "IM_MSG_TYPE_LIST";
/**
* 支付
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment