refacotr(linkzo): 扩展标记已读接口

This commit is contained in:
zhansihu 2023-08-23 11:17:45 +08:00
parent 27432804b5
commit 49ccf58dcc
4 changed files with 25 additions and 4 deletions

View File

@ -16,6 +16,7 @@ import cn.axzo.msg.center.dal.MessageRecordDao;
import cn.axzo.msg.center.domain.dto.UpdateReadDTO;
import cn.axzo.msg.center.inside.notices.service.MessageRecordService;
import cn.azxo.framework.common.model.CommonResponse;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;

View File

@ -2,20 +2,22 @@ package cn.axzo.msg.center.api.request;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class UpdateReadReq {
/** 消息ID **/
private List<Long> msgIdList;
/**
* 消息类型 1:普通消息 2:待办
*/
@NotNull(message = "消息类型不能为空")
private Integer msgType;
/**
* 待办消息模块类型Id - 针对待办使用
*/
@NotNull(message = "moduleId不能为空")
private Long moduleId;
/**
* 发送人id

View File

@ -173,7 +173,20 @@
<!---->
<update id="updateHasRead" parameterType="cn.axzo.msg.center.domain.dto.UpdateReadDTO">
update message_record set state=4 where is_delete=0 AND module_id=#{req.moduleId} AND type=#{req.msgType}
update message_record set state=4
where is_delete=0
<if test="req.msgIdList != null">
AND id IN
<foreach close=")" collection="msgIdList" item="msgId" open="(" separator=",">
#{msgId}
</foreach>
</if>
<if test="req.moduleId != null">
AND module_id = #{req.moduleId}
</if>
<if test="req.msgType != null">
AND type = #{req.msgType}
</if>
<if test="req.tenantId != null">
AND tenant_id = #{req.tenantId}
</if>

View File

@ -2,8 +2,13 @@ package cn.axzo.msg.center.domain.dto;
import lombok.Data;
import java.util.List;
@Data
public class UpdateReadDTO {
/** 消息ID **/
private List<Long> msgIdList;
/**
* 消息类型 1:普通消息 2:待办
*/