auto(e099a090076e): session end @ 2026-07-31T14:20:21 (+34f)
This commit is contained in:
1 parent
0f12fa1c25
commit
db43e57f1d
38 files changed
-8537
No files matched your search
Vendored
BIN
Binary file not shown.
@@ -1,263 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ssw-boot</artifactId>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<version>6.2.0-RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jnpf-admin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<!--打包WAR包删除注释-->
|
||||
<!--<packaging>war</packaging>-->
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-file-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>ssw-common-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- tdd3 子代理 (2026-07-25) no-spa-page 网站后端业务包 -->
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>ssw-tdd3-biz</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- jyzs AI 智能录入 (no-spa-page) 后端扩展 -->
|
||||
<!-- <dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>ssw-jyzs-biz</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency> -->
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>ssw-dr-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency> -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-extend-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-system-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-scheduletask-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-message-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-permission-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-visualdev-base-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-visualdev-onlinedev-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-visualdev-generater-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-visualdev-portal-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-visualdata-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-exception</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-oauth-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-example-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-app-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-flowable-controller</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jnpf</groupId>
|
||||
<artifactId>jnpf-common-i18n</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 单点登录相关依赖-Start -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.jnpf</groupId>-->
|
||||
<!-- <artifactId>jnpf-sso-starter-all</artifactId>-->
|
||||
<!-- <version>${project.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 单点登录(用户信息拉取)相关依赖 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.jnpf</groupId>-->
|
||||
<!-- <artifactId>jnpf-sso-connector</artifactId>-->
|
||||
<!-- <version>${project.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 单点登录(用户信息推送)相关依赖 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.jnpf</groupId>-->
|
||||
<!-- <artifactId>jnpf-sso-pull</artifactId>-->
|
||||
<!-- <version>${project.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 单点登录相关依赖-End -->
|
||||
|
||||
<!--打包WAR包删除注释-->
|
||||
<!--<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>default-package</id>
|
||||
<activation>
|
||||
<jdk>[,]</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- ... -->
|
||||
<!--打包WAR包注释插件-->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>jnpf.JnpfAdminApplication</mainClass>
|
||||
<layout>ZIP</layout>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- ... -->
|
||||
<!--打包WAR包删除注释-->
|
||||
<!--<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<configuration>
|
||||
<warSourceExcludes>src/main/resources/**</warSourceExcludes>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>-->
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>external-package</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 复制依赖到外部目录 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${external-lib-out-path}</outputDirectory>
|
||||
<overWriteReleases>true</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<!--启动类path-->
|
||||
<mainClass>jnpf.JnpfAdminApplication</mainClass>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>${external-lib-start-path}</classpathPrefix>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<!--如果不指定,classpath 可能会找不到,加载资源有问题-->
|
||||
<Class-Path>.</Class-Path>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -1,28 +0,0 @@
|
||||
package jnpf;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.x.file.storage.spring.EnableFileStorage;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JNPF开发平台组
|
||||
* @version V3.1.0
|
||||
* @copyright 引迈信息技术有限公司
|
||||
* @date 2021/3/15 17:12
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication(scanBasePackages = {"jnpf","ssw"}, exclude = {DataSourceAutoConfiguration.class})
|
||||
@EnableFileStorage
|
||||
public class JnpfAdminApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication springApplication = new SpringApplication(JnpfAdminApplication.class);
|
||||
springApplication.run(args);
|
||||
log.error("JnpfAdmin启动完成");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package jnpf.aop;
|
||||
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import cn.dev33.satoken.router.SaRouter;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.config.ConfigValueUtil;
|
||||
import jnpf.database.util.NotTenantPluginHolder;
|
||||
import jnpf.database.util.TenantDataSourceUtil;
|
||||
import jnpf.properties.GatewayWhite;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.TenantHolder;
|
||||
import jnpf.util.UserProvider;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JNPF开发平台组
|
||||
* @version V3.1.0
|
||||
* @copyright 引迈信息技术有限公司
|
||||
* @date 2021/3/15 17:12
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
@Order(1)
|
||||
@RequiredArgsConstructor
|
||||
public class DataSourceBindAspect {
|
||||
|
||||
private final ConfigValueUtil configValueUtil;
|
||||
|
||||
private final GatewayWhite gatewayWhite;
|
||||
|
||||
@Pointcut("within(jnpf.*.controller.* || jnpf.controller.*)")
|
||||
public void bindDataSource() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* NoDataSourceBind 不需要绑定数据库的注解
|
||||
*/
|
||||
@Around("bindDataSource() && !@annotation(jnpf.util.NoDataSourceBind)")
|
||||
public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable {
|
||||
if (configValueUtil.isMultiTenancy()) {
|
||||
if (StringUtil.isEmpty(TenantHolder.getDatasourceId())) {
|
||||
String url = null;
|
||||
try {
|
||||
url = SaHolder.getRequest().getRequestPath();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
if (url != null) {
|
||||
// 白名单接口不传Token, 不检查租户信息, 要查询数据库需要手动切换租户
|
||||
boolean isWhiteUrl = SaRouter.isMatch(gatewayWhite.getExcludeUrl(), url) || SaRouter.isMatch(
|
||||
gatewayWhite.getWhiteUrl(), url);
|
||||
if (!isWhiteUrl) {
|
||||
UserInfo userInfo = UserProvider.getUser();
|
||||
log.error("未检测到租户信息, Tenant: {}, URL: {}, TOKEN: {}", userInfo.getTenantId(), url,
|
||||
userInfo.getToken());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return pjp.proceed();
|
||||
}
|
||||
return pjp.proceed();
|
||||
}
|
||||
|
||||
/**
|
||||
* NoDataSourceBind 不需要绑定数据库的注解 加入不切租户库标记
|
||||
*
|
||||
*/
|
||||
@Around("bindDataSource() && @annotation(jnpf.util.NoDataSourceBind)")
|
||||
public Object doAroundService2(ProceedingJoinPoint pjp) throws Throwable {
|
||||
try {
|
||||
NotTenantPluginHolder.setNotSwitchAlwaysFlag();
|
||||
//Filter中提前设置租户信息, 不需要切库的方法进行清除切库
|
||||
TenantDataSourceUtil.clearLocalTenantInfo();
|
||||
return pjp.proceed();
|
||||
} finally {
|
||||
NotTenantPluginHolder.clearNotSwitchAlwaysFlag();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package jnpf.aop;
|
||||
|
||||
import jnpf.config.ConfigValueUtil;
|
||||
import jnpf.constant.MsgCode;
|
||||
import jnpf.exception.DataException;
|
||||
import jnpf.util.PdfUtil;
|
||||
import jnpf.util.XSSEscape;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.x.file.storage.core.FileInfo;
|
||||
import org.dromara.x.file.storage.core.UploadPretreatment;
|
||||
import org.dromara.x.file.storage.core.aspect.DeleteAspectChain;
|
||||
import org.dromara.x.file.storage.core.aspect.DownloadAspectChain;
|
||||
import org.dromara.x.file.storage.core.aspect.DownloadThAspectChain;
|
||||
import org.dromara.x.file.storage.core.aspect.ExistsAspectChain;
|
||||
import org.dromara.x.file.storage.core.aspect.FileStorageAspect;
|
||||
import org.dromara.x.file.storage.core.aspect.UploadAspectChain;
|
||||
import org.dromara.x.file.storage.core.platform.FileStorage;
|
||||
import org.dromara.x.file.storage.core.recorder.FileRecorder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class MyFileAspect implements FileStorageAspect {
|
||||
|
||||
private final ConfigValueUtil configValueUtil;
|
||||
|
||||
@Override
|
||||
public FileInfo uploadAround(UploadAspectChain chain, FileInfo fileInfo, UploadPretreatment pre,
|
||||
FileStorage fileStorage, FileRecorder fileRecorder) {
|
||||
checkFilePath(fileInfo);
|
||||
if (configValueUtil.isCheckFilePdf()) {
|
||||
try {
|
||||
String ext = fileInfo.getExt();
|
||||
if ("pdf".equalsIgnoreCase(ext)) {
|
||||
log.error("检测PDF文件");
|
||||
if (PdfUtil.containsJavaScript(pre.getFileWrapper().getInputStream())) {
|
||||
throw new DataException(MsgCode.FA053.get());
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("PDF文档解析失败: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return FileStorageAspect.super.uploadAround(chain, fileInfo, pre, fileStorage, fileRecorder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAround(DeleteAspectChain chain, FileInfo fileInfo, FileStorage fileStorage,
|
||||
FileRecorder fileRecorder) {
|
||||
checkFilePath(fileInfo);
|
||||
return FileStorageAspect.super.deleteAround(chain, fileInfo, fileStorage, fileRecorder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsAround(ExistsAspectChain chain, FileInfo fileInfo, FileStorage fileStorage) {
|
||||
checkFilePath(fileInfo);
|
||||
return FileStorageAspect.super.existsAround(chain, fileInfo, fileStorage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadAround(DownloadAspectChain chain, FileInfo fileInfo, FileStorage fileStorage,
|
||||
Consumer<InputStream> consumer) {
|
||||
checkFilePath(fileInfo);
|
||||
FileStorageAspect.super.downloadAround(chain, fileInfo, fileStorage, consumer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadThAround(DownloadThAspectChain chain, FileInfo fileInfo, FileStorage fileStorage,
|
||||
Consumer<InputStream> consumer) {
|
||||
checkFilePath(fileInfo);
|
||||
FileStorageAspect.super.downloadThAround(chain, fileInfo, fileStorage, consumer);
|
||||
}
|
||||
|
||||
private void checkFilePath(FileInfo fileInfo) {
|
||||
//处理特殊文件名
|
||||
fileInfo.setPath(XSSEscape.escapePath(fileInfo.getPath()));
|
||||
fileInfo.setFilename(XSSEscape.escapePath(fileInfo.getFilename()));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package jnpf.aop;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
|
||||
public interface PermissionAdminBase {
|
||||
|
||||
/**
|
||||
* 管理者权限判断
|
||||
*
|
||||
*/
|
||||
static Object permissionCommon(ProceedingJoinPoint pjp) throws Throwable {
|
||||
|
||||
// 是否是管理员
|
||||
return pjp.proceed();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package jnpf.aop;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 角色操作权限
|
||||
*
|
||||
* @author JNPF开发平台组 YanYu
|
||||
* @version V3.2.0
|
||||
* @copyright 引迈信息技术有限公司
|
||||
* @date 2022/2/10
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
public class PermissionRoleAspect implements PermissionAdminBase {
|
||||
|
||||
/**
|
||||
* 分级管理切点
|
||||
*/
|
||||
@Pointcut("within(jnpf.*.controller.*) && @annotation(jnpf.annotation.RolePermission)")
|
||||
public void pointcut() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 分级管理切点
|
||||
*
|
||||
* @param pjp
|
||||
* @return
|
||||
* @throws Throwable
|
||||
*/
|
||||
@Around("pointcut()")
|
||||
public Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||
return PermissionAdminBase.permissionCommon(pjp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
package jnpf.aop;
|
||||
|
||||
import cn.hutool.http.useragent.UserAgent;
|
||||
import cn.hutool.http.useragent.UserAgentUtil;
|
||||
import jnpf.annotation.HandleLog;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.config.ConfigValueUtil;
|
||||
import jnpf.entity.LogEntity;
|
||||
import jnpf.enums.LogSortEnum;
|
||||
import jnpf.service.LogService;
|
||||
import jnpf.util.IpUtil;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.RandomUtil;
|
||||
import jnpf.util.ServletUtil;
|
||||
import jnpf.util.TenantHolder;
|
||||
import jnpf.util.ThreadPoolExecutorUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.Signature;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author JNPF开发平台组
|
||||
* @version V3.1.0
|
||||
* @copyright 引迈信息技术有限公司
|
||||
* @date 2021/3/15 17:12
|
||||
*/
|
||||
@Slf4j
|
||||
@Aspect
|
||||
@Component
|
||||
@Order(2)
|
||||
@RequiredArgsConstructor
|
||||
public class RequestLogAspect {
|
||||
|
||||
private final ConfigValueUtil configValueUtil;
|
||||
|
||||
private final LogService logService;
|
||||
|
||||
@Pointcut("within(jnpf.*.controller.* || jnpf.controller.*)")// && !within(jnpf.controller.UtilsController)
|
||||
public void requestLog() {
|
||||
|
||||
}
|
||||
|
||||
@Around("requestLog()")
|
||||
public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable {
|
||||
long startTime = System.currentTimeMillis();
|
||||
Object obj = pjp.proceed();
|
||||
if (ServletUtil.getRequest() == null) {
|
||||
return obj;
|
||||
}
|
||||
long costTime = System.currentTimeMillis() - startTime;
|
||||
UserInfo userInfo = UserProvider.getUser();
|
||||
if (userInfo.getUserId() != null && (!configValueUtil.isMultiTenancy()
|
||||
|| TenantHolder.getLocalTenantCache() != null)) {
|
||||
// 得到请求参数
|
||||
Object[] args = pjp.getArgs();
|
||||
Signature signature = pjp.getSignature();
|
||||
printLog(userInfo, costTime, obj, args, signature);
|
||||
try {
|
||||
// 判断是否需要操作日志
|
||||
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
|
||||
// 得到请求方法
|
||||
Method method = methodSignature.getMethod();
|
||||
HandleLog methodAnnotation = method.getAnnotation(HandleLog.class);
|
||||
if (methodAnnotation != null) {
|
||||
String moduleName = methodAnnotation.moduleName();
|
||||
handleLog(userInfo, costTime, obj, moduleName, args, signature);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("记录操作日志发生错误:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求日志
|
||||
*
|
||||
*/
|
||||
private void printLog(UserInfo userInfo, long costTime, Object obj, Object[] args, Signature signature) {
|
||||
LogEntity entity = new LogEntity();
|
||||
entity.setId(RandomUtil.uuId());
|
||||
entity.setType(LogSortEnum.REQUEST.getCode());
|
||||
entity.setUserId(userInfo.getUserId());
|
||||
entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount());
|
||||
//请求耗时
|
||||
entity.setRequestDuration((int) costTime);
|
||||
entity.setRequestUrl(ServletUtil.getRequest().getServletPath());
|
||||
entity.setRequestMethod(ServletUtil.getRequest().getMethod());
|
||||
String ipAddr = IpUtil.getIpAddr();
|
||||
entity.setIpAddress(ipAddr);
|
||||
entity.setIpAddressName(IpUtil.getIpCity(ipAddr));
|
||||
entity.setCreatorTime(new Date());
|
||||
UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent());
|
||||
if (userAgent != null) {
|
||||
entity.setPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion());
|
||||
entity.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion());
|
||||
}
|
||||
String declaringTypeName = signature.getDeclaringTypeName();
|
||||
String name = signature.getName();
|
||||
entity.setRequestTarget(declaringTypeName + "." + name);
|
||||
entity.setJsons(obj + "");
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (Object o : args) {
|
||||
// 如果是MultipartFile则为导入
|
||||
if (o instanceof MultipartFile) {
|
||||
stringBuilder.append("{\"originalFilename\":\"")
|
||||
.append(((MultipartFile) o).getOriginalFilename())
|
||||
.append("\",");
|
||||
stringBuilder.append("\"contentType\":\"").append(((MultipartFile) o).getContentType()).append("\",");
|
||||
stringBuilder.append("\"name\":\"").append(((MultipartFile) o).getName()).append("\",");
|
||||
stringBuilder.append("\"resource\":\"").append(((MultipartFile) o).getResource()).append("\",");
|
||||
stringBuilder.append("\"size\":\"").append(((MultipartFile) o).getSize()).append("\"}");
|
||||
}
|
||||
}
|
||||
if (stringBuilder.length() > 0) {
|
||||
entity.setRequestParam(stringBuilder.toString());
|
||||
} else {
|
||||
entity.setRequestParam(JsonUtil.getObjectToString(args));
|
||||
}
|
||||
ThreadPoolExecutorUtil.getExecutor().execute(() -> logService.save(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加操作日志
|
||||
*
|
||||
* @param userInfo 用户信息
|
||||
* @param costTime 操作耗时
|
||||
* @param obj 请求结果
|
||||
* @param moduleName 模块名称
|
||||
* @param args 请求参数
|
||||
*/
|
||||
private void handleLog(UserInfo userInfo, long costTime, Object obj, String moduleName, Object[] args,
|
||||
Signature signature) {
|
||||
LogEntity entity = new LogEntity();
|
||||
entity.setId(RandomUtil.uuId());
|
||||
entity.setType(LogSortEnum.OPERATE.getCode());
|
||||
entity.setUserId(userInfo.getUserId());
|
||||
entity.setUserName(userInfo.getUserName() + "/" + userInfo.getUserAccount());
|
||||
//请求耗时
|
||||
entity.setRequestDuration((int) costTime);
|
||||
entity.setRequestMethod(ServletUtil.getRequest().getMethod());
|
||||
entity.setRequestUrl(ServletUtil.getRequest().getServletPath());
|
||||
String ipAddr = IpUtil.getIpAddr();
|
||||
entity.setIpAddress(ipAddr);
|
||||
entity.setIpAddressName(IpUtil.getIpCity(ipAddr));
|
||||
entity.setCreatorTime(new Date());
|
||||
// 请求设备
|
||||
UserAgent userAgent = UserAgentUtil.parse(ServletUtil.getUserAgent());
|
||||
if (userAgent != null) {
|
||||
entity.setPlatForm(userAgent.getPlatform().getName() + " " + userAgent.getOsVersion());
|
||||
entity.setBrowser(userAgent.getBrowser().getName() + " " + userAgent.getVersion());
|
||||
}
|
||||
// 操作模块
|
||||
entity.setModuleName(moduleName);
|
||||
String declaringTypeName = signature.getDeclaringTypeName();
|
||||
String name = signature.getName();
|
||||
entity.setRequestTarget(declaringTypeName + "." + name);
|
||||
// 操作记录
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (Object o : args) {
|
||||
// 如果是MultipartFile则为导入
|
||||
if (o instanceof MultipartFile) {
|
||||
stringBuilder.append("{\"originalFilename\":\"")
|
||||
.append(((MultipartFile) o).getOriginalFilename())
|
||||
.append("\",");
|
||||
stringBuilder.append("\"contentType\":\"").append(((MultipartFile) o).getContentType()).append("\",");
|
||||
stringBuilder.append("\"name\":\"").append(((MultipartFile) o).getName()).append("\",");
|
||||
stringBuilder.append("\"resource\":\"").append(((MultipartFile) o).getResource()).append("\",");
|
||||
stringBuilder.append("\"size\":\"").append(((MultipartFile) o).getSize()).append("\"}");
|
||||
}
|
||||
}
|
||||
if (stringBuilder.length() > 0) {
|
||||
entity.setRequestParam(stringBuilder.toString());
|
||||
} else {
|
||||
entity.setRequestParam(JsonUtil.getObjectToString(args));
|
||||
}
|
||||
entity.setJsons(obj + "");
|
||||
ThreadPoolExecutorUtil.getExecutor().execute(() -> logService.save(entity));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package jnpf.constant;
|
||||
|
||||
/**
|
||||
* 分级管理常量
|
||||
*
|
||||
* @author JNPF开发平台组
|
||||
* @version V3.1.0
|
||||
* @copyright 引迈信息技术有限公司(<a href="https://www.jnpfsoft.com">...</a>)
|
||||
* @date 2021-11-01
|
||||
*/
|
||||
public class PermissionConstant {
|
||||
|
||||
/**
|
||||
* 创建方法
|
||||
*/
|
||||
public static final String METHOD_CREATE = "create";
|
||||
|
||||
/**
|
||||
* 编辑方法
|
||||
*/
|
||||
public static final String METHOD_UPDATE = "update";
|
||||
|
||||
/**
|
||||
* 删除方法
|
||||
*/
|
||||
public static final String METHOD_DELETE = "delete";
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
*/
|
||||
public static final String METHOD_DISABLE = "disable";
|
||||
|
||||
/**
|
||||
* 创建方法
|
||||
*/
|
||||
public static final String METHOD_CREATE_DEPARTMENT = "createDepartment";
|
||||
|
||||
/**
|
||||
* 编辑方法
|
||||
*/
|
||||
public static final String METHOD_UPDATE_DEPARTMENT = "updateDepartment";
|
||||
|
||||
/**
|
||||
* 删除方法
|
||||
*/
|
||||
public static final String METHOD_DELETE_DEPARTMENT = "deleteDepartment";
|
||||
|
||||
/**
|
||||
* 保存方法
|
||||
*/
|
||||
public static final String METHOD_SAVE = "save";
|
||||
|
||||
public static final String METHOD_SAVE_BATCH = "saveBatch";
|
||||
|
||||
/**
|
||||
* 修改用户密码
|
||||
*/
|
||||
public static final String METHOD_MODIFY_PW = "modifyPassword";
|
||||
|
||||
/**
|
||||
* 拼接方法名
|
||||
*/
|
||||
public static final String GET_METHOD_CREATE = "Add";
|
||||
|
||||
public static final String GET_METHOD_UPDATE = "Edit";
|
||||
|
||||
public static final String GET_METHOD_DELETE = "Delete";
|
||||
|
||||
public static final String GET_METHOD_SELECT = "Select";
|
||||
|
||||
public static final String GET_METHOD_THIS = "getThisLayer";
|
||||
|
||||
public static final String GET_METHOD_SUB = "getSubLayer";
|
||||
|
||||
/**
|
||||
* 解除绑定方法
|
||||
*/
|
||||
public static final String METHOD_DELETE_SOCIALS = "deleteSocials";
|
||||
|
||||
private PermissionConstant() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package jnpf.filter;
|
||||
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.filter.SaFilterAuthStrategy;
|
||||
import cn.dev33.satoken.filter.SaServletFilter;
|
||||
import cn.dev33.satoken.router.SaRouter;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.util.SaResult;
|
||||
import jnpf.base.ActionResultCode;
|
||||
import jnpf.constant.MsgCode;
|
||||
import jnpf.consts.AuthConsts;
|
||||
import jnpf.properties.GatewayWhite;
|
||||
import jnpf.util.GatewayUtil;
|
||||
import jnpf.util.IpUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 网关验证token
|
||||
*
|
||||
* @author JNPF开发平台组
|
||||
* @version V3.1.0
|
||||
* {@code @copyright} 引迈信息技术有限公司(<a href="https://www.jnpfsoft.com">...</a>)
|
||||
* {@code @date} 2021-03-24
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class AuthFilter {
|
||||
|
||||
private final GatewayWhite gatewayWhite;
|
||||
|
||||
private final SaFilterAuthStrategy defaultBeforeAuthStrategy;
|
||||
|
||||
public static String getIpAddr() {
|
||||
return IpUtil.getIpAddr();
|
||||
}
|
||||
|
||||
// 注册 Sa-Token全局过滤器
|
||||
@Bean
|
||||
public SaServletFilter getSaReactorFilter() {
|
||||
return new SaServletFilter()
|
||||
// 拦截地址
|
||||
.addInclude("/**").setExcludeList(gatewayWhite.getExcludeUrl())
|
||||
// 鉴权方法:每次访问进入
|
||||
.setAuth(obj -> {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("请求路径: {}", SaHolder.getRequest().getRequestPath());
|
||||
}
|
||||
//拦截路径
|
||||
SaRouter.match(gatewayWhite.getBlockUrl()).match(o -> {
|
||||
//禁止访问URL 排除白名单
|
||||
String ip = getIpAddr();
|
||||
for (String o1 : gatewayWhite.getWhiteIp()) {
|
||||
if (ip.startsWith(o1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
log.info("非白名单IP访问限制接口:{}, {}", SaHolder.getRequest().getRequestPath(), ip);
|
||||
return true;
|
||||
}).back(MsgCode.AD101.get());
|
||||
//白名单不拦截
|
||||
SaRouter.match(gatewayWhite.getWhiteUrl()).stop();
|
||||
//内部请求不拦截
|
||||
SaRouter.match(t -> {
|
||||
String innerToken = SaHolder.getRequest().getHeader(AuthConsts.INNER_TOKEN_KEY);
|
||||
return UserProvider.isValidInnerToken(innerToken);
|
||||
}).stop();
|
||||
// 登录校验 -- 拦截所有路由
|
||||
SaRouter.match("/**", r -> {
|
||||
StpUtil.checkLogin();
|
||||
GatewayUtil.renewToken(StpUtil.getTokenValue());
|
||||
}).stop();
|
||||
}).setError(e -> {
|
||||
SaHolder.getResponse().addHeader("Content-Type", "application/json; charset=utf-8");
|
||||
if (e instanceof NotLoginException) {
|
||||
return SaResult.error(ActionResultCode.SESSIONOVERDUE.getMessage())
|
||||
.setCode(ActionResultCode.SESSIONOVERDUE.getCode());
|
||||
}
|
||||
log.error(e.getMessage(), e);
|
||||
return SaResult.error(MsgCode.AD102.get()).setCode(ActionResultCode.EXCEPTION.getCode());
|
||||
})
|
||||
// 前置函数:在每次认证函数之前执行
|
||||
.setBeforeAuth(defaultBeforeAuthStrategy);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package jnpf.filter;
|
||||
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import cn.dev33.satoken.context.model.SaRequest;
|
||||
import cn.dev33.satoken.context.model.SaResponse;
|
||||
import cn.dev33.satoken.filter.SaFilterAuthStrategy;
|
||||
import cn.dev33.satoken.router.SaRouter;
|
||||
import jnpf.properties.MvcSecurityProperties;
|
||||
import jnpf.util.Constants;
|
||||
import jnpf.util.IpUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* mvc配置
|
||||
*
|
||||
* @author JNPF开发平台组
|
||||
* @version V5.0.0
|
||||
* @copyright 引迈信息技术有限公司(<a href="https://www.jnpfsoft.com">...</a>)
|
||||
* @date 2025-01-21
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@RequiredArgsConstructor
|
||||
public class MvcSecurityConfig {
|
||||
|
||||
private static final String DOMAIN_FORMAT = "%s://%s";
|
||||
|
||||
private final MvcSecurityProperties mvcSecurityProperties;
|
||||
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
// 允许发送凭据
|
||||
config.setAllowCredentials(true);
|
||||
//允许任意域名跨域访问接口
|
||||
config.setAllowedOrigins(mvcSecurityProperties.getCors().getAllowedOrigins());
|
||||
config.setAllowedOriginPatterns(mvcSecurityProperties.getCors().getAllowedOriginPatterns());
|
||||
// 允许所有头部信息
|
||||
config.setAllowedHeaders(mvcSecurityProperties.getCors().getAllowedHeaders());
|
||||
// 允许所有请求方法
|
||||
config.setAllowedMethods(mvcSecurityProperties.getCors().getAllowedMethods());
|
||||
// 应用于所有路径
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
return new MyCorsFilter(source);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public SaFilterAuthStrategy defaultBeforeAuthStrategy() {
|
||||
CorsConfiguration csrfConfiguration;
|
||||
if (!mvcSecurityProperties.getCsrfOrigins().isEmpty() || !mvcSecurityProperties.getCsrfOriginsPatterns()
|
||||
.isEmpty()) {
|
||||
csrfConfiguration = new CorsConfiguration();
|
||||
csrfConfiguration.setAllowedOrigins(mvcSecurityProperties.getCsrfOrigins());
|
||||
csrfConfiguration.setAllowedOriginPatterns(mvcSecurityProperties.getCsrfOriginsPatterns());
|
||||
} else {
|
||||
csrfConfiguration = null;
|
||||
}
|
||||
return obj -> {
|
||||
SaRequest request = SaHolder.getRequest();
|
||||
// ---------- 设置跨域响应头 ----------
|
||||
SaResponse response = SaHolder.getResponse();
|
||||
if (!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getServerName())) {
|
||||
response.setServer(mvcSecurityProperties.getHeaders().getServerName());
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getXFrameOptions())
|
||||
&& !MvcSecurityProperties.XFrameOptionsMode.DISABLED.equals(
|
||||
mvcSecurityProperties.getHeaders().getXFrameOptions())) {
|
||||
response.setHeader(MvcSecurityProperties.HEADER_XFRAME_OPTIONS,
|
||||
mvcSecurityProperties.getHeaders().getXFrameOptions().getMode());
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getXXssProtection())
|
||||
&& !MvcSecurityProperties.XXssProtectionMode.DISABLED.equals(
|
||||
mvcSecurityProperties.getHeaders().getXXssProtection())) {
|
||||
response.setHeader(MvcSecurityProperties.HEADER_XSS_PROTECTION,
|
||||
mvcSecurityProperties.getHeaders().getXXssProtection().getMode());
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(mvcSecurityProperties.getHeaders().getXContentTypeOptions())
|
||||
&& !MvcSecurityProperties.XContentTypeOptions.DISABLED.equals(
|
||||
mvcSecurityProperties.getHeaders().getXContentTypeOptions())) {
|
||||
response.setHeader(MvcSecurityProperties.HEADER_CONTENT_TYPE_OPTIONS,
|
||||
mvcSecurityProperties.getHeaders().getXContentTypeOptions().getMode());
|
||||
}
|
||||
|
||||
if (csrfConfiguration != null) {
|
||||
String referer = request.getHeader("referer");
|
||||
if (!ObjectUtils.isEmpty(referer)) {
|
||||
URI uri = URI.create(referer);
|
||||
String refererDomain = String.format(DOMAIN_FORMAT, uri.getScheme(), uri.getAuthority());
|
||||
String allowOrign = csrfConfiguration.checkOrigin(refererDomain);
|
||||
if (ObjectUtils.isEmpty(allowOrign)) {
|
||||
log.error("Reject CSRF Request: {}, {}, {}, {}", request.getRequestPath(), referer,
|
||||
IpUtil.getIpAddr(), request.getHeader(Constants.AUTHORIZATION));
|
||||
response.setStatus(HttpStatus.FORBIDDEN.value());
|
||||
SaRouter.back("Invalid CSRF Request");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Order(-110)
|
||||
public static class MyCorsFilter extends CorsFilter {
|
||||
|
||||
public MyCorsFilter(CorsConfigurationSource configSource) {
|
||||
super(configSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package jnpf.util;
|
||||
|
||||
import cn.hutool.cache.CacheUtil;
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
|
||||
/**
|
||||
* 网关工具类
|
||||
*/
|
||||
public class GatewayUtil {
|
||||
|
||||
private static final long TIMEOUT = 1000L * 60;
|
||||
|
||||
private static TimedCache<String, Integer> renewLimit = null;
|
||||
|
||||
static {
|
||||
renewLimit = CacheUtil.newTimedCache(TIMEOUT);
|
||||
// 一分钟清理一次无用数据
|
||||
renewLimit.schedulePrune(TIMEOUT);
|
||||
}
|
||||
|
||||
private GatewayUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 同一个TOKEN一分钟内只会续期一次
|
||||
*/
|
||||
public static void renewToken(String token) {
|
||||
if (renewLimit.containsKey(token)) {
|
||||
return;
|
||||
}
|
||||
UserProvider.renewTimeout(token);
|
||||
renewLimit.put(token, 0);
|
||||
}
|
||||
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -1,178 +0,0 @@
|
||||
server:
|
||||
tomcat: {uri-encoding: UTF-8, max-part-count: 1000}
|
||||
port: 30000
|
||||
spring:
|
||||
messages: {basename: i18n/message, cache-duration: 24H}
|
||||
devtools:
|
||||
restart: {enabled: true}
|
||||
freemarker: {cache: false}
|
||||
thymeleaf: {cache: false}
|
||||
claude:
|
||||
api: {url: 'https://api.minimaxi.com/anthropic/v1/messages', key: sk-cp-_ZEM-BIKTgHuTSEwyotKnm8C3Mu0l3jEyOc0Jh2UwdXRUBYcPwLLc4dz3tACJO3hMeWXJ6dKCJuu2lKUtw45RWV798Xw_JOZv0UxCyIaGFuv_j_gWHcp17c,
|
||||
model: MiniMax-M2.7}
|
||||
threads:
|
||||
virtual: {enabled: true}
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
# db-type: MySQL
|
||||
# host: mariadb
|
||||
# port: 3306
|
||||
# username: root
|
||||
# password: 2213
|
||||
# db-name: j62
|
||||
# db-schema: null
|
||||
# prepare-url: null
|
||||
db-type: PostgreSQL
|
||||
host: postgres
|
||||
port: 5432
|
||||
username: dacli
|
||||
password: dacli123
|
||||
db-name: j62
|
||||
db-schema: public
|
||||
prepare-url: null
|
||||
dynamic:
|
||||
primary: master
|
||||
strict: true
|
||||
druid:
|
||||
test-while-idle: true
|
||||
time-between-eviction-runs-millis: 60000
|
||||
max-wait: 3000
|
||||
initial-size: 4
|
||||
max-active: 20
|
||||
min-idle: 4
|
||||
keep-alive: true
|
||||
connect-timeout: 10000
|
||||
socket-timeout: 10000
|
||||
query-timeout: 90000
|
||||
transaction-query-timeout: 90000
|
||||
slf4j:
|
||||
statementLogEnabled: true
|
||||
resultSetLogEnabled: false
|
||||
connectionLogEnabled: false
|
||||
dataSourceLogEnabled: false
|
||||
statementCreateAfterLogEnabled: false
|
||||
statementCloseAfterLogEnabled: false
|
||||
statementExecuteAfterLogEnabled: false
|
||||
statementExecutableSqlLogEnable: true
|
||||
statementPrepareAfterLogEnabled: false
|
||||
statementPrepareCallAfterLogEnabled: false
|
||||
statementParameterSetLogEnabled: false
|
||||
sswportal:
|
||||
url: 'jdbc:postgresql://${spring.datasource.host}:${spring.datasource.port}/sswportal?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC'
|
||||
username: ${spring.datasource.username}
|
||||
password: ${spring.datasource.password}
|
||||
driver-class-name: org.postgresql.Driver
|
||||
jxcj:
|
||||
url: 'jdbc:postgresql://${spring.datasource.host}:${spring.datasource.port}/jxcj?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC'
|
||||
username: ${spring.datasource.username}
|
||||
password: ${spring.datasource.password}
|
||||
driver-class-name: org.postgresql.Driver
|
||||
tdd3:
|
||||
url: 'jdbc:postgresql://${spring.datasource.host}:${spring.datasource.port}/tdd3?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC'
|
||||
username: ${spring.datasource.username}
|
||||
password: ${spring.datasource.password}
|
||||
driver-class-name: org.postgresql.Driver
|
||||
redis:
|
||||
redisson:
|
||||
config: |
|
||||
singleServerConfig:
|
||||
database: 1 # Redis数据库编号(0-15)
|
||||
address: "redis://redis:6379" # Redis节点地址
|
||||
password: "123456" # Redis密码
|
||||
timeout: 10000 # 读取超时(毫秒)
|
||||
connectTimeout: 10000 # 连接超时(毫秒)
|
||||
connectionMinimumIdleSize: 24 # 最小空闲连接数
|
||||
connectionPoolSize: 64 # 最大连接池大小
|
||||
threads: 4 # Redisson业务线程数
|
||||
nettyThreads: 8 # Netty IO线程数
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {} # 序列化方式:JSON
|
||||
cloud:
|
||||
stream:
|
||||
rocketmq:
|
||||
binder: {name-server: '192.168.10.6:30094', group: maxkey_identity}
|
||||
bindings:
|
||||
ssoEventReceiver-in-0: {content-type: text/json, destination: MXK_IDENTITY_MAIN_TOPIC,
|
||||
group: maxkey_identity}
|
||||
ai:
|
||||
openai:
|
||||
user-limit-count: 1 # 单个用户限流:单位时间内最大请求数
|
||||
user-limit-time: 3s # 单个用户限流时间窗口(s=秒/m=分/h=时)
|
||||
total-limit-count: 500 # 全局限流:单位时间内最大请求数
|
||||
total-limit-time: 1m # 全局限流时间窗口
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml
|
||||
type-aliases-package: jnpf.**.entity,ssw.**.entity
|
||||
global-config:
|
||||
db-config: {id-type: assign_id}
|
||||
configuration: {call-setters-on-nulls: true, jdbc-type-for-null: 'NULL', log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl}
|
||||
springdoc:
|
||||
default-flat-param-object: true
|
||||
api-docs: {enabled: true}
|
||||
lock4j:
|
||||
aop: {enabled: false}
|
||||
config:
|
||||
TestVersion: false
|
||||
ocrUrl: http://192.168.10.12:10888
|
||||
sharding-sphere-enabled: false
|
||||
file-storage:
|
||||
default-platform: local-plus-1
|
||||
thumbnail-suffix: .thumb.jpg
|
||||
local-plus:
|
||||
- {platform: local-plus-1, enable-storage: true, enable-access: true, domain: '',
|
||||
base-path: /home/ubuntu/ccWorkDir/boot/resources/, path-patterns: /**, storage-path: null}
|
||||
aliyun-oss:
|
||||
- {platform: aliyun-oss-1, enable-storage: false, access-key: '??', secret-key: '??',
|
||||
end-point: '??', bucket-name: '??', domain: '??', base-path: hy/}
|
||||
qiniu-kodo:
|
||||
- {platform: qiniu-kodo-1, enable-storage: false, access-key: '??', secret-key: '??',
|
||||
bucket-name: '??', domain: '??', base-path: base/}
|
||||
tencent-cos:
|
||||
- {platform: tencent-cos-1, enable-storage: false, secret-id: '??', secret-key: '??',
|
||||
region: '??', bucket-name: '??', domain: '??', base-path: hy/}
|
||||
minio:
|
||||
- {platform: minio-1, enable-storage: true, access-key: 9Y3sjaDWgbxKjXjm, secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc,
|
||||
end-point: 'http://192.168.0.207:9000/', bucket-name: v350, domain: '${config.file-storage.minio[0].end-point}',
|
||||
base-path: null}
|
||||
socials:
|
||||
socials-enabled: false
|
||||
config:
|
||||
- {provider: ymsso, client-id: 768085549729714693, domain-prefix: 'http://127.0.0.1:33000',
|
||||
client-secret: 8999753b453f430c8851b658c4ca507f}
|
||||
- {provider: wechat_open, client-id: your-client-id, client-secret: your-client-secret}
|
||||
- {provider: wechat_enterprise, client-id: your-client-id, client-secret: your-client-secret,
|
||||
agentId: your-agentId}
|
||||
- {provider: dingtalk, client-id: your-client-id, client-secret: your-client-secret,
|
||||
agentId: your-agentId}
|
||||
- {provider: feishu, client-id: your-client-id, client-secret: your-client-secret}
|
||||
- {provider: wechat_applets, client-id: your-client-id, client-secret: your-client-secret}
|
||||
xxl:
|
||||
job:
|
||||
admin: {accessToken: 432e62f3b488bc861d91b0e274e850cc, addresses: 'http://xxl:30020/xxl-job-admin/',
|
||||
timeout: 3}
|
||||
executor: {address: '', appname: xxl-job-executor-custom, ip: '', port: 39999,
|
||||
logpath: /data/applogs/xxl-job/jobhandler, logretentiondays: 30}
|
||||
jnpf:
|
||||
sso:
|
||||
connector: {enabled: false}
|
||||
pull: {enabled: false, create-rest-address: 'http://localhost:9526/sso-mgt-api/api/idm/Account',
|
||||
replace-rest-address: 'http://localhost:9526/sso-mgt-api/api/idm/Account', change-password-rest-address: 'http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword',
|
||||
delete-rest-address: 'http://localhost:9526/sso-mgt-api/api/idm/Account', credential-type: Basic,
|
||||
user-name: 747887288041603072, password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ}
|
||||
oauth:
|
||||
ssoEnabled: false
|
||||
ticketTimeout: 120
|
||||
defaultSSO: cas
|
||||
loginPath: http://127.0.0.1:30000/api/oauth/Login
|
||||
sso:
|
||||
baseUrl: http://127.0.0.1:8527
|
||||
sucessFrontUrl: http://127.0.0.1:3000/sso
|
||||
ticketOutMessage: false
|
||||
auth2: {enabled: true, clientId: 747887288041603072, clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ,
|
||||
baseUrl: '${oauth.sso.baseUrl}', authorizeUrl: '${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize',
|
||||
accessTokenUrl: '${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token', userInfoUrl: '${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me'}
|
||||
cas: {enabled: true, baseUrl: '${oauth.sso.baseUrl}', serverLoginUrl: '${oauth.sso.cas.baseUrl}/sign/authz/cas/login',
|
||||
serverValidateUrl: '${oauth.sso.cas.baseUrl}/sign/authz/cas'}
|
||||
stripe: {enabled: true, sandbox: true, secretKey: sk_test_51PlaceholderReplaceWithYourStripeSecretKey,
|
||||
publishableKey: pk_test_PlaceholderReplaceWithYourStripePublishableKey, webhookSecret: whsec_PlaceholderReplaceWithYourWebhookSecret,
|
||||
orderPrefix: DR, successUrl: 'http://127.0.0.1:3000/jnpf_app_dr/payment/success',
|
||||
cancelUrl: 'http://127.0.0.1:3000/jnpf_app_dr/payment/cancel'}
|
||||
@@ -1,421 +0,0 @@
|
||||
# ==============================================================================
|
||||
# 开发环境配置文件(application-dev.yml)
|
||||
# 用途:该文件为开发环境专属配置,包含服务器、数据源、缓存、消息队列、SSO、任务调度等核心配置
|
||||
# ==============================================================================
|
||||
|
||||
# ===================== 服务器基础配置 =====================
|
||||
server:
|
||||
tomcat:
|
||||
uri-encoding: UTF-8 # Tomcat请求URI编码,统一UTF-8避免中文乱码
|
||||
max-part-count: 1000 # 单个请求最大文件上传分片数,防止超大文件上传超限
|
||||
port: 30000 # tomcat监听端口,避免端口冲突
|
||||
|
||||
# ===================== Spring 核心配置 =====================
|
||||
spring:
|
||||
# 国际化消息配置
|
||||
messages:
|
||||
basename: i18n/message # 国际化消息文件基础路径(classpath下i18n目录的message_*.properties)
|
||||
cache-duration: 24H # 消息缓存有效期,开发环境24小时刷新一次,生产可适当延长
|
||||
|
||||
# Spring开发者工具(热部署)
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true # 热部署开关:开发环境开启,修改代码无需重启应用
|
||||
freemarker:
|
||||
cache: false # 关闭freemarker模板缓存,开发环境实时生效模板修改
|
||||
|
||||
# Thymeleaf模板引擎配置
|
||||
thymeleaf:
|
||||
cache: false # 关闭模板缓存,开发环境实时生效页面修改
|
||||
|
||||
# 虚拟线程配置(Spring 6+特性)
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true # 开启虚拟线程,提升高并发场景下的性能
|
||||
|
||||
# ===================== 数据源配置 =====================
|
||||
# 排除Druid自动配置,手动精细化配置连接池
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
db-type: MySQL # 数据库类型(可选值:MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL)
|
||||
host: 127.0.0.1 # 数据库服务器地址
|
||||
port: 166 # 数据库端口
|
||||
username: root # 数据库登录账号
|
||||
password: 2213 # 数据库密码
|
||||
db-name: j62 # 数据库名
|
||||
db-schema: # 金仓/达梦数据库需指定schema,其他数据库留空
|
||||
prepare-url: # 自定义JDBC URL,优先级高于自动拼接
|
||||
|
||||
# ===================== 动态多数据源配置 =====================
|
||||
dynamic:
|
||||
primary: master # 默认数据源/数据源组名称
|
||||
strict: true # 严格匹配数据源:true-未匹配到抛异常,false-降级使用默认数据源
|
||||
druid:
|
||||
# Druid连接池核心配置
|
||||
test-while-idle: true # 空闲时检测连接有效性,防止无效连接
|
||||
time-between-eviction-runs-millis: 60000 # 连接检测间隔(毫秒)
|
||||
max-wait: 3000 # 获取连接最大等待时间(毫秒),超时抛异常
|
||||
initial-size: 4 # 初始化连接数
|
||||
max-active: 20 # 最大活跃连接数(生产需根据业务调整)
|
||||
min-idle: 4 # 最小空闲连接数
|
||||
keep-alive: true # 开启空闲连接保活,防止数据库主动断开连接
|
||||
# 网络超时配置
|
||||
connect-timeout: 10000 # 连接建立超时(毫秒)
|
||||
socket-timeout: 10000 # 数据传输超时(毫秒)
|
||||
query-timeout: 90000 # SQL查询超时(毫秒)
|
||||
transaction-query-timeout: 90000 # 事务内查询超时(毫秒)
|
||||
# 数据库编码转换(按需启用,解决乱码问题)
|
||||
# proxy-filters: druidEncodingFilter
|
||||
# connection-properties:
|
||||
# clientEncoding: GB2312
|
||||
# serverEncoding: windows-1252
|
||||
|
||||
# SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
# filters: slf4j # SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
slf4j:
|
||||
statementLogEnabled: true # 打印SQL执行语句
|
||||
resultSetLogEnabled: false # 关闭结果集日志(减少日志量)
|
||||
connectionLogEnabled: false # 关闭连接日志
|
||||
dataSourceLogEnabled: false # 关闭数据源日志
|
||||
statementCreateAfterLogEnabled: false # 关闭语句创建日志
|
||||
statementCloseAfterLogEnabled: false # 关闭语句关闭日志
|
||||
statementExecuteAfterLogEnabled: false # 关闭语句执行后日志
|
||||
statementExecutableSqlLogEnable: true # 打印替换参数后的完整可执行SQL
|
||||
statementPrepareAfterLogEnabled: false # 关闭语句预编译日志
|
||||
statementPrepareCallAfterLogEnabled: false # 关闭存储过程调用日志
|
||||
statementParameterSetLogEnabled: false # 关闭参数设置日志
|
||||
|
||||
# 多数据源节点配置(示例,按需启用)
|
||||
datasource:
|
||||
ais:
|
||||
url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/ais?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
username: ${spring.datasource.username}
|
||||
password: ${spring.datasource.password}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# ===================== Redis配置(Redisson客户端) =====================
|
||||
redis:
|
||||
# 1. Redis单机模式(开发环境默认启用)
|
||||
redisson:
|
||||
config: |
|
||||
singleServerConfig:
|
||||
database: 1 # Redis数据库编号(0-15)
|
||||
address: "redis://127.0.0.1:168" # Redis节点地址
|
||||
password: "123456" # Redis密码
|
||||
timeout: 10000 # 读取超时(毫秒)
|
||||
connectTimeout: 10000 # 连接超时(毫秒)
|
||||
connectionMinimumIdleSize: 24 # 最小空闲连接数
|
||||
connectionPoolSize: 64 # 最大连接池大小
|
||||
threads: 4 # Redisson业务线程数
|
||||
nettyThreads: 8 # Netty IO线程数
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {} # 序列化方式:JSON
|
||||
|
||||
# 2. Redis分片集群模式(按需启用,注释单机模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# clusterServersConfig:
|
||||
# nodeAddresses: # 集群节点列表(至少填1个,建议多填容错)
|
||||
# - "redis://127.0.0.1:7000"
|
||||
# - "redis://127.0.0.1:7001"
|
||||
# - "redis://127.0.0.1:7002"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24 # 主库最小空闲连接
|
||||
# masterConnectionPoolSize: 64 # 主库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
# 3. Redis主从模式(按需启用,注释其他模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# masterSlaveServersConfig:
|
||||
# database: 1
|
||||
# masterAddress: "redis://192.168.8.199:6379" # 主库地址
|
||||
# slaveAddresses: # 从库列表
|
||||
# - "redis://192.168.8.199:6380"
|
||||
# - "redis://192.168.8.199:6381"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24
|
||||
# masterConnectionPoolSize: 64
|
||||
# slaveConnectionMinimumIdleSize: 24 # 从库最小空闲连接
|
||||
# slaveConnectionPoolSize: 64 # 从库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
|
||||
# ===================== 单点登录(用户信息同步) - 消息队列配置 =====================
|
||||
cloud:
|
||||
stream:
|
||||
# RocketMQ配置(默认启用)
|
||||
rocketmq:
|
||||
binder:
|
||||
name-server: 192.168.10.6:30094
|
||||
group: maxkey_identity
|
||||
# RabbitMQ配置(按需启用,注释RocketMQ后开启)
|
||||
# binders:
|
||||
# defaultRabbit: # 绑定器名称
|
||||
# type: rabbit # 消息组件类型
|
||||
# environment:
|
||||
# spring:
|
||||
# rabbitmq:
|
||||
# host: 192.168.10.6 # RabbitMQ地址
|
||||
# port: 5672 # RabbitMQ端口
|
||||
# username: rabbitmq # 登录账号
|
||||
# password: rabbitmq # 登录密码
|
||||
# Kafka配置(按需启用,注释其他MQ后开启)
|
||||
# kafka:
|
||||
# binder:
|
||||
# brokers: 192.168.10.6:9092 # Kafka broker地址
|
||||
# 消息消费绑定配置
|
||||
bindings:
|
||||
ssoEventReceiver-in-0:
|
||||
content-type: text/json # 消息格式:JSON
|
||||
destination: MXK_IDENTITY_MAIN_TOPIC # 消息主题
|
||||
group: maxkey_identity # 消费组(需与上方一致)
|
||||
|
||||
# ===================== AI能力配置 =====================
|
||||
ai:
|
||||
openai:
|
||||
user-limit-count: 1 # 单个用户限流:单位时间内最大请求数
|
||||
user-limit-time: 3s # 单个用户限流时间窗口(s=秒/m=分/h=时)
|
||||
total-limit-count: 500 # 全局限流:单位时间内最大请求数
|
||||
total-limit-time: 1m # 全局限流时间窗口
|
||||
|
||||
# ===================== MyBatis Plus配置 =====================
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml # Mapper XML文件扫描路径(多路径用,分割)
|
||||
type-aliases-package: jnpf.**.entity,ssw.**.entity # 实体类别名包(简化XML中的类名)
|
||||
# 全局配置
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: assign_id # 主键策略:assign_id=雪花算法生成ID
|
||||
# 逻辑删除配置(按需启用)
|
||||
# logic-delete-field: deleteMark # 逻辑删除字段名
|
||||
# logic-not-delete-value: "null" # 未删除值
|
||||
# logic-delete-value: "1" # 已删除值
|
||||
configuration:
|
||||
call-setters-on-nulls: true # 查询结果为空时,仍调用SET方法设置NULL(避免空指针)
|
||||
jdbc-type-for-null: 'NULL' # 空值对应的JDBC类型
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # SQL日志实现类(Slf4j)
|
||||
|
||||
|
||||
# ===================== SpringDoc/Swagger接口文档配置 =====================
|
||||
# 访问地址:http://127.0.0.1:30000/doc.html
|
||||
springdoc:
|
||||
default-flat-param-object: true # 扁平化参数对象(便于前端调试)
|
||||
api-docs:
|
||||
enabled: true # 启用OpenAPI文档
|
||||
# version: openapi_3_0 # 输出OpenAPI 3.0版本(兼容旧版Swagger)
|
||||
|
||||
# ===================== Knife4j增强配置(可选) =====================
|
||||
# knife4j:
|
||||
# enable: true # 启用Knife4j,提供更友好的Swagger UI
|
||||
# basic: # 接口文档访问鉴权(生产建议开启)
|
||||
# enable: true
|
||||
# username: jnpf # 登录账号
|
||||
# password: 123456 # 登录密码
|
||||
|
||||
# ===================== Lock4j分布式锁配置 =====================
|
||||
lock4j:
|
||||
aop:
|
||||
enabled: false # 关闭Lock4j注解(开发环境无需分布式锁)
|
||||
|
||||
# ===================== 自定义业务配置 =====================
|
||||
config:
|
||||
TestVersion: false # 是否开启测试环境:true-测试特性开启,false-生产模式
|
||||
ocrUrl: http://192.168.10.12:10888 # OCR服务访问地址(图文识别)
|
||||
sharding-sphere-enabled: false # 是否启用分库分表(Apache ShardingSphere)
|
||||
|
||||
# ===================== 文件存储配置 =====================
|
||||
file-storage:
|
||||
default-platform: local-plus-1 # 默认存储平台(对应下方platform值)
|
||||
thumbnail-suffix: ".thumb.jpg" # 缩略图后缀(如:.min.png)
|
||||
|
||||
# 1. 本地存储升级版(开发环境默认启用)
|
||||
local-plus:
|
||||
- platform: local-plus-1 # 存储平台标识(唯一)
|
||||
enable-storage: true # 启用该存储平台
|
||||
enable-access: true # 启用应用内访问(生产建议用Nginx代理)
|
||||
domain: "" # 访问域名(本地存储建议留空,使用相对路径)
|
||||
base-path: /Users/xs/Desktop/6.2/resources/ # 文件存储根路径
|
||||
path-patterns: /** # 访问路径匹配规则
|
||||
storage-path: # 子路径(留空则存储到base-path根目录)
|
||||
|
||||
# 2. 阿里云OSS(按需启用)
|
||||
aliyun-oss:
|
||||
- platform: aliyun-oss-1 # 存储平台标识
|
||||
enable-storage: false # 禁用(启用需填写access-key/secret-key等)
|
||||
access-key: ?? # AccessKey ID(替换为实际值)
|
||||
secret-key: ?? # AccessKey Secret(替换为实际值)
|
||||
end-point: ?? # OSS地域节点地址
|
||||
bucket-name: ?? # Bucket名称
|
||||
domain: ?? # 访问域名(需以/结尾,如https://abc.oss-cn-shanghai.aliyuncs.com/)
|
||||
base-path: hy/ # 存储基础路径(Bucket内的子目录)
|
||||
|
||||
# 3. 七牛云Kodo(按需启用)
|
||||
qiniu-kodo:
|
||||
- platform: qiniu-kodo-1
|
||||
enable-storage: false
|
||||
access-key: ?? # AccessKey
|
||||
secret-key: ?? # SecretKey
|
||||
bucket-name: ?? # 存储空间名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: base/ # 存储基础路径
|
||||
|
||||
# 4. 腾讯云COS(按需启用)
|
||||
tencent-cos:
|
||||
- platform: tencent-cos-1
|
||||
enable-storage: false
|
||||
secret-id: ?? # SecretId
|
||||
secret-key: ?? # SecretKey
|
||||
region: ?? # 存储桶地域(如ap-nanjing)
|
||||
bucket-name: ?? # 存储桶名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: hy/ # 存储基础路径
|
||||
|
||||
# 5. MinIO(兼容AWS S3协议,按需启用)
|
||||
minio:
|
||||
- platform: minio-1
|
||||
enable-storage: true # 启用MinIO(开发环境测试用)
|
||||
access-key: 9Y3sjaDWgbxKjXjm # AccessKey
|
||||
secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc # SecretKey
|
||||
end-point: http://192.168.0.207:9000/ # MinIO服务地址(需以/结尾)
|
||||
bucket-name: v350 # Bucket名称
|
||||
domain: ${config.file-storage.minio[0].end-point} # 访问域名(复用服务地址)
|
||||
base-path: # 存储基础路径(留空则根目录)
|
||||
|
||||
# ===================== 第三方登录配置 =====================
|
||||
socials:
|
||||
socials-enabled: false # 第三方登录功能开关(false-关闭,true-开启)
|
||||
config:
|
||||
- # 引迈统一身份认证
|
||||
provider: ymsso # 引迈统一身份认证登录
|
||||
client-id: 768085549729714693 # 应用ID
|
||||
domain-prefix: http://127.0.0.1:33000 # 引迈统一身份认证接口地址
|
||||
client-secret: 8999753b453f430c8851b658c4ca507f # 应用Secret
|
||||
- # 微信
|
||||
provider: wechat_open # 微信开放平台登录
|
||||
client-id: your-client-id # 应用ID(替换为实际值)
|
||||
client-secret: your-client-secret # 应用密钥(替换为实际值)
|
||||
- # 企业微信
|
||||
provider: wechat_enterprise # 企业微信登录
|
||||
client-id: your-client-id # 企业微信CorpID
|
||||
client-secret: your-client-secret # 应用Secret
|
||||
agentId: your-agentId # 应用AgentID
|
||||
- # 钉钉
|
||||
provider: dingtalk # 钉钉登录
|
||||
client-id: your-client-id # 钉钉应用ID
|
||||
client-secret: your-client-secret # 钉钉应用密钥
|
||||
agentId: your-agentId # 钉钉应用AgentID
|
||||
- # 飞书
|
||||
provider: feishu # 飞书登录
|
||||
client-id: your-client-id # 飞书应用ID
|
||||
client-secret: your-client-secret # 飞书应用密钥
|
||||
- # 小程序
|
||||
provider: wechat_applets # 微信小程序登录
|
||||
client-id: your-client-id # 小程序AppID
|
||||
client-secret: your-client-secret # 小程序AppSecret
|
||||
|
||||
# ===================== XXL-Job任务调度配置 =====================
|
||||
xxl:
|
||||
job:
|
||||
# 调度中心配置
|
||||
admin:
|
||||
accessToken: '432e62f3b488bc861d91b0e274e850cc' # 调度中心通信令牌(需与XXL-Job 后端配置一致)
|
||||
addresses: http://127.0.0.1:158/xxl-job-admin/ # 调度中心地址
|
||||
timeout: 3 # 连接超时时间(秒)
|
||||
# 调度中心地址
|
||||
executor:
|
||||
address: '' # 执行器地址(自动注册时留空)
|
||||
appname: xxl-job-executor-custom # 执行器名称(需与调度中心配置一致)
|
||||
ip: '' # 执行器IP(自动获取时留空)
|
||||
port: 39999 # 执行器端口
|
||||
logpath: /data/applogs/xxl-job/jobhandler # 日志存储路径
|
||||
logretentiondays: 30 # 日志保留天数
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 Start =====================
|
||||
jnpf:
|
||||
sso:
|
||||
# 单点登录-用户信息拉取配置
|
||||
connector:
|
||||
enabled: false # 关闭用户信息拉取
|
||||
# 单点登录-用户信息推送配置
|
||||
pull:
|
||||
enabled: false # 关闭用户信息推送
|
||||
create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 关闭用户信息推送
|
||||
replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 更新用户接口
|
||||
change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword # 修改密码接口
|
||||
delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 删除用户接口
|
||||
credential-type: Basic # 认证类型
|
||||
user-name: 747887288041603072 # 认证账号
|
||||
password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 认证密码
|
||||
|
||||
oauth:
|
||||
ssoEnabled: false # 是否启用单点登录
|
||||
ticketTimeout: 120 # 轮询票据有效期
|
||||
defaultSSO: cas # 默认SSO协议(cas/auth2)
|
||||
loginPath: http://127.0.0.1:30000/api/oauth/Login # 后端登录接口地址
|
||||
# JWT配置(按需启用)
|
||||
# login:
|
||||
# jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d # JWT秘钥
|
||||
sso:
|
||||
baseUrl: http://127.0.0.1:8527 # SSO系统地址
|
||||
sucessFrontUrl: http://127.0.0.1:3000/sso # 登录成功后前端跳转地址
|
||||
ticketOutMessage: false # 错误信息是否输出到页面
|
||||
# logoutFrontUrl: http://sso.maxkey.top:8527/maxkey # 退出登录跳转地址
|
||||
# ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout # 单点注销接口(触发全应用退出)
|
||||
|
||||
# OAuth2协议配置
|
||||
auth2:
|
||||
enabled: true # 启用OAuth2协议
|
||||
clientId: 747887288041603072 # 客户端ID
|
||||
clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 客户端秘钥
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize # 授权地址
|
||||
accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token # 获取Token地址
|
||||
userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me # 获取用户信息地址
|
||||
|
||||
# CAS协议配置
|
||||
cas:
|
||||
enabled: true # 启用CAS协议
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login # CAS登录地址
|
||||
serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas # CAS票据验证地址
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 End =====================
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-Start =====================
|
||||
#oauth:
|
||||
# #启用单点登录, 普通登录不可用
|
||||
# ssoEnabled: false
|
||||
# #jnpf单点登录
|
||||
# jnpfSso: true
|
||||
# #轮询票据有效期
|
||||
# ticketTimeout: 120
|
||||
# #默认单点登录协议
|
||||
# defaultSSO: auth2
|
||||
# #后端登录接口地址
|
||||
# loginPath: http://127.0.0.1:30000/api/oauth/Login
|
||||
# #login:
|
||||
# #JWT生成秘钥 不填写为默认值
|
||||
# #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d
|
||||
# sso:
|
||||
# #单点登录系统地址
|
||||
# baseUrl: http://127.0.0.1:33000
|
||||
# #登录成功后跳转到前端的页面
|
||||
# sucessFrontUrl: http://127.0.0.1:3000/sso
|
||||
# #错误信息是否输出到页面
|
||||
# ticketOutMessage: false
|
||||
# auth2:
|
||||
# enabled: true
|
||||
# clientId: 768085549729714693
|
||||
# clientSecret: 8999753b453f430c8851b658c4ca507f
|
||||
# baseUrl: ${oauth.sso.baseUrl}
|
||||
# authorizeUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/authorize
|
||||
# accessTokenUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/token
|
||||
# userInfoUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/me
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-End =====================
|
||||
@@ -1,422 +0,0 @@
|
||||
# ==============================================================================
|
||||
# 预生产环境配置文件(application-preview.yml)
|
||||
# 用途:该文件为预生产环境专属配置,包含服务器、数据源、缓存、消息队列、SSO、任务调度等核心配置
|
||||
# ==============================================================================
|
||||
|
||||
# ===================== 服务器基础配置 =====================
|
||||
server:
|
||||
tomcat:
|
||||
uri-encoding: UTF-8 # Tomcat请求URI编码,统一UTF-8避免中文乱码
|
||||
max-part-count: 1000 # 单个请求最大文件上传分片数,防止超大文件上传超限
|
||||
port: 30000 # tomcat监听端口,避免端口冲突
|
||||
|
||||
# ===================== Spring 核心配置 =====================
|
||||
spring:
|
||||
# 国际化消息配置
|
||||
messages:
|
||||
basename: i18n/message # 国际化消息文件基础路径(classpath下i18n目录的message_*.properties)
|
||||
cache-duration: 24H # 消息缓存有效期,开发环境24小时刷新一次,生产可适当延长
|
||||
|
||||
# Spring开发者工具(热部署)
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true # 热部署开关:开发环境开启,修改代码无需重启应用
|
||||
freemarker:
|
||||
cache: false # 关闭freemarker模板缓存,开发环境实时生效模板修改
|
||||
|
||||
# Thymeleaf模板引擎配置
|
||||
thymeleaf:
|
||||
cache: false # 关闭模板缓存,开发环境实时生效页面修改
|
||||
|
||||
# 虚拟线程配置(Spring 6+特性)
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true # 开启虚拟线程,提升高并发场景下的性能
|
||||
|
||||
# ===================== 数据源配置 =====================
|
||||
# 排除Druid自动配置,手动精细化配置连接池
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
db-type: MySQL # 数据库类型(可选值:MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL)
|
||||
host: 127.0.0.1 # 数据库服务器地址
|
||||
port: 3306 # 数据库端口
|
||||
username: root # 数据库登录账号
|
||||
password: 123456 # 数据库密码
|
||||
db-name: jnpf_init # 数据库名
|
||||
db-schema: # 金仓/达梦数据库需指定schema,其他数据库留空
|
||||
prepare-url: # 自定义JDBC URL,优先级高于自动拼接
|
||||
|
||||
# ===================== 动态多数据源配置 =====================
|
||||
dynamic:
|
||||
primary: master # 默认数据源/数据源组名称
|
||||
strict: true # 严格匹配数据源:true-未匹配到抛异常,false-降级使用默认数据源
|
||||
druid:
|
||||
# Druid连接池核心配置
|
||||
test-while-idle: true # 空闲时检测连接有效性,防止无效连接
|
||||
time-between-eviction-runs-millis: 60000 # 连接检测间隔(毫秒)
|
||||
max-wait: 3000 # 获取连接最大等待时间(毫秒),超时抛异常
|
||||
initial-size: 4 # 初始化连接数
|
||||
max-active: 20 # 最大活跃连接数(生产需根据业务调整)
|
||||
min-idle: 4 # 最小空闲连接数
|
||||
keep-alive: true # 开启空闲连接保活,防止数据库主动断开连接
|
||||
# 网络超时配置
|
||||
connect-timeout: 10000 # 连接建立超时(毫秒)
|
||||
socket-timeout: 10000 # 数据传输超时(毫秒)
|
||||
query-timeout: 90000 # SQL查询超时(毫秒)
|
||||
transaction-query-timeout: 90000 # 事务内查询超时(毫秒)
|
||||
# 数据库编码转换(按需启用,解决乱码问题)
|
||||
# proxy-filters: druidEncodingFilter
|
||||
# connection-properties:
|
||||
# clientEncoding: GB2312
|
||||
# serverEncoding: windows-1252
|
||||
|
||||
# SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
# filters: slf4j # SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
slf4j:
|
||||
statementLogEnabled: true # 打印SQL执行语句
|
||||
resultSetLogEnabled: false # 关闭结果集日志(减少日志量)
|
||||
connectionLogEnabled: false # 关闭连接日志
|
||||
dataSourceLogEnabled: false # 关闭数据源日志
|
||||
statementCreateAfterLogEnabled: false # 关闭语句创建日志
|
||||
statementCloseAfterLogEnabled: false # 关闭语句关闭日志
|
||||
statementExecuteAfterLogEnabled: false # 关闭语句执行后日志
|
||||
statementExecutableSqlLogEnable: true # 打印替换参数后的完整可执行SQL
|
||||
statementPrepareAfterLogEnabled: false # 关闭语句预编译日志
|
||||
statementPrepareCallAfterLogEnabled: false # 关闭存储过程调用日志
|
||||
statementParameterSetLogEnabled: false # 关闭参数设置日志
|
||||
|
||||
# 多数据源节点配置(示例,按需启用)
|
||||
|
||||
# datasource:
|
||||
# master:
|
||||
# url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
# username: ${spring.datasource.username}
|
||||
# password: ${spring.datasource.password}
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# ===================== Redis配置(Redisson客户端) =====================
|
||||
redis:
|
||||
# 1. Redis单机模式(开发环境默认启用)
|
||||
redisson:
|
||||
config: |
|
||||
singleServerConfig:
|
||||
database: 1 # Redis数据库编号(0-15)
|
||||
address: "redis://127.0.0.1:6379" # Redis节点地址
|
||||
password: "123456" # Redis密码
|
||||
timeout: 10000 # 读取超时(毫秒)
|
||||
connectTimeout: 10000 # 连接超时(毫秒)
|
||||
connectionMinimumIdleSize: 24 # 最小空闲连接数
|
||||
connectionPoolSize: 64 # 最大连接池大小
|
||||
threads: 4 # Redisson业务线程数
|
||||
nettyThreads: 8 # Netty IO线程数
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {} # 序列化方式:JSON
|
||||
|
||||
# 2. Redis分片集群模式(按需启用,注释单机模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# clusterServersConfig:
|
||||
# nodeAddresses: # 集群节点列表(至少填1个,建议多填容错)
|
||||
# - "redis://127.0.0.1:7000"
|
||||
# - "redis://127.0.0.1:7001"
|
||||
# - "redis://127.0.0.1:7002"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24 # 主库最小空闲连接
|
||||
# masterConnectionPoolSize: 64 # 主库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
# 3. Redis主从模式(按需启用,注释其他模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# masterSlaveServersConfig:
|
||||
# database: 1
|
||||
# masterAddress: "redis://192.168.8.199:6379" # 主库地址
|
||||
# slaveAddresses: # 从库列表
|
||||
# - "redis://192.168.8.199:6380"
|
||||
# - "redis://192.168.8.199:6381"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24
|
||||
# masterConnectionPoolSize: 64
|
||||
# slaveConnectionMinimumIdleSize: 24 # 从库最小空闲连接
|
||||
# slaveConnectionPoolSize: 64 # 从库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
|
||||
# ===================== 单点登录(用户信息同步) - 消息队列配置 =====================
|
||||
cloud:
|
||||
stream:
|
||||
# RocketMQ配置(默认启用)
|
||||
rocketmq:
|
||||
binder:
|
||||
name-server: 192.168.10.6:30094
|
||||
group: maxkey_identity
|
||||
# RabbitMQ配置(按需启用,注释RocketMQ后开启)
|
||||
# binders:
|
||||
# defaultRabbit: # 绑定器名称
|
||||
# type: rabbit # 消息组件类型
|
||||
# environment:
|
||||
# spring:
|
||||
# rabbitmq:
|
||||
# host: 192.168.10.6 # RabbitMQ地址
|
||||
# port: 5672 # RabbitMQ端口
|
||||
# username: rabbitmq # 登录账号
|
||||
# password: rabbitmq # 登录密码
|
||||
# Kafka配置(按需启用,注释其他MQ后开启)
|
||||
# kafka:
|
||||
# binder:
|
||||
# brokers: 192.168.10.6:9092 # Kafka broker地址
|
||||
# 消息消费绑定配置
|
||||
bindings:
|
||||
ssoEventReceiver-in-0:
|
||||
content-type: text/json # 消息格式:JSON
|
||||
destination: MXK_IDENTITY_MAIN_TOPIC # 消息主题
|
||||
group: maxkey_identity # 消费组(需与上方一致)
|
||||
|
||||
# ===================== AI能力配置 =====================
|
||||
ai:
|
||||
openai:
|
||||
user-limit-count: 1 # 单个用户限流:单位时间内最大请求数
|
||||
user-limit-time: 3s # 单个用户限流时间窗口(s=秒/m=分/h=时)
|
||||
total-limit-count: 500 # 全局限流:单位时间内最大请求数
|
||||
total-limit-time: 1m # 全局限流时间窗口
|
||||
|
||||
# ===================== MyBatis Plus配置 =====================
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml # Mapper XML文件扫描路径(多路径用,分割)
|
||||
type-aliases-package: jnpf.**.entity,ssw.**.entity # 实体类别名包(简化XML中的类名)
|
||||
# 全局配置
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: assign_id # 主键策略:assign_id=雪花算法生成ID
|
||||
# 逻辑删除配置(按需启用)
|
||||
# logic-delete-field: deleteMark # 逻辑删除字段名
|
||||
# logic-not-delete-value: "null" # 未删除值
|
||||
# logic-delete-value: "1" # 已删除值
|
||||
configuration:
|
||||
call-setters-on-nulls: true # 查询结果为空时,仍调用SET方法设置NULL(避免空指针)
|
||||
jdbc-type-for-null: 'NULL' # 空值对应的JDBC类型
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # SQL日志实现类(Slf4j)
|
||||
|
||||
|
||||
# ===================== SpringDoc/Swagger接口文档配置 =====================
|
||||
# 访问地址:http://127.0.0.1:30000/doc.html
|
||||
springdoc:
|
||||
default-flat-param-object: true # 扁平化参数对象(便于前端调试)
|
||||
api-docs:
|
||||
enabled: true # 启用OpenAPI文档
|
||||
# version: openapi_3_0 # 输出OpenAPI 3.0版本(兼容旧版Swagger)
|
||||
|
||||
# ===================== Knife4j增强配置(可选) =====================
|
||||
# knife4j:
|
||||
# enable: true # 启用Knife4j,提供更友好的Swagger UI
|
||||
# basic: # 接口文档访问鉴权(生产建议开启)
|
||||
# enable: true
|
||||
# username: jnpf # 登录账号
|
||||
# password: 123456 # 登录密码
|
||||
|
||||
# ===================== Lock4j分布式锁配置 =====================
|
||||
lock4j:
|
||||
aop:
|
||||
enabled: false # 关闭Lock4j注解(开发环境无需分布式锁)
|
||||
|
||||
# ===================== 自定义业务配置 =====================
|
||||
config:
|
||||
TestVersion: false # 是否开启测试环境:true-测试特性开启,false-生产模式
|
||||
ocrUrl: http://192.168.10.12:10888 # OCR服务访问地址(图文识别)
|
||||
sharding-sphere-enabled: false # 是否启用分库分表(Apache ShardingSphere)
|
||||
|
||||
# ===================== 文件存储配置 =====================
|
||||
file-storage:
|
||||
default-platform: local-plus-1 # 默认存储平台(对应下方platform值)
|
||||
thumbnail-suffix: ".thumb.jpg" # 缩略图后缀(如:.min.png)
|
||||
|
||||
# 1. 本地存储升级版(开发环境默认启用)
|
||||
local-plus:
|
||||
- platform: local-plus-1 # 存储平台标识(唯一)
|
||||
enable-storage: true # 启用该存储平台
|
||||
enable-access: true # 启用应用内访问(生产建议用Nginx代理)
|
||||
domain: "" # 访问域名(本地存储建议留空,使用相对路径)
|
||||
base-path: D:/project/jnpf-resources/ # 文件存储根路径
|
||||
path-patterns: /** # 访问路径匹配规则
|
||||
storage-path: # 子路径(留空则存储到base-path根目录)
|
||||
|
||||
# 2. 阿里云OSS(按需启用)
|
||||
aliyun-oss:
|
||||
- platform: aliyun-oss-1 # 存储平台标识
|
||||
enable-storage: false # 禁用(启用需填写access-key/secret-key等)
|
||||
access-key: ?? # AccessKey ID(替换为实际值)
|
||||
secret-key: ?? # AccessKey Secret(替换为实际值)
|
||||
end-point: ?? # OSS地域节点地址
|
||||
bucket-name: ?? # Bucket名称
|
||||
domain: ?? # 访问域名(需以/结尾,如https://abc.oss-cn-shanghai.aliyuncs.com/)
|
||||
base-path: hy/ # 存储基础路径(Bucket内的子目录)
|
||||
|
||||
# 3. 七牛云Kodo(按需启用)
|
||||
qiniu-kodo:
|
||||
- platform: qiniu-kodo-1
|
||||
enable-storage: false
|
||||
access-key: ?? # AccessKey
|
||||
secret-key: ?? # SecretKey
|
||||
bucket-name: ?? # 存储空间名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: base/ # 存储基础路径
|
||||
|
||||
# 4. 腾讯云COS(按需启用)
|
||||
tencent-cos:
|
||||
- platform: tencent-cos-1
|
||||
enable-storage: false
|
||||
secret-id: ?? # SecretId
|
||||
secret-key: ?? # SecretKey
|
||||
region: ?? # 存储桶地域(如ap-nanjing)
|
||||
bucket-name: ?? # 存储桶名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: hy/ # 存储基础路径
|
||||
|
||||
# 5. MinIO(兼容AWS S3协议,按需启用)
|
||||
minio:
|
||||
- platform: minio-1
|
||||
enable-storage: true # 启用MinIO(开发环境测试用)
|
||||
access-key: 9Y3sjaDWgbxKjXjm # AccessKey
|
||||
secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc # SecretKey
|
||||
end-point: http://192.168.0.207:9000/ # MinIO服务地址(需以/结尾)
|
||||
bucket-name: v350 # Bucket名称
|
||||
domain: ${config.file-storage.minio[0].end-point} # 访问域名(复用服务地址)
|
||||
base-path: # 存储基础路径(留空则根目录)
|
||||
|
||||
# ===================== 第三方登录配置 =====================
|
||||
socials:
|
||||
socials-enabled: false # 第三方登录功能开关(false-关闭,true-开启)
|
||||
config:
|
||||
- # 引迈统一身份认证
|
||||
provider: ymsso # 引迈统一身份认证登录
|
||||
client-id: 768085549729714693 # 应用ID
|
||||
domain-prefix: http://127.0.0.1:33000 # 引迈统一身份认证接口地址
|
||||
client-secret: 8999753b453f430c8851b658c4ca507f # 应用Secret
|
||||
- # 微信
|
||||
provider: wechat_open # 微信开放平台登录
|
||||
client-id: your-client-id # 应用ID(替换为实际值)
|
||||
client-secret: your-client-secret # 应用密钥(替换为实际值)
|
||||
- # 企业微信
|
||||
provider: wechat_enterprise # 企业微信登录
|
||||
client-id: your-client-id # 企业微信CorpID
|
||||
client-secret: your-client-secret # 应用Secret
|
||||
agentId: your-agentId # 应用AgentID
|
||||
- # 钉钉
|
||||
provider: dingtalk # 钉钉登录
|
||||
client-id: your-client-id # 钉钉应用ID
|
||||
client-secret: your-client-secret # 钉钉应用密钥
|
||||
agentId: your-agentId # 钉钉应用AgentID
|
||||
- # 飞书
|
||||
provider: feishu # 飞书登录
|
||||
client-id: your-client-id # 飞书应用ID
|
||||
client-secret: your-client-secret # 飞书应用密钥
|
||||
- # 小程序
|
||||
provider: wechat_applets # 微信小程序登录
|
||||
client-id: your-client-id # 小程序AppID
|
||||
client-secret: your-client-secret # 小程序AppSecret
|
||||
|
||||
# ===================== XXL-Job任务调度配置 =====================
|
||||
xxl:
|
||||
job:
|
||||
# 调度中心配置
|
||||
admin:
|
||||
accessToken: '432e62f3b488bc861d91b0e274e850cc' # 调度中心通信令牌(需与XXL-Job 后端配置一致)
|
||||
addresses: http://127.0.0.1:30020/xxl-job-admin/ # 调度中心地址
|
||||
timeout: 3 # 连接超时时间(秒)
|
||||
# 调度中心地址
|
||||
executor:
|
||||
address: '' # 执行器地址(自动注册时留空)
|
||||
appname: xxl-job-executor-custom # 执行器名称(需与调度中心配置一致)
|
||||
ip: '' # 执行器IP(自动获取时留空)
|
||||
port: 39999 # 执行器端口
|
||||
logpath: /data/applogs/xxl-job/jobhandler # 日志存储路径
|
||||
logretentiondays: 30 # 日志保留天数
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 Start =====================
|
||||
jnpf:
|
||||
sso:
|
||||
# 单点登录-用户信息拉取配置
|
||||
connector:
|
||||
enabled: false # 关闭用户信息拉取
|
||||
# 单点登录-用户信息推送配置
|
||||
pull:
|
||||
enabled: false # 关闭用户信息推送
|
||||
create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 关闭用户信息推送
|
||||
replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 更新用户接口
|
||||
change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword # 修改密码接口
|
||||
delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 删除用户接口
|
||||
credential-type: Basic # 认证类型
|
||||
user-name: 747887288041603072 # 认证账号
|
||||
password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 认证密码
|
||||
|
||||
oauth:
|
||||
ssoEnabled: false # 是否启用单点登录
|
||||
ticketTimeout: 120 # 轮询票据有效期
|
||||
defaultSSO: cas # 默认SSO协议(cas/auth2)
|
||||
loginPath: http://127.0.0.1:30000/api/oauth/Login # 后端登录接口地址
|
||||
# JWT配置(按需启用)
|
||||
# login:
|
||||
# jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d # JWT秘钥
|
||||
sso:
|
||||
baseUrl: http://127.0.0.1:8527 # SSO系统地址
|
||||
sucessFrontUrl: http://127.0.0.1:3000/sso # 登录成功后前端跳转地址
|
||||
ticketOutMessage: false # 错误信息是否输出到页面
|
||||
# logoutFrontUrl: http://sso.maxkey.top:8527/maxkey # 退出登录跳转地址
|
||||
# ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout # 单点注销接口(触发全应用退出)
|
||||
|
||||
# OAuth2协议配置
|
||||
auth2:
|
||||
enabled: true # 启用OAuth2协议
|
||||
clientId: 747887288041603072 # 客户端ID
|
||||
clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 客户端秘钥
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize # 授权地址
|
||||
accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token # 获取Token地址
|
||||
userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me # 获取用户信息地址
|
||||
|
||||
# CAS协议配置
|
||||
cas:
|
||||
enabled: true # 启用CAS协议
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login # CAS登录地址
|
||||
serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas # CAS票据验证地址
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 End =====================
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-Start =====================
|
||||
#oauth:
|
||||
# #启用单点登录, 普通登录不可用
|
||||
# ssoEnabled: false
|
||||
# #jnpf单点登录
|
||||
# jnpfSso: true
|
||||
# #轮询票据有效期
|
||||
# ticketTimeout: 120
|
||||
# #默认单点登录协议
|
||||
# defaultSSO: auth2
|
||||
# #后端登录接口地址
|
||||
# loginPath: http://127.0.0.1:30000/api/oauth/Login
|
||||
# #login:
|
||||
# #JWT生成秘钥 不填写为默认值
|
||||
# #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d
|
||||
# sso:
|
||||
# #单点登录系统地址
|
||||
# baseUrl: http://127.0.0.1:33000
|
||||
# #登录成功后跳转到前端的页面
|
||||
# sucessFrontUrl: http://127.0.0.1:3000/sso
|
||||
# #错误信息是否输出到页面
|
||||
# ticketOutMessage: false
|
||||
# auth2:
|
||||
# enabled: true
|
||||
# clientId: 768085549729714693
|
||||
# clientSecret: 8999753b453f430c8851b658c4ca507f
|
||||
# baseUrl: ${oauth.sso.baseUrl}
|
||||
# authorizeUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/authorize
|
||||
# accessTokenUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/token
|
||||
# userInfoUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/me
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-End =====================
|
||||
@@ -1,423 +0,0 @@
|
||||
# ==============================================================================
|
||||
# 生产环境配置文件(application-prod.yml)
|
||||
# 用途:该文件为生产环境专属配置,包含服务器、数据源、缓存、消息队列、SSO、任务调度等核心配置
|
||||
# ==============================================================================
|
||||
|
||||
# ===================== 服务器基础配置 =====================
|
||||
server:
|
||||
tomcat:
|
||||
uri-encoding: UTF-8 # Tomcat请求URI编码,统一UTF-8避免中文乱码
|
||||
max-part-count: 1000 # 单个请求最大文件上传分片数,防止超大文件上传超限
|
||||
port: 30000 # tomcat监听端口,避免端口冲突
|
||||
|
||||
# ===================== Spring 核心配置 =====================
|
||||
spring:
|
||||
# 国际化消息配置
|
||||
messages:
|
||||
basename: i18n/message # 国际化消息文件基础路径(classpath下i18n目录的message_*.properties)
|
||||
cache-duration: 24H # 消息缓存有效期,开发环境24小时刷新一次,生产可适当延长
|
||||
|
||||
# Spring开发者工具(热部署)
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true # 热部署开关:开发环境开启,修改代码无需重启应用
|
||||
freemarker:
|
||||
cache: false # 关闭freemarker模板缓存,开发环境实时生效模板修改
|
||||
|
||||
# Thymeleaf模板引擎配置
|
||||
thymeleaf:
|
||||
cache: false # 关闭模板缓存,开发环境实时生效页面修改
|
||||
|
||||
# 虚拟线程配置(Spring 6+特性)
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true # 开启虚拟线程,提升高并发场景下的性能
|
||||
|
||||
# ===================== 数据源配置 =====================
|
||||
# 排除Druid自动配置,手动精细化配置连接池
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
db-type: MySQL # 数据库类型(可选值:MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL)
|
||||
host: 127.0.0.1 # 数据库服务器地址
|
||||
port: 3306 # 数据库端口
|
||||
username: root # 数据库登录账号
|
||||
password: 123456 # 数据库密码
|
||||
db-name: jnpf_init # 数据库名
|
||||
db-schema: # 金仓/达梦数据库需指定schema,其他数据库留空
|
||||
prepare-url: # 自定义JDBC URL,优先级高于自动拼接
|
||||
|
||||
# ===================== 动态多数据源配置 =====================
|
||||
dynamic:
|
||||
primary: master # 默认数据源/数据源组名称
|
||||
strict: true # 严格匹配数据源:true-未匹配到抛异常,false-降级使用默认数据源
|
||||
druid:
|
||||
# Druid连接池核心配置
|
||||
test-while-idle: true # 空闲时检测连接有效性,防止无效连接
|
||||
time-between-eviction-runs-millis: 60000 # 连接检测间隔(毫秒)
|
||||
max-wait: 3000 # 获取连接最大等待时间(毫秒),超时抛异常
|
||||
initial-size: 4 # 初始化连接数
|
||||
max-active: 20 # 最大活跃连接数(生产需根据业务调整)
|
||||
min-idle: 4 # 最小空闲连接数
|
||||
keep-alive: true # 开启空闲连接保活,防止数据库主动断开连接
|
||||
# 网络超时配置
|
||||
connect-timeout: 10000 # 连接建立超时(毫秒)
|
||||
socket-timeout: 10000 # 数据传输超时(毫秒)
|
||||
query-timeout: 90000 # SQL查询超时(毫秒)
|
||||
transaction-query-timeout: 90000 # 事务内查询超时(毫秒)
|
||||
# 数据库编码转换(按需启用,解决乱码问题)
|
||||
# proxy-filters: druidEncodingFilter
|
||||
# connection-properties:
|
||||
# clientEncoding: GB2312
|
||||
# serverEncoding: windows-1252
|
||||
|
||||
# SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
# filters: slf4j # SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
slf4j:
|
||||
statementLogEnabled: true # 打印SQL执行语句
|
||||
resultSetLogEnabled: false # 关闭结果集日志(减少日志量)
|
||||
connectionLogEnabled: false # 关闭连接日志
|
||||
dataSourceLogEnabled: false # 关闭数据源日志
|
||||
statementCreateAfterLogEnabled: false # 关闭语句创建日志
|
||||
statementCloseAfterLogEnabled: false # 关闭语句关闭日志
|
||||
statementExecuteAfterLogEnabled: false # 关闭语句执行后日志
|
||||
statementExecutableSqlLogEnable: true # 打印替换参数后的完整可执行SQL
|
||||
statementPrepareAfterLogEnabled: false # 关闭语句预编译日志
|
||||
statementPrepareCallAfterLogEnabled: false # 关闭存储过程调用日志
|
||||
statementParameterSetLogEnabled: false # 关闭参数设置日志
|
||||
|
||||
# 多数据源节点配置(示例,按需启用)
|
||||
|
||||
# datasource:
|
||||
# master:
|
||||
# url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
# username: ${spring.datasource.username}
|
||||
# password: ${spring.datasource.password}
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# ===================== Redis配置(Redisson客户端) =====================
|
||||
redis:
|
||||
# 1. Redis单机模式(开发环境默认启用)
|
||||
redisson:
|
||||
config: |
|
||||
singleServerConfig:
|
||||
database: 1 # Redis数据库编号(0-15)
|
||||
address: "redis://127.0.0.1:6379" # Redis节点地址
|
||||
password: "123456" # Redis密码
|
||||
timeout: 10000 # 读取超时(毫秒)
|
||||
connectTimeout: 10000 # 连接超时(毫秒)
|
||||
connectionMinimumIdleSize: 24 # 最小空闲连接数
|
||||
connectionPoolSize: 64 # 最大连接池大小
|
||||
threads: 4 # Redisson业务线程数
|
||||
nettyThreads: 8 # Netty IO线程数
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {} # 序列化方式:JSON
|
||||
|
||||
# 2. Redis分片集群模式(按需启用,注释单机模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# clusterServersConfig:
|
||||
# nodeAddresses: # 集群节点列表(至少填1个,建议多填容错)
|
||||
# - "redis://127.0.0.1:7000"
|
||||
# - "redis://127.0.0.1:7001"
|
||||
# - "redis://127.0.0.1:7002"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24 # 主库最小空闲连接
|
||||
# masterConnectionPoolSize: 64 # 主库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
# 3. Redis主从模式(按需启用,注释其他模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# masterSlaveServersConfig:
|
||||
# database: 1
|
||||
# masterAddress: "redis://192.168.8.199:6379" # 主库地址
|
||||
# slaveAddresses: # 从库列表
|
||||
# - "redis://192.168.8.199:6380"
|
||||
# - "redis://192.168.8.199:6381"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24
|
||||
# masterConnectionPoolSize: 64
|
||||
# slaveConnectionMinimumIdleSize: 24 # 从库最小空闲连接
|
||||
# slaveConnectionPoolSize: 64 # 从库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
|
||||
# ===================== 单点登录(用户信息同步) - 消息队列配置 =====================
|
||||
cloud:
|
||||
stream:
|
||||
# RocketMQ配置(默认启用)
|
||||
rocketmq:
|
||||
binder:
|
||||
name-server: 192.168.10.6:30094
|
||||
group: maxkey_identity
|
||||
# RabbitMQ配置(按需启用,注释RocketMQ后开启)
|
||||
# binders:
|
||||
# defaultRabbit: # 绑定器名称
|
||||
# type: rabbit # 消息组件类型
|
||||
# environment:
|
||||
# spring:
|
||||
# rabbitmq:
|
||||
# host: 192.168.10.6 # RabbitMQ地址
|
||||
# port: 5672 # RabbitMQ端口
|
||||
# username: rabbitmq # 登录账号
|
||||
# password: rabbitmq # 登录密码
|
||||
# Kafka配置(按需启用,注释其他MQ后开启)
|
||||
# kafka:
|
||||
# binder:
|
||||
# brokers: 192.168.10.6:9092 # Kafka broker地址
|
||||
# 消息消费绑定配置
|
||||
bindings:
|
||||
ssoEventReceiver-in-0:
|
||||
content-type: text/json # 消息格式:JSON
|
||||
destination: MXK_IDENTITY_MAIN_TOPIC # 消息主题
|
||||
group: maxkey_identity # 消费组(需与上方一致)
|
||||
|
||||
# ===================== AI能力配置 =====================
|
||||
ai:
|
||||
openai:
|
||||
user-limit-count: 1 # 单个用户限流:单位时间内最大请求数
|
||||
user-limit-time: 3s # 单个用户限流时间窗口(s=秒/m=分/h=时)
|
||||
total-limit-count: 500 # 全局限流:单位时间内最大请求数
|
||||
total-limit-time: 1m # 全局限流时间窗口
|
||||
|
||||
# ===================== MyBatis Plus配置 =====================
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml # Mapper XML文件扫描路径(多路径用,分割)
|
||||
type-aliases-package: jnpf.**.entity,ssw.**.entity # 实体类别名包(简化XML中的类名)
|
||||
# 全局配置
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: assign_id # 主键策略:assign_id=雪花算法生成ID
|
||||
# 逻辑删除配置(按需启用)
|
||||
# logic-delete-field: deleteMark # 逻辑删除字段名
|
||||
# logic-not-delete-value: "null" # 未删除值
|
||||
# logic-delete-value: "1" # 已删除值
|
||||
configuration:
|
||||
call-setters-on-nulls: true # 查询结果为空时,仍调用SET方法设置NULL(避免空指针)
|
||||
jdbc-type-for-null: 'NULL' # 空值对应的JDBC类型
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # SQL日志实现类(Slf4j)
|
||||
|
||||
|
||||
# ===================== SpringDoc/Swagger接口文档配置 =====================
|
||||
# 访问地址:http://127.0.0.1:30000/doc.html
|
||||
springdoc:
|
||||
default-flat-param-object: true # 扁平化参数对象(便于前端调试)
|
||||
api-docs:
|
||||
enabled: true # 启用OpenAPI文档
|
||||
# version: openapi_3_0 # 输出OpenAPI 3.0版本(兼容旧版Swagger)
|
||||
|
||||
# ===================== Knife4j增强配置(可选) =====================
|
||||
# knife4j:
|
||||
# enable: true # 启用Knife4j,提供更友好的Swagger UI
|
||||
# basic: # 接口文档访问鉴权(生产建议开启)
|
||||
# enable: true
|
||||
# username: jnpf # 登录账号
|
||||
# password: 123456 # 登录密码
|
||||
|
||||
# ===================== Lock4j分布式锁配置 =====================
|
||||
lock4j:
|
||||
aop:
|
||||
enabled: false # 关闭Lock4j注解(开发环境无需分布式锁)
|
||||
|
||||
# ===================== 自定义业务配置 =====================
|
||||
config:
|
||||
TestVersion: false # 是否开启测试环境:true-测试特性开启,false-生产模式
|
||||
ocrUrl: http://192.168.10.12:10888 # OCR服务访问地址(图文识别)
|
||||
sharding-sphere-enabled: false # 是否启用分库分表(Apache ShardingSphere)
|
||||
|
||||
# ===================== 文件存储配置 =====================
|
||||
file-storage:
|
||||
default-platform: local-plus-1 # 默认存储平台(对应下方platform值)
|
||||
thumbnail-suffix: ".thumb.jpg" # 缩略图后缀(如:.min.png)
|
||||
|
||||
# 1. 本地存储升级版(开发环境默认启用)
|
||||
local-plus:
|
||||
- platform: local-plus-1 # 存储平台标识(唯一)
|
||||
enable-storage: true # 启用该存储平台
|
||||
enable-access: true # 启用应用内访问(生产建议用Nginx代理)
|
||||
domain: "" # 访问域名(本地存储建议留空,使用相对路径)
|
||||
base-path: D:/project/jnpf-resources/ # 文件存储根路径
|
||||
path-patterns: /** # 访问路径匹配规则
|
||||
storage-path: # 子路径(留空则存储到base-path根目录)
|
||||
|
||||
# 2. 阿里云OSS(按需启用)
|
||||
aliyun-oss:
|
||||
- platform: aliyun-oss-1 # 存储平台标识
|
||||
enable-storage: false # 禁用(启用需填写access-key/secret-key等)
|
||||
access-key: ?? # AccessKey ID(替换为实际值)
|
||||
secret-key: ?? # AccessKey Secret(替换为实际值)
|
||||
end-point: ?? # OSS地域节点地址
|
||||
bucket-name: ?? # Bucket名称
|
||||
domain: ?? # 访问域名(需以/结尾,如https://abc.oss-cn-shanghai.aliyuncs.com/)
|
||||
base-path: hy/ # 存储基础路径(Bucket内的子目录)
|
||||
|
||||
# 3. 七牛云Kodo(按需启用)
|
||||
qiniu-kodo:
|
||||
- platform: qiniu-kodo-1
|
||||
enable-storage: false
|
||||
access-key: ?? # AccessKey
|
||||
secret-key: ?? # SecretKey
|
||||
bucket-name: ?? # 存储空间名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: base/ # 存储基础路径
|
||||
|
||||
# 4. 腾讯云COS(按需启用)
|
||||
tencent-cos:
|
||||
- platform: tencent-cos-1
|
||||
enable-storage: false
|
||||
secret-id: ?? # SecretId
|
||||
secret-key: ?? # SecretKey
|
||||
region: ?? # 存储桶地域(如ap-nanjing)
|
||||
bucket-name: ?? # 存储桶名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: hy/ # 存储基础路径
|
||||
|
||||
# 5. MinIO(兼容AWS S3协议,按需启用)
|
||||
minio:
|
||||
- platform: minio-1
|
||||
enable-storage: true # 启用MinIO(开发环境测试用)
|
||||
access-key: 9Y3sjaDWgbxKjXjm # AccessKey
|
||||
secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc # SecretKey
|
||||
end-point: http://192.168.0.207:9000/ # MinIO服务地址(需以/结尾)
|
||||
bucket-name: v350 # Bucket名称
|
||||
domain: ${config.file-storage.minio[0].end-point} # 访问域名(复用服务地址)
|
||||
base-path: # 存储基础路径(留空则根目录)
|
||||
|
||||
# ===================== 第三方登录配置 =====================
|
||||
socials:
|
||||
socials-enabled: false # 第三方登录功能开关(false-关闭,true-开启)
|
||||
config:
|
||||
- # 引迈统一身份认证
|
||||
provider: ymsso # 引迈统一身份认证登录
|
||||
client-id: 768085549729714693 # 应用ID
|
||||
domain-prefix: http://127.0.0.1:33000 # 引迈统一身份认证接口地址
|
||||
client-secret: 8999753b453f430c8851b658c4ca507f # 应用Secret
|
||||
- # 微信
|
||||
provider: wechat_open # 微信开放平台登录
|
||||
client-id: your-client-id # 应用ID(替换为实际值)
|
||||
client-secret: your-client-secret # 应用密钥(替换为实际值)
|
||||
- # 企业微信
|
||||
provider: wechat_enterprise # 企业微信登录
|
||||
client-id: your-client-id # 企业微信CorpID
|
||||
client-secret: your-client-secret # 应用Secret
|
||||
agentId: your-agentId # 应用AgentID
|
||||
- # 钉钉
|
||||
provider: dingtalk # 钉钉登录
|
||||
client-id: your-client-id # 钉钉应用ID
|
||||
client-secret: your-client-secret # 钉钉应用密钥
|
||||
agentId: your-agentId # 钉钉应用AgentID
|
||||
- # 飞书
|
||||
provider: feishu # 飞书登录
|
||||
client-id: your-client-id # 飞书应用ID
|
||||
client-secret: your-client-secret # 飞书应用密钥
|
||||
- # 小程序
|
||||
provider: wechat_applets # 微信小程序登录
|
||||
client-id: your-client-id # 小程序AppID
|
||||
client-secret: your-client-secret # 小程序AppSecret
|
||||
|
||||
# ===================== XXL-Job任务调度配置 =====================
|
||||
xxl:
|
||||
job:
|
||||
# 调度中心配置
|
||||
admin:
|
||||
accessToken: '432e62f3b488bc861d91b0e274e850cc' # 调度中心通信令牌(需与XXL-Job 后端配置一致)
|
||||
addresses: http://127.0.0.1:30020/xxl-job-admin/ # 调度中心地址
|
||||
timeout: 3 # 连接超时时间(秒)
|
||||
# 调度中心地址
|
||||
executor:
|
||||
address: '' # 执行器地址(自动注册时留空)
|
||||
appname: xxl-job-executor-custom # 执行器名称(需与调度中心配置一致)
|
||||
ip: '' # 执行器IP(自动获取时留空)
|
||||
port: 39999 # 执行器端口
|
||||
logpath: /data/applogs/xxl-job/jobhandler # 日志存储路径
|
||||
logretentiondays: 30 # 日志保留天数
|
||||
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 Start =====================
|
||||
jnpf:
|
||||
sso:
|
||||
# 单点登录-用户信息拉取配置
|
||||
connector:
|
||||
enabled: false # 关闭用户信息拉取
|
||||
# 单点登录-用户信息推送配置
|
||||
pull:
|
||||
enabled: false # 关闭用户信息推送
|
||||
create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 关闭用户信息推送
|
||||
replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 更新用户接口
|
||||
change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword # 修改密码接口
|
||||
delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 删除用户接口
|
||||
credential-type: Basic # 认证类型
|
||||
user-name: 747887288041603072 # 认证账号
|
||||
password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 认证密码
|
||||
|
||||
oauth:
|
||||
ssoEnabled: false # 是否启用单点登录
|
||||
ticketTimeout: 120 # 轮询票据有效期
|
||||
defaultSSO: cas # 默认SSO协议(cas/auth2)
|
||||
loginPath: http://127.0.0.1:30000/api/oauth/Login # 后端登录接口地址
|
||||
# JWT配置(按需启用)
|
||||
# login:
|
||||
# jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d # JWT秘钥
|
||||
sso:
|
||||
baseUrl: http://127.0.0.1:8527 # SSO系统地址
|
||||
sucessFrontUrl: http://127.0.0.1:3000/sso # 登录成功后前端跳转地址
|
||||
ticketOutMessage: false # 错误信息是否输出到页面
|
||||
# logoutFrontUrl: http://sso.maxkey.top:8527/maxkey # 退出登录跳转地址
|
||||
# ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout # 单点注销接口(触发全应用退出)
|
||||
|
||||
# OAuth2协议配置
|
||||
auth2:
|
||||
enabled: true # 启用OAuth2协议
|
||||
clientId: 747887288041603072 # 客户端ID
|
||||
clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 客户端秘钥
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize # 授权地址
|
||||
accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token # 获取Token地址
|
||||
userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me # 获取用户信息地址
|
||||
|
||||
# CAS协议配置
|
||||
cas:
|
||||
enabled: true # 启用CAS协议
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login # CAS登录地址
|
||||
serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas # CAS票据验证地址
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 End =====================
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-Start =====================
|
||||
#oauth:
|
||||
# #启用单点登录, 普通登录不可用
|
||||
# ssoEnabled: false
|
||||
# #jnpf单点登录
|
||||
# jnpfSso: true
|
||||
# #轮询票据有效期
|
||||
# ticketTimeout: 120
|
||||
# #默认单点登录协议
|
||||
# defaultSSO: auth2
|
||||
# #后端登录接口地址
|
||||
# loginPath: http://127.0.0.1:30000/api/oauth/Login
|
||||
# #login:
|
||||
# #JWT生成秘钥 不填写为默认值
|
||||
# #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d
|
||||
# sso:
|
||||
# #单点登录系统地址
|
||||
# baseUrl: http://127.0.0.1:33000
|
||||
# #登录成功后跳转到前端的页面
|
||||
# sucessFrontUrl: http://127.0.0.1:3000/sso
|
||||
# #错误信息是否输出到页面
|
||||
# ticketOutMessage: false
|
||||
# auth2:
|
||||
# enabled: true
|
||||
# clientId: 768085549729714693
|
||||
# clientSecret: 8999753b453f430c8851b658c4ca507f
|
||||
# baseUrl: ${oauth.sso.baseUrl}
|
||||
# authorizeUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/authorize
|
||||
# accessTokenUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/token
|
||||
# userInfoUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/me
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-End =====================
|
||||
@@ -1,423 +0,0 @@
|
||||
# ==============================================================================
|
||||
# 测试环境配置文件(application-test.yml)
|
||||
# 用途:该文件为测试环境专属配置,包含服务器、数据源、缓存、消息队列、SSO、任务调度等核心配置
|
||||
# ==============================================================================
|
||||
|
||||
# ===================== 服务器基础配置 =====================
|
||||
server:
|
||||
tomcat:
|
||||
uri-encoding: UTF-8 # Tomcat请求URI编码,统一UTF-8避免中文乱码
|
||||
max-part-count: 1000 # 单个请求最大文件上传分片数,防止超大文件上传超限
|
||||
port: 30000 # tomcat监听端口,避免端口冲突
|
||||
|
||||
# ===================== Spring 核心配置 =====================
|
||||
spring:
|
||||
# 国际化消息配置
|
||||
messages:
|
||||
basename: i18n/message # 国际化消息文件基础路径(classpath下i18n目录的message_*.properties)
|
||||
cache-duration: 24H # 消息缓存有效期,开发环境24小时刷新一次,生产可适当延长
|
||||
|
||||
# Spring开发者工具(热部署)
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true # 热部署开关:开发环境开启,修改代码无需重启应用
|
||||
freemarker:
|
||||
cache: false # 关闭freemarker模板缓存,开发环境实时生效模板修改
|
||||
|
||||
# Thymeleaf模板引擎配置
|
||||
thymeleaf:
|
||||
cache: false # 关闭模板缓存,开发环境实时生效页面修改
|
||||
|
||||
# 虚拟线程配置(Spring 6+特性)
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true # 开启虚拟线程,提升高并发场景下的性能
|
||||
|
||||
# ===================== 数据源配置 =====================
|
||||
# 排除Druid自动配置,手动精细化配置连接池
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
db-type: MySQL # 数据库类型(可选值:MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL)
|
||||
host: 127.0.0.1 # 数据库服务器地址
|
||||
port: 3306 # 数据库端口
|
||||
username: root # 数据库登录账号
|
||||
password: 123456 # 数据库密码
|
||||
db-name: jnpf_init # 数据库名
|
||||
db-schema: # 金仓/达梦数据库需指定schema,其他数据库留空
|
||||
prepare-url: # 自定义JDBC URL,优先级高于自动拼接
|
||||
|
||||
# ===================== 动态多数据源配置 =====================
|
||||
dynamic:
|
||||
primary: master # 默认数据源/数据源组名称
|
||||
strict: true # 严格匹配数据源:true-未匹配到抛异常,false-降级使用默认数据源
|
||||
druid:
|
||||
# Druid连接池核心配置
|
||||
test-while-idle: true # 空闲时检测连接有效性,防止无效连接
|
||||
time-between-eviction-runs-millis: 60000 # 连接检测间隔(毫秒)
|
||||
max-wait: 3000 # 获取连接最大等待时间(毫秒),超时抛异常
|
||||
initial-size: 4 # 初始化连接数
|
||||
max-active: 20 # 最大活跃连接数(生产需根据业务调整)
|
||||
min-idle: 4 # 最小空闲连接数
|
||||
keep-alive: true # 开启空闲连接保活,防止数据库主动断开连接
|
||||
# 网络超时配置
|
||||
connect-timeout: 10000 # 连接建立超时(毫秒)
|
||||
socket-timeout: 10000 # 数据传输超时(毫秒)
|
||||
query-timeout: 90000 # SQL查询超时(毫秒)
|
||||
transaction-query-timeout: 90000 # 事务内查询超时(毫秒)
|
||||
# 数据库编码转换(按需启用,解决乱码问题)
|
||||
# proxy-filters: druidEncodingFilter
|
||||
# connection-properties:
|
||||
# clientEncoding: GB2312
|
||||
# serverEncoding: windows-1252
|
||||
|
||||
# SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
# filters: slf4j # SQL日志打印配置(按需启用,开发环境便于调试)
|
||||
slf4j:
|
||||
statementLogEnabled: true # 打印SQL执行语句
|
||||
resultSetLogEnabled: false # 关闭结果集日志(减少日志量)
|
||||
connectionLogEnabled: false # 关闭连接日志
|
||||
dataSourceLogEnabled: false # 关闭数据源日志
|
||||
statementCreateAfterLogEnabled: false # 关闭语句创建日志
|
||||
statementCloseAfterLogEnabled: false # 关闭语句关闭日志
|
||||
statementExecuteAfterLogEnabled: false # 关闭语句执行后日志
|
||||
statementExecutableSqlLogEnable: true # 打印替换参数后的完整可执行SQL
|
||||
statementPrepareAfterLogEnabled: false # 关闭语句预编译日志
|
||||
statementPrepareCallAfterLogEnabled: false # 关闭存储过程调用日志
|
||||
statementParameterSetLogEnabled: false # 关闭参数设置日志
|
||||
|
||||
# 多数据源节点配置(示例,按需启用)
|
||||
|
||||
# datasource:
|
||||
# master:
|
||||
# url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
# username: ${spring.datasource.username}
|
||||
# password: ${spring.datasource.password}
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# ===================== Redis配置(Redisson客户端) =====================
|
||||
redis:
|
||||
# 1. Redis单机模式(开发环境默认启用)
|
||||
redisson:
|
||||
config: |
|
||||
singleServerConfig:
|
||||
database: 1 # Redis数据库编号(0-15)
|
||||
address: "redis://127.0.0.1:6379" # Redis节点地址
|
||||
password: "123456" # Redis密码
|
||||
timeout: 10000 # 读取超时(毫秒)
|
||||
connectTimeout: 10000 # 连接超时(毫秒)
|
||||
connectionMinimumIdleSize: 24 # 最小空闲连接数
|
||||
connectionPoolSize: 64 # 最大连接池大小
|
||||
threads: 4 # Redisson业务线程数
|
||||
nettyThreads: 8 # Netty IO线程数
|
||||
codec: !<org.redisson.codec.JsonJacksonCodec> {} # 序列化方式:JSON
|
||||
|
||||
# 2. Redis分片集群模式(按需启用,注释单机模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# clusterServersConfig:
|
||||
# nodeAddresses: # 集群节点列表(至少填1个,建议多填容错)
|
||||
# - "redis://127.0.0.1:7000"
|
||||
# - "redis://127.0.0.1:7001"
|
||||
# - "redis://127.0.0.1:7002"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24 # 主库最小空闲连接
|
||||
# masterConnectionPoolSize: 64 # 主库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
# 3. Redis主从模式(按需启用,注释其他模式后开启)
|
||||
# redisson:
|
||||
# config: |
|
||||
# masterSlaveServersConfig:
|
||||
# database: 1
|
||||
# masterAddress: "redis://192.168.8.199:6379" # 主库地址
|
||||
# slaveAddresses: # 从库列表
|
||||
# - "redis://192.168.8.199:6380"
|
||||
# - "redis://192.168.8.199:6381"
|
||||
# password: "123456"
|
||||
# timeout: 10000
|
||||
# connectTimeout: 10000
|
||||
# masterConnectionMinimumIdleSize: 24
|
||||
# masterConnectionPoolSize: 64
|
||||
# slaveConnectionMinimumIdleSize: 24 # 从库最小空闲连接
|
||||
# slaveConnectionPoolSize: 64 # 从库最大连接池
|
||||
# threads: 4
|
||||
# nettyThreads: 8
|
||||
# codec: !<org.redisson.codec.JsonJacksonCodec> {}
|
||||
|
||||
|
||||
# ===================== 单点登录(用户信息同步) - 消息队列配置 =====================
|
||||
cloud:
|
||||
stream:
|
||||
# RocketMQ配置(默认启用)
|
||||
rocketmq:
|
||||
binder:
|
||||
name-server: 192.168.10.6:30094
|
||||
group: maxkey_identity
|
||||
# RabbitMQ配置(按需启用,注释RocketMQ后开启)
|
||||
# binders:
|
||||
# defaultRabbit: # 绑定器名称
|
||||
# type: rabbit # 消息组件类型
|
||||
# environment:
|
||||
# spring:
|
||||
# rabbitmq:
|
||||
# host: 192.168.10.6 # RabbitMQ地址
|
||||
# port: 5672 # RabbitMQ端口
|
||||
# username: rabbitmq # 登录账号
|
||||
# password: rabbitmq # 登录密码
|
||||
# Kafka配置(按需启用,注释其他MQ后开启)
|
||||
# kafka:
|
||||
# binder:
|
||||
# brokers: 192.168.10.6:9092 # Kafka broker地址
|
||||
# 消息消费绑定配置
|
||||
bindings:
|
||||
ssoEventReceiver-in-0:
|
||||
content-type: text/json # 消息格式:JSON
|
||||
destination: MXK_IDENTITY_MAIN_TOPIC # 消息主题
|
||||
group: maxkey_identity # 消费组(需与上方一致)
|
||||
|
||||
# ===================== AI能力配置 =====================
|
||||
ai:
|
||||
openai:
|
||||
user-limit-count: 1 # 单个用户限流:单位时间内最大请求数
|
||||
user-limit-time: 3s # 单个用户限流时间窗口(s=秒/m=分/h=时)
|
||||
total-limit-count: 500 # 全局限流:单位时间内最大请求数
|
||||
total-limit-time: 1m # 全局限流时间窗口
|
||||
|
||||
# ===================== MyBatis Plus配置 =====================
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:mapper/**/*.xml # Mapper XML文件扫描路径(多路径用,分割)
|
||||
type-aliases-package: jnpf.**.entity,ssw.**.entity # 实体类别名包(简化XML中的类名)
|
||||
# 全局配置
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: assign_id # 主键策略:assign_id=雪花算法生成ID
|
||||
# 逻辑删除配置(按需启用)
|
||||
# logic-delete-field: deleteMark # 逻辑删除字段名
|
||||
# logic-not-delete-value: "null" # 未删除值
|
||||
# logic-delete-value: "1" # 已删除值
|
||||
configuration:
|
||||
call-setters-on-nulls: true # 查询结果为空时,仍调用SET方法设置NULL(避免空指针)
|
||||
jdbc-type-for-null: 'NULL' # 空值对应的JDBC类型
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # SQL日志实现类(Slf4j)
|
||||
|
||||
|
||||
# ===================== SpringDoc/Swagger接口文档配置 =====================
|
||||
# 访问地址:http://127.0.0.1:30000/doc.html
|
||||
springdoc:
|
||||
default-flat-param-object: true # 扁平化参数对象(便于前端调试)
|
||||
api-docs:
|
||||
enabled: true # 启用OpenAPI文档
|
||||
# version: openapi_3_0 # 输出OpenAPI 3.0版本(兼容旧版Swagger)
|
||||
|
||||
# ===================== Knife4j增强配置(可选) =====================
|
||||
# knife4j:
|
||||
# enable: true # 启用Knife4j,提供更友好的Swagger UI
|
||||
# basic: # 接口文档访问鉴权(生产建议开启)
|
||||
# enable: true
|
||||
# username: jnpf # 登录账号
|
||||
# password: 123456 # 登录密码
|
||||
|
||||
# ===================== Lock4j分布式锁配置 =====================
|
||||
lock4j:
|
||||
aop:
|
||||
enabled: false # 关闭Lock4j注解(开发环境无需分布式锁)
|
||||
|
||||
# ===================== 自定义业务配置 =====================
|
||||
config:
|
||||
TestVersion: false # 是否开启测试环境:true-测试特性开启,false-生产模式
|
||||
ocrUrl: http://192.168.10.12:10888 # OCR服务访问地址(图文识别)
|
||||
sharding-sphere-enabled: false # 是否启用分库分表(Apache ShardingSphere)
|
||||
|
||||
# ===================== 文件存储配置 =====================
|
||||
file-storage:
|
||||
default-platform: local-plus-1 # 默认存储平台(对应下方platform值)
|
||||
thumbnail-suffix: ".thumb.jpg" # 缩略图后缀(如:.min.png)
|
||||
|
||||
# 1. 本地存储升级版(开发环境默认启用)
|
||||
local-plus:
|
||||
- platform: local-plus-1 # 存储平台标识(唯一)
|
||||
enable-storage: true # 启用该存储平台
|
||||
enable-access: true # 启用应用内访问(生产建议用Nginx代理)
|
||||
domain: "" # 访问域名(本地存储建议留空,使用相对路径)
|
||||
base-path: D:/project/jnpf-resources/ # 文件存储根路径
|
||||
path-patterns: /** # 访问路径匹配规则
|
||||
storage-path: # 子路径(留空则存储到base-path根目录)
|
||||
|
||||
# 2. 阿里云OSS(按需启用)
|
||||
aliyun-oss:
|
||||
- platform: aliyun-oss-1 # 存储平台标识
|
||||
enable-storage: false # 禁用(启用需填写access-key/secret-key等)
|
||||
access-key: ?? # AccessKey ID(替换为实际值)
|
||||
secret-key: ?? # AccessKey Secret(替换为实际值)
|
||||
end-point: ?? # OSS地域节点地址
|
||||
bucket-name: ?? # Bucket名称
|
||||
domain: ?? # 访问域名(需以/结尾,如https://abc.oss-cn-shanghai.aliyuncs.com/)
|
||||
base-path: hy/ # 存储基础路径(Bucket内的子目录)
|
||||
|
||||
# 3. 七牛云Kodo(按需启用)
|
||||
qiniu-kodo:
|
||||
- platform: qiniu-kodo-1
|
||||
enable-storage: false
|
||||
access-key: ?? # AccessKey
|
||||
secret-key: ?? # SecretKey
|
||||
bucket-name: ?? # 存储空间名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: base/ # 存储基础路径
|
||||
|
||||
# 4. 腾讯云COS(按需启用)
|
||||
tencent-cos:
|
||||
- platform: tencent-cos-1
|
||||
enable-storage: false
|
||||
secret-id: ?? # SecretId
|
||||
secret-key: ?? # SecretKey
|
||||
region: ?? # 存储桶地域(如ap-nanjing)
|
||||
bucket-name: ?? # 存储桶名称
|
||||
domain: ?? # 访问域名(需以/结尾)
|
||||
base-path: hy/ # 存储基础路径
|
||||
|
||||
# 5. MinIO(兼容AWS S3协议,按需启用)
|
||||
minio:
|
||||
- platform: minio-1
|
||||
enable-storage: true # 启用MinIO(开发环境测试用)
|
||||
access-key: 9Y3sjaDWgbxKjXjm # AccessKey
|
||||
secret-key: Bs2GyJwmOLpqNsQwbDjdinyUJQHtM0rc # SecretKey
|
||||
end-point: http://192.168.0.207:9000/ # MinIO服务地址(需以/结尾)
|
||||
bucket-name: v350 # Bucket名称
|
||||
domain: ${config.file-storage.minio[0].end-point} # 访问域名(复用服务地址)
|
||||
base-path: # 存储基础路径(留空则根目录)
|
||||
|
||||
# ===================== 第三方登录配置 =====================
|
||||
socials:
|
||||
socials-enabled: false # 第三方登录功能开关(false-关闭,true-开启)
|
||||
config:
|
||||
- # 引迈统一身份认证
|
||||
provider: ymsso # 引迈统一身份认证登录
|
||||
client-id: 768085549729714693 # 应用ID
|
||||
domain-prefix: http://127.0.0.1:33000 # 引迈统一身份认证接口地址
|
||||
client-secret: 8999753b453f430c8851b658c4ca507f # 应用Secret
|
||||
- # 微信
|
||||
provider: wechat_open # 微信开放平台登录
|
||||
client-id: your-client-id # 应用ID(替换为实际值)
|
||||
client-secret: your-client-secret # 应用密钥(替换为实际值)
|
||||
- # 企业微信
|
||||
provider: wechat_enterprise # 企业微信登录
|
||||
client-id: your-client-id # 企业微信CorpID
|
||||
client-secret: your-client-secret # 应用Secret
|
||||
agentId: your-agentId # 应用AgentID
|
||||
- # 钉钉
|
||||
provider: dingtalk # 钉钉登录
|
||||
client-id: your-client-id # 钉钉应用ID
|
||||
client-secret: your-client-secret # 钉钉应用密钥
|
||||
agentId: your-agentId # 钉钉应用AgentID
|
||||
- # 飞书
|
||||
provider: feishu # 飞书登录
|
||||
client-id: your-client-id # 飞书应用ID
|
||||
client-secret: your-client-secret # 飞书应用密钥
|
||||
- # 小程序
|
||||
provider: wechat_applets # 微信小程序登录
|
||||
client-id: your-client-id # 小程序AppID
|
||||
client-secret: your-client-secret # 小程序AppSecret
|
||||
|
||||
# ===================== XXL-Job任务调度配置 =====================
|
||||
xxl:
|
||||
job:
|
||||
# 调度中心配置
|
||||
admin:
|
||||
accessToken: '432e62f3b488bc861d91b0e274e850cc' # 调度中心通信令牌(需与XXL-Job 后端配置一致)
|
||||
addresses: http://127.0.0.1:30020/xxl-job-admin/ # 调度中心地址
|
||||
timeout: 3 # 连接超时时间(秒)
|
||||
# 调度中心地址
|
||||
executor:
|
||||
address: '' # 执行器地址(自动注册时留空)
|
||||
appname: xxl-job-executor-custom # 执行器名称(需与调度中心配置一致)
|
||||
ip: '' # 执行器IP(自动获取时留空)
|
||||
port: 39999 # 执行器端口
|
||||
logpath: /data/applogs/xxl-job/jobhandler # 日志存储路径
|
||||
logretentiondays: 30 # 日志保留天数
|
||||
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 Start =====================
|
||||
jnpf:
|
||||
sso:
|
||||
# 单点登录-用户信息拉取配置
|
||||
connector:
|
||||
enabled: false # 关闭用户信息拉取
|
||||
# 单点登录-用户信息推送配置
|
||||
pull:
|
||||
enabled: false # 关闭用户信息推送
|
||||
create-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 关闭用户信息推送
|
||||
replace-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 更新用户接口
|
||||
change-password-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account/changePassword # 修改密码接口
|
||||
delete-rest-address: http://localhost:9526/sso-mgt-api/api/idm/Account # 删除用户接口
|
||||
credential-type: Basic # 认证类型
|
||||
user-name: 747887288041603072 # 认证账号
|
||||
password: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 认证密码
|
||||
|
||||
oauth:
|
||||
ssoEnabled: false # 是否启用单点登录
|
||||
ticketTimeout: 120 # 轮询票据有效期
|
||||
defaultSSO: cas # 默认SSO协议(cas/auth2)
|
||||
loginPath: http://127.0.0.1:30000/api/oauth/Login # 后端登录接口地址
|
||||
# JWT配置(按需启用)
|
||||
# login:
|
||||
# jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d # JWT秘钥
|
||||
sso:
|
||||
baseUrl: http://127.0.0.1:8527 # SSO系统地址
|
||||
sucessFrontUrl: http://127.0.0.1:3000/sso # 登录成功后前端跳转地址
|
||||
ticketOutMessage: false # 错误信息是否输出到页面
|
||||
# logoutFrontUrl: http://sso.maxkey.top:8527/maxkey # 退出登录跳转地址
|
||||
# ssoLogoutApiUrl: ${oauth.sso.baseUrl}/sign/logout # 单点注销接口(触发全应用退出)
|
||||
|
||||
# OAuth2协议配置
|
||||
auth2:
|
||||
enabled: true # 启用OAuth2协议
|
||||
clientId: 747887288041603072 # 客户端ID
|
||||
clientSecret: MYgMMjIwNzIwMjIxNTU4MTAxNzQlKQ # 客户端秘钥
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
authorizeUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/authorize # 授权地址
|
||||
accessTokenUrl: ${oauth.sso.auth2.baseUrl}/sign/authz/oauth/v20/token # 获取Token地址
|
||||
userInfoUrl: ${oauth.sso.auth2.baseUrl}/sign/api/oauth/v20/me # 获取用户信息地址
|
||||
|
||||
# CAS协议配置
|
||||
cas:
|
||||
enabled: true # 启用CAS协议
|
||||
baseUrl: ${oauth.sso.baseUrl} # SSO基础地址
|
||||
serverLoginUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas/login # CAS登录地址
|
||||
serverValidateUrl: ${oauth.sso.cas.baseUrl}/sign/authz/cas # CAS票据验证地址
|
||||
|
||||
# ===================== 单点登录(jnpf-sso)核心配置 End =====================
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-Start =====================
|
||||
#oauth:
|
||||
# #启用单点登录, 普通登录不可用
|
||||
# ssoEnabled: false
|
||||
# #jnpf单点登录
|
||||
# jnpfSso: true
|
||||
# #轮询票据有效期
|
||||
# ticketTimeout: 120
|
||||
# #默认单点登录协议
|
||||
# defaultSSO: auth2
|
||||
# #后端登录接口地址
|
||||
# loginPath: http://127.0.0.1:30000/api/oauth/Login
|
||||
# #login:
|
||||
# #JWT生成秘钥 不填写为默认值
|
||||
# #jwtSecretKey: WviMjFNC72VKwGqm5LPoheQo5XN9iN4d
|
||||
# sso:
|
||||
# #单点登录系统地址
|
||||
# baseUrl: http://127.0.0.1:33000
|
||||
# #登录成功后跳转到前端的页面
|
||||
# sucessFrontUrl: http://127.0.0.1:3000/sso
|
||||
# #错误信息是否输出到页面
|
||||
# ticketOutMessage: false
|
||||
# auth2:
|
||||
# enabled: true
|
||||
# clientId: 768085549729714693
|
||||
# clientSecret: 8999753b453f430c8851b658c4ca507f
|
||||
# baseUrl: ${oauth.sso.baseUrl}
|
||||
# authorizeUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/authorize
|
||||
# accessTokenUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/token
|
||||
# userInfoUrl: ${oauth.sso.auth2.baseUrl}/api/oidc/me
|
||||
# ===================== YM统一身份认证(jnpf-java-sso-mgt)配置-End =====================
|
||||
@@ -1,105 +0,0 @@
|
||||
spring:
|
||||
application:
|
||||
name: jnpf-java-boot
|
||||
profiles:
|
||||
active: dev
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
enabled: true
|
||||
mvc:
|
||||
cors:
|
||||
allowed-origin-patterns: '**'
|
||||
allowed-methods: '*'
|
||||
allowed-headers: '*'
|
||||
options-max-age: 18000
|
||||
headers:
|
||||
server-name: ''
|
||||
x-frame-options: sameorigin
|
||||
x-content-type-options: disabled
|
||||
x-xss-protection: enabled_mode_block
|
||||
hiddenmethod:
|
||||
filter:
|
||||
enabled: true
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: true
|
||||
deserialization:
|
||||
fail-on-unknown-properties: false
|
||||
time-zone: GMT+8
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
allow-circular-references: false
|
||||
config:
|
||||
ApiDomain: http://127.0.0.1:30000
|
||||
FrontDomain: http://127.0.0.1:3000
|
||||
AppDomain: http://127.0.0.1:8080
|
||||
FlowDomain: http://workflow:31000
|
||||
ReportDomain: http://report:32000
|
||||
OldReportDomain: http://127.0.0.1:30007
|
||||
WebAnnexFilePath: WebAnnexFile
|
||||
DataBackupFilePath: DataBackupFile
|
||||
TemporaryFilePath: TemporaryFile
|
||||
SystemFilePath: SystemFile
|
||||
TemplateFilePath: TemplateFile
|
||||
EmailFilePath: EmailFile
|
||||
DocumentFilePath: DocumentFile
|
||||
DocumentPreviewPath: DocumentPreview
|
||||
UserAvatarFilePath: UserAvatar
|
||||
IMContentFilePath: IMContentFile
|
||||
TemplateCodePathVue3: TemplateCodeVue3
|
||||
BiVisualPath: BiVisualPath
|
||||
AllowUploadFileType: jpg,gif,png,bmp,jpeg,doc,docx,ppt,pptx,xls,xlsx,pdf,txt,rar,zip,csv,mp3,aac,svg
|
||||
AllowPreviewFileType: doc,docx,xls,xlsx,ppt,pptx,pdf,jpg,gif,png,bmp,jpeg,txt
|
||||
PreviewType: kkfile
|
||||
kkFileUrl: http://127.0.0.1:30090/FileServer/
|
||||
MultiTenancy: false
|
||||
MultiTenancyUrl: http://127.0.0.1:30006/api/tenant/DbName/
|
||||
MultiTenancyVersion: 1
|
||||
MultiTenancyAppCode: null
|
||||
SoftName: jnpf-java-boot
|
||||
SoftFullName: JNPF快速开发平台
|
||||
SoftVersion: V6.2.0
|
||||
Email: [email protected]
|
||||
AppVersion: V6.2.0
|
||||
AppUpdateContent: ;
|
||||
YozoDomain: //dcsapi.com/
|
||||
YozoDomainKey: 57462250284462899305150
|
||||
YozoCloudDomain: //dmc.yozocloud.cn
|
||||
YozoAppId: yozoAgR41jgC0062
|
||||
YozoAppKey: fc3134a9ba8bc6f4c69d635f9adf
|
||||
YozoEditDomain: //eic.yozocloud.cn
|
||||
EnableLogicDelete: false
|
||||
CodeCertificateTimeout: 180
|
||||
check-file-pdf: false
|
||||
security:
|
||||
security-key: EY8WePvjM5GGwQzn
|
||||
enable-pre-auth: true
|
||||
enable-rest-encrypt: true
|
||||
event:
|
||||
event-publish-type: redis
|
||||
redis-publish-type: current
|
||||
gateway:
|
||||
block-url: null
|
||||
white-url:
|
||||
- /api/ssw/wiki/**
|
||||
- /api/nl/**
|
||||
- /api/open-design/**
|
||||
- /api/ssw/tds/api/**
|
||||
- /api/ssw/jyzs/ai/**
|
||||
# BS-NCPF-400 (2026-07-12): NCPF /visualdev/ai/form 走 SSW proxy 翻译 Anthropic 协议
|
||||
# NCPF 发 Authorization: Bearer <base_ai.credential> (非 user token), 需 bypass auth
|
||||
- /api/ssw/ai/openai-proxy
|
||||
exclude-url: null
|
||||
white-ip: null
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
level:
|
||||
org.redisson.command.RedisExecutor: ERROR
|
||||
org.springframework.data.redis.core.RedisConnectionUtils: ERROR
|
||||
druid.sql.Statement: debug
|
||||
log:
|
||||
level:
|
||||
root: info
|
||||
path: /home/ubuntu/ccWorkDir/log/${spring.application.name}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -1,335 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<!--日志格式应用spring boot默认的格式,也可以自己更改-->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<property name="FILE_LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%thread] [%logger{50}] [%M] [%line] - %msg%n" />
|
||||
<springProperty scope="context" name="SERVICE_NAME" source="spring.application.name" defaultValue="jnpf"/>
|
||||
|
||||
<!--定义日志存放的位置,默认存放在项目启动的相对路径的目录-->
|
||||
<springProperty scope="context" name="LOG_PATH" source="log.path" defaultValue="log/${SERVICE_NAME}"/>
|
||||
<!-- 全局日志等级 -->
|
||||
<springProperty scope="context" name="LOG_LEVEL_ROOT" source="log.level.root" defaultValue="INFO"/>
|
||||
<!-- 服务自定义等级 如需自定义服务日志等级 修改下方的【自定义服务名】与nacos上的log.level.自定义服务名=等级 -->
|
||||
<springProperty scope="context" name="LOG_LEVEL" source="log.level.jnpf-boot" defaultValue="${LOG_LEVEL_ROOT}"/>
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 ERROR 日志 -->
|
||||
<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_error.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录error级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>error</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 INFO 日志 -->
|
||||
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_info.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录info级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>info</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 WARN 日志 -->
|
||||
<appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_warn.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录warn级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>warn</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 DEBUG 日志 -->
|
||||
<appender name="FILE_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_debug.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录debug级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>debug</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,所有日志 -->
|
||||
<appender name="FILE_ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_total.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level 根据配置动态输出日志 -->
|
||||
<appender name="FILE_RELEASE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||
<file>${LOG_PATH}/log_release.log</file>
|
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 -->
|
||||
<fileNamePattern>${LOG_PATH}/release/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<!--日志最大的历史7天-->
|
||||
<maxHistory>7</maxHistory>
|
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||
命名日志文件,例如log-error-2013-12-21.0.log -->
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
|
||||
<!-- 追加方式记录日志 -->
|
||||
<append>true</append>
|
||||
|
||||
<!-- 日志文件的格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!-- 此日志文件只记录warn级别的 -->
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>${LOG_LEVEL}</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
<!-- 异步输出 DEBUG -->
|
||||
<appender name="ASYNC_FILE_DEBUG" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_DEBUG"/>
|
||||
</appender>
|
||||
<!-- 异步输出 INFO -->
|
||||
<appender name="ASYNC_FILE_INFO" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_INFO"/>
|
||||
</appender>
|
||||
<!-- 异步输出 WARN -->
|
||||
<appender name="ASYNC_FILE_WARN" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_WARN"/>
|
||||
</appender>
|
||||
<!-- 异步输出 ERROR -->
|
||||
<appender name="ASYNC_FILE_ERROR" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_ERROR"/>
|
||||
</appender>
|
||||
<!-- 异步输出 ALL -->
|
||||
<appender name="ASYNC_FILE_ALL" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="FILE_ALL"/>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!-- 异步输出 控制台 -->
|
||||
<appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold>0</discardingThreshold>
|
||||
<queueSize>256</queueSize>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
|
||||
<!– 必填:目标:LogStash的 IP:Port –>
|
||||
<destination>192.168.0.50:50000</destination>
|
||||
<!– 可选:保持程序存活时间 –>
|
||||
<keepAliveDuration>5 minutes</keepAliveDuration>
|
||||
<!– 可选:重连延迟时长 –>
|
||||
<reconnectionDelay>10 second</reconnectionDelay>
|
||||
<!– 可选:等待策略 –>
|
||||
<waitStrategyType>sleeping</waitStrategyType>
|
||||
<!– ============ encoder必须配置,有多种可选 ============= –>
|
||||
<!– 编码器二:LoggingEventCompositeJsonEncoder –>
|
||||
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
|
||||
<providers>
|
||||
<!– 时间戳:时区 –>
|
||||
<timestamp>
|
||||
<timeZone>UTC</timeZone>
|
||||
</timestamp>
|
||||
<!– 模式 –>
|
||||
<pattern>
|
||||
<pattern>
|
||||
{
|
||||
"severity": "%level",
|
||||
"service": "${SERVICE_NAME:-}",
|
||||
"trace": "%X{X-B3-TraceId:-}",
|
||||
"span": "%X{X-B3-SpanId:-}",
|
||||
"exportable": "%X{X-Span-Export:-}",
|
||||
"pid": "${PID:-}",
|
||||
"thread": "%thread",
|
||||
"class": "%logger{40}",
|
||||
"msg": "%message"
|
||||
<!–"idx_pre": "elk-original-third-access",–>
|
||||
<!–"json": "#asJson{%message}" 这个asJson可以把对应的字符串作为json对象取出来,这样es可以对json里面的字段索引了–>
|
||||
}
|
||||
</pattern>
|
||||
</pattern>
|
||||
</providers>
|
||||
</encoder>
|
||||
</appender>-->
|
||||
<!--<appender name="skywalking-log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
|
||||
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>-->
|
||||
|
||||
|
||||
<root level="${LOG_LEVEL}">
|
||||
<appender-ref ref="ASYNC_STDOUT"/>
|
||||
<appender-ref ref="ASYNC_FILE_ERROR"/>
|
||||
<appender-ref ref="ASYNC_FILE_INFO"/>
|
||||
<appender-ref ref="ASYNC_FILE_WARN"/>
|
||||
<appender-ref ref="ASYNC_FILE_DEBUG"/>
|
||||
<appender-ref ref="ASYNC_FILE_ALL"/>
|
||||
<!--<appender-ref ref="LOGSTASH"/>-->
|
||||
<!--<appender-ref ref="skywalking-log"/>-->
|
||||
</root>
|
||||
|
||||
|
||||
</configuration>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.mapper.BigDataMapper">
|
||||
|
||||
<select id="maxCode" resultType="Integer">
|
||||
SELECT MAX(F_EN_CODE) FROM ext_big_data
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,245 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.permission.mapper.AuthorizeMapper">
|
||||
|
||||
<resultMap id="ModuleVO" type="jnpf.base.model.module.ModuleModel">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_parent_id" property="parentId"/>
|
||||
<result column="f_full_name" property="fullName"/>
|
||||
<result column="f_en_code" property="enCode"/>
|
||||
<result column="f_type" property="type"/>
|
||||
<result column="f_url_address" property="urlAddress"/>
|
||||
<result column="f_page_address" property="pageAddress"/>
|
||||
<result column="f_link_target" property="linkTarget"/>
|
||||
<result column="f_category" property="category"/>
|
||||
<result column="f_icon" property="icon"/>
|
||||
<result column="f_sort_code" property="sortCode"/>
|
||||
<result column="f_property_json" property="propertyJson"/>
|
||||
<result column="f_module_id" property="moduleId"/>
|
||||
<result column="f_system_id" property="systemId"/>
|
||||
<result column="f_description" property="description"/>
|
||||
<result column="f_creator_time" property="creatorTimes"/>
|
||||
<result column="f_no_show" property="noShow"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ButtonVO" type="jnpf.base.model.button.ButtonModel">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_parent_id" property="parentId"/>
|
||||
<result column="f_full_name" property="fullName"/>
|
||||
<result column="f_en_code" property="enCode"/>
|
||||
<result column="f_icon" property="icon"/>
|
||||
<result column="f_url_address" property="urlAddress"/>
|
||||
<result column="f_module_id" property="moduleId"/>
|
||||
<result column="f_creator_time" property="creatorTimes"/>
|
||||
<result column="f_sort_code" property="sortCode"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ColumnVO" type="jnpf.base.model.column.ColumnModel">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_parent_id" property="parentId"/>
|
||||
<result column="f_full_name" property="fullName"/>
|
||||
<result column="f_en_code" property="enCode"/>
|
||||
<result column="f_bind_table" property="bindTable"/>
|
||||
<result column="f_bind_table_name" property="bindTableName"/>
|
||||
<result column="f_module_id" property="moduleId"/>
|
||||
<result column="f_creator_time" property="creatorTimes"/>
|
||||
<result column="f_sort_code" property="sortCode"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ResourceVO" type="jnpf.base.model.resource.ResourceModel">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_full_name" property="fullName"/>
|
||||
<result column="f_en_code" property="enCode"/>
|
||||
<result column="f_condition_json" property="conditionJson"/>
|
||||
<result column="f_condition_text" property="conditionText"/>
|
||||
<result column="f_module_id" property="moduleId"/>
|
||||
<result column="f_match_logic" property="matchLogic"/>
|
||||
<result column="f_object_id" property="objectId"/>
|
||||
<result column="f_creator_time" property="creatorTimes"/>
|
||||
<result column="f_sort_code" property="sortCode"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="FormVO" type="jnpf.base.model.form.ModuleFormModel">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_parent_id" property="parentId"/>
|
||||
<result column="f_full_name" property="fullName"/>
|
||||
<result column="f_en_code" property="enCode"/>
|
||||
<result column="f_module_id" property="moduleId"/>
|
||||
<result column="f_creator_time" property="creatorTimes"/>
|
||||
<result column="f_sort_code" property="sortCode"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SystemVO" type="jnpf.base.model.base.SystemBaeModel">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_full_name" property="fullName"/>
|
||||
<result column="f_en_code" property="enCode"/>
|
||||
<result column="f_icon" property="icon"/>
|
||||
<result column="f_property_json" property="propertyJson"/>
|
||||
<result column="f_description" property="description"/>
|
||||
<result column="f_sort_code" property="sortCode"/>
|
||||
<result column="f_enabled_mark" property="enabledMark"/>
|
||||
<result column="f_creator_time" property="creatorTimes"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="findModule" parameterType="String" resultMap="ModuleVO">
|
||||
SELECT * FROM base_module WHERE 1=1
|
||||
AND (f_id IN
|
||||
<trim suffixOverrides=" OR f_id IN()">
|
||||
<foreach collection="objectId" item="id" index="index" open="(" close=")" >
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR f_id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{id}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
<if test="mark == 1">
|
||||
and f_enabled_mark = #{mark}
|
||||
</if>
|
||||
<if test="systemId != null and systemId.size > 0">
|
||||
and f_system_id in
|
||||
<foreach collection="systemId" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="moduleAuthorize != null and moduleAuthorize.size > 0">
|
||||
and f_id not in
|
||||
<foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
|
||||
#{moduleId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="moduleAuthorize != null and moduleAuthorize.size > 0">
|
||||
and f_en_code not in
|
||||
<foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
|
||||
#{moduleId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="moduleUrlAddressAuthorize != null and moduleUrlAddressAuthorize.size > 0">
|
||||
and
|
||||
((f_url_address not in
|
||||
<foreach collection="moduleUrlAddressAuthorize" item="urlAddress" open="(" close=")" separator=",">
|
||||
#{urlAddress}
|
||||
</foreach>
|
||||
)
|
||||
or f_url_address is null
|
||||
)
|
||||
</if>
|
||||
Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findButton" parameterType="String" resultMap="ButtonVO">
|
||||
SELECT * FROM base_module_button WHERE 1=1
|
||||
AND (f_id IN
|
||||
<trim suffixOverrides=" OR f_id IN()">
|
||||
<foreach collection="objectId" item="id" index="index" open="(" close=")">
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR f_id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{id}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
and f_enabled_mark = 1 Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findColumn" parameterType="String" resultMap="ColumnVO">
|
||||
SELECT * FROM base_module_column WHERE 1=1
|
||||
AND (f_id IN
|
||||
<trim suffixOverrides=" OR f_id IN()">
|
||||
<foreach collection="objectId" item="id" index="index" open="(" close=")">
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR f_id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{id}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
and f_enabled_mark = 1 Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findForms" parameterType="String" resultMap="FormVO">
|
||||
SELECT * FROM base_module_form WHERE 1=1
|
||||
AND (f_id IN
|
||||
<trim suffixOverrides=" OR f_id IN()">
|
||||
<foreach collection="objectId" item="id" index="index" open="(" close=")">
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR f_id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{id}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
and f_enabled_mark = 1 Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findSystem" parameterType="String" resultMap="SystemVO">
|
||||
SELECT * FROM base_system WHERE f_id IN
|
||||
<foreach collection="objectId" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
<if test="mark == 1">
|
||||
and f_enabled_mark = #{mark}
|
||||
</if>
|
||||
<if test="enCode != null and enCode != ''">
|
||||
and f_en_code != #{enCode}
|
||||
</if>
|
||||
<if test="moduleAuthorize != null and moduleAuthorize.size > 0">
|
||||
and f_id not in
|
||||
<foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
|
||||
#{moduleId}
|
||||
</foreach>
|
||||
</if>
|
||||
Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findResource" parameterType="String" resultMap="ResourceVO">
|
||||
select s.*, a.f_object_id from base_module_scheme s
|
||||
LEFT JOIN base_authorize a on s.f_id = a.f_item_id
|
||||
where 1=1
|
||||
AND (s.f_id IN
|
||||
<trim suffixOverrides=" OR s.f_id IN()">
|
||||
<foreach collection="objectId" item="id" index="index" open="(" close=")">
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR s.f_id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{id}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
and s.f_enabled_mark = 1 Order by s.f_sort_code asc,s.f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findButtonAdmin" parameterType="Integer" resultMap="ButtonVO">
|
||||
SELECT * FROM base_module_button WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findColumnAdmin" parameterType="Integer" resultMap="ColumnVO">
|
||||
SELECT * FROM base_module_column WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findFormsAdmin" parameterType="Integer" resultMap="FormVO">
|
||||
SELECT * FROM base_module_form WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="findResourceAdmin" parameterType="Integer" resultMap="ResourceVO">
|
||||
SELECT * FROM base_module_scheme WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.message.mapper.ImContentMapper">
|
||||
|
||||
<select id="getUnreadList" parameterType="String" resultType="jnpf.message.model.ImUnreadNumModel">
|
||||
SELECT * FROM (
|
||||
SELECT SUM(CASE WHEN f_enabled_mark = 0 THEN 1 ELSE 0 END) UnreadNum, f_send_user_id SendUserId, f_receive_user_id ReceiveUserId
|
||||
FROM base_im_content WHERE 1 = 1 AND f_receive_user_id = #{receiveUserId} GROUP BY f_send_user_id, f_receive_user_id
|
||||
) t WHERE UnreadNum > 0
|
||||
</select>
|
||||
|
||||
<select id="getUnreadLists" parameterType="String" resultType="jnpf.message.model.ImUnreadNumModel">
|
||||
select f_send_user_id SendUserId, f_content DefaultMessage,f_content_type DefaultMessageType, f_send_time DefaultMessageTime from base_im_content WHERE 1 = 1 AND f_receive_user_id = #{receiveUserId} AND f_enabled_mark = 0 order by f_send_time desc
|
||||
</select>
|
||||
|
||||
<update id="readMessage" parameterType="map">
|
||||
UPDATE base_im_content SET f_enabled_mark = 1, f_receive_time = #{map.receiveTime} WHERE 1 = 1 AND f_enabled_mark = 0 AND f_send_user_id = #{map.sendUserId} AND f_receive_user_id = #{map.receiveUserId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.message.mapper.ImReplyMapper">
|
||||
<resultMap id="imReplyList" type="jnpf.message.model.ImReplyListModel">
|
||||
<id column="f_receive_user_id" property="id"/>
|
||||
<result column="f_user_id" property="userId"/>
|
||||
<result column="F_HEAD_ICON" property="headIcon"/>
|
||||
<result column="f_receive_time" property="latestDate"/>
|
||||
<result column="f_content_type" property="messageType"/>
|
||||
<result column="f_content" property="latestMessage"/>
|
||||
<result column="f_delete_user_id" property="deleteUserId"/>
|
||||
<result column="f_delete_mark" property="deleteMark"/>
|
||||
<result column="imreplydeleteuser" property="imreplyDeleteUser"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getImReplyList" resultMap="imReplyList" parameterType="jnpf.message.model.ImReplyListVo">
|
||||
SELECT
|
||||
ir.f_user_id,
|
||||
ir.f_receive_user_id,
|
||||
ir.f_delete_user_id as imreplydeleteuser,
|
||||
bu.F_HEAD_ICON,
|
||||
ir.f_receive_time,
|
||||
ic.f_content_type,
|
||||
ic.f_content,
|
||||
ic.f_delete_user_id,
|
||||
ic.f_delete_mark
|
||||
FROM
|
||||
base_im_reply ir
|
||||
LEFT JOIN base_user bu ON ir.f_user_id = bu.F_Id
|
||||
LEFT JOIN base_im_content ic ON ic.f_send_user_id = bu.F_Id
|
||||
AND ir.f_user_id = ic.f_send_user_id
|
||||
AND ir.f_receive_user_id = ic.f_receive_user_id
|
||||
AND ir.f_receive_time = ic.f_send_time
|
||||
AND (ir.f_delete_mark != 1 OR ir.f_delete_mark IS NULL)
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.message.mapper.MessageMapper">
|
||||
|
||||
<resultMap id="Message" type="jnpf.message.entity.MessageReceiveEntity">
|
||||
<id column="f_id" property="id"/>
|
||||
<result column="f_title" property="title"/>
|
||||
<result column="f_type" property="type"/>
|
||||
<result column="f_creator_time" property="creatorTime"/>
|
||||
<result column="f_creator_user_id" property="creatorUserId"/>
|
||||
<result column="f_last_modify_time" property="lastModifyTime"/>
|
||||
<result column="f_is_read" property="isRead"/>
|
||||
<result column="f_last_modify_user_id" property="lastModifyUserId"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getMessageList" parameterType="map" resultMap="Message">
|
||||
SELECT r.f_id, r.f_title, r.f_type, r.f_is_read, r.f_creator_time, r.f_creator_user_id, r.f_last_modify_time, r.f_last_modify_user_id,
|
||||
u.f_real_name,u.f_account FROM base_message r
|
||||
LEFT JOIN base_user u ON u.f_id = r.f_user_id where 1 = 1
|
||||
<if test="map.userId != null">
|
||||
AND r.f_user_id= #{map.userId}
|
||||
</if>
|
||||
<if test="map.keyword != null">
|
||||
AND (r.f_title like #{map.keyword} OR u.f_real_name LIKE #{map.keyword} OR u.f_account LIKE #{map.keyword})
|
||||
</if>
|
||||
<if test="map.type != null">
|
||||
AND r.f_type = #{map.type}
|
||||
</if>
|
||||
<if test="map.isRead != null">
|
||||
AND r.f_is_read = #{map.isRead}
|
||||
</if>
|
||||
ORDER BY r.f_last_modify_time desc
|
||||
</select>
|
||||
|
||||
<select id="getUnreadCount" resultType="int">
|
||||
SELECT COUNT(1) FROM base_message
|
||||
WHERE f_user_id = #{userId} AND f_is_read = 0 AND f_type = #{type}
|
||||
</select>
|
||||
|
||||
<select id="getInfoDefault" parameterType="int" resultMap="Message">
|
||||
SELECT * FROM base_message WHERE 1 = 1 AND f_type = #{type} ORDER BY f_creator_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.permission.mapper.PositionMapper">
|
||||
|
||||
<select id="getListByUserId" parameterType="String" resultType="jnpf.permission.entity.PositionEntity">
|
||||
SELECT * FROM base_position WHERE F_ID IN(SELECT F_OBJECT_ID FROM base_user_relation WHERE F_USER_ID = #{userId}) ORDER BY F_SORT_CODE
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,106 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.permission.mapper.RoleMapper">
|
||||
|
||||
<select id="getListId" resultType="java.lang.String">
|
||||
SELECT * FROM base_role WHERE F_ID IN(SELECT F_OBJECT_ID FROM base_user_relation WHERE F_USER_ID = #{userId}) ORDER BY F_SORT_CODE
|
||||
</select>
|
||||
|
||||
<select id="query" resultType="java.lang.String">
|
||||
SELECT F_Id FROM base_role
|
||||
<if test="globalMark != 1">
|
||||
WHERE 1 = 1
|
||||
AND F_Id IN (
|
||||
SELECT DISTINCT
|
||||
a.F_Id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
br.F_Id
|
||||
FROM
|
||||
base_organize bo
|
||||
LEFT JOIN base_organize_relation bor ON bo.F_Id = bor.F_Organize_Id
|
||||
LEFT JOIN base_role br ON br.F_Id = bor.F_Object_Id
|
||||
WHERE
|
||||
bor.F_Object_Type = 'Role'
|
||||
AND bor.F_Object_Type IS NOT NULL
|
||||
<if test="orgIdList != null and orgIdList.size() != 0">
|
||||
AND bo.F_Id IN
|
||||
<foreach collection="orgIdList"
|
||||
item="orgIds" index="index" separator="," open="(" close=")">
|
||||
#{orgIds}
|
||||
</foreach>
|
||||
</if>
|
||||
) a
|
||||
)
|
||||
</if>
|
||||
<if test="globalMark == -1 or globalMark == 1">
|
||||
<if test="globalMark != 1">
|
||||
OR
|
||||
</if>
|
||||
<if test="globalMark == 1">
|
||||
Where
|
||||
</if>
|
||||
F_Id IN
|
||||
(
|
||||
SELECT F_Id FROM base_role WHERE F_Global_Mark = 1
|
||||
)
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (F_Full_Name LIKE #{keyword} OR F_En_Code LIKE #{keyword})
|
||||
</if>
|
||||
<if test="enabledMark != null">
|
||||
AND (f_enabled_Mark = #{enabledMark})
|
||||
</if>
|
||||
ORDER BY f_sort_code asc, f_creator_time desc
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
SELECT count(F_Id) FROM base_role
|
||||
<if test="globalMark != 1">
|
||||
WHERE 1 = 1
|
||||
AND F_Id IN (
|
||||
SELECT DISTINCT
|
||||
a.F_Id
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
br.F_Id
|
||||
FROM
|
||||
base_organize bo
|
||||
LEFT JOIN base_organize_relation bor ON bo.F_Id = bor.F_Organize_Id
|
||||
LEFT JOIN base_role br ON br.F_Id = bor.F_Object_Id
|
||||
WHERE
|
||||
bor.F_Object_Type = 'Role'
|
||||
AND bor.F_Object_Type IS NOT NULL
|
||||
<if test="orgIdList != null and orgIdList.size() != 0">
|
||||
AND bo.F_Id IN
|
||||
<foreach collection="orgIdList"
|
||||
item="orgIds" index="index" separator="," open="(" close=")">
|
||||
#{orgIds}
|
||||
</foreach>
|
||||
</if>
|
||||
) a
|
||||
)
|
||||
</if>
|
||||
<if test="globalMark == -1 or globalMark == 1">
|
||||
<if test="globalMark != 1">
|
||||
OR
|
||||
</if>
|
||||
<if test="globalMark == 1">
|
||||
Where
|
||||
</if>
|
||||
F_Id IN
|
||||
(
|
||||
SELECT F_Id FROM base_role WHERE F_Global_Mark = 1
|
||||
)
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (F_Full_Name LIKE #{keyword} OR F_En_Code LIKE #{keyword})
|
||||
</if>
|
||||
<if test="enabledMark != null">
|
||||
AND (f_enabled_Mark = #{enabledMark})
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.base.mapper.SysconfigMapper">
|
||||
|
||||
<delete id="deleteFig">
|
||||
delete from base_sys_config where F_Category ='SysConfig'
|
||||
</delete>
|
||||
<delete id="deleteMpFig">
|
||||
delete from base_sys_config where F_Category='MPConfig'
|
||||
</delete>
|
||||
<delete id="deleteQyhFig">
|
||||
delete from base_sys_config where F_Category='QYHConfig'
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.permission.mapper.UserMapper">
|
||||
|
||||
<select id="getListId" resultType="java.lang.String">
|
||||
SELECT F_Id from base_user WHERE F_Enabled_Mark = 1
|
||||
</select>
|
||||
|
||||
<select id="query" resultType="java.lang.String">
|
||||
SELECT F_Id FROM
|
||||
(SELECT DISTINCT u.F_Id,u.F_Sort_Code,u.F_Creator_Time
|
||||
FROM base_user_relation ul1,base_user u
|
||||
WHERE u.F_Id = ul1.F_User_Id
|
||||
AND u.f_account != 'admin'
|
||||
<if test="enabledMark != null">
|
||||
AND u.f_enabled_mark = #{enabledMark}
|
||||
</if>
|
||||
<if test="gender != null and gender != ''">
|
||||
AND u.f_gender = #{gender}
|
||||
</if>
|
||||
<if test="account != null and account != ''">
|
||||
and (u.F_Account like #{account} or u.F_Real_Name like #{account} or u.F_Mobile_Phone like
|
||||
#{account})
|
||||
</if>
|
||||
<if test="orgIdList != null and orgIdList.size > 0">
|
||||
AND (ul1.F_Object_Id IN
|
||||
<trim suffixOverrides=" OR ul1.F_Object_Id IN()">
|
||||
<foreach collection="orgIdList" item="orgIds" index="index" open="(" close=")">
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR ul1.F_Object_Id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{orgIds}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
</if>
|
||||
ORDER BY u.F_Sort_Code ASC,u.F_Creator_Time DESC) uu
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
SELECT count(F_Id) FROM
|
||||
(SELECT DISTINCT u.F_Id,u.F_Sort_Code,u.F_Creator_Time
|
||||
FROM base_user_relation ul1,base_user u
|
||||
WHERE u.F_Id = ul1.F_User_Id
|
||||
AND u.F_Account != 'admin'
|
||||
<if test="enabledMark != null">
|
||||
AND u.f_enabled_mark = #{enabledMark}
|
||||
</if>
|
||||
<if test="gender != null and gender != ''">
|
||||
AND u.f_gender = #{gender}
|
||||
</if>
|
||||
<if test="account != null and account != ''">
|
||||
and (u.F_Account like #{account} or u.F_Real_Name like #{account} or u.F_Mobile_Phone like
|
||||
#{account})
|
||||
</if>
|
||||
<if test="orgIdList != null and orgIdList.size > 0">
|
||||
AND (ul1.F_Object_Id IN
|
||||
<trim suffixOverrides=" OR ul1.F_Object_Id IN()">
|
||||
<foreach collection="orgIdList" item="orgIds" index="index" open="(" close=")">
|
||||
<if test="index != 0">
|
||||
<choose>
|
||||
<when test="index % 1000 == 999">) OR ul1.F_Object_Id IN (</when>
|
||||
<otherwise>,</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
#{orgIds}
|
||||
</foreach>
|
||||
</trim>
|
||||
)
|
||||
</if>) uu
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,52 +0,0 @@
|
||||
databaseName: myshardingsphere
|
||||
dataSources: # 数据源配置 =============
|
||||
# <数据源_0>: # 自定义数据源名称
|
||||
# dataSourceClassName: com.zaxxer.hikari.HikariDataSource # 连接池提供方完整类名(Spring默认Hikari)
|
||||
# driverClassName: com.mysql.jdbc.Driver # JDBC驱动
|
||||
# jdbcUrl: jdbc:mysql://{host}:{port}/{dbName}?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL
|
||||
# username: {username} # 用户
|
||||
# password: {password} # 密码
|
||||
ds0: # 自定义数据源名称
|
||||
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource # 连接池提供方完整类名(Spring默认Hikari)
|
||||
driverClassName: com.mysql.cj.jdbc.Driver # JDBC驱动
|
||||
url: jdbc:mysql://127.0.0.1:3306/sharding1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL
|
||||
username: root # 用户
|
||||
password: 123456 # 密码
|
||||
ds1: # 自定义数据源名称
|
||||
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource # 连接池提供方完整类名(Spring默认Hikari)
|
||||
driverClassName: com.mysql.cj.jdbc.Driver # JDBC驱动
|
||||
url: jdbc:mysql://127.0.0.1:3306/sharding2?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 数据库连接URL
|
||||
username: root # 用户
|
||||
password: 123456 # 密码
|
||||
rules: # 规则 =============
|
||||
- !SHARDING # 注意类似“- !SHARDING”标识不能省略
|
||||
tables:
|
||||
ext_big_data: # 自定义逻辑表名
|
||||
actualDataNodes: ds${0..1}.ext_big_data_$->{0..1} # 由数据源名 + 表名组成(参考 Inline 语法规则)
|
||||
databaseStrategy:
|
||||
standard:
|
||||
shardingColumn: F_Id # 分表依据字段
|
||||
shardingAlgorithmName: myDataSourceAlgorithm
|
||||
tableStrategy: # 表策略 -------
|
||||
standard:
|
||||
shardingColumn: F_Id # 分表依据字段
|
||||
shardingAlgorithmName: myTableAlgorithm
|
||||
|
||||
# defaultDatabaseStrategy: # 库策略 -------
|
||||
# standard:
|
||||
# shardingColumn: F_Id
|
||||
# shardingAlgorithmName: myDataSourceAlgorithm
|
||||
shardingAlgorithms: # 分片算法 -------
|
||||
myDataSourceAlgorithm: # 自定义算法名
|
||||
type: INLINE
|
||||
props:
|
||||
algorithm-expression: ds${(long)(Long.parseLong(F_Id)/10) % 2}
|
||||
myTableAlgorithm: # 自定义算法名
|
||||
type: INLINE
|
||||
props:
|
||||
algorithm-expression: ext_big_data_${(long)(Long.parseLong(F_Id)/10 / 2) % 2}
|
||||
# keyGenerators:
|
||||
# dsKey: # 自定义主键策略名
|
||||
# type: SNOWFLAKE
|
||||
props:
|
||||
sql-show: true
|
||||
Reference in new issue
Block a user