Commit 8cd9a3be authored by limei's avatar limei

消息列表全部已读

parent 4d80683a
......@@ -31,6 +31,10 @@ public class MsgNoticeDto {
*/
private Long sequenceNbr;
/**
* 消息状态
*/
private String status;
}
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.List;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.RectifyMsgServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -128,6 +129,35 @@ public class RectifyMsgController extends BaseController {
Page page = new Page(current,size);
List<MsgNoticeDto> msgNoticeDtoList = new ArrayList<>();
msgNoticeDtoList.addAll(rectifyMsgServiceImpl.msgNotice(isRead));
if(isRead){
for(MsgNoticeDto msgNoticeDto:msgNoticeDtoList){
msgNoticeDto.setStatus("已读");
}
}else{
for(MsgNoticeDto msgNoticeDto:msgNoticeDtoList){
msgNoticeDto.setStatus("未读");
}
}
page.setRecords(msgNoticeDtoList);
page.setTotal(msgNoticeDtoList.size());
return ResponseHelper.buildResponse(page);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "消息已读", notes = "消息已读")
@GetMapping(value = "/allRead")
public ResponseModel<Page<MsgNoticeDto>> allRead(@RequestParam(value = "isRead",required = false) Boolean isRead,Long current,Long size){
Page page = new Page(current,size);
List<MsgNoticeDto> msgNoticeDtoList = new ArrayList<>();
msgNoticeDtoList.addAll(rectifyMsgServiceImpl.msgNotice(isRead));
if(!ValidationUtil.isEmpty(msgNoticeDtoList)) {
for(MsgNoticeDto msgNoticeDto:msgNoticeDtoList){
msgNoticeDto.setStatus("已读");
}
if (!isRead) {
isRead = true;
}
}
page.setRecords(msgNoticeDtoList);
page.setTotal(msgNoticeDtoList.size());
return ResponseHelper.buildResponse(page);
......
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