|
@@ -1,7 +1,9 @@
|
|
|
package com.pavis.app.saasbacken.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.pavis.app.saasbacken.aop.PreSaveLog;
|
|
|
import com.pavis.app.saasbacken.exception.GlobalExceptionHandler;
|
|
|
+import com.pavis.app.saasbacken.form.ModuleTree;
|
|
|
import com.pavis.app.saasbacken.http.ResultBody;
|
|
|
import com.pavis.app.saasbacken.service.*;
|
|
|
import com.pavis.app.saasbacken.utils.HttpContextUtils;
|
|
@@ -9,12 +11,10 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @program: push-saas
|
|
@@ -54,7 +54,7 @@ public class CommonController {
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
String uri = request.getRequestURI();
|
|
|
try {
|
|
|
- log.info("param:{}", test);
|
|
|
+ log.info("param dic:{}", test);
|
|
|
return ResultBody.ok().path(uri).data(dicService.createDic());
|
|
|
} catch (Exception e) {
|
|
|
return GlobalExceptionHandler.resolveException(e, uri);
|
|
@@ -72,7 +72,7 @@ public class CommonController {
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
String uri = request.getRequestURI();
|
|
|
try {
|
|
|
- log.info("init:{}", "init");
|
|
|
+ log.info("init initDataParent:{}", "init");
|
|
|
return ResultBody.ok().path(uri).data(initDataParentService.initDataParent());
|
|
|
} catch (Exception e) {
|
|
|
return GlobalExceptionHandler.resolveException(e, uri);
|
|
@@ -90,7 +90,7 @@ public class CommonController {
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
String uri = request.getRequestURI();
|
|
|
try {
|
|
|
- log.info("init:{}", "init");
|
|
|
+ log.info("init initDataChild:{}", "init");
|
|
|
return ResultBody.ok().path(uri).data(initDataChildService.initDataChild());
|
|
|
} catch (Exception e) {
|
|
|
return GlobalExceptionHandler.resolveException(e, uri);
|
|
@@ -109,7 +109,7 @@ public class CommonController {
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
String uri = request.getRequestURI();
|
|
|
try {
|
|
|
- log.info("init:{}", "init");
|
|
|
+ log.info("init initDataThird:{}", "init");
|
|
|
return ResultBody.ok().path(uri).data(initDataThirdService.initDataThird());
|
|
|
} catch (Exception e) {
|
|
|
return GlobalExceptionHandler.resolveException(e, uri);
|
|
@@ -120,18 +120,53 @@ public class CommonController {
|
|
|
* 通用配置:
|
|
|
* key-value。通用配置。
|
|
|
*/
|
|
|
- @PreSaveLog("获取基础功能数据")
|
|
|
- @ApiOperation(value = "获取基础功能数据信息接口", notes = "获取基础功能数据信息接口")
|
|
|
+ @PreSaveLog("获取所有基础功能数据")
|
|
|
+ @ApiOperation(value = "获取所有基础功能数据信息接口", notes = "获取所有基础功能数据信息接口")
|
|
|
@GetMapping("/get/lib")
|
|
|
public ResultBody getLibrary() {
|
|
|
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
String uri = request.getRequestURI();
|
|
|
try {
|
|
|
- log.info("init:{}", "init");
|
|
|
+ log.info("getLibrary:{}", "init");
|
|
|
return ResultBody.ok().path(uri).data(checkModuleService.selModules());
|
|
|
} catch (Exception e) {
|
|
|
return GlobalExceptionHandler.resolveException(e, uri);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通用配置:
|
|
|
+ * key-value。通用配置。
|
|
|
+ */
|
|
|
+ @PreSaveLog("节点管理员动态创建节点数据")
|
|
|
+ @ApiOperation(value = "节点管理员动态创建节点数据接口", notes = "节点管理员动态创建节点数据接口")
|
|
|
+ @PostMapping("/add/init")
|
|
|
+ // public ResultBody addInitFunction(@RequestBody List<ModuleParam> moduleParams) {
|
|
|
+ // public ResultBody addInitFunction(@RequestBody Object o) {
|
|
|
+ public ResultBody addInitFunction(@RequestBody List<ModuleTree> moduleParams) {
|
|
|
+ HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
+ String uri = request.getRequestURI();
|
|
|
+ try {
|
|
|
+ log.info("addInitFunction:{}", JSON.toJSONString(moduleParams));
|
|
|
+ // return ResultBody.ok().path(uri).data(null);
|
|
|
+ return ResultBody.ok().path(uri).data(checkModuleService.addInitData(moduleParams));
|
|
|
+ } catch (Exception e) {
|
|
|
+ return GlobalExceptionHandler.resolveException(e, uri);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @PreSaveLog("获取节点基础数据")
|
|
|
+ @ApiOperation(value = "获取节点基础数据接口", notes = "获取节点基础数据接口")
|
|
|
+ @GetMapping("/node/data")
|
|
|
+ public ResultBody getNodeData() {
|
|
|
+ HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
|
|
+ String uri = request.getRequestURI();
|
|
|
+ try {
|
|
|
+ log.info("getNodeData:{}", "");
|
|
|
+ // return ResultBody.ok().path(uri).data(null);
|
|
|
+ return ResultBody.ok().path(uri).data(checkModuleService.getNodeData());
|
|
|
+ } catch (Exception e) {
|
|
|
+ return GlobalExceptionHandler.resolveException(e, uri);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|