Compare commits

...

2 Commits

  1. 25
      ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java

@ -1,9 +1,12 @@
package com.alops.web.controller.message; package com.alops.web.controller.message;
import com.alops.common.annotation.Log; import com.alops.common.annotation.Log;
import com.alops.common.core.controller.BaseController;
import com.alops.common.core.domain.AjaxResult; import com.alops.common.core.domain.AjaxResult;
import com.alops.common.core.page.TableDataInfo;
import com.alops.common.enums.BusinessType; import com.alops.common.enums.BusinessType;
import com.alops.common.utils.SecurityUtils; import com.alops.common.utils.SecurityUtils;
import com.alops.system.domain.EquType;
import com.alops.system.domain.InternalMessage; import com.alops.system.domain.InternalMessage;
import com.alops.system.domain.dto.AlertRuleAddDto; import com.alops.system.domain.dto.AlertRuleAddDto;
import com.alops.system.domain.vo.AlertRuleVo; import com.alops.system.domain.vo.AlertRuleVo;
@ -11,13 +14,25 @@ import com.alops.system.service.IInternalMessageService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import static com.alops.common.utils.PageUtils.startPage;
@RestController @RestController
@RequestMapping("/message") @RequestMapping("/message")
public class messageController { public class messageController extends BaseController {
@Autowired @Autowired
public IInternalMessageService iInternalMessageService; public IInternalMessageService iInternalMessageService;
@ -51,14 +66,14 @@ public class messageController {
@ApiOperation("获取用户消息列表") @ApiOperation("获取用户消息列表")
@Log(title = "【消息列表】") @Log(title = "【消息列表】")
@GetMapping("/list") @GetMapping("/list")
public AjaxResult getMessageList() { public TableDataInfo getMessageList() {
startPage();
// 获取当前登录用户ID // 获取当前登录用户ID
Long userId = SecurityUtils.getLoginUser().getUserId(); Long userId = SecurityUtils.getLoginUser().getUserId();
// 调用Service获取消息列表 // 调用Service获取消息列表
List<InternalMessage> messages = iInternalMessageService.getMessagesByUserId(userId); List<InternalMessage> messages = iInternalMessageService.getMessagesByUserId(userId);
return getDataTable(messages);
return AjaxResult.success(messages);
} }

Loading…
Cancel
Save