|
@@ -1,6 +1,8 @@
|
1
|
1
|
package com.ruoyi.web.controller.system;
|
2
|
2
|
|
3
|
3
|
import java.util.List;
|
|
4
|
+
|
|
5
|
+import com.ruoyi.system.service.ISysUserService;
|
4
|
6
|
import org.springframework.beans.factory.annotation.Autowired;
|
5
|
7
|
//import org.springframework.security.access.prepost.PreAuthorize;
|
6
|
8
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -32,6 +34,9 @@ public class SysNoticeController extends BaseController
|
32
|
34
|
@Autowired
|
33
|
35
|
private ISysNoticeService noticeService;
|
34
|
36
|
|
|
37
|
+ @Autowired
|
|
38
|
+ private ISysUserService userService;
|
|
39
|
+
|
35
|
40
|
/**
|
36
|
41
|
* 获取通知公告列表
|
37
|
42
|
*/
|
|
@@ -62,7 +67,7 @@ public class SysNoticeController extends BaseController
|
62
|
67
|
@PostMapping
|
63
|
68
|
public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
64
|
69
|
{
|
65
|
|
- notice.setCreateBy(getUsername());
|
|
70
|
+ notice.setCreateBy(userService.selectUserById(getLoginUser().getUserId()).getNickName());
|
66
|
71
|
return toAjax(noticeService.insertNotice(notice));
|
67
|
72
|
}
|
68
|
73
|
|
|
@@ -74,7 +79,7 @@ public class SysNoticeController extends BaseController
|
74
|
79
|
@PutMapping
|
75
|
80
|
public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
76
|
81
|
{
|
77
|
|
- notice.setUpdateBy(getUsername());
|
|
82
|
+ notice.setUpdateBy(userService.selectUserById(getLoginUser().getUserId()).getNickName());
|
78
|
83
|
return toAjax(noticeService.updateNotice(notice));
|
79
|
84
|
}
|
80
|
85
|
|