Merge branch 'feature/REQ-2010' into test
This commit is contained in:
commit
54b3ec3fc6
@ -61,10 +61,6 @@ public class MessageRecordDao extends
|
|||||||
public void readMsg(InsideCmsReadMsgReq req,
|
public void readMsg(InsideCmsReadMsgReq req,
|
||||||
Long personId, Long identityId) {
|
Long personId, Long identityId) {
|
||||||
lambdaUpdate().set(MessageRecord::getState, MsgStateEnum.HAVE_READ)
|
lambdaUpdate().set(MessageRecord::getState, MsgStateEnum.HAVE_READ)
|
||||||
.and(i -> i.and(
|
|
||||||
a -> a.eq(MessageRecord::getPersonId, personId).eq(MessageRecord::getReceiveType,
|
|
||||||
ReceiveTypeEnum.NOT_IDENTITY)).or()
|
|
||||||
.eq(MessageRecord::getToId, identityId))
|
|
||||||
.eq(MessageRecord::getIsDelete, 0L)
|
.eq(MessageRecord::getIsDelete, 0L)
|
||||||
.eq(req.getMsgId() != -1L, MessageRecord::getId, req.getMsgId())
|
.eq(req.getMsgId() != -1L, MessageRecord::getId, req.getMsgId())
|
||||||
.eq(MessageRecord::getType, MsgTypeEnum.GENERAL_MESSAGE)
|
.eq(MessageRecord::getType, MsgTypeEnum.GENERAL_MESSAGE)
|
||||||
@ -72,9 +68,9 @@ public class MessageRecordDao extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void readAllMsg(InsideCmsReadMsgReq req, Long personId, Long identityId) {
|
public void readAllMsg(InsideCmsReadMsgReq req, Long personId, Long identityId) {
|
||||||
List<MessageRecord> list = this.lambdaQuery().and(i -> i.and(
|
List<MessageRecord> list = this.lambdaQuery()
|
||||||
a -> a.eq(MessageRecord::getPersonId, personId).eq(MessageRecord::getReceiveType,
|
.and(nested -> nested.eq(MessageRecord::getPersonId, personId)
|
||||||
ReceiveTypeEnum.NOT_IDENTITY)).or()
|
.or()
|
||||||
.eq(MessageRecord::getToId, identityId))
|
.eq(MessageRecord::getToId, identityId))
|
||||||
.eq(MessageRecord::getIsDelete, 0L)
|
.eq(MessageRecord::getIsDelete, 0L)
|
||||||
.eq(MessageRecord::getType, MsgTypeEnum.GENERAL_MESSAGE)
|
.eq(MessageRecord::getType, MsgTypeEnum.GENERAL_MESSAGE)
|
||||||
|
|||||||
@ -0,0 +1,35 @@
|
|||||||
|
package cn.axzo.msg.center.inside.notices.service;
|
||||||
|
|
||||||
|
import cn.axzo.msg.center.MsgCenterApplication;
|
||||||
|
import cn.axzo.msg.center.api.enums.BizTypeEnum;
|
||||||
|
import cn.axzo.msg.center.api.request.CmsReadMsgReq;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.annotation.Commit;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author yanglin
|
||||||
|
*/
|
||||||
|
@SpringBootTest(classes = MsgCenterApplication.class)
|
||||||
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
|
class MessageRecordServiceTest {
|
||||||
|
|
||||||
|
private final MessageRecordService messageRecordService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Commit
|
||||||
|
void foo() {
|
||||||
|
// CmsReadMsgReq(msgId=1790536, personId=9000399060, identityId=2004201, bizTypeEnum=CONSTRUCTION)
|
||||||
|
CmsReadMsgReq req = new CmsReadMsgReq();
|
||||||
|
req.setMsgId(1790536L);
|
||||||
|
req.setPersonId(9000399060L);
|
||||||
|
req.setPersonId(2004201L);
|
||||||
|
req.setBizTypeEnum(BizTypeEnum.CONSTRUCTION);
|
||||||
|
messageRecordService.updateReadMsgStatus(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user