refacotr(linkzo): 扩展标记已读接口
This commit is contained in:
parent
27432804b5
commit
49ccf58dcc
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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:待办
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user