|
@@ -2,8 +2,6 @@ package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
-import org.slf4j.Logger;
|
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -14,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.common.support.tree.TreeNode;
|
|
import cn.com.qmth.examcloud.common.support.tree.TreeNode;
|
|
import cn.com.qmth.examcloud.common.support.tree.TreeUtil;
|
|
import cn.com.qmth.examcloud.common.support.tree.TreeUtil;
|
|
import cn.com.qmth.examcloud.common.support.tree.ZtreeNode;
|
|
import cn.com.qmth.examcloud.common.support.tree.ZtreeNode;
|
|
@@ -29,9 +28,7 @@ import io.swagger.annotations.ApiOperation;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("${app.api.root}/orgFunction")
|
|
@RequestMapping("${app.api.root}/orgFunction")
|
|
-public class OrgFunctionApi {
|
|
|
|
-
|
|
|
|
- private final Logger LOG = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
+public class OrgFunctionApi extends ControllerSupport {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
OrgFunctionRepo orgFunctionRepo;
|
|
OrgFunctionRepo orgFunctionRepo;
|
|
@@ -48,7 +45,7 @@ public class OrgFunctionApi {
|
|
@ApiOperation(value = "查询机构功能", notes = "查询")
|
|
@ApiOperation(value = "查询机构功能", notes = "查询")
|
|
@GetMapping("/{id}")
|
|
@GetMapping("/{id}")
|
|
public ResponseEntity<?> getOrgFunctions(@PathVariable Long id) {
|
|
public ResponseEntity<?> getOrgFunctions(@PathVariable Long id) {
|
|
- LOG.debug("getOrgFunctions(). id=" + id);
|
|
|
|
|
|
+ log.debug("getOrgFunctions(). id=" + id);
|
|
List<OrgFunction> orgFunctions = orgFunctionRepo.getOrgFunctions(id);
|
|
List<OrgFunction> orgFunctions = orgFunctionRepo.getOrgFunctions(id);
|
|
return new ResponseEntity<>(orgFunctions, HttpStatus.OK);
|
|
return new ResponseEntity<>(orgFunctions, HttpStatus.OK);
|
|
}
|
|
}
|
|
@@ -56,7 +53,7 @@ public class OrgFunctionApi {
|
|
@ApiOperation(value = "修改机构功能", notes = "修改")
|
|
@ApiOperation(value = "修改机构功能", notes = "修改")
|
|
@PutMapping("/{id}")
|
|
@PutMapping("/{id}")
|
|
public ResponseEntity<?> setOrgFunctions(@PathVariable Long id, @RequestBody String[] funcIds) {
|
|
public ResponseEntity<?> setOrgFunctions(@PathVariable Long id, @RequestBody String[] funcIds) {
|
|
- LOG.debug("setOrgFunctions(). id=" + id);
|
|
|
|
|
|
+ log.debug("setOrgFunctions(). id=" + id);
|
|
try {
|
|
try {
|
|
orgFunctionRepo.deleteAllOrgFunctions(id);
|
|
orgFunctionRepo.deleteAllOrgFunctions(id);
|
|
for (String funcId : funcIds) {
|
|
for (String funcId : funcIds) {
|