diff --git a/doc/后端开发约定.md b/doc/后端开发约定.md
index 7f9ac6f2..1008f4f8 100644
--- a/doc/后端开发约定.md
+++ b/doc/后端开发约定.md
@@ -2,7 +2,8 @@
### 关于数据库或orm
-- 数据库版本管理工具使用flyway,请将文件resource目录下对应位置;文件名称使用 R__XXX 或 Vn.n__XXX ,R开头文件表明该文件为可重复执行sql,当文件内容更改时,该sql文件会在启动时再次执行一次,即该文件无版本执行限制,常用于数据初始化或数据迁移;V开头的文件为版本约束文件,常用于数据库表DDL操作,使用场景一般为创表、加字段、加索引等ddl操作,文件一旦被执行过,不会再次重复执行;
+- 数据库版本管理工具使用flyway,请将文件resource目录下对应位置;文件名称使用 R__XXX 或 Vn.n__XXX
+ ,R开头文件表明该文件为可重复执行sql,当文件内容更改时,该sql文件会在启动时再次执行一次,即该文件无版本执行限制,常用于数据初始化或数据迁移;V开头的文件为版本约束文件,常用于数据库表DDL操作,使用场景一般为创表、加字段、加索引等ddl操作,文件一旦被执行过,不会再次重复执行;
- 使用flyway管理的ddl语句,对表的操作语句不要指定Schema(Database),防止在不同地区部署的数据库名称不一致导致执行异常;
- 使用flyway管理的ddl语句,增加表的字段时不要指定新增字段位于已有字段后;防止表内不存在指定表字段导致ddl失败;
diff --git a/doc/能力超市版本更新日志.md b/doc/能力超市版本更新日志.md
index ae98ae05..25035733 100644
--- a/doc/能力超市版本更新日志.md
+++ b/doc/能力超市版本更新日志.md
@@ -11,12 +11,8 @@
7. 更新底部栏;支持通过读取配置文件,更改底部栏信息。
8. 更新单点登录配置;支持通过配置关闭单点登录功能。
-
-
------------------
-
-
- v0.8.0.1
更新内容:
@@ -24,14 +20,8 @@
1. 修复登录白屏问题
2. 修复平台弱口令问题
-
-
-
-
---------------
-
-
- v0.8.1.dev
更新内容:
@@ -46,12 +36,8 @@
8. 更新赋能案例,新增后台赋能案例增删改查,门户读取后台管理中的相关模块数据。
9. 更新申购车模块
-
-
-----------------
-
-
- v0.8.1.1.release(本地测试环境测试)
更新内容:
@@ -68,21 +54,13 @@
--------------------
-
-
-
-
- v0.8.1.2.release(西海岸部署修复)
1. 修复本地测试P1、P2问题
2. 修复云图调用市局接口的问题
-
-
---------------
-
-
- v0.8.1.3.release(市局部署修复)
1. 修复市局接口报错问题
@@ -90,20 +68,10 @@
3. 修复审核流程字段验证bug
4. 其他旧数据格式导致的展示类问题
-
-
------------
-
-
-
-
-
-
## 后续内容
-
-
- v0.8.1.4
1. 新增数据资源对接
@@ -116,12 +84,8 @@
8. 更新赋能案例,新增后台赋能案例增删改查,门户读取后台管理中的相关模块数据。
9. 更新申购车模块
-
-
-------------------
-
-
- v0.8.2.dev
更新内容:
@@ -130,20 +94,4 @@
2. 新增后台能力统计
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-|| 新增、修改、删除、解决的重点bug;
\ No newline at end of file
+|| 新增、修改、删除、解决的重点bug;
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 92f0fecb..c8386131 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,15 +8,15 @@
security-enterprise
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.3.7.RELEASE
-
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.3.7.RELEASE
+
renren-common
- renren-dynamic-datasource
+ renren-dynamic-datasource
renren-admin
renren-api
diff --git a/renren-admin/src/main/java/io/renren/AdminApplication.java b/renren-admin/src/main/java/io/renren/AdminApplication.java
index 58c996af..5a394fff 100644
--- a/renren-admin/src/main/java/io/renren/AdminApplication.java
+++ b/renren-admin/src/main/java/io/renren/AdminApplication.java
@@ -10,11 +10,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* renren-admin
- *
*/
@SpringBootApplication(exclude = {
- org.activiti.spring.boot.SecurityAutoConfiguration.class,
- org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
+ org.activiti.spring.boot.SecurityAutoConfiguration.class,
+ org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
})
@EnableSwagger2
//@MapperScan("io.renren.modules.monitor.mapper")
@@ -22,12 +21,12 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableScheduling
public class AdminApplication extends SpringBootServletInitializer {
- public static void main(String[] args) {
- SpringApplication.run(AdminApplication.class, args);
- }
+ public static void main(String[] args) {
+ SpringApplication.run(AdminApplication.class, args);
+ }
- @Override
- protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
- return application.sources(AdminApplication.class);
- }
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+ return application.sources(AdminApplication.class);
+ }
}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java b/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java
index c3063a42..715a788b 100644
--- a/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java
+++ b/renren-admin/src/main/java/io/renren/common/annotation/DataFilter.java
@@ -4,7 +4,6 @@ import java.lang.annotation.*;
/**
* 数据过滤注解
- *
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
diff --git a/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java b/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java
index 81882346..29c264a9 100644
--- a/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java
+++ b/renren-admin/src/main/java/io/renren/common/annotation/LogOperation.java
@@ -1,27 +1,22 @@
package io.renren.common.annotation;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
/**
* 操作日志注解
- *
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface LogOperation {
- /**
- * 操作名称
- */
- String value() default "";
+ /**
+ * 操作名称
+ */
+ String value() default "";
- /**
- * 操作数据库表
- */
- String operationTable() default "";
+ /**
+ * 操作数据库表
+ */
+ String operationTable() default "";
}
diff --git a/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java
index aa0b1c20..9b48e054 100644
--- a/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java
+++ b/renren-admin/src/main/java/io/renren/common/aspect/DataFilterAspect.java
@@ -22,7 +22,6 @@ import java.util.Map;
/**
* 数据过滤,切面处理类
- *
*/
@Aspect
@Component
@@ -36,24 +35,24 @@ public class DataFilterAspect {
@Before("dataFilterCut()")
public void dataFilter(JoinPoint point) {
Object params = point.getArgs()[0];
- if(params instanceof Map){
+ if (params instanceof Map) {
UserDetail user = SecurityUser.getUser();
//如果是超级管理员,则不进行数据过滤
- if(user.getSuperAdmin() == SuperAdminEnum.YES.value()) {
- return ;
+ if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) {
+ return;
}
try {
//否则进行数据过滤
- Map map = (Map)params;
+ Map map = (Map) params;
String sqlFilter = getSqlFilter(user, point);
map.put(Constant.SQL_FILTER, new DataScope(sqlFilter));
- }catch (Exception e){
+ } catch (Exception e) {
}
- return ;
+ return;
}
throw new io.renren.common.exception.RenException(ErrorCode.DATA_SCOPE_PARAMS_ERROR);
@@ -69,8 +68,8 @@ public class DataFilterAspect {
//获取表的别名
String tableAlias = dataFilter.tableAlias();
- if(StringUtils.isNotBlank(tableAlias)){
- tableAlias += ".";
+ if (StringUtils.isNotBlank(tableAlias)) {
+ tableAlias += ".";
}
StringBuilder sqlFilter = new StringBuilder();
@@ -78,14 +77,14 @@ public class DataFilterAspect {
//部门ID列表
List deptIdList = user.getDeptIdList();
- if(CollUtil.isNotEmpty(deptIdList)){
+ if (CollUtil.isNotEmpty(deptIdList)) {
sqlFilter.append(tableAlias).append(dataFilter.deptId());
sqlFilter.append(" in(").append(StringUtils.join(deptIdList, ",")).append(")");
}
//查询本人数据
- if(CollUtil.isNotEmpty(deptIdList)){
+ if (CollUtil.isNotEmpty(deptIdList)) {
sqlFilter.append(" or ");
}
sqlFilter.append(tableAlias).append(dataFilter.userId()).append("=").append(user.getId());
diff --git a/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java
index 5ec31c40..048641f4 100644
--- a/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java
+++ b/renren-admin/src/main/java/io/renren/common/aspect/LogOperationAspect.java
@@ -23,7 +23,6 @@ import java.lang.reflect.Method;
/**
* 操作日志,切面处理类
- *
*/
@Aspect
@Component
@@ -47,7 +46,7 @@ public class LogOperationAspect {
saveLog(point, time, OperationStatusEnum.SUCCESS.value(), result);
return result;
- }catch(Exception e) {
+ } catch (Exception e) {
//执行时长(毫秒)
long time = System.currentTimeMillis() - beginTime;
//保存日志
@@ -63,7 +62,7 @@ public class LogOperationAspect {
LogOperation annotation = method.getAnnotation(LogOperation.class);
SysLogOperationEntity log = new SysLogOperationEntity();
- if(annotation != null){
+ if (annotation != null) {
//注解上的描述
log.setOperation(annotation.value());
//操作数据库表
@@ -72,12 +71,12 @@ public class LogOperationAspect {
//登录用户信息
UserDetail user = SecurityUser.getUser();
- if(user != null){
+ if (user != null) {
log.setCreatorName(user.getUsername());
}
log.setStatus(status);
- log.setRequestTime((int)time);
+ log.setRequestTime((int) time);
log.setResultData(JSON.toJSONString(result));
//请求相关信息
@@ -89,10 +88,10 @@ public class LogOperationAspect {
//请求参数
Object[] args = joinPoint.getArgs();
- try{
+ try {
String params = JSON.toJSONString(args[0]);
log.setRequestParams(params);
- }catch (Exception e){
+ } catch (Exception e) {
}
diff --git a/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java b/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java
index 9eccef43..685b4cea 100644
--- a/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java
+++ b/renren-admin/src/main/java/io/renren/common/config/RestTemplateConfig.java
@@ -2,18 +2,12 @@ package io.renren.common.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpRequest;
-import org.springframework.http.client.*;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.SocketAddress;
import java.nio.charset.Charset;
-import java.util.Collections;
@Configuration
public class RestTemplateConfig {
diff --git a/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java b/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java
index 3e055de6..ec9f1b34 100644
--- a/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java
+++ b/renren-admin/src/main/java/io/renren/common/config/SwaggerConfig.java
@@ -19,39 +19,38 @@ import static com.google.common.collect.Lists.newArrayList;
/**
* Swagger配置
- *
*/
@Configuration
@EnableSwagger2
-public class SwaggerConfig{
+public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
- .apiInfo(apiInfo())
- .select()
- //加了ApiOperation注解的类,生成接口文档
- .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
- //包下的类,生成接口文档
- //.apis(RequestHandlerSelectors.basePackage("io.renren.modules.job.controller"))
- .paths(PathSelectors.any())
- .build()
- .directModelSubstitute(java.util.Date.class, String.class)
- .securitySchemes(security());
+ .apiInfo(apiInfo())
+ .select()
+ //加了ApiOperation注解的类,生成接口文档
+ .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+ //包下的类,生成接口文档
+ //.apis(RequestHandlerSelectors.basePackage("io.renren.modules.job.controller"))
+ .paths(PathSelectors.any())
+ .build()
+ .directModelSubstitute(java.util.Date.class, String.class)
+ .securitySchemes(security());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
- .title("能力平台")
- .description("能力平台文档")
- .termsOfServiceUrl("https://www.renren.io")
- .version("1.0.0")
- .build();
+ .title("能力平台")
+ .description("能力平台文档")
+ .termsOfServiceUrl("https://www.renren.io")
+ .version("1.0.0")
+ .build();
}
private List security() {
return newArrayList(
- new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header")
+ new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header")
);
}
}
\ No newline at end of file
diff --git a/renren-admin/src/main/java/io/renren/common/config/TomcatConfig.java b/renren-admin/src/main/java/io/renren/common/config/TomcatConfig.java
index 99fb86c2..0364a108 100644
--- a/renren-admin/src/main/java/io/renren/common/config/TomcatConfig.java
+++ b/renren-admin/src/main/java/io/renren/common/config/TomcatConfig.java
@@ -7,7 +7,6 @@ import org.springframework.context.annotation.Configuration;
/**
* Swagger配置
- *
*/
@Configuration
public class TomcatConfig {
diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java
index 9a232a4d..2f05d262 100644
--- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java
+++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java
@@ -28,7 +28,10 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java
index 5989c205..6ecd64cd 100644
--- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java
+++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java
@@ -211,7 +211,7 @@ public class AbilityCenterControllerV2 {
.filter(Objects::nonNull)
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
.collect(Collectors.groupingBy(t -> {
- if(t.getResourceOwnerDept() != null){
+ if (t.getResourceOwnerDept() != null) {
return t.getResourceOwnerDept().getId();
}
ResourceDTO resourceDTO = resourceService.get(Long.valueOf(t.getResourceId()));
diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java
index 6ec46ccc..ed7d900d 100644
--- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java
+++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java
@@ -58,7 +58,6 @@ public class CensusController {
private String[] censusApplyTypes; // 需要进行申请统计的资源类型
-
/**
* 获取各类资源数目
*
@@ -382,7 +381,7 @@ public class CensusController {
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
- public Result selectCensusResourceTable(@RequestParam Map params){
+ public Result selectCensusResourceTable(@RequestParam Map params) {
return new Result().ok(resourceService.selectCensusResourceTable(params));
}
@@ -396,7 +395,7 @@ public class CensusController {
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
})
- public Result selectCensusApplyTable(@RequestParam Map params){
+ public Result selectCensusApplyTable(@RequestParam Map params) {
return new Result().ok(resourceService.selectCensusApplyTable(params));
}
diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java
index abc318ec..7f80171e 100644
--- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java
+++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java
@@ -23,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -182,7 +181,7 @@ public class CensusControllerV3 {
@ApiImplicitParam(name = "resourceType", value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
})
public Result>> assemblerCaredTopInfo(@ApiIgnore @RequestParam Map params) {
- Object[] args = { params.get("resourceType"),params.get("id")};
+ Object[] args = {params.get("resourceType"), params.get("id")};
List