|
|
@@ -1,7 +1,10 @@
|
|
|
package com.kede.wechat.controller;
|
|
|
|
|
|
|
|
|
+import com.kede.common.bo.Result;
|
|
|
+import com.kede.common.constant.ErrorConstants;
|
|
|
import com.kede.common.controller.BaseController;
|
|
|
+import com.kede.common.utils.StringUtils;
|
|
|
import com.kede.wechat.bo.InputGetChatName;
|
|
|
import com.kede.wechat.bo.InputgetUserMsg;
|
|
|
import com.kede.wechat.service.ConversationContentService;
|
|
|
@@ -59,28 +62,50 @@ public class ConversationContentController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 数据解析
|
|
|
+ * 查看企业存储名单
|
|
|
*/
|
|
|
@RequestMapping(value = "/getUserMsg", method = RequestMethod.GET)
|
|
|
- public Object getUserMsg(InputgetUserMsg in)
|
|
|
+ public Result getUserMsg(InputgetUserMsg in)
|
|
|
{
|
|
|
- return conversationContentService.getUserMsg(in);
|
|
|
+ Result res = new Result();
|
|
|
+ return res.data(conversationContentService.getUserMsg(in));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查看单聊列表
|
|
|
*/
|
|
|
@RequestMapping(value = "/getMyIdByUser", method = RequestMethod.GET)
|
|
|
- public Object getMyIdByUser(InputgetUserMsg in)
|
|
|
+ public Result getMyIdByUser(InputgetUserMsg in)
|
|
|
{
|
|
|
- return conversationContentService.getMyIdByUser(in);
|
|
|
+ Result res = new Result();
|
|
|
+
|
|
|
+ return res.data(conversationContentService.getMyIdByUser(in));
|
|
|
}
|
|
|
/**
|
|
|
* 查看群聊列表
|
|
|
*/
|
|
|
@RequestMapping(value = "/getMyIdByRoom", method = RequestMethod.GET)
|
|
|
- public Object getMyIdByRoom(InputgetUserMsg in)
|
|
|
+ public Result getMyIdByRoom(InputgetUserMsg in)
|
|
|
+ {
|
|
|
+ Result res = new Result();
|
|
|
+ return res.data(conversationContentService.getMyIdByRoom(in));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查看聊天信息
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getMsgList", method = RequestMethod.GET)
|
|
|
+ public Result getMsgList(InputgetUserMsg in)
|
|
|
{
|
|
|
- return conversationContentService.getMyIdByRoom(in);
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isEmpty(in.getUserId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"用户ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(in.getUserId())&&StringUtils.isNotEmpty(in.getRoomId())){
|
|
|
+ res.getError().add(buildError("用户ID和群ID不能同时为空"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ return res.data(conversationContentService.getMsgList(in));
|
|
|
}
|
|
|
}
|