Merge branch 'feature/REQ-1465' of axzsource.com:universal/infrastructure/backend/msg-center-plat into dev
This commit is contained in:
commit
3d42520dba
@ -196,7 +196,8 @@ public class MessageRelationServiceImpl implements MessageRelationService {
|
||||
}
|
||||
return messageRelationDao.lambdaQuery()
|
||||
.in(MessageRelation::getModuleId, moduleIds)
|
||||
.eq(MessageRelation::getIsDelete, 0)
|
||||
.eq(MessageRelation::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.select(MessageRelation::getId)
|
||||
.list().stream()
|
||||
.map(MessageRelation::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
package cn.axzo.msg.center.message.controller;
|
||||
|
||||
import cn.axzo.msg.center.api.request.CmsMsgQueryReq;
|
||||
import cn.axzo.msg.center.api.response.MessageNewRes;
|
||||
import cn.axzo.msg.center.message.service.GeneralMessageOldService;
|
||||
import cn.axzo.msg.center.message.service.GeneralMessageService;
|
||||
import cn.axzo.msg.center.service.dto.PersonDTO;
|
||||
import cn.axzo.msg.center.service.general.client.GeneralMessageClient;
|
||||
import cn.axzo.msg.center.service.general.request.GeneralMessageOldDataStatisticRequest;
|
||||
import cn.axzo.msg.center.service.general.request.GeneralMessageSendRequest;
|
||||
import cn.axzo.msg.center.service.general.response.GeneralMessageOldDataStatisticResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -21,15 +26,27 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
public class GeneralMessageController implements GeneralMessageClient {
|
||||
|
||||
private final GeneralMessageService generalMessageService;
|
||||
private final GeneralMessageOldService generalMessageOldService;
|
||||
|
||||
@Override
|
||||
public CommonResponse<String> statisticOldData(GeneralMessageSendRequest request) {
|
||||
public CommonResponse<String> pageQueryOldMessage(GeneralMessageSendRequest request) {
|
||||
return CommonResponse.success(generalMessageService.batchSendMessage(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<GeneralMessageOldDataStatisticResponse> statisticOldData(
|
||||
public CommonResponse<GeneralMessageOldDataStatisticResponse> pageQueryOldMessage(
|
||||
GeneralMessageOldDataStatisticRequest request) {
|
||||
return CommonResponse.success(generalMessageService.statisticOldData(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Integer> countUnreadFromOldMessage(GeneralMessageOldDataStatisticRequest request) {
|
||||
PersonDTO person = PersonDTO.from(request.getPersonId(), request.getIdentityId(), request.getIdentityType());
|
||||
return CommonResponse.success(generalMessageOldService.countUnread(person));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<MessageNewRes>> pageQueryOldMessage(CmsMsgQueryReq request) {
|
||||
return CommonResponse.success(generalMessageOldService.pageMsgInfo(request));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package cn.axzo.msg.center.service.general.client;
|
||||
|
||||
import cn.axzo.msg.center.api.request.CmsMsgQueryReq;
|
||||
import cn.axzo.msg.center.api.response.MessageNewRes;
|
||||
import cn.axzo.msg.center.service.general.request.GeneralMessageOldDataStatisticRequest;
|
||||
import cn.axzo.msg.center.service.general.request.GeneralMessageSendRequest;
|
||||
import cn.axzo.msg.center.service.general.response.GeneralMessageOldDataStatisticResponse;
|
||||
import cn.axzo.msg.center.service.pending.client.fallback.PendingMessageClientFallback;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -32,7 +35,7 @@ public interface GeneralMessageClient {
|
||||
* @return 消息的唯一标识
|
||||
*/
|
||||
@PostMapping(value = "/general-message/send", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<String> statisticOldData(@RequestBody @Valid GeneralMessageSendRequest request);
|
||||
CommonResponse<String> pageQueryOldMessage(@RequestBody @Valid GeneralMessageSendRequest request);
|
||||
|
||||
/**
|
||||
* 统计旧消息的未读数以及最新一条消息内容
|
||||
@ -41,6 +44,24 @@ public interface GeneralMessageClient {
|
||||
* @return 消息未读数&最新一条消息内容
|
||||
*/
|
||||
@PostMapping(value = "/general-message/old-data/statistic", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<GeneralMessageOldDataStatisticResponse> statisticOldData(
|
||||
CommonResponse<GeneralMessageOldDataStatisticResponse> pageQueryOldMessage(
|
||||
@RequestBody @Valid GeneralMessageOldDataStatisticRequest request);
|
||||
|
||||
/**
|
||||
* 统计旧消息的未读数
|
||||
*
|
||||
* @param request 消息所需参数
|
||||
* @return 消息未读数
|
||||
*/
|
||||
@PostMapping(value = "/general-message/old-data/count-unread", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Integer> countUnreadFromOldMessage(@RequestBody @Valid GeneralMessageOldDataStatisticRequest request);
|
||||
|
||||
/**
|
||||
* 旧消息的分页查询入口
|
||||
*
|
||||
* @param request 分页查询所需参数
|
||||
* @return 旧消息的分页列表
|
||||
*/
|
||||
@PostMapping(value = "/general-message/old-data/page", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||
CommonResponse<Page<MessageNewRes>> pageQueryOldMessage(@RequestBody @Valid CmsMsgQueryReq request);
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package cn.axzo.msg.center.service.general.client.fallback;
|
||||
|
||||
import cn.axzo.msg.center.api.request.CmsMsgQueryReq;
|
||||
import cn.axzo.msg.center.api.response.MessageNewRes;
|
||||
import cn.axzo.msg.center.service.general.client.GeneralMessageClient;
|
||||
import cn.axzo.msg.center.service.general.request.GeneralMessageOldDataStatisticRequest;
|
||||
import cn.axzo.msg.center.service.general.request.GeneralMessageSendRequest;
|
||||
import cn.axzo.msg.center.service.general.response.GeneralMessageOldDataStatisticResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.model.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -18,15 +21,27 @@ import org.springframework.stereotype.Component;
|
||||
public class GeneralMessageClientFallback implements GeneralMessageClient {
|
||||
|
||||
@Override
|
||||
public CommonResponse<String> statisticOldData(GeneralMessageSendRequest request) {
|
||||
public CommonResponse<String> pageQueryOldMessage(GeneralMessageSendRequest request) {
|
||||
log.error("fall back while sending message. req:{}", request);
|
||||
return CommonResponse.error("fall back while sending message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<GeneralMessageOldDataStatisticResponse> statisticOldData(
|
||||
public CommonResponse<GeneralMessageOldDataStatisticResponse> pageQueryOldMessage(
|
||||
GeneralMessageOldDataStatisticRequest request) {
|
||||
log.error("fall back while statistic old message. req:{}", request);
|
||||
return CommonResponse.error("fall back while statistic old message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Integer> countUnreadFromOldMessage(GeneralMessageOldDataStatisticRequest request) {
|
||||
log.error("fall back while counting unread old message. request:{}", request);
|
||||
return CommonResponse.error("fall back while counting unread old message");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResponse<Page<MessageNewRes>> pageQueryOldMessage(CmsMsgQueryReq request) {
|
||||
log.error("fall back while statistic old message. request:{}", request);
|
||||
return CommonResponse.error("fall back while statistic old message");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user