add 问答库权限
This commit is contained in:
+8
@@ -15,6 +15,7 @@ import com.jero.modules.laws.library.service.ILawsProblemLibraryService;
|
||||
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.*;
|
||||
@@ -43,6 +44,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@AutoLog(value = "问答库-分页列表查询")
|
||||
@ApiOperation(value="问答库-分页列表查询", notes="问答库-问题-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@RequiresPermissions("businessSupport:questionAnswer:search")
|
||||
public Result<IPage<LawsProblemLibrary>> queryPageList(LawsProblemLibrary lawsProblemLibrary,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@@ -54,6 +56,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@AutoLog(value = "问答库-提出问题")
|
||||
@ApiOperation(value="问答库-提出问题", notes="问答库-提出问题")
|
||||
@PostMapping(value = "/addProblem")
|
||||
@RequiresPermissions("businessSupport:questionAnswer:quiz")
|
||||
public Result<T> addProblem(@Validated @RequestBody LawsProblemLibrary lawsProblemLibrary) {
|
||||
lawsProblemLibraryService.addProblem(lawsProblemLibrary);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
@@ -89,6 +92,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@AutoLog(value = "问答库-回答问题")
|
||||
@ApiOperation(value="问答库-回答问题", notes="问答库-回答问题")
|
||||
@PostMapping(value = "/addAnswer")
|
||||
@RequiresPermissions("quiz:detail:answerSubmit")
|
||||
public Result<T> addAnswer(@Validated @RequestBody LawsAnswerLibrary lawsAnswerLibrary) {
|
||||
lawsProblemLibraryService.addAnswer(lawsAnswerLibrary);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
@@ -98,6 +102,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@ApiOperation(value="问答库-通过id查询", notes="问答库-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
@Translation
|
||||
@RequiresPermissions("businessSupport:questionAnswer:detail")
|
||||
public Result<LawsProblemLibrary> queryById(@RequestParam(name="id") String id) {
|
||||
LawsProblemLibrary lawsProblemLibrary = lawsProblemLibraryService.queryById(id);
|
||||
return Result.OK(lawsProblemLibrary);
|
||||
@@ -106,6 +111,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@AutoLog(value = "问答库-通过id删除问题")
|
||||
@ApiOperation(value="问答库-通过id删除问题", notes="问答库-通过id删除问题")
|
||||
@PostMapping(value = "/deleteProblem")
|
||||
@RequiresPermissions("businessSupport:questionAnswer:delete")
|
||||
public Result<T> deleteProblem(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
||||
@@ -117,6 +123,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@AutoLog(value = "问答库-通过id删除回答")
|
||||
@ApiOperation(value="问答库-通过id删除回答", notes="问答库-通过id删除回答")
|
||||
@PostMapping(value = "/deleteAnswer")
|
||||
@RequiresPermissions("quiz:detail:deleteAnswer")
|
||||
public Result<T> deleteAnswer(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error(MessageUtils.getMessage(ResultCommon.SELECT_DATA));
|
||||
@@ -128,6 +135,7 @@ public class LawsProblemLibraryController extends JeroController<LawsProblemLibr
|
||||
@AutoLog(value = "问答库-是否置顶")
|
||||
@ApiOperation(value="问答库-是否置顶", notes="问答库-是否置顶")
|
||||
@GetMapping(value = "/isTop")
|
||||
@RequiresPermissions("quiz:detail:topOrCancel")
|
||||
public Result<T> isTop(@RequestParam(name="id") String id) {
|
||||
lawsProblemLibraryService.isTop(id);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
|
||||
Reference in New Issue
Block a user