|
|
|
@ -25,6 +25,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.springblade.desk.common.controller; |
|
|
|
package org.springblade.desk.common.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
@ -33,7 +34,6 @@ import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
import org.springblade.core.log.annotation.ApiLog; |
|
|
|
import org.springblade.core.log.annotation.ApiLog; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
@ -74,10 +74,13 @@ public class MesNotifyMessageController extends BladeController { |
|
|
|
@GetMapping("/count") |
|
|
|
@GetMapping("/count") |
|
|
|
@Operation(summary = "获取未读数量", description = "传入mesNotifyMessage") |
|
|
|
@Operation(summary = "获取未读数量", description = "传入mesNotifyMessage") |
|
|
|
public R<Long> count() { |
|
|
|
public R<Long> count() { |
|
|
|
MesNotifyMessageVO mesNotifyMessage = new MesNotifyMessageVO(); |
|
|
|
long count = mesNotifyMessageService.count(new LambdaQueryWrapper<MesNotifyMessageEntity>() |
|
|
|
mesNotifyMessage.setReceiveUserId(AuthUtil.getUserId()); |
|
|
|
.eq(MesNotifyMessageEntity::getStatus, 0) |
|
|
|
mesNotifyMessage.setStatus(0); |
|
|
|
.and(wrapper -> wrapper |
|
|
|
long count = mesNotifyMessageService.count(Condition.getQueryWrapper(mesNotifyMessage)); |
|
|
|
.eq(MesNotifyMessageEntity::getReceiveUserId, AuthUtil.getUserId()) |
|
|
|
|
|
|
|
.or() |
|
|
|
|
|
|
|
.eq(MesNotifyMessageEntity::getReceiveRoleName, AuthUtil.getUserRole()) |
|
|
|
|
|
|
|
)); |
|
|
|
return R.data(count); |
|
|
|
return R.data(count); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -87,14 +90,14 @@ public class MesNotifyMessageController extends BladeController { |
|
|
|
@PostMapping("/remove") |
|
|
|
@PostMapping("/remove") |
|
|
|
@ApiLog("删除通知消息") |
|
|
|
@ApiLog("删除通知消息") |
|
|
|
@Operation(summary = "逻辑删除", description = "传入ids") |
|
|
|
@Operation(summary = "逻辑删除", description = "传入ids") |
|
|
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
public R<Boolean> remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
return R.status(mesNotifyMessageService.deleteLogic(Func.toLongList(ids))); |
|
|
|
return R.status(mesNotifyMessageService.deleteLogic(Func.toLongList(ids))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/read") |
|
|
|
@PostMapping("/read") |
|
|
|
@ApiLog("标记已读") |
|
|
|
@ApiLog("标记已读") |
|
|
|
@Operation(summary = "标记已读", description = "传入ids") |
|
|
|
@Operation(summary = "标记已读", description = "传入ids") |
|
|
|
public R read(@Parameter(description = "主键集合", required = true) String ids) { |
|
|
|
public R<Boolean> read(@Parameter(description = "主键集合", required = true) String ids) { |
|
|
|
List<Long> idList = Func.toLongList(ids); |
|
|
|
List<Long> idList = Func.toLongList(ids); |
|
|
|
return R.status(mesNotifyMessageService.updateReadStatus(idList)); |
|
|
|
return R.status(mesNotifyMessageService.updateReadStatus(idList)); |
|
|
|
} |
|
|
|
} |
|
|
|
|