Commit bce7f015 by Future

集成saas

parent dfe10aa3
......@@ -152,7 +152,7 @@ public class NormalChatAction {
// 异步推送系统通知消息
PushDTO pushDTO = mqSender.buildPushDto(data.getPush(), imClientReceiver, imApplication);
mqSender.orderSend(MqConstant.Topic.IM_MSG_TOPIC, MqConstant.Tag.IM_MSG_TAG, pushDTO, conversation.getId());
mqSender.orderSend(MqConstant.Topic.IM_MSG_TOPIC, MqConstant.Tag.IM_MSG_TAG, pushDTO);
}
// 响应发送方消息id等信息
......@@ -364,7 +364,7 @@ public class NormalChatAction {
log.info("发送方: {}, 已被禁言", senderId);
// 响应发送方
WsResponse<HashMap<String, Long>> responseModel = new WsResponse<>();
ApiResult<Boolean> apiResult = ApiResult.result(ApiCode.IS_BE_KICK_OUT);
ApiResult<Boolean> apiResult = ApiResult.result(ApiCode.IS_BE_MUTED);
responseModel.setCmd(WsResponseCmdEnum.RES.getCmdCode());
responseModel.setCode(apiResult.getCode());
responseModel.setMsg(apiResult.getMessage());
......
......@@ -164,7 +164,7 @@ public class ImConversationController extends BaseController {
*/
@PostMapping("/info")
@ApiOperation(value = "根据会话id查询指定会话信息", notes = "根据会话id查询指定会话信息 与每个会话的未读条数")
public ApiResult<ConversationVo> info(ImConversationQueryParam param) throws Exception {
public ApiResult<ConversationVo> info(@RequestBody @Validated ImConversationQueryParam param) throws Exception {
ConversationVo conversationVo = imConversationService.infoImConversationAndMsgCount(param);
return ApiResult.ok(conversationVo);
}
......
......@@ -66,7 +66,7 @@ public class FriendEventSender {
pushVO.setTitle(FRIEND_APPLY_TITLE);
pushVO.setSubTitle(FRIEND_APPLY_TITLE_SUB);
PushDTO pushDTO = mqSender.buildPushDto(pushVO, receiveClient, app);
mqSender.orderSend(MqConstant.Topic.IM_MSG_TOPIC, MqConstant.Tag.IM_MSG_TAG, pushDTO, 1L);
mqSender.orderSend(MqConstant.Topic.IM_MSG_TOPIC, MqConstant.Tag.IM_MSG_TAG, pushDTO);
}
public void sendFriendApproveEventMsg(ImClient claimerClient, ImClient receiveClient, boolean isAgree, String rejectRemark) {
......@@ -94,6 +94,6 @@ public class FriendEventSender {
pushVO.setTitle(FRIEND_APPROVE_TITLE);
pushVO.setSubTitle(isAgree ? FRIEND_APPROVE_TITLE_AGREE : FRIEND_APPROVE_TITLE_REJECT);
PushDTO pushDTO = mqSender.buildPushDto(pushVO, receiveClient, app);
mqSender.orderSend(MqConstant.Topic.IM_MSG_TOPIC, MqConstant.Tag.IM_MSG_TAG, pushDTO, 1L);
mqSender.orderSend(MqConstant.Topic.IM_MSG_TOPIC, MqConstant.Tag.IM_MSG_TAG, pushDTO);
}
}
......@@ -67,9 +67,9 @@ public class MqSender {
* @param pushDTO
* @return
*/
public SendResult orderSend(String topic, String tag, PushDTO pushDTO, Long conversationId) {
public SendResult orderSend(String topic, String tag, PushDTO pushDTO) {
log.info("mq按顺序发送topic: {} tag: {} 推送内容: {}", topic, tag, JSON.toJSONString(pushDTO));
SendResult sendResult = rocketMqProducerService.orderSend(topic, tag, JSON.toJSONString(pushDTO), conversationId);
SendResult sendResult = rocketMqProducerService.orderSend(topic, tag, JSON.toJSONString(pushDTO), 1);
log.info("mq按顺序发送topic: {} tag: {} 返回结果: {}", topic, tag, JSON.toJSONString(sendResult));
return sendResult;
}
......
......@@ -149,7 +149,7 @@ public class RocketMqProducerService implements SendCallback {
*
* @param orderId 相同的orderId 的消息会被有顺序的消费
*/
public SendResult orderSend(String topic, String tag, String content, long orderId) {
public SendResult orderSend(String topic, String tag, String content, int orderId) {
return this.orderSend(topic, tag, "", content, orderId);
}
......@@ -158,7 +158,7 @@ public class RocketMqProducerService implements SendCallback {
* 有顺序发送
*/
public SendResult orderSend(String topic, String tag, String keys, String content,
long orderId) {
int orderId) {
Message msg = getMessage(topic, tag, keys, content);
try {
......
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
......@@ -19,6 +20,7 @@ public class ImConversationQueryParam implements Serializable {
private static final long serialVersionUID = 302200332780152186L;
@NotNull(message = "会话id不能为空")
@ApiModelProperty("会话id")
private Long id;
......
......@@ -29,6 +29,13 @@ public class ListConversationMembersParam implements Serializable {
@ApiModelProperty(value = "角色列表 可多选,不传则查全部", required = true)
private List<Integer> roles;
/**
* 禁言开关
* @see com.wecloud.im.enums.MutedEnum
*/
@ApiModelProperty("禁言开关 1-未禁言 2-禁言")
private Integer muted;
@ApiModelProperty(value = "clientId列表,传了则只查询指定入参群成员", required = true)
private List<String> clientIds;
......
......@@ -29,7 +29,7 @@ public class MutedGroupParam extends BaseEntity {
private List<String> clientIds;
@NotNull
@ApiModelProperty("禁言类型 1-禁言 2-取消禁言")
@ApiModelProperty("禁言类型 1-取消禁言 2-禁言")
private Integer mutedType;
}
......@@ -14,6 +14,7 @@ import com.wecloud.im.entity.ImMessage;
import com.wecloud.im.entity.ImMessageOnlineSend;
import com.wecloud.im.enums.ChatTypeEnum;
import com.wecloud.im.enums.GroupRoleEnum;
import com.wecloud.im.enums.MutedEnum;
import com.wecloud.im.mapper.ImConversationMapper;
import com.wecloud.im.param.ImClientSimpleDto;
import com.wecloud.im.param.ListConversationMembersParam;
......@@ -685,6 +686,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
muteGroupParam.setUpdateTime(new Date());
muteGroupParam.setMuted(param.getMutedType());
imConversationMapper.updateById(muteGroupParam);
deleteCacheImConversationById(param.getConversationId());
return true;
}
......@@ -935,7 +937,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
}
@Override
@Cacheable(key = "#p0")
// @Cacheable(key = "#p0")
public ImConversationQueryVo getCacheImConversationById(Long id) {
return imConversationMapper.getImConversationById(id);
}
......
......@@ -55,6 +55,9 @@
#{clientId}
</foreach>
</if>
<if test="param.muted != null">
AND im_conversation_members.muted = #{param.muted}
</if>
</select>
......
......@@ -130,6 +130,12 @@ public enum ApiCode {
* 已被踢出会话
*/
IS_BE_KICK_OUT(6014, "api.response.code.IS_BE_KICK_OUT"),
/**
* 已被禁言
*/
IS_BE_MUTED(6015, "api.response.code.IS_BE_MUTED"),
;
private final int code;
......
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