|
@@ -1,5 +1,6 @@
|
|
|
package com.fjhx.socket.controller.push;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fjhx.socket.entity.push.dto.PushInfoSelectDto;
|
|
@@ -7,12 +8,15 @@ import com.fjhx.socket.entity.push.vo.PushInfoVo;
|
|
|
import com.fjhx.socket.service.push.PushInfoService;
|
|
|
import com.ruoyi.common.constant.BaseSourceConstant;
|
|
|
import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
+import com.ruoyi.common.exception.ServiceException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -48,7 +52,15 @@ public class PushInfoController {
|
|
|
|
|
|
@PostMapping("/read")
|
|
|
public void read(@RequestBody PushInfoSelectDto dto) {
|
|
|
- pushInfoService.read(dto.getIdList());
|
|
|
+ List<Long> idList = dto.getIdList();
|
|
|
+ if(ObjectUtil.isEmpty(idList)){
|
|
|
+ throw new ServiceException("消息id列表不能为空");
|
|
|
+ }
|
|
|
+ pushInfoService.read(idList);
|
|
|
+ }
|
|
|
+ @PostMapping("/readAll")
|
|
|
+ public void readAll() {
|
|
|
+ pushInfoService.readAll();
|
|
|
}
|
|
|
|
|
|
}
|