|
@@ -0,0 +1,68 @@
|
|
|
+package com.koobietech.eas.controller;
|
|
|
+
|
|
|
+import com.koobietech.eas.common.result.JsonResult;
|
|
|
+import com.koobietech.eas.common.result.PageData;
|
|
|
+import com.koobietech.eas.mbg.model.EasSysPermission;
|
|
|
+import com.koobietech.eas.service.EasPermissionService;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/permission")
|
|
|
+public class EasPermissionController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ EasPermissionService easPermissionService;
|
|
|
+
|
|
|
+ @GetMapping("/home")
|
|
|
+ public String home(){
|
|
|
+ return "home";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/lesson")
|
|
|
+ public String lesson(){
|
|
|
+ return "lesson";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/lesson-download")
|
|
|
+ public String download(){
|
|
|
+ return "lesson-download";
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/query")
|
|
|
+ public PageData query(@RequestParam Integer id){
|
|
|
+ PageData ret = easPermissionService.query(id);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/add")
|
|
|
+ public JsonResult add(@RequestBody EasSysPermission permission){
|
|
|
+ Boolean ret = easPermissionService.add(permission);
|
|
|
+ if(ret){
|
|
|
+ return JsonResult.ok();
|
|
|
+ }
|
|
|
+ return JsonResult.fail();
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete")
|
|
|
+ public JsonResult delete(@RequestParam Integer id){
|
|
|
+ Boolean ret = easPermissionService.delete(id);
|
|
|
+ if(ret){
|
|
|
+ return JsonResult.ok();
|
|
|
+ }
|
|
|
+ return JsonResult.fail();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/update")
|
|
|
+ public JsonResult update(@RequestBody EasSysPermission permission){
|
|
|
+ Boolean ret = easPermissionService.update(permission);
|
|
|
+ if(ret){
|
|
|
+ return JsonResult.ok();
|
|
|
+ }
|
|
|
+ return JsonResult.fail();
|
|
|
+ }
|
|
|
+}
|