add 动态消息-权限

This commit is contained in:
liao
2023-11-09 10:16:14 +08:00
parent 3abdc4ca79
commit 7300adf1da
@@ -12,6 +12,7 @@ import com.jero.modules.laws.standard.service.ILawsNewsFeedService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -47,6 +48,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@AutoLog(value = "动态消息-分页列表查询")
@ApiOperation(value = "动态消息-分页列表查询", notes = "动态消息-分页列表查询")
@GetMapping(value = "/page")
@RequiresPermissions("dynamicMessage:search")
public Result<IPage<LawsNewsFeed>> queryPageList(LawsNewsFeed lawsNewsFeed,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
@@ -63,6 +65,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@AutoLog(value = "动态消息-列表查询")
@ApiOperation(value = "动态消息-列表查询", notes = "动态消息-列表查询")
@GetMapping(value = "/list")
@RequiresPermissions("dynamicMessage:search")
public Result<List<LawsNewsFeed>> queryList(LawsNewsFeed lawsNewsFeed) {
List<LawsNewsFeed> list = lawsNewsFeedService.queryList(lawsNewsFeed);
return Result.OK(list);
@@ -71,6 +74,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@AutoLog(value = "动态消息-保存")
@ApiOperation(value = "动态消息-保存", notes = "动态消息-保存")
@PostMapping(value = "/save")
@RequiresPermissions("dynamicMessage:save")
public Result<String> save(@Validated @RequestBody LawsNewsFeed lawsNewsFeed) {
// 第一次保存,附上初值
if (Objects.isNull(lawsNewsFeed.getReleaseStatus())) {
@@ -89,6 +93,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@AutoLog(value = "动态消息-发布")
@ApiOperation(value = "动态消息-发布", notes = "动态消息-发布")
@PostMapping(value = "/release")
@RequiresPermissions("dynamicMessage:release")
public Result<String> release(@Validated @RequestBody LawsNewsFeed lawsNewsFeed) {
// 第一次发布,赋初值
if (Objects.isNull(lawsNewsFeed.getReleaseStatus())) {
@@ -110,6 +115,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@AutoLog(value = "动态消息-通过id删除")
@ApiOperation(value = "动态消息-通过id删除", notes = "动态消息-通过id删除")
@PostMapping(value = "/delete")
@RequiresPermissions("dynamicMessage:delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
throw new JeroBootException(ResultCommon.SELECT_DATA);
@@ -127,6 +133,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@AutoLog(value = "动态消息-批量删除")
@ApiOperation(value = "动态消息-批量删除", notes = "动态消息-批量删除")
@PostMapping(value = "/deleteBatch")
@RequiresPermissions("dynamicMessage:deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
throw new JeroBootException(ResultCommon.SELECT_DATA);
@@ -145,6 +152,7 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
@ApiOperation(value = "动态消息-通过id查询", notes = "动态消息-通过id查询")
@GetMapping(value = "/queryById")
@Translation
@RequiresPermissions("dynamicMessage:search")
public Result<LawsNewsFeed> queryById(@RequestParam(name = "id") String id,
@RequestParam(name = "type") String type) {
LawsNewsFeed lawsNewsFeed = lawsNewsFeedService.queryById(id, type);