mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit:同步2.3版本
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package com.orangeforms.operationlogconsumer;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
@@ -10,8 +11,9 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@ComponentScan("com.orangeforms")
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class OperationLogConsumerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.orangeforms.courseclassservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@@ -11,9 +12,9 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@EnableFeignClients(basePackages = "com.orangeforms")
|
||||
@ComponentScan("com.orangeforms")
|
||||
@EnableFeignClients(basePackages = "com.orangeforms")
|
||||
@SpringBootApplication
|
||||
public class CourseClassApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
</if>
|
||||
<if test="studentFilter.searchString != null and studentFilter.searchString != ''">
|
||||
<bind name = "safeStudentSearchString" value = "'%' + studentFilter.searchString + '%'" />
|
||||
AND CONCAT(COALESCE(zz_student.login_mobile,''), COALESCE(zz_student.student_name,'')) LIKE #{safeStudentSearchString}
|
||||
AND CONCAT(IFNULL(zz_student.login_mobile,''), IFNULL(zz_student.student_name,'')) LIKE #{safeStudentSearchString}
|
||||
</if>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
@@ -5,9 +5,9 @@ import com.orangeforms.gateway.filter.AuthenticationPostFilter;
|
||||
import com.orangeforms.gateway.filter.AuthenticationPreFilter;
|
||||
import com.orangeforms.gateway.filter.RequestLogFilter;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
|
||||
@SpringCloudApplication
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class GatewayApplication {
|
||||
|
||||
@RestController
|
||||
|
||||
@@ -22,10 +22,14 @@ public class CorsConfig {
|
||||
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource(new PathPatternParser());
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
if (StringUtils.isNotBlank(appConfig.getCredentialIpList())) {
|
||||
String[] credentialIpList = StringUtils.split(appConfig.getCredentialIpList(), ",");
|
||||
if (credentialIpList.length > 0) {
|
||||
for (String ip : credentialIpList) {
|
||||
config.addAllowedOrigin(ip);
|
||||
if ("*".equals(appConfig.getCredentialIpList())) {
|
||||
config.addAllowedOriginPattern("*");
|
||||
} else {
|
||||
String[] credentialIpList = StringUtils.split(appConfig.getCredentialIpList(), ",");
|
||||
if (credentialIpList.length > 0) {
|
||||
for (String ip : credentialIpList) {
|
||||
config.addAllowedOrigin(ip);
|
||||
}
|
||||
}
|
||||
}
|
||||
config.addAllowedHeader("*");
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.orangeforms.statsservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@@ -11,9 +12,9 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@EnableFeignClients(basePackages = "com.orangeforms")
|
||||
@ComponentScan("com.orangeforms")
|
||||
@EnableFeignClients(basePackages = "com.orangeforms")
|
||||
@SpringBootApplication
|
||||
public class StatsApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.orangeforms.upmsservice;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@@ -13,10 +13,10 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
|
||||
@SpringCloudApplication
|
||||
@EnableFeignClients(basePackages = "com.orangeforms")
|
||||
@ComponentScan("com.orangeforms")
|
||||
@EnableFeignClients(basePackages = "com.orangeforms")
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class UpmsApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface SysDeptRelationMapper extends BaseDaoMapper<SysDeptRelation> {
|
||||
/**
|
||||
* 批量插入部门关联数据。
|
||||
* 由于目前版本(3.4.1)的Mybatis Plus没有提供真正的批量插入,为了保证效率需要自己实现。
|
||||
* 目前我们仅仅给出MySQL的insert list实现作为参考,其他数据库需要自行修改。
|
||||
* 目前我们仅仅给出MySQL和PostgresSQL的insert list实现作为参考,其他数据库需要自行修改。
|
||||
*
|
||||
* @param deptRelationList 部门关联关系数据列表。
|
||||
*/
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.orangeforms.common.core.base.client;
|
||||
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
import com.orangeforms.common.core.object.*;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.orangeforms.common.core.base.controller;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.orangeforms.common.core.base.mapper.BaseModelMapper;
|
||||
import com.orangeforms.common.core.base.service.IBaseService;
|
||||
import com.orangeforms.common.core.config.CoreProperties;
|
||||
import com.orangeforms.common.core.constant.AggregationKind;
|
||||
import com.orangeforms.common.core.constant.AggregationType;
|
||||
import com.orangeforms.common.core.constant.ErrorCodeEnum;
|
||||
@@ -19,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -42,6 +45,8 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public abstract class BaseController<M, V, K extends Serializable> {
|
||||
|
||||
@Autowired
|
||||
private CoreProperties coreProperties;
|
||||
/**
|
||||
* 当前Service关联的主Model实体对象的Class。
|
||||
*/
|
||||
@@ -245,7 +250,42 @@ public abstract class BaseController<M, V, K extends Serializable> {
|
||||
}
|
||||
}
|
||||
M filter = queryParam.getFilterDto(modelClass);
|
||||
if (StrUtil.isNotBlank(queryParam.getInFilterField())
|
||||
&& CollUtil.isNotEmpty(queryParam.getInFilterValues())) {
|
||||
if (queryParam.getCriteriaList() == null) {
|
||||
queryParam.setCriteriaList(new LinkedList<>());
|
||||
}
|
||||
MyWhereCriteria whereCriteria = new MyWhereCriteria();
|
||||
whereCriteria.setFieldName(queryParam.getInFilterField());
|
||||
whereCriteria.setOperatorType(MyWhereCriteria.OPERATOR_IN);
|
||||
whereCriteria.setValue(queryParam.getInFilterValues());
|
||||
queryParam.getCriteriaList().add(whereCriteria);
|
||||
}
|
||||
String whereClause = MyWhereCriteria.makeCriteriaString(queryParam.getCriteriaList(), modelClass);
|
||||
if (CollUtil.isNotEmpty(queryParam.getSearchStringFieldList())
|
||||
&& StrUtil.isNotBlank(queryParam.getSearchStringValue())) {
|
||||
String tableName = MyModelUtil.mapToTableName(modelClass);
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
if (StrUtil.isNotBlank(whereClause)) {
|
||||
sb.append(" AND ");
|
||||
}
|
||||
sb.append(" CONCAT(");
|
||||
for (int i = 0; i < queryParam.getSearchStringFieldList().size(); i++) {
|
||||
String fieldName = queryParam.getSearchStringFieldList().get(i);
|
||||
String columnName = MyModelUtil.mapToColumnInfo(fieldName, modelClass).getFirst();
|
||||
if (coreProperties.isMySql()) {
|
||||
sb.append("IFNULL(");
|
||||
} else if (coreProperties.isPostgresql()) {
|
||||
sb.append("COALESCE(");
|
||||
}
|
||||
sb.append(tableName).append(".").append(columnName).append(", '')");
|
||||
if (i != queryParam.getSearchStringFieldList().size() - 1) {
|
||||
sb.append(", ");
|
||||
}
|
||||
}
|
||||
sb.append(") LIKE ").append("'").append(queryParam.getSearchStringValue()).append("'");
|
||||
whereClause = whereClause + sb.toString();
|
||||
}
|
||||
String orderBy = MyOrderParam.buildOrderBy(queryParam.getOrderParam(), modelClass);
|
||||
MyPageParam pageParam = queryParam.getPageParam();
|
||||
if (pageParam != null) {
|
||||
@@ -364,9 +404,9 @@ public abstract class BaseController<M, V, K extends Serializable> {
|
||||
for (Map.Entry<Object, Set<Object>> entry : param.getGroupedInFilterValues().entrySet()) {
|
||||
StringBuilder groupedSelectList = new StringBuilder(64);
|
||||
if (stringKey) {
|
||||
groupedSelectList.append("'").append(entry.getKey()).append("' ");
|
||||
groupedSelectList.append("'").append(entry.getKey()).append("' as ");
|
||||
} else {
|
||||
groupedSelectList.append(entry.getKey()).append(" ");
|
||||
groupedSelectList.append(entry.getKey()).append(" as ");
|
||||
}
|
||||
groupedSelectList.append(MyAggregationParam.KEY_NAME).append(", ").append(selectList);
|
||||
MyWhereCriteria criteria = new MyWhereCriteria();
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.orangeforms.common.core.object.TokenData;
|
||||
import com.orangeforms.common.core.util.ContextUtil;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -17,6 +18,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
public class FeignConfig implements RequestInterceptor {
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
// 对于非servlet请求发起的远程调用,由于无法获取到标识用户身份的TokenData,因此需要略过下面的HEADER注入。
|
||||
|
||||
@@ -19,13 +19,13 @@ public class MyAggregationParam {
|
||||
* 聚合返回数据中,聚合键的常量字段名。
|
||||
* 如select groupColumn groupedKey, max(aggregationColumn) aggregatedValue。
|
||||
*/
|
||||
public static final String KEY_NAME = "groupedKey";
|
||||
public static final String KEY_NAME = "grouped_key";
|
||||
|
||||
/**
|
||||
* 聚合返回数据中,聚合值的常量字段名。
|
||||
* 如select groupColumn groupedKey, max(aggregationColumn) aggregatedValue。
|
||||
*/
|
||||
public static final String VALUE_NAME = "aggregatedValue";
|
||||
public static final String VALUE_NAME = "aggregated_value";
|
||||
|
||||
/**
|
||||
* 聚合计算是否使用数据权限进行过滤。true表示数据过滤将产生作用,否则SQL中不会包含数据过滤。
|
||||
|
||||
@@ -61,6 +61,16 @@ public class MyQueryParam {
|
||||
*/
|
||||
private Boolean withDict = false;
|
||||
|
||||
/**
|
||||
* 参与模糊搜索的Java字段列表。
|
||||
*/
|
||||
private List<String> searchStringFieldList;
|
||||
|
||||
/**
|
||||
* 模糊搜索的字符串值,该值要包含百分号,这样可以精确控制搜索参数中百分号的配置。
|
||||
*/
|
||||
private String searchStringValue;
|
||||
|
||||
/**
|
||||
* 缺省构造函数。
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,12 @@ public class MyDateUtil {
|
||||
private static final DateTimeFormatter DATETIME_PARSE_FORMATTER =
|
||||
DateTimeFormat.forPattern(MyDateUtil.COMMON_DATETIME_FORMAT);
|
||||
|
||||
/**
|
||||
* 缺省短日期时间格式化器,提前获取提升运行时效率。
|
||||
*/
|
||||
private static final DateTimeFormatter DATETIME_SHORT_PARSE_FORMATTER =
|
||||
DateTimeFormat.forPattern(MyDateUtil.COMMON_SHORT_DATETIME_FORMAT);
|
||||
|
||||
/**
|
||||
* 获取一天的开始时间的字符串格式,如2019-08-03 00:00:00.000。
|
||||
*
|
||||
@@ -144,6 +150,16 @@ public class MyDateUtil {
|
||||
return DATETIME_PARSE_FORMATTER.parseDateTime(dateTimeString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将缺省格式的(不包含毫秒的)日期时间字符串解析为日期对象。
|
||||
*
|
||||
* @param dateTimeString 待解析的字符串。
|
||||
* @return 解析后的日期对象。
|
||||
*/
|
||||
public static DateTime toDateTimeWithoutMs(String dateTimeString) {
|
||||
return DATETIME_SHORT_PARSE_FORMATTER.parseDateTime(dateTimeString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 截取时间到天。如2019-10-03 01:20:30 转换为 2019-10-03 00:00:00。
|
||||
* 由于没有字符串的中间转换,因此效率更高。
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<result column="request_arguments" jdbcType="VARCHAR" property="requestArguments"/>
|
||||
<result column="response_result" jdbcType="VARCHAR" property="responseResult"/>
|
||||
<result column="request_ip" jdbcType="VARCHAR" property="requestIp"/>
|
||||
<result column="success" jdbcType="BIT" property="success"/>
|
||||
<result column="success" jdbcType="BOOLEAN" property="success"/>
|
||||
<result column="error_msg" jdbcType="VARCHAR" property="errorMsg"/>
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId"/>
|
||||
<result column="operator_id" jdbcType="BIGINT" property="operatorId"/>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.orangeforms.uaaadmin;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
@@ -10,8 +11,9 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@ComponentScan("com.orangeforms")
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class UaaAdminApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -24,10 +24,14 @@ public class CorsConfig {
|
||||
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
if (StringUtils.isNotBlank(applicationConfig.getCredentialIpList())) {
|
||||
String[] credentialIpList = StringUtils.split(applicationConfig.getCredentialIpList(), ",");
|
||||
if (credentialIpList.length > 0) {
|
||||
for (String ip : credentialIpList) {
|
||||
corsConfiguration.addAllowedOrigin(ip);
|
||||
if ("*".equals(applicationConfig.getCredentialIpList())) {
|
||||
corsConfiguration.addAllowedOriginPattern("*");
|
||||
} else {
|
||||
String[] credentialIpList = StringUtils.split(applicationConfig.getCredentialIpList(), ",");
|
||||
if (credentialIpList.length > 0) {
|
||||
for (String ip : credentialIpList) {
|
||||
corsConfiguration.addAllowedOrigin(ip);
|
||||
}
|
||||
}
|
||||
}
|
||||
corsConfiguration.addAllowedHeader("*");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.orangeforms.uaaadmin.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.orangeforms.common.core.base.dao.BaseDaoMapper;
|
||||
import com.orangeforms.common.core.base.service.BaseService;
|
||||
import com.orangeforms.common.core.constant.GlobalDeletedFlag;
|
||||
import com.orangeforms.common.core.object.MyRelationParam;
|
||||
import com.orangeforms.common.core.util.MyModelUtil;
|
||||
import com.orangeforms.common.sequence.wrapper.IdGeneratorWrapper;
|
||||
@@ -54,6 +54,7 @@ public class SysUaaUserServiceImpl extends BaseService<SysUaaUser, Long> impleme
|
||||
sysUaaUser.setUserId(idGenerator.nextLongId());
|
||||
sysUaaUser.setPassword(passwordEncoder.encode(sysUaaUser.getPassword()));
|
||||
MyModelUtil.fillCommonsForInsert(sysUaaUser);
|
||||
sysUaaUser.setDeletedFlag(GlobalDeletedFlag.NORMAL);
|
||||
sysUaaUserMapper.insert(sysUaaUser);
|
||||
return sysUaaUser;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-oauth2</artifactId>
|
||||
<version>2.2.5.RELEASE</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.security.oauth</groupId>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.orangeforms.uaaauth;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
@@ -10,8 +11,9 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* @author Jerry
|
||||
* @date 2020-08-08
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
@ComponentScan("com.orangeforms")
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication
|
||||
public class UaaAuthApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<spring-cloud.version>Hoxton.SR9</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2.2.5.RELEASE</spring-cloud-alibaba.version>
|
||||
<spring-boot.version>2.3.10.RELEASE</spring-boot.version>
|
||||
<spring-boot-admin.version>2.3.1</spring-boot-admin.version>
|
||||
<spring-cloud.version>2020.0.4</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.1</spring-cloud-alibaba.version>
|
||||
<spring-boot.version>2.5.8</spring-boot.version>
|
||||
<spring-boot-admin.version>2.5.5</spring-boot-admin.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
@@ -59,6 +59,10 @@
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<!-- freemarker 模板引擎模块 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -180,14 +184,9 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-httpclient</artifactId>
|
||||
</dependency>
|
||||
<!--断路器依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
<!-- api参数验证 -->
|
||||
<dependency>
|
||||
|
||||
@@ -42,7 +42,7 @@ spring:
|
||||
|
||||
# feign 配置
|
||||
feign:
|
||||
hystrix:
|
||||
sentinel:
|
||||
enabled: true
|
||||
httpclient:
|
||||
enabled: true
|
||||
@@ -66,22 +66,9 @@ feign:
|
||||
response:
|
||||
enabled: true
|
||||
|
||||
hystrix:
|
||||
command:
|
||||
default:
|
||||
execution:
|
||||
isolation:
|
||||
strategy: SEMAPHORE
|
||||
thread:
|
||||
timeoutInMilliseconds: 30000
|
||||
shareSecurityContext: true
|
||||
|
||||
#请求处理的超时时间
|
||||
ribbon:
|
||||
ReadTimeout: 7000
|
||||
ConnectTimeout: 3000
|
||||
MaxAutoRetries: 1
|
||||
MaxAutoRetriesNextServer: 1
|
||||
common-core:
|
||||
# 可选值为 mysql / postgresql
|
||||
databaseType: mysql
|
||||
|
||||
swagger:
|
||||
# 当enabled为false的时候,则可禁用swagger。
|
||||
@@ -116,8 +103,7 @@ management:
|
||||
# keys-to-sanitize:
|
||||
keys-to-sanitize: password
|
||||
server:
|
||||
servlet:
|
||||
context-path: "/"
|
||||
base-path: "/"
|
||||
|
||||
# 存储session数据的Redis,所有服务均需要,因此放到公共配置中。
|
||||
# 根据实际情况,该Redis也可以用于存储其他数据。
|
||||
|
||||
@@ -33,27 +33,15 @@ spring:
|
||||
- Path=/admin/upms/**
|
||||
filters:
|
||||
- StripPrefix=2
|
||||
- name: Hystrix
|
||||
args:
|
||||
name: default
|
||||
fallbackUri: forward:/fallback
|
||||
- id: course-class
|
||||
uri: lb://course-class
|
||||
predicates:
|
||||
- Path=/admin/CourseClass/**
|
||||
filters:
|
||||
- StripPrefix=2
|
||||
- name: Hystrix
|
||||
args:
|
||||
name: default
|
||||
fallbackUri: forward:/fallback
|
||||
- id: stats
|
||||
uri: lb://stats
|
||||
predicates:
|
||||
- Path=/admin/stats/**
|
||||
filters:
|
||||
- StripPrefix=2
|
||||
- name: Hystrix
|
||||
args:
|
||||
name: default
|
||||
fallbackUri: forward:/fallback
|
||||
|
||||
@@ -11,19 +11,6 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO `zz_data_sync_producer_update_mark` VALUES (1,0,CURDATE());
|
||||
COMMIT;
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 管理员账号数据
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `zz_sys_dept` VALUES(1293376634891538435,NULL,'公司总部',1,1293376634887344128,CURDATE(),1293376634887344128,CURDATE(),1);
|
||||
INSERT INTO `zz_sys_user` VALUES(1293376634887344128,'admin','管理员',1293376634891538435,NULL,0,0,1293376634887344128,CURDATE(),1293376634887344128,CURDATE(),1);
|
||||
INSERT INTO `zz_sys_dept_relation` VALUES(1293376634891538435,1293376634891538435);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- 全部菜单数据
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
DELETE FROM `zz_data_sync_producer_update_mark` WHERE id = 1;
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 全部菜单数据
|
||||
-- ----------------------------
|
||||
|
||||
@@ -314,4 +314,17 @@ CREATE TABLE `zz_data_sync_producer_update_mark` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='数据同步生产者消息流水表的高水标记表';
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO `zz_data_sync_producer_update_mark` VALUES (1,0,CURDATE());
|
||||
COMMIT;
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 管理员账号数据
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `zz_sys_dept` VALUES(1293376634891538435,NULL,'公司总部',1,1293376634887344128,CURDATE(),1293376634887344128,CURDATE(),1);
|
||||
INSERT INTO `zz_sys_user` VALUES(1293376634887344128,'admin','管理员',1293376634891538435,NULL,0,0,1293376634887344128,CURDATE(),1293376634887344128,CURDATE(),1);
|
||||
INSERT INTO `zz_sys_dept_relation` VALUES(1293376634891538435,1293376634891538435);
|
||||
COMMIT;
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
Reference in New Issue
Block a user