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