更改项目名称,命名空间,上传更改过的jar包,更改服务名,项目中的类引用路径
已添加953个文件
已重命名260个文件
已删除898个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>UBCS</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <packaging>pom</packaging> |
| | | |
| | | <properties> |
| | | <bladex.project.version>3.0.1.RELEASE</bladex.project.version> |
| | | |
| | | <java.version>1.8</java.version> |
| | | <maven.plugin.version>3.8.0</maven.plugin.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <orai18n.version>11.2.0.4</orai18n.version> |
| | | <spring.boot.version>2.7.1</spring.boot.version> |
| | | <spring.cloud.version>2021.0.3</spring.cloud.version> |
| | | <spring.platform.version>Cairo-SR8</spring.platform.version> |
| | | |
| | | <!-- æ¨è使ç¨Harbor --> |
| | | <docker.registry.url>192.168.0.157</docker.registry.url> |
| | | <docker.registry.host>http://${docker.registry.url}:2375</docker.registry.host> |
| | | <docker.username>admin</docker.username> |
| | | <docker.password>Harbor12345</docker.password> |
| | | <docker.namespace>blade</docker.namespace> |
| | | <docker.plugin.version>1.4.13</docker.plugin.version> |
| | | </properties> |
| | | |
| | | <modules> |
| | | <module>ubcs-auth</module> |
| | | <module>ubcs-common</module> |
| | | <module>ubcs-gateway</module> |
| | | <module>ubcs-ops</module> |
| | | <module>ubcs-ops-api</module> |
| | | <module>ubcs-plugin</module> |
| | | <module>ubcs-plugin-api</module> |
| | | <module>ubcs-service</module> |
| | | <module>ubcs-service-api</module> |
| | | </modules> |
| | | |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade.platform</groupId> |
| | | <artifactId>blade-bom</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-dependencies</artifactId> |
| | | <version>${spring.boot.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-dependencies</artifactId> |
| | | <version>${spring.cloud.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.spring.platform</groupId> |
| | | <artifactId>platform-bom</artifactId> |
| | | <version>${spring.platform.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>${project.name}</finalName> |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | </includes> |
| | | </resource> |
| | | </resources> |
| | | <pluginManagement> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>${spring.boot.version}</version> |
| | | <configuration> |
| | | <fork>true</fork> |
| | | <finalName>${project.build.finalName}</finalName> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <version>${docker.plugin.version}</version> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | </configuration> |
| | | <!--åæå¡æ·»å å¦ä¸é
ç½®ï¼è¿è¡ mvn deploy å½ä»¤ä¾¿ä¼èªå¨æå
éå--> |
| | | <!--<executions> |
| | | <execution> |
| | | <id>default</id> |
| | | <goals> |
| | | <goal>build</goal> |
| | | <goal>push</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions>--> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>run</goal> |
| | | </goals> |
| | | <configuration> |
| | | <tasks> |
| | | <!--suppress UnresolvedMavenProperty --> |
| | | <copy overwrite="true" |
| | | tofile="${session.executionRootDirectory}/target/${project.artifactId}.jar" |
| | | file="${project.build.directory}/${project.artifactId}.jar" /> |
| | | </tasks> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | </plugins> |
| | | </pluginManagement> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | <plugin> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>${maven.plugin.version}</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>UTF-8</encoding> |
| | | <compilerArgs> |
| | | <arg>-parameters</arg> |
| | | </compilerArgs> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>aliyun-repos</id> |
| | | <url>https://maven.aliyun.com/repository/public/</url> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </repository> |
| | | <repository> |
| | | <id>blade-release</id> |
| | | <name>Release Repository</name> |
| | | <url>http://nexus.javablade.com/repository/maven-releases/</url> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | <pluginRepositories> |
| | | <pluginRepository> |
| | | <id>aliyun-plugin</id> |
| | | <url>https://maven.aliyun.com/repository/public/</url> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </pluginRepository> |
| | | </pluginRepositories> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #æå¡çæéåï¼å¹¶è¿è¡ |
| | | start(){ |
| | | |
| | | #å
æ¸
空targetå¹¶æå
|
| | | mvn clean package |
| | | |
| | | #å¯å¨adminæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-admin/Dockerfile -t vci-ubcs/ubcs-admin . |
| | | docker run -d -p 36002:36002 --name ubcs-admin vci-ubcs/ubcs-admin:latest |
| | | |
| | | #å¯å¨authæå¡ |
| | | docker build -f ./ubcs-auth/Dockerfile -t vci-ubcs/ubcs-auth . |
| | | docker run -d -p 36001:36001 --name ubcs-auth vci-ubcs/ubcs-auth:latest |
| | | |
| | | #å¯å¨logæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-log/Dockerfile -t vci-ubcs/ubcs-log . |
| | | docker run -d -p 36005:36005 --name ubcs-log vci-ubcs/ubcs-log:latest |
| | | |
| | | #å¯å¨deskæå¡ |
| | | docker build -f ./ubcs-service/ubcs-desk/Dockerfile -t vci-ubcs/ubcs-desk . |
| | | docker run -d -p 36010:36010 --name ubcs-desk vci-ubcs/ubcs-desk:latest |
| | | |
| | | #å¯å¨å·¥ä½æµflowæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-flow/Dockerfile -t vci-ubcs/ubcs-flow . |
| | | docker run -d -p 36004:36004 --name ubcs-flow vci-ubcs/ubcs-flow:latest |
| | | |
| | | #å¯å¨developæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-develop/Dockerfile -t vci-ubcs/ubcs-develop . |
| | | docker run -d -p 36003:36003 --name ubcs-develop vci-ubcs/ubcs-develop:latest |
| | | |
| | | #å¯å¨jobAdminæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-xxljob-admin/Dockerfile -t vci-ubcs/ubcs-jobadmin . |
| | | docker run -d -p 36013:36013 --name ubcs-jobadmin vci-ubcs/ubcs-jobadmin:latest |
| | | |
| | | #å¯å¨jobæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-xxljob/Dockerfile -t vci-ubcs/ubcs-job . |
| | | docker run -d -p 36009:36009 --name ubcs-job vci-ubcs/ubcs-job:latest |
| | | |
| | | #å¯å¨reportæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-report/Dockerfile -t vci-ubcs/ubcs-report . |
| | | docker run -d -p 36006:36006 --name ubcs-report vci-ubcs/ubcs-report:latest |
| | | |
| | | #å¯å¨Resourceæå¡ |
| | | docker build -f ./ubcs-ops/ubcs-resource/Dockerfile -t vci-ubcs/ubcs-resource . |
| | | docker run -d -p 36007:36007 --name ubcs-rresource vci-ubcs/ubcs-resource:latest |
| | | |
| | | #å¯å¨swaggeræå¡ |
| | | docker build -f ./ubcs-ops/ubcs-swagger/Dockerfile -t vci-ubcs/ubcs-swagger . |
| | | docker run -d -p 36008:36008 --name ubcs-swagger vci-ubcs/ubcs-swagger:latest |
| | | |
| | | #å¯å¨systemæå¡ |
| | | docker build -f ./ubcs-service/ubcs-system/Dockerfile -t vci-ubcs/ubcs-system . |
| | | docker run -d -p 36011:36011 --name ubcs-system vci-ubcs/ubcs-system:latest |
| | | |
| | | #å¯å¨useræå¡ |
| | | docker build -f ./ubcs-service/ubcs-user/Dockerfile -t vci-ubcs/ubcs-user . |
| | | docker run -d -p 36012:36012 --name ubcs-user vci-ubcs/ubcs-user:latest |
| | | |
| | | #å¯å¨gatewayæå¡ |
| | | docker build -f ./ubcs-gateway/Dockerfile -t vci-ubcs/ubcs-gateway . |
| | | docker run -d -p 37000:37000 --name ubcs-gateway vci-ubcs/ubcs-gateway:latest |
| | | |
| | | #å¯å¨omdyæå¡ |
| | | docker build -f ./ubcs-omd/Dockerfile -t vci-ubcs/ubcs-omd . |
| | | docker run -d -p 36015:36015 --name ubcs-omd vci-ubcs/ubcs-omd:latest |
| | | |
| | | #å¯å¨codeæå¡ |
| | | docker build -f ./ubcs-code/Dockerfile -t vci-ubcs/ubcs-code . |
| | | docker run -d -p 36013:36013 --name ubcs-code vci-ubcs/ubcs-code:latest |
| | | |
| | | |
| | | #å
¶ä»æå¡è¯·èªè¡æ·»å |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | start |
| | | |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #忢容å¨è¿è¡åå é¤å¯¹åºéåæ¹æ³ |
| | | stop(){ |
| | | #å®ä¹å®¹å¨åéåçåç§° |
| | | imagesName=vci-ubcs/ubcs- |
| | | #å®ä¹æå¡åç§° |
| | | containerName=ubcs-auth |
| | | #妿åå¨ï¼å°±å
³éå¹¶ä¸å é¤è¯¥å®¹å¨ |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-admin |
| | | containerName=ubcs-admin |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-auth |
| | | containerName=ubcs-auth |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-log |
| | | containerName=ubcs-log |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-desk |
| | | containerName=ubcs-desk |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-flow |
| | | containerName=ubcs-flow |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-develop |
| | | containerName=ubcs-develop |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-jobadmin |
| | | containerName=ubcs-jobadmin |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-job |
| | | containerName=ubcs-job |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-report |
| | | containerName=ubcs-report |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-resource |
| | | containerName=ubcs-resource |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-swagger |
| | | containerName=ubcs-swagger |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-system |
| | | containerName=ubcs-system |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-user |
| | | containerName=ubcs-user |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-gateway |
| | | containerName=ubcs-gateway |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-omd |
| | | containerName=ubcs-omd |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | imagesName=vci-ubcs/ubcs-code |
| | | containerName=ubcs-code |
| | | if [[ -n $(docker ps -q -f "name=$containerName") ]];then |
| | | echo $containerName"is up,we will stop and remove it !!!" |
| | | docker stop $containerName |
| | | docker rm $containerName |
| | | docker rmi $imagesName |
| | | else |
| | | echo $containerName" is not up!!!" |
| | | fi |
| | | |
| | | #å
¶ä»æå¡éè¦ï¼è¯·èªè¡æ·»å |
| | | |
| | | |
| | | } |
| | | stop |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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"> |
| | | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <parent> |
| | | <artifactId>UBCS</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | |
| | | <artifactId>ubcs-auth</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-scope-api</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-db</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-cloud</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-metrics</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-swagger</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-social</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-user-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-system-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <!--å®å
¨æ¨¡å--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security.oauth</groupId> |
| | | <artifactId>spring-security-oauth2</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-jwt</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.data</groupId> |
| | | <artifactId>spring-data-redis</artifactId> |
| | | </dependency> |
| | | <!-- éªè¯ç --> |
| | | <dependency> |
| | | <groupId>com.github.whvcse</groupId> |
| | | <artifactId>easy-captcha</artifactId> |
| | | </dependency> |
| | | <!--freemarker--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-freemarker</artifactId> |
| | | </dependency> |
| | | <!--oracle驱å¨--> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | <!-- é¾è·¯è¿½è¸ªãæå¡çæ§ --> |
| | | <!--<dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-trace</artifactId> |
| | | </dependency>--> |
| | | <!-- è§£å³Java11æ æ³è¿è¡çé®é¢ --> |
| | | <!--<dependency> |
| | | <groupId>javax.xml.bind</groupId> |
| | | <artifactId>jaxb-api</artifactId> |
| | | <version>2.2.11</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.sun.xml.bind</groupId> |
| | | <artifactId>jaxb-core</artifactId> |
| | | <version>2.2.11</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.sun.xml.bind</groupId> |
| | | <artifactId>jaxb-impl</artifactId> |
| | | <version>2.2.11</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.activation</groupId> |
| | | <artifactId>activation</artifactId> |
| | | <version>1.1.1</version> |
| | | </dependency>--> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth; |
| | | |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * ç¨æ·è®¤è¯æå¡å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class AuthApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_AUTH_NAME, AuthApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.config; |
| | | |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import com.vci.ubcs.auth.constant.AuthConstant; |
| | | import com.vci.ubcs.auth.granter.BladeTokenGranter; |
| | | import com.vci.ubcs.auth.service.BladeClientDetailsServiceImpl; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.social.props.SocialProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.core.userdetails.UserDetailsService; |
| | | import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; |
| | | import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; |
| | | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; |
| | | import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; |
| | | import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer; |
| | | import org.springframework.security.oauth2.provider.TokenGranter; |
| | | import org.springframework.security.oauth2.provider.token.TokenEnhancer; |
| | | import org.springframework.security.oauth2.provider.token.TokenEnhancerChain; |
| | | import org.springframework.security.oauth2.provider.token.TokenStore; |
| | | import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; |
| | | |
| | | import javax.sql.DataSource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è®¤è¯æå¡å¨é
ç½® |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Order |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | @EnableAuthorizationServer |
| | | public class BladeAuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter { |
| | | |
| | | private final DataSource dataSource; |
| | | |
| | | private final AuthenticationManager authenticationManager; |
| | | |
| | | private final UserDetailsService userDetailsService; |
| | | |
| | | private final TokenStore tokenStore; |
| | | |
| | | private final TokenEnhancer jwtTokenEnhancer; |
| | | |
| | | private final JwtAccessTokenConverter jwtAccessTokenConverter; |
| | | |
| | | private final BladeRedis bladeRedis; |
| | | |
| | | private final IUserClient userClient; |
| | | |
| | | private final SocialProperties socialProperties; |
| | | |
| | | @Override |
| | | public void configure(AuthorizationServerEndpointsConfigurer endpoints) { |
| | | //è·åèªå®ä¹tokenGranter |
| | | TokenGranter tokenGranter = BladeTokenGranter.getTokenGranter(authenticationManager, endpoints, bladeRedis, userClient, socialProperties); |
| | | |
| | | //é
ç½®ç«¯ç¹ |
| | | endpoints.tokenStore(tokenStore) |
| | | .authenticationManager(authenticationManager) |
| | | .userDetailsService(userDetailsService) |
| | | .tokenGranter(tokenGranter); |
| | | |
| | | //æ©å±tokenè¿åç»æ |
| | | if (jwtAccessTokenConverter != null && jwtTokenEnhancer != null) { |
| | | TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain(); |
| | | List<TokenEnhancer> enhancerList = new ArrayList<>(); |
| | | enhancerList.add(jwtTokenEnhancer); |
| | | enhancerList.add(jwtAccessTokenConverter); |
| | | tokenEnhancerChain.setTokenEnhancers(enhancerList); |
| | | //jwtå¢å¼º |
| | | endpoints.tokenEnhancer(tokenEnhancerChain).accessTokenConverter(jwtAccessTokenConverter); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * é
置客æ·ç«¯ä¿¡æ¯ |
| | | * æå¡å¯å¨æ¶å è½½sql |
| | | * ä½ç¨ï¼æ¥è¯¢clientä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | @SneakyThrows |
| | | public void configure(ClientDetailsServiceConfigurer clients) { |
| | | BladeClientDetailsServiceImpl clientDetailsService = new BladeClientDetailsServiceImpl(dataSource); |
| | | clientDetailsService.setSelectClientDetailsSql(AuthConstant.DEFAULT_SELECT_STATEMENT); |
| | | clientDetailsService.setFindClientDetailsSql(AuthConstant.DEFAULT_FIND_STATEMENT); |
| | | clients.withClientDetails(clientDetailsService); |
| | | } |
| | | |
| | | @Override |
| | | public void configure(AuthorizationServerSecurityConfigurer oauthServer) { |
| | | oauthServer |
| | | .allowFormAuthenticationForClients() |
| | | .tokenKeyAccess("permitAll()") |
| | | .checkTokenAccess("isAuthenticated()"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; |
| | | |
| | | /** |
| | | * èªå®ä¹èµæºæ¾è¡ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | public class BladeResourceServerConfiguration extends ResourceServerConfigurerAdapter { |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | public void configure(HttpSecurity http) { |
| | | http.authorizeRequests() |
| | | .antMatchers( |
| | | "/actuator/**", |
| | | "/oauth/captcha", |
| | | "/oauth/logout", |
| | | "/oauth/clear-cache", |
| | | "/oauth/render/**", |
| | | "/oauth/callback/**", |
| | | "/oauth/revoke/**", |
| | | "/oauth/refresh/**", |
| | | "/oauth/login", |
| | | "/oauth/form", |
| | | "/token/**", |
| | | "/mobile/**", |
| | | "/static/**", |
| | | "/v2/api-docs").permitAll() |
| | | .anyRequest().authenticated().and() |
| | | .csrf().disable(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.config; |
| | | |
| | | import com.vci.ubcs.auth.support.BladeJwtTokenEnhancer; |
| | | import org.springblade.core.jwt.props.JwtProperties; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.jwt.crypto.sign.MacSigner; |
| | | import org.springframework.security.jwt.crypto.sign.SignatureVerifier; |
| | | import org.springframework.security.oauth2.provider.token.TokenEnhancer; |
| | | import org.springframework.security.oauth2.provider.token.TokenStore; |
| | | import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; |
| | | import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; |
| | | |
| | | /** |
| | | * JwtTokenStore |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @ConditionalOnProperty(prefix = "blade.security.oauth2", name = "storeType", havingValue = "jwt", matchIfMissing = true) |
| | | public class JwtTokenStoreConfiguration { |
| | | |
| | | /** |
| | | * 使ç¨jwtTokenStoreåå¨token |
| | | */ |
| | | @Bean |
| | | public TokenStore jwtTokenStore(JwtProperties jwtProperties) { |
| | | return new JwtTokenStore(getJwtAccessTokenConverter(jwtProperties)); |
| | | } |
| | | |
| | | /** |
| | | * ç¨äºçæjwt |
| | | */ |
| | | @Bean |
| | | public JwtAccessTokenConverter jwtAccessTokenConverter(JwtProperties jwtProperties) { |
| | | return getJwtAccessTokenConverter(jwtProperties); |
| | | } |
| | | |
| | | /** |
| | | * èªå®ä¹ JwtAccessTokenConverter |
| | | */ |
| | | private JwtAccessTokenConverter getJwtAccessTokenConverter(JwtProperties jwtProperties) { |
| | | JwtAccessTokenConverter accessTokenConverter = new JwtAccessTokenConverter(); |
| | | accessTokenConverter.setSigningKey(jwtProperties.getSignKey()); |
| | | SignatureVerifier verifier = new MacSigner(jwtProperties.getSignKey()); |
| | | accessTokenConverter.setVerifier(verifier); |
| | | return accessTokenConverter; |
| | | } |
| | | |
| | | /** |
| | | * ç¨äºæ©å±jwt |
| | | */ |
| | | @Bean |
| | | @ConditionalOnMissingBean(name = "jwtTokenEnhancer") |
| | | public TokenEnhancer jwtTokenEnhancer(JwtAccessTokenConverter jwtAccessTokenConverter, JwtProperties jwtProperties) { |
| | | return new BladeJwtTokenEnhancer(jwtAccessTokenConverter, jwtProperties); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import com.vci.ubcs.auth.support.BladePasswordEncoderFactories; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.config.annotation.web.builders.WebSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | /** |
| | | * Securityé
ç½® |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { |
| | | |
| | | @Bean |
| | | @Override |
| | | @SneakyThrows |
| | | public AuthenticationManager authenticationManagerBean() { |
| | | return super.authenticationManagerBean(); |
| | | } |
| | | |
| | | @Bean |
| | | public PasswordEncoder passwordEncoder() { |
| | | return BladePasswordEncoderFactories.createDelegatingPasswordEncoder(); |
| | | } |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | protected void configure(HttpSecurity http) { |
| | | http.headers().frameOptions().disable(); |
| | | http.httpBasic().and().csrf().disable(); |
| | | http.formLogin().loginPage("/oauth/login").loginProcessingUrl("/oauth/form"); |
| | | } |
| | | |
| | | @Override |
| | | public void configure(WebSecurity web) { |
| | | web.ignoring().antMatchers("/js/*.js", "/css/*.css"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.constant; |
| | | |
| | | /** |
| | | * æææ ¡éªå¸¸é |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface AuthConstant { |
| | | |
| | | /** |
| | | * å¯ç å å¯è§å |
| | | */ |
| | | String ENCRYPT = "{blade}"; |
| | | |
| | | /** |
| | | * pl_sys_clientè¡¨åæ®µ |
| | | */ |
| | | String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, Resource_ids, scope, authorized_grant_types, " + |
| | | "web_server_redirect_uri, authorities, access_token_validity, " + |
| | | "refresh_token_validity, additional_information, autoapprove"; |
| | | |
| | | /** |
| | | * pl_sys_clientæ¥è¯¢è¯å¥ |
| | | */ |
| | | String BASE_STATEMENT = "select " + CLIENT_FIELDS + " from pl_sys_client"; |
| | | |
| | | /** |
| | | * pl_sys_clientæ¥è¯¢æåº |
| | | */ |
| | | String DEFAULT_FIND_STATEMENT = BASE_STATEMENT + " order by client_id"; |
| | | |
| | | /** |
| | | * æ¥è¯¢client_id |
| | | */ |
| | | String DEFAULT_SELECT_STATEMENT = BASE_STATEMENT + " where client_id = ?"; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.endpoint; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.zhyd.oauth.model.AuthCallback; |
| | | import me.zhyd.oauth.model.AuthToken; |
| | | import me.zhyd.oauth.request.AuthRequest; |
| | | import me.zhyd.oauth.utils.AuthStateUtils; |
| | | import org.springblade.core.social.props.SocialProperties; |
| | | import org.springblade.core.social.utils.SocialUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * SocialEndpoint |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @Slf4j |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @ConditionalOnProperty(value = "social.enabled", havingValue = "true") |
| | | public class BladeSocialEndpoint { |
| | | |
| | | private final SocialProperties socialProperties; |
| | | |
| | | /** |
| | | * ææå®æ¯è·³è½¬ |
| | | */ |
| | | @RequestMapping("/oauth/render/{source}") |
| | | public void renderAuth(@PathVariable("source") String source, HttpServletResponse response) throws IOException { |
| | | AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); |
| | | String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); |
| | | response.sendRedirect(authorizeUrl); |
| | | } |
| | | |
| | | /** |
| | | * è·å认è¯ä¿¡æ¯ |
| | | */ |
| | | @RequestMapping("/oauth/callback/{source}") |
| | | public Object login(@PathVariable("source") String source, AuthCallback callback) { |
| | | AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); |
| | | return authRequest.login(callback); |
| | | } |
| | | |
| | | /** |
| | | * æ¤éææ |
| | | */ |
| | | @RequestMapping("/oauth/revoke/{source}/{token}") |
| | | public Object revokeAuth(@PathVariable("source") String source, @PathVariable("token") String token) { |
| | | AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); |
| | | return authRequest.revoke(AuthToken.builder().accessToken(token).build()); |
| | | } |
| | | |
| | | /** |
| | | * ç»æä»¤ç |
| | | */ |
| | | @RequestMapping("/oauth/refresh/{source}") |
| | | public Object refreshAuth(@PathVariable("source") String source, String token) { |
| | | AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); |
| | | return authRequest.refresh(AuthToken.builder().refreshToken(token).build()); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.endpoint; |
| | | |
| | | import com.wf.captcha.SpecCaptcha; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.vci.ubcs.common.cache.CacheNames; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.jwt.props.JwtProperties; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.security.oauth2.common.OAuth2AccessToken; |
| | | import org.springframework.security.oauth2.common.OAuth2RefreshToken; |
| | | import org.springframework.security.oauth2.provider.AuthorizationRequest; |
| | | import org.springframework.security.oauth2.provider.ClientDetailsService; |
| | | import org.springframework.security.oauth2.provider.token.TokenStore; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import java.time.Duration; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.*; |
| | | |
| | | /** |
| | | * BladeEndPoint |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @Slf4j |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class BladeTokenEndPoint { |
| | | |
| | | private final BladeRedis bladeRedis; |
| | | private final JwtProperties jwtProperties; |
| | | private final ClientDetailsService clientDetailsService; |
| | | private final TokenStore tokenStore; |
| | | |
| | | /** |
| | | * ç»å½é¡µé¢ |
| | | */ |
| | | @GetMapping("/oauth/login") |
| | | public ModelAndView require(ModelAndView model) { |
| | | model.setViewName("login"); |
| | | return model; |
| | | } |
| | | |
| | | /** |
| | | * ææé¡µé¢ |
| | | */ |
| | | @GetMapping("/oauth/confirm_access") |
| | | public ModelAndView confirm(HttpSession session, ModelAndView model) { |
| | | Object auth = session.getAttribute("authorizationRequest"); |
| | | if (auth != null) { |
| | | AuthorizationRequest authorizationRequest = (AuthorizationRequest) auth; |
| | | model.addObject("client", clientDetailsService.loadClientByClientId(authorizationRequest.getClientId())); |
| | | model.addObject("principal", SecurityContextHolder.getContext().getAuthentication().getPrincipal()); |
| | | } |
| | | model.setViewName("confirm"); |
| | | return model; |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/oauth/user-info") |
| | | public R<Authentication> currentUser(Authentication authentication) { |
| | | return R.data(authentication); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯ç |
| | | */ |
| | | @GetMapping("/oauth/captcha") |
| | | public Kv captcha() { |
| | | SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5); |
| | | String verCode = specCaptcha.text().toLowerCase(); |
| | | String key = StringUtil.randomUUID(); |
| | | // åå
¥rediså¹¶è®¾ç½®è¿ææ¶é´ä¸º30åé |
| | | bladeRedis.setEx(CacheNames.CAPTCHA_KEY + key, verCode, Duration.ofMinutes(30)); |
| | | // å°keyåbase64è¿åç»å端 |
| | | return Kv.create().set("key", key).set("image", specCaptcha.toBase64()); |
| | | } |
| | | |
| | | /** |
| | | * éåºç»å½ |
| | | */ |
| | | @GetMapping("/oauth/logout") |
| | | public Kv logout() { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | String token = JwtUtil.getToken(WebUtil.getRequest().getHeader(TokenConstant.HEADER)); |
| | | // æ¸
空redisä¿åçtoken |
| | | if (user != null && jwtProperties.getState()) { |
| | | JwtUtil.removeAccessToken(user.getTenantId(), String.valueOf(user.getUserId()), token); |
| | | } |
| | | // æ¸
ç©ºèµæºæå¡å¨ä¿åçtoken |
| | | OAuth2AccessToken accessToken = tokenStore.readAccessToken(token); |
| | | OAuth2RefreshToken refreshToken = null; |
| | | if (accessToken != null && StringUtil.isNoneBlank(accessToken.getValue())) { |
| | | refreshToken = accessToken.getRefreshToken(); |
| | | tokenStore.removeAccessToken(accessToken); |
| | | } |
| | | if (refreshToken != null && StringUtil.isNoneBlank(refreshToken.getValue())) { |
| | | tokenStore.removeRefreshToken(refreshToken); |
| | | } |
| | | return Kv.create().set("success", "true").set("msg", "success"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼åæ¸
空 |
| | | */ |
| | | @GetMapping("/oauth/clear-cache") |
| | | public Kv clearCache() { |
| | | CacheUtil.clear(BIZ_CACHE); |
| | | CacheUtil.clear(USER_CACHE); |
| | | CacheUtil.clear(DICT_CACHE); |
| | | CacheUtil.clear(FLOW_CACHE); |
| | | CacheUtil.clear(SYS_CACHE); |
| | | CacheUtil.clear(PARAM_CACHE); |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | CacheUtil.clear(MENU_CACHE); |
| | | CacheUtil.clear(DICT_CACHE, Boolean.FALSE); |
| | | CacheUtil.clear(MENU_CACHE, Boolean.FALSE); |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | CacheUtil.clear(PARAM_CACHE, Boolean.FALSE); |
| | | return Kv.create().set("success", "true").set("msg", "success"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.granter; |
| | | |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.social.props.SocialProperties; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer; |
| | | import org.springframework.security.oauth2.provider.CompositeTokenGranter; |
| | | import org.springframework.security.oauth2.provider.TokenGranter; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * èªå®ä¹æå±TokenGranter |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class BladeTokenGranter { |
| | | |
| | | /** |
| | | * èªå®ä¹tokenGranter |
| | | */ |
| | | public static TokenGranter getTokenGranter(final AuthenticationManager authenticationManager, final AuthorizationServerEndpointsConfigurer endpoints, BladeRedis bladeRedis, IUserClient userClient, SocialProperties socialProperties) { |
| | | // é»è®¤tokenGranteréå |
| | | List<TokenGranter> granters = new ArrayList<>(Collections.singletonList(endpoints.getTokenGranter())); |
| | | // å¢å éªè¯ç æ¨¡å¼ |
| | | granters.add(new CaptchaTokenGranter(authenticationManager, endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), bladeRedis)); |
| | | // å¢å ç¬¬ä¸æ¹ç»éæ¨¡å¼ |
| | | granters.add(new SocialTokenGranter(endpoints.getTokenServices(), endpoints.getClientDetailsService(), endpoints.getOAuth2RequestFactory(), userClient, socialProperties)); |
| | | // ç»åtokenGranteréå |
| | | return new CompositeTokenGranter(granters); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.auth.granter; |
| | | |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springframework.security.authentication.*; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.oauth2.common.exceptions.InvalidGrantException; |
| | | import org.springframework.security.oauth2.provider.*; |
| | | import org.springframework.security.oauth2.provider.token.AbstractTokenGranter; |
| | | import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices; |
| | | |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * éªè¯ç TokenGranter |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class CaptchaTokenGranter extends AbstractTokenGranter { |
| | | |
| | | private static final String GRANT_TYPE = "captcha"; |
| | | |
| | | private final AuthenticationManager authenticationManager; |
| | | |
| | | private BladeRedis bladeRedis; |
| | | |
| | | public CaptchaTokenGranter(AuthenticationManager authenticationManager, |
| | | AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, BladeRedis bladeRedis) { |
| | | this(authenticationManager, tokenServices, clientDetailsService, requestFactory, GRANT_TYPE); |
| | | this.bladeRedis = bladeRedis; |
| | | } |
| | | |
| | | protected CaptchaTokenGranter(AuthenticationManager authenticationManager, AuthorizationServerTokenServices tokenServices, |
| | | ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, String grantType) { |
| | | super(tokenServices, clientDetailsService, requestFactory, grantType); |
| | | this.authenticationManager = authenticationManager; |
| | | } |
| | | |
| | | @Override |
| | | protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) { |
| | | Map<String, String> parameters = new LinkedHashMap<String, String>(tokenRequest.getRequestParameters()); |
| | | String username = parameters.get("username"); |
| | | String password = parameters.get("password"); |
| | | // Protect from downstream leaks of password |
| | | parameters.remove("password"); |
| | | |
| | | Authentication userAuth = new UsernamePasswordAuthenticationToken(username, password); |
| | | ((AbstractAuthenticationToken) userAuth).setDetails(parameters); |
| | | try { |
| | | userAuth = authenticationManager.authenticate(userAuth); |
| | | } |
| | | catch (AccountStatusException | BadCredentialsException ase) { |
| | | //covers expired, locked, disabled cases (mentioned in section 5.2, draft 31) |
| | | throw new InvalidGrantException(ase.getMessage()); |
| | | } |
| | | // If the username/password are wrong the spec says we should send 400/invalid grant |
| | | |
| | | if (userAuth == null || !userAuth.isAuthenticated()) { |
| | | throw new InvalidGrantException("Could not authenticate user: " + username); |
| | | } |
| | | |
| | | OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest); |
| | | return new OAuth2Authentication(storedOAuth2Request, userAuth); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.granter; |
| | | |
| | | import com.vci.ubcs.auth.service.BladeUserDetails; |
| | | import com.vci.ubcs.auth.utils.TokenUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import com.vci.ubcs.system.user.entity.UserInfo; |
| | | import com.vci.ubcs.system.user.entity.UserOauth; |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import me.zhyd.oauth.model.AuthCallback; |
| | | import me.zhyd.oauth.model.AuthResponse; |
| | | import me.zhyd.oauth.model.AuthUser; |
| | | import me.zhyd.oauth.request.AuthRequest; |
| | | import com.vci.ubcs.auth.constant.AuthConstant; |
| | | import org.springblade.core.social.props.SocialProperties; |
| | | import org.springblade.core.social.utils.SocialUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springframework.security.authentication.AbstractAuthenticationToken; |
| | | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.authority.AuthorityUtils; |
| | | import org.springframework.security.oauth2.common.exceptions.InvalidGrantException; |
| | | import org.springframework.security.oauth2.provider.*; |
| | | import org.springframework.security.oauth2.provider.token.AbstractTokenGranter; |
| | | import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¹ç»å½è®¤è¯ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class SocialTokenGranter extends AbstractTokenGranter { |
| | | private static final String GRANT_TYPE = "social"; |
| | | private static final Integer AUTH_SUCCESS_CODE = 2000; |
| | | |
| | | private final IUserClient userClient; |
| | | private final SocialProperties socialProperties; |
| | | |
| | | protected SocialTokenGranter(AuthorizationServerTokenServices tokenServices, ClientDetailsService clientDetailsService, OAuth2RequestFactory requestFactory, IUserClient userClient, SocialProperties socialProperties) { |
| | | super(tokenServices, clientDetailsService, requestFactory, GRANT_TYPE); |
| | | this.userClient = userClient; |
| | | this.socialProperties = socialProperties; |
| | | } |
| | | |
| | | @Override |
| | | protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) { |
| | | // 请æ±å¤´ç§æ·ä¿¡æ¯ |
| | | HttpServletRequest request = WebUtil.getRequest(); |
| | | String tenantId = Func.toStr(request.getHeader(TokenUtil.TENANT_HEADER_KEY), TokenUtil.DEFAULT_TENANT_ID); |
| | | |
| | | Map<String, String> parameters = new LinkedHashMap<>(tokenRequest.getRequestParameters()); |
| | | // 弿¾å¹³å°æ¥æº |
| | | String sourceParameter = parameters.get("source"); |
| | | // å¹é
æ¯å¦æå«åå®ä¹ |
| | | String source = socialProperties.getAlias().getOrDefault(sourceParameter, sourceParameter); |
| | | // 弿¾å¹³å°ææç |
| | | String code = parameters.get("code"); |
| | | // 弿¾å¹³å°ç¶æå |
| | | String state = parameters.get("state"); |
| | | |
| | | // è·å弿¾å¹³å°æææ°æ® |
| | | AuthRequest authRequest = SocialUtil.getAuthRequest(source, socialProperties); |
| | | AuthCallback authCallback = new AuthCallback(); |
| | | authCallback.setCode(code); |
| | | authCallback.setState(state); |
| | | AuthResponse authResponse = authRequest.login(authCallback); |
| | | AuthUser authUser; |
| | | if (authResponse.getCode() == AUTH_SUCCESS_CODE) { |
| | | authUser = (AuthUser) authResponse.getData(); |
| | | } else { |
| | | throw new InvalidGrantException("social grant failure, auth response is not success"); |
| | | } |
| | | |
| | | // ç»è£
æ°æ® |
| | | UserOauth userOauth = Objects.requireNonNull(BeanUtil.copy(authUser, UserOauth.class)); |
| | | userOauth.setSource(authUser.getSource()); |
| | | userOauth.setTenantId(tenantId); |
| | | userOauth.setUuid(authUser.getUuid()); |
| | | |
| | | // è¿ç¨è°ç¨ï¼è·å认è¯ä¿¡æ¯ |
| | | R<UserInfo> result = userClient.userAuthInfo(userOauth); |
| | | BladeUserDetails bladeUserDetails; |
| | | if (result.isSuccess()) { |
| | | User user = result.getData().getUser(); |
| | | Kv detail = result.getData().getDetail(); |
| | | if (user == null || user.getId() == null) { |
| | | throw new InvalidGrantException("social grant failure, user is null"); |
| | | } |
| | | bladeUserDetails = new BladeUserDetails(user.getId(), |
| | | tenantId, result.getData().getOauthId(), user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(result.getData().getRoles()), Func.toStr(userOauth.getAvatar(), TokenUtil.DEFAULT_AVATAR), |
| | | userOauth.getUsername(), AuthConstant.ENCRYPT + user.getPassword(), detail, true, true, true, true, |
| | | AuthorityUtils.commaSeparatedStringToAuthorityList(Func.join(result.getData().getRoles()))); |
| | | } else { |
| | | throw new InvalidGrantException("social grant failure, feign client return error"); |
| | | } |
| | | |
| | | // ç»è£
è®¤è¯æ°æ®ï¼å
³éå¯ç æ ¡éª |
| | | Authentication userAuth = new UsernamePasswordAuthenticationToken(bladeUserDetails, null, bladeUserDetails.getAuthorities()); |
| | | ((AbstractAuthenticationToken) userAuth).setDetails(parameters); |
| | | OAuth2Request storedOAuth2Request = getRequestFactory().createOAuth2Request(client, tokenRequest); |
| | | |
| | | // è¿å OAuth2Authentication |
| | | return new OAuth2Authentication(storedOAuth2Request, userAuth); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.service; |
| | | |
| | | import org.springframework.security.oauth2.provider.ClientDetails; |
| | | import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * 客æ·ç«¯ä¿¡æ¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Component |
| | | public class BladeClientDetailsServiceImpl extends JdbcClientDetailsService { |
| | | |
| | | public BladeClientDetailsServiceImpl(DataSource dataSource) { |
| | | super(dataSource); |
| | | } |
| | | |
| | | /** |
| | | * ç¼å客æ·ç«¯ä¿¡æ¯ |
| | | * clientId=saber |
| | | * @param clientId 客æ·ç«¯id |
| | | */ |
| | | @Override |
| | | public ClientDetails loadClientByClientId(String clientId) { |
| | | try { |
| | | return super.loadClientByClientId(clientId); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.service; |
| | | |
| | | import lombok.Getter; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.userdetails.User; |
| | | |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯æå± |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Getter |
| | | public class BladeUserDetails extends User { |
| | | |
| | | /** |
| | | * ç¨æ·id |
| | | */ |
| | | private final Long userId; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | private final String tenantId; |
| | | /** |
| | | * ç¬¬ä¸æ¹è®¤è¯ID |
| | | */ |
| | | private final String oauthId; |
| | | /** |
| | | * æµç§° |
| | | */ |
| | | private final String name; |
| | | /** |
| | | * çå |
| | | */ |
| | | private final String realName; |
| | | /** |
| | | * è´¦å· |
| | | */ |
| | | private final String account; |
| | | /** |
| | | * é¨é¨id |
| | | */ |
| | | private final String deptId; |
| | | /** |
| | | * å²ä½id |
| | | */ |
| | | private final String postId; |
| | | /** |
| | | * è§è²id |
| | | */ |
| | | private final String roleId; |
| | | /** |
| | | * è§è²å |
| | | */ |
| | | private final String roleName; |
| | | /** |
| | | * 头å |
| | | */ |
| | | private final String avatar; |
| | | /** |
| | | * ç¨æ·è¯¦æ
|
| | | */ |
| | | private final Kv detail; |
| | | /** |
| | | * å¯ç çç¥ä¿®æ¹ç¶æ |
| | | */ |
| | | private Long strategyUpdateStatus; |
| | | |
| | | |
| | | public BladeUserDetails(Long userId, String tenantId, String oauthId, String name, String realName, String deptId, String postId, String roleId, String roleName, String avatar, String username, String password, Kv detail, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities,Long strategyUpdateStatus) { |
| | | super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); |
| | | this.userId = userId; |
| | | this.tenantId = tenantId; |
| | | this.oauthId = oauthId; |
| | | this.name = name; |
| | | this.realName = realName; |
| | | this.account = username; |
| | | this.deptId = deptId; |
| | | this.postId = postId; |
| | | this.roleId = roleId; |
| | | this.roleName = roleName; |
| | | this.avatar = avatar; |
| | | this.detail = detail; |
| | | this.strategyUpdateStatus = strategyUpdateStatus; |
| | | } |
| | | |
| | | public BladeUserDetails(Long userId, String tenantId, String oauthId, String name, String realName, String deptId, String postId, String roleId, String roleName, String avatar, String username, String password, Kv detail, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) { |
| | | super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); |
| | | this.userId = userId; |
| | | this.tenantId = tenantId; |
| | | this.oauthId = oauthId; |
| | | this.name = name; |
| | | this.realName = realName; |
| | | this.account = username; |
| | | this.deptId = deptId; |
| | | this.postId = postId; |
| | | this.roleId = roleId; |
| | | this.roleName = roleName; |
| | | this.avatar = avatar; |
| | | this.detail = detail; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.service; |
| | | |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.vci.ubcs.auth.constant.AuthConstant; |
| | | import com.vci.ubcs.auth.utils.TokenUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import com.vci.ubcs.system.user.entity.UserInfo; |
| | | import com.vci.ubcs.system.user.enums.UserEnum; |
| | | import com.vci.ubcs.system.user.feign.IUserClient; |
| | | import io.jsonwebtoken.Claims; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import me.zhyd.oauth.log.Log; |
| | | import com.vci.ubcs.common.cache.CacheNames; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.jwt.props.JwtProperties; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.*; |
| | | import com.vci.ubcs.system.cache.ParamCache; |
| | | import com.vci.ubcs.system.entity.Strategy; |
| | | import com.vci.ubcs.system.entity.Tenant; |
| | | import com.vci.ubcs.system.feign.ISysClient; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.authority.AuthorityUtils; |
| | | import org.springframework.security.core.authority.SimpleGrantedAuthority; |
| | | import org.springframework.security.core.userdetails.UserDetailsService; |
| | | import org.springframework.security.core.userdetails.UsernameNotFoundException; |
| | | import org.springframework.security.oauth2.common.exceptions.UserDeniedAuthorizationException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.time.Duration; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class BladeUserDetailsServiceImpl implements UserDetailsService { |
| | | |
| | | /** |
| | | * å
许éè¯¯æ¬¡æ° |
| | | */ |
| | | //public static final Integer FAIL_COUNT = 5; |
| | | public static final String FAIL_COUNT_VALUE = "account.failCount"; |
| | | |
| | | /** |
| | | * useræå¡è°ç¨ç±» |
| | | */ |
| | | private final IUserClient userClient; |
| | | |
| | | private final ISysClient sysClient; |
| | | |
| | | private final BladeRedis bladeRedis; |
| | | |
| | | private final JwtProperties jwtProperties; |
| | | |
| | | |
| | | /** |
| | | * è¶
级管çåä¿¡æ¯ |
| | | */ |
| | | @Value("${user-info.tenant-id}") |
| | | private String tenantId; |
| | | @Value("${user-info.user-name}") |
| | | private String userName; |
| | | @Value("${user-info.passwrod}") |
| | | private String password; |
| | | @Value("${user-info.id}") |
| | | private String id; |
| | | @Value("${ip-whitelist.ip-enable}") |
| | | private Boolean ipEnable; |
| | | @Value("#{'${ip-whitelist.ip}'.split(',')}") |
| | | private List<String> ips; |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | public BladeUserDetails loadUserByUsername(String username) { |
| | | HttpServletRequest request = WebUtil.getRequest(); |
| | | // è·åç¨æ·ç»å®ID |
| | | String headerDept = request.getHeader(TokenUtil.DEPT_HEADER_KEY); |
| | | String headerRole = request.getHeader(TokenUtil.ROLE_HEADER_KEY); |
| | | // è·åç§æ·ID |
| | | String headerTenant = request.getHeader(TokenUtil.TENANT_HEADER_KEY); |
| | | String paramTenant = request.getParameter(TokenUtil.TENANT_PARAM_KEY); |
| | | String password = request.getParameter(TokenUtil.PASSWORD_KEY); |
| | | String grantType = request.getParameter(TokenUtil.GRANT_TYPE_KEY); |
| | | // å¤æç§æ·è¯·æ±å¤´ |
| | | if (StringUtil.isAllBlank(headerTenant, paramTenant)) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.TENANT_NOT_FOUND); |
| | | } |
| | | // 夿令çåæ³æ§ |
| | | if (!judgeRefreshToken(grantType, request)) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.TOKEN_NOT_PERMISSION); |
| | | } |
| | | |
| | | // æå®ç§æ·ID |
| | | String tenantId = StringUtils.isBlank(headerTenant) ? paramTenant : headerTenant; |
| | | |
| | | Log.debug("å½åç»å½ç¨æ·çç§æ·Id为ï¼"+tenantId+"å½åç»å½ç¨æ·å为ï¼"+username); |
| | | Strategy strategy = sysClient.getByTenantIdAndName(tenantId, username).getData(); |
| | | |
| | | // 夿ç»å½æ¯å¦éå® |
| | | int count = getFailCount(tenantId, username); |
| | | int failCount = Func.toInt(ParamCache.getValue(FAIL_COUNT_VALUE), Func.toInt(strategy.getLockingNum())); |
| | | |
| | | if (count >= failCount) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_TOO_MANY_FAILS); |
| | | } |
| | | //è¶
级管çåé
ç½®æä»¶é
置账å·å¯ç ï¼å®ç°ç»å½, é»è®¤ç§æ·id为000000 |
| | | if(tenantId.equals(this.tenantId)){ |
| | | if (!this.userName.equals(username) && !password.equalsIgnoreCase(this.password)) { |
| | | setFailCount(tenantId, username, count,strategy.getLockingTime()); |
| | | throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); |
| | | } |
| | | //妿ipæ¯å¯¹ågetæåºå¼å¸¸No value presentå°±ç´æ¥æå¼å¸¸ç»æç»å½ |
| | | if(ipEnable){ |
| | | Log.debug("å½å访é®IPï¼"+getIpAddress(request)); |
| | | try { |
| | | ips.stream().filter(s -> s.equals(getIpAddress(request))).findFirst().get(); |
| | | } catch (Exception e){ |
| | | throw new UserDeniedAuthorizationException(TokenUtil.IP_NOT_FOND); |
| | | } |
| | | } |
| | | |
| | | ArrayList<GrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority("administrator")); |
| | | // æå忏
é¤ç»å½éè¯¯æ¬¡æ° |
| | | delFailCount(tenantId, username); |
| | | Kv kv = Kv.create(); |
| | | kv.set("type","web"); |
| | | return new BladeUserDetails( |
| | | new Long(this.id),this.tenantId, StringPool.EMPTY, "è¶
级管çå", "è¶
级管çå",this.id, this.id,"1123598816738675201", |
| | | "administrator","https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" ,this.userName, AuthConstant.ENCRYPT + this.password, kv, |
| | | true, true, true, true,authorities |
| | | ); |
| | | }else { |
| | | R<Tenant> tenant = sysClient.getTenant(tenantId); |
| | | |
| | | if (tenant.isSuccess()) { |
| | | if (TokenUtil.judgeTenant(tenant.getData())) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_TENANT_PERMISSION); |
| | | } |
| | | } else { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_TENANT); |
| | | } |
| | | |
| | | // è·åç¨æ·ç±»å |
| | | String userType = Func.toStr(request.getHeader(TokenUtil.USER_TYPE_HEADER_KEY), TokenUtil.DEFAULT_USER_TYPE); |
| | | |
| | | // è¿ç¨è°ç¨è¿åæ°æ® |
| | | R<UserInfo> result; |
| | | // æ ¹æ®ä¸åç¨æ·ç±»åè°ç¨å¯¹åºçæ¥å£è¿åæ°æ®ï¼ç¨æ·å¯èªè¡æå± |
| | | if (userType.equals(UserEnum.WEB.getName())) { |
| | | result = userClient.userInfo(tenantId, username, UserEnum.WEB.getName()); |
| | | } else if (userType.equals(UserEnum.APP.getName())) { |
| | | result = userClient.userInfo(tenantId, username, UserEnum.APP.getName()); |
| | | } else { |
| | | result = userClient.userInfo(tenantId, username, UserEnum.OTHER.getName()); |
| | | } |
| | | |
| | | // 夿è¿åä¿¡æ¯ |
| | | if (result.isSuccess()) { |
| | | UserInfo userInfo = result.getData(); |
| | | User user = userInfo.getUser(); |
| | | // ç¨æ·ä¸åå¨,ä½æç¤ºç¨æ·åä¸å¯ç é误并éå®è´¦å· |
| | | if (user == null || user.getId() == null) { |
| | | setFailCount(tenantId, username, count,strategy.getLockingTime()); |
| | | throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); |
| | | } |
| | | String hex = DigestUtil.hex(password); |
| | | // ç¨æ·åå¨ä½å¯ç é误,è¶
è¿æ¬¡æ°åéå®è´¦å· |
| | | if (grantType != null && !grantType.equals(TokenUtil.REFRESH_TOKEN_KEY) && !user.getPassword().equals(hex)) { |
| | | setFailCount(tenantId, username, count,strategy.getLockingTime()); |
| | | throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); |
| | | } |
| | | // ç¨æ·è§è²ä¸åå¨ |
| | | if (Func.isEmpty(userInfo.getRoles())) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_ROLE); |
| | | } |
| | | // å¤é¨é¨æ
åµä¸æå®åé¨é¨ |
| | | if (Func.isNotEmpty(headerDept) && user.getDeptId().contains(headerDept)) { |
| | | user.setDeptId(headerDept); |
| | | } |
| | | // å¤è§è²æ
åµä¸æå®åè§è² |
| | | if (Func.isNotEmpty(headerRole) && user.getRoleId().contains(headerRole)) { |
| | | R<List<String>> roleResult = sysClient.getRoleAliases(headerRole); |
| | | if (roleResult.isSuccess()) { |
| | | userInfo.setRoles(roleResult.getData()); |
| | | } |
| | | user.setRoleId(headerRole); |
| | | } |
| | | // æå忏
é¤ç»å½éè¯¯æ¬¡æ° |
| | | delFailCount(tenantId, username); |
| | | //å¡«å
ç¨æ·ä¿¡æ¯å°ç¨æ·ä¿¡æ¯æ©å±ç±» |
| | | BladeUserDetails bladeUserDetails = new BladeUserDetails(user.getId(), |
| | | user.getTenantId(), StringPool.EMPTY, user.getName(), user.getRealName(), user.getDeptId(), user.getPostId(), user.getRoleId(), Func.join(userInfo.getRoles()), Func.toStr(user.getAvatar(), TokenUtil.DEFAULT_AVATAR), |
| | | username, AuthConstant.ENCRYPT + user.getPassword(), userInfo.getDetail(), true, true, true, true, |
| | | AuthorityUtils.commaSeparatedStringToAuthorityList(Func.join(result.getData().getRoles())),user.getStrategyUpdateStatus()); |
| | | return bladeUserDetails; |
| | | } else { |
| | | throw new UsernameNotFoundException(result.getMsg()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å客æ·ç«¯ipï¼å®¢æ·ç«¯å¯è½ç»è¿ä»£çï¼ä¹å¯è½æ²¡ç»è¿ä»£ç |
| | | * å¦å¼å¯èææºçæ
åµä¹å¯è½å¯¼è´è·åå°çæ¯èææºçip |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static String getIpAddress(HttpServletRequest request){ |
| | | String ip = request.getHeader("x-forwarded-for"); |
| | | if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) { |
| | | // 夿¬¡åå代çå伿å¤ä¸ªipå¼ï¼ç¬¬ä¸ä¸ªipææ¯çå®ip |
| | | ip = ip.split(",")[0]; |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("Proxy-Client-IP"); |
| | | System.out.println("Proxy-Client-IP"+ip); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("WL-Proxy-Client-IP"); |
| | | System.out.println("WL-Proxy-Client-IP"+ip); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_CLIENT_IP"); |
| | | System.out.println("HTTP_CLIENT_IP"+ip); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); |
| | | System.out.println("HTTP_X_FORWARDED_FOR"+ip); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("X-Real-IP"); |
| | | System.out.println("X-Real-IP"+ip); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getRemoteAddr(); |
| | | System.out.println("getRemoteAddr"+ip); |
| | | } |
| | | //å¦ææ²¡åå°ipï¼è¿å"" |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = ""; |
| | | } |
| | | return ip; |
| | | } |
| | | |
| | | /** |
| | | * è·åè´¦å·éè¯¯æ¬¡æ° |
| | | * |
| | | * @param tenantId ç§æ·id |
| | | * @param username è´¦å· |
| | | * @return int |
| | | */ |
| | | private int getFailCount(String tenantId, String username) { |
| | | return Func.toInt(bladeRedis.get(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username)), 0); |
| | | } |
| | | |
| | | /** |
| | | * 设置账å·éè¯¯æ¬¡æ° |
| | | * |
| | | * @param tenantId ç§æ·id |
| | | * @param username è´¦å· |
| | | * @param count æ¬¡æ° |
| | | */ |
| | | private void setFailCount(String tenantId, String username, int count, Long expir) { |
| | | bladeRedis.setEx(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username), count + 1, Duration.ofMinutes(expir)); |
| | | } |
| | | |
| | | /** |
| | | * æ¸
空账å·éè¯¯æ¬¡æ° |
| | | * |
| | | * @param tenantId ç§æ·id |
| | | * @param username è´¦å· |
| | | */ |
| | | private void delFailCount(String tenantId, String username) { |
| | | bladeRedis.del(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, username)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªrefreshTokenåæ³æ§ |
| | | * |
| | | * @param grantType 认è¯ç±»å |
| | | * @param request è¯·æ± |
| | | */ |
| | | private boolean judgeRefreshToken(String grantType, HttpServletRequest request) { |
| | | if (jwtProperties.getState() && jwtProperties.getSingle() && StringUtil.equals(grantType, TokenUtil.REFRESH_TOKEN_KEY)) { |
| | | String refreshToken = request.getParameter(TokenUtil.REFRESH_TOKEN_KEY); |
| | | Claims claims = JwtUtil.parseJWT(refreshToken); |
| | | String tenantId = String.valueOf(claims.get("tenant_id")); |
| | | String userId = String.valueOf(claims.get("user_id")); |
| | | String token = JwtUtil.getRefreshToken(tenantId, userId, refreshToken); |
| | | return StringUtil.equalsIgnoreCase(token, refreshToken); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.support; |
| | | |
| | | import com.vci.ubcs.auth.service.BladeUserDetails; |
| | | import com.vci.ubcs.auth.utils.TokenUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.jwt.props.JwtProperties; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; |
| | | import org.springframework.security.oauth2.common.OAuth2AccessToken; |
| | | import org.springframework.security.oauth2.common.OAuth2RefreshToken; |
| | | import org.springframework.security.oauth2.provider.OAuth2Authentication; |
| | | import org.springframework.security.oauth2.provider.token.TokenEnhancer; |
| | | import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * jwtè¿ååæ°å¢å¼º |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @AllArgsConstructor |
| | | public class BladeJwtTokenEnhancer implements TokenEnhancer { |
| | | |
| | | private final JwtAccessTokenConverter jwtAccessTokenConverter; |
| | | private final JwtProperties jwtProperties; |
| | | |
| | | @Override |
| | | public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { |
| | | BladeUserDetails principal = (BladeUserDetails) authentication.getUserAuthentication().getPrincipal(); |
| | | |
| | | //tokenåæ°å¢å¼º |
| | | Map<String, Object> info = new HashMap<>(16); |
| | | info.put(TokenUtil.CLIENT_ID, TokenUtil.getClientIdFromHeader()); |
| | | info.put(TokenUtil.USER_ID, Func.toStr(principal.getUserId())); |
| | | info.put(TokenUtil.DEPT_ID, Func.toStr(principal.getDeptId())); |
| | | info.put(TokenUtil.POST_ID, Func.toStr(principal.getPostId())); |
| | | info.put(TokenUtil.ROLE_ID, Func.toStr(principal.getRoleId())); |
| | | info.put(TokenUtil.TENANT_ID, principal.getTenantId()); |
| | | info.put(TokenUtil.OAUTH_ID, principal.getOauthId()); |
| | | info.put(TokenUtil.ACCOUNT, principal.getAccount()); |
| | | info.put(TokenUtil.USER_NAME, principal.getUsername()); |
| | | info.put(TokenUtil.NICK_NAME, principal.getName()); |
| | | info.put(TokenUtil.REAL_NAME, principal.getRealName()); |
| | | info.put(TokenUtil.ROLE_NAME, principal.getRoleName()); |
| | | info.put(TokenUtil.AVATAR, principal.getAvatar()); |
| | | info.put(TokenUtil.DETAIL, principal.getDetail()); |
| | | info.put(TokenUtil.LICENSE, TokenUtil.LICENSE_NAME); |
| | | info.put(TokenUtil.STRATEGYUPDATESTATUS, principal.getStrategyUpdateStatus()); |
| | | ((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(info); |
| | | |
| | | //tokenç¶æè®¾ç½® |
| | | if (jwtProperties.getState()) { |
| | | OAuth2AccessToken oAuth2AccessToken = jwtAccessTokenConverter.enhance(accessToken, authentication); |
| | | String accessTokenValue = oAuth2AccessToken.getValue(); |
| | | String tenantId = principal.getTenantId(); |
| | | String userId = Func.toStr(principal.getUserId()); |
| | | JwtUtil.addAccessToken(tenantId, userId, accessTokenValue, accessToken.getExpiresIn()); |
| | | |
| | | if (jwtProperties.getSingle()) { |
| | | OAuth2RefreshToken oAuth2RefreshToken = oAuth2AccessToken.getRefreshToken(); |
| | | String refreshTokenValue = oAuth2RefreshToken.getValue(); |
| | | JwtUtil.addRefreshToken(tenantId, userId, refreshTokenValue, accessToken.getExpiresIn() * 168); |
| | | } |
| | | } |
| | | |
| | | return accessToken; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.support; |
| | | |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | /** |
| | | * æ å¯ç å å¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class BladeNoOpPasswordEncoder implements PasswordEncoder { |
| | | |
| | | @Override |
| | | public String encode(CharSequence rawPassword) { |
| | | return rawPassword.toString(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean matches(CharSequence rawPassword, String encodedPassword) { |
| | | return rawPassword.toString().equals(encodedPassword); |
| | | } |
| | | |
| | | /** |
| | | * Get the singleton {@link BladeNoOpPasswordEncoder}. |
| | | */ |
| | | public static PasswordEncoder getInstance() { |
| | | return INSTANCE; |
| | | } |
| | | |
| | | private static final PasswordEncoder INSTANCE = new BladeNoOpPasswordEncoder(); |
| | | |
| | | private BladeNoOpPasswordEncoder() { |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.support; |
| | | |
| | | import org.springblade.core.tool.utils.DigestUtil; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | |
| | | /** |
| | | * èªå®ä¹å¯ç å å¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class BladePasswordEncoder implements PasswordEncoder { |
| | | |
| | | @Override |
| | | public String encode(CharSequence rawPassword) { |
| | | return DigestUtil.hex((String) rawPassword); |
| | | } |
| | | |
| | | @Override |
| | | public boolean matches(CharSequence rawPassword, String encodedPassword) { |
| | | return encodedPassword.equals(encode(rawPassword)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright 2002-2017 the original author or authors. |
| | | * |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * https://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.vci.ubcs.auth.support; |
| | | |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.DelegatingPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder; |
| | | import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * èªå®ä¹å¯ç å·¥å |
| | | * |
| | | * @author Rob Winch, Chill |
| | | * @since 5.0 |
| | | */ |
| | | public class BladePasswordEncoderFactories { |
| | | |
| | | /** |
| | | * Creates a {@link DelegatingPasswordEncoder} with default mappings. Additional |
| | | * mappings may be added and the encoding will be updated to conform with best |
| | | * practices. However, due to the nature of {@link DelegatingPasswordEncoder} the |
| | | * updates should not impact users. The mappings current are: |
| | | * |
| | | * <ul> |
| | | * <li>blade - {@link BladePasswordEncoder} (sha1(md5("password")))</li> |
| | | * <li>bcrypt - {@link BCryptPasswordEncoder} (Also used for encoding)</li> |
| | | * <li>noop - {@link BladeNoOpPasswordEncoder}</li> |
| | | * <li>pbkdf2 - {@link Pbkdf2PasswordEncoder}</li> |
| | | * <li>scrypt - {@link SCryptPasswordEncoder}</li> |
| | | * </ul> |
| | | * |
| | | * @return the {@link PasswordEncoder} to use |
| | | */ |
| | | public static PasswordEncoder createDelegatingPasswordEncoder() { |
| | | String encodingId = "blade"; |
| | | Map<String, PasswordEncoder> encoders = new HashMap<>(16); |
| | | encoders.put(encodingId, new BladePasswordEncoder()); |
| | | encoders.put("bcrypt", new BCryptPasswordEncoder()); |
| | | encoders.put("noop", BladeNoOpPasswordEncoder.getInstance()); |
| | | encoders.put("pbkdf2", new Pbkdf2PasswordEncoder()); |
| | | encoders.put("scrypt", new SCryptPasswordEncoder()); |
| | | |
| | | return new DelegatingPasswordEncoder(encodingId, encoders); |
| | | } |
| | | |
| | | private BladePasswordEncoderFactories() { |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.auth.utils; |
| | | |
| | | import lombok.SneakyThrows; |
| | | import com.vci.ubcs.common.constant.TenantConstant; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import org.springblade.core.tenant.BladeTenantProperties; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.utils.*; |
| | | import com.vci.ubcs.system.entity.Tenant; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | | import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException; |
| | | import org.springframework.security.oauth2.common.exceptions.UserDeniedAuthorizationException; |
| | | |
| | | import java.util.Base64; |
| | | import java.util.Calendar; |
| | | |
| | | /** |
| | | * 认è¯å·¥å
·ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class TokenUtil { |
| | | |
| | | public final static String AVATAR = TokenConstant.AVATAR; |
| | | public final static String ACCOUNT = TokenConstant.ACCOUNT; |
| | | public final static String USER_NAME = TokenConstant.USER_NAME; |
| | | public final static String NICK_NAME = TokenConstant.NICK_NAME; |
| | | public final static String REAL_NAME = TokenConstant.REAL_NAME; |
| | | public final static String USER_ID = TokenConstant.USER_ID; |
| | | public final static String DEPT_ID = TokenConstant.DEPT_ID; |
| | | public final static String POST_ID = TokenConstant.POST_ID; |
| | | public final static String ROLE_ID = TokenConstant.ROLE_ID; |
| | | public final static String ROLE_NAME = TokenConstant.ROLE_NAME; |
| | | public final static String TENANT_ID = TokenConstant.TENANT_ID; |
| | | public final static String OAUTH_ID = TokenConstant.OAUTH_ID; |
| | | public final static String CLIENT_ID = TokenConstant.CLIENT_ID; |
| | | public final static String DETAIL = TokenConstant.DETAIL; |
| | | public final static String LICENSE = TokenConstant.LICENSE; |
| | | public final static String LICENSE_NAME = TokenConstant.LICENSE_NAME; |
| | | public final static String STRATEGYUPDATESTATUS = "strategyUpdateStatus"; |
| | | |
| | | public final static String DEPT_HEADER_KEY = "Dept-Id"; |
| | | public final static String ROLE_HEADER_KEY = "Role-Id"; |
| | | public final static String CAPTCHA_HEADER_KEY = "Captcha-Key"; |
| | | public final static String CAPTCHA_HEADER_CODE = "Captcha-Code"; |
| | | public final static String CAPTCHA_NOT_CORRECT = "éªè¯ç 䏿£ç¡®"; |
| | | public final static String TENANT_HEADER_KEY = "Tenant-Id"; |
| | | public final static String TENANT_PARAM_KEY = "tenant_id"; |
| | | public final static String DEFAULT_TENANT_ID = "000000"; |
| | | public final static String TENANT_NOT_FOUND = "ç§æ·IDæªæ¾å°"; |
| | | public final static String USER_TYPE_HEADER_KEY = "User-Type"; |
| | | public final static String DEFAULT_USER_TYPE = "web"; |
| | | public final static String TOKEN_NOT_PERMISSION = "ä»¤çææå·²è¿æ"; |
| | | public final static String USER_NOT_FOUND = "ç¨æ·åæå¯ç é误"; |
| | | public final static String USER_HAS_NO_ROLE = "æªè·å¾ç¨æ·çè§è²ä¿¡æ¯"; |
| | | public final static String USER_HAS_NO_TENANT = "æªè·å¾ç¨æ·çç§æ·ä¿¡æ¯"; |
| | | public final static String USER_HAS_NO_TENANT_PERMISSION = "ç§æ·ææå·²è¿æ,请è系管çå"; |
| | | public final static String USER_HAS_TOO_MANY_FAILS = "ç»å½é误次æ°è¿å¤,请ç¨ååè¯"; |
| | | public final static String IP_NOT_FOND = "该IPå°åæ è®¿é®æéï¼è¯·é
ç½®IPç½åå"; |
| | | public final static String HEADER_KEY = "Authorization"; |
| | | public final static String HEADER_PREFIX = "Basic "; |
| | | public final static String DEFAULT_AVATAR = ""; |
| | | public final static String PASSWORD_KEY = "password"; |
| | | public final static String GRANT_TYPE_KEY = "grant_type"; |
| | | public final static String REFRESH_TOKEN_KEY = "refresh_token"; |
| | | |
| | | private static BladeTenantProperties tenantProperties; |
| | | |
| | | /** |
| | | * è·åç§æ·é
ç½® |
| | | * |
| | | * @return tenantProperties |
| | | */ |
| | | private static BladeTenantProperties getTenantProperties() { |
| | | if (tenantProperties == null) { |
| | | tenantProperties = SpringUtil.getBean(BladeTenantProperties.class); |
| | | } |
| | | return tenantProperties; |
| | | } |
| | | |
| | | /** |
| | | * è§£ç |
| | | */ |
| | | @SneakyThrows |
| | | public static String[] extractAndDecodeHeader() { |
| | | String header = WebUtil.getRequest().getHeader(TokenUtil.HEADER_KEY); |
| | | if (header == null || !header.startsWith(TokenUtil.HEADER_PREFIX)) { |
| | | throw new UnapprovedClientAuthenticationException("请æ±å¤´ä¸æ clientä¿¡æ¯"); |
| | | } |
| | | |
| | | byte[] base64Token = header.substring(6).getBytes(Charsets.UTF_8_NAME); |
| | | |
| | | byte[] decoded; |
| | | try { |
| | | decoded = Base64.getDecoder().decode(base64Token); |
| | | } catch (IllegalArgumentException var7) { |
| | | throw new BadCredentialsException("Failed to decode basic authentication token"); |
| | | } |
| | | |
| | | String token = new String(decoded, Charsets.UTF_8_NAME); |
| | | int index = token.indexOf(StringPool.COLON); |
| | | if (index == -1) { |
| | | throw new BadCredentialsException("Invalid basic authentication token"); |
| | | } else { |
| | | return new String[]{token.substring(0, index), token.substring(index + 1)}; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å请æ±å¤´ä¸ç客æ·ç«¯id |
| | | */ |
| | | public static String getClientIdFromHeader() { |
| | | String[] tokens = extractAndDecodeHeader(); |
| | | return tokens[0]; |
| | | } |
| | | |
| | | /** |
| | | * è·åtokenè¿ææ¶é´(次æ¥åæ¨3ç¹) |
| | | * |
| | | * @return expire |
| | | */ |
| | | public static int getTokenValiditySecond() { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.add(Calendar.DAY_OF_YEAR, 1); |
| | | cal.set(Calendar.HOUR_OF_DAY, 3); |
| | | cal.set(Calendar.SECOND, 0); |
| | | cal.set(Calendar.MINUTE, 0); |
| | | cal.set(Calendar.MILLISECOND, 0); |
| | | return (int) (cal.getTimeInMillis() - System.currentTimeMillis()) / 1000; |
| | | } |
| | | |
| | | /** |
| | | * è·årefreshTokenè¿ææ¶é´ |
| | | * |
| | | * @return expire |
| | | */ |
| | | public static int getRefreshTokenValiditySeconds() { |
| | | return 60 * 60 * 24 * 15; |
| | | } |
| | | |
| | | /** |
| | | * å¤æç§æ·æé |
| | | * |
| | | * @param tenant ç§æ·ä¿¡æ¯ |
| | | * @return boolean |
| | | */ |
| | | public static boolean judgeTenant(Tenant tenant) { |
| | | if (tenant == null || tenant.getId() == null) { |
| | | throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_TENANT); |
| | | } |
| | | if (StringUtil.equalsIgnoreCase(tenant.getTenantId(), BladeConstant.ADMIN_TENANT_ID)) { |
| | | return false; |
| | | } |
| | | if (getTenantProperties().getLicense()) { |
| | | String licenseKey = tenant.getLicenseKey(); |
| | | String decrypt = DesUtil.decryptFormHex(licenseKey, TenantConstant.DES_KEY); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # å¨ä½¿ç¨Springé»è®¤æ°æ®æºHikariçæ
åµä¸é
置以ä¸é
置项 |
| | | spring: |
| | | datasource: |
| | | hikari: |
| | | # èªå¨æäº¤ä»æ± ä¸è¿åçè¿æ¥ |
| | | auto-commit: true |
| | | # è¿æ¥æ± ä¸ç»´æ¤çæå°ç©ºé²è¿æ¥æ° |
| | | minimum-idle: 10 |
| | | # è¿æ¥æ± ä¸å
许çæå¤§è¿æ¥æ°ã缺çå¼ï¼10ï¼æ¨èçå
¬å¼ï¼((core_count * 2) + effective_spindle_count) |
| | | maximum-pool-size: 60 |
| | | # 空é²è¿æ¥è¶
æ¶æ¶é´ï¼é»è®¤å¼600000ï¼10åéï¼ï¼å¤§äºçäºmax-lifetimeä¸max-lifetime>0ï¼ä¼è¢«é置为0ï¼ä¸çäº0ä¸å°äº10ç§ï¼ä¼è¢«é置为10ç§ã |
| | | # åªæç©ºé²è¿æ¥æ°å¤§äºæå¤§è¿æ¥æ°ä¸ç©ºé²æ¶é´è¶
è¿è¯¥å¼ï¼æä¼è¢«éæ¾ |
| | | idle-timeout: 30000 |
| | | # è¿æ¥æå¤§åæ´»æ¶é´.ä¸çäº0ä¸å°äº30ç§ï¼ä¼è¢«é置为é»è®¤å¼30åé.设置åºè¯¥æ¯mysql设置çè¶
æ¶æ¶é´ç |
| | | max-lifetime: 1800000 |
| | | # çå¾
è¿æ¥æ± åé
è¿æ¥çæå¤§æ¶é¿ï¼æ¯«ç§ï¼ï¼è¶
è¿è¿ä¸ªæ¶é¿è¿æ²¡å¯ç¨çè¿æ¥ååçSQLExceptionï¼ ç¼ºç:30ç§ |
| | | connection-timeout: 30000 |
| | | # è¿æ¥æµè¯æ¥è¯¢ |
| | | #connection-test-query: select 1 |
| | | #connection-test-query: SELECT 1 FROM dual |
| | | freemarker: |
| | | # 模æ¿åç¼å |
| | | suffix: .ftl |
| | | # ææ¡£ç±»å |
| | | content-type: text/html |
| | | # 页é¢ç¼ç |
| | | charset: UTF-8 |
| | | # 页é¢ç¼å |
| | | cache: false |
| | | # 模æ¿è·¯å¾ |
| | | template-loader-path: classpath:/templates/ |
| | | web: |
| | | # èµæºè·¯å¾ |
| | | resources: |
| | | static-locations: classpath:/static/ |
| | | |
| | | #swaggerææ¡£ |
| | | swagger: |
| | | base-packages: |
| | | - org.springblade |
| | | - org.springframework.security.oauth2.provider.endpoint |
| | | |
| | | #ç¬¬ä¸æ¹ç»é |
| | | social: |
| | | oauth: |
| | | GITHUB: |
| | | client-id: 233************ |
| | | client-secret: 233************************************ |
| | | redirect-uri: ${social.domain}/oauth/redirect/github |
| | | GITEE: |
| | | client-id: 233************ |
| | | client-secret: 233************************************ |
| | | redirect-uri: ${social.domain}/oauth/redirect/gitee |
| | | WECHAT_OPEN: |
| | | client-id: 233************ |
| | | client-secret: 233************************************ |
| | | redirect-uri: ${social.domain}/oauth/redirect/wechat |
| | | QQ: |
| | | client-id: 233************ |
| | | client-secret: 233************************************ |
| | | redirect-uri: ${social.domain}/oauth/redirect/qq |
| | | DINGTALK: |
| | | client-id: 233************ |
| | | client-secret: 233************************************ |
| | | redirect-uri: ${social.domain}/oauth/redirect/dingtalk |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>UBCS</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-common</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-launch</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-loadbalancer</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-auto</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | <finalName>${project.name}</finalName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.cache; |
| | | |
| | | /** |
| | | * ç¼åå |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface CacheNames { |
| | | |
| | | /** |
| | | * è¿åæ¼æ¥åçkey |
| | | * |
| | | * @param cacheKey ç¼åkey |
| | | * @param cacheKeyValue ç¼åkeyå¼ |
| | | * @return tenantKey |
| | | */ |
| | | static String cacheKey(String cacheKey, String cacheKeyValue) { |
| | | return cacheKey.concat(cacheKeyValue); |
| | | } |
| | | |
| | | /** |
| | | * è¿åç§æ·æ ¼å¼çkey |
| | | * |
| | | * @param tenantId ç§æ·ç¼å· |
| | | * @param cacheKey ç¼åkey |
| | | * @param cacheKeyValue ç¼åkeyå¼ |
| | | * @return tenantKey |
| | | */ |
| | | static String tenantKey(String tenantId, String cacheKey, String cacheKeyValue) { |
| | | return tenantId.concat(":").concat(cacheKey).concat(cacheKeyValue); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯ç key |
| | | */ |
| | | String CAPTCHA_KEY = "blade:auth::blade:captcha:"; |
| | | |
| | | /** |
| | | * ç»å½å¤±è´¥key |
| | | */ |
| | | String USER_FAIL_KEY = "blade:user::blade:fail:"; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.config; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * å
Œ
±å°è£
å
é
置类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | public class BladeCommonConfiguration { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.constant; |
| | | |
| | | /** |
| | | * éç¨å¸¸é |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface CommonConstant { |
| | | |
| | | /** |
| | | * sword ç³»ç»å |
| | | */ |
| | | String SWORD_NAME = "sword"; |
| | | |
| | | /** |
| | | * saber ç³»ç»å |
| | | */ |
| | | String SABER_NAME = "saber"; |
| | | |
| | | /** |
| | | * 顶级ç¶èç¹id |
| | | */ |
| | | Long TOP_PARENT_ID = 0L; |
| | | |
| | | /** |
| | | * 顶级ç¶èç¹åç§° |
| | | */ |
| | | String TOP_PARENT_NAME = "顶级"; |
| | | |
| | | /** |
| | | * æªå°åç¶æå¼ |
| | | */ |
| | | Integer NOT_SEALED_ID = 0; |
| | | |
| | | /** |
| | | * é»è®¤å¯ç |
| | | */ |
| | | String DEFAULT_PASSWORD = "123456"; |
| | | |
| | | /** |
| | | * é»è®¤å¯ç åæ°å¼ |
| | | */ |
| | | String DEFAULT_PARAM_PASSWORD = "account.initPassword"; |
| | | |
| | | /** |
| | | * é»è®¤æåºå段 |
| | | */ |
| | | String SORT_FIELD = "sort"; |
| | | |
| | | /** |
| | | * æ°æ®æéç±»å |
| | | */ |
| | | Integer DATA_SCOPE_CATEGORY = 1; |
| | | |
| | | /** |
| | | * æ¥å£æéç±»å |
| | | */ |
| | | Integer API_SCOPE_CATEGORY = 2; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.constant; |
| | | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX; |
| | | |
| | | /** |
| | | * å¯å¨å¸¸é |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface LauncherConstant { |
| | | |
| | | /** |
| | | * xxljob |
| | | */ |
| | | String APPLICATION_XXLJOB_NAME = APPLICATION_NAME_PREFIX + "xxljob"; |
| | | |
| | | /** |
| | | * xxljob |
| | | */ |
| | | String APPLICATION_XXLJOB_ADMIN_NAME = APPLICATION_NAME_PREFIX + "xxljob-admin"; |
| | | |
| | | /** |
| | | * nacos dev å°å |
| | | */ |
| | | //String NACOS_DEV_ADDR = "dev.vci-tech.com:38848"; |
| | | String NACOS_DEV_ADDR = "192.168.93.133:38848"; |
| | | |
| | | /** |
| | | * nacos prod å°å |
| | | */ |
| | | //String NACOS_PROD_ADDR = "dev.vci-tech.com:38848"; |
| | | String NACOS_PROD_ADDR = "192.168.93.129:38848"; |
| | | |
| | | /** |
| | | * nacos test å°å |
| | | */ |
| | | //String NACOS_TEST_ADDR = "dev.vci-tech.com:38848"; |
| | | String NACOS_TEST_ADDR = "192.168.93.133:38848"; |
| | | |
| | | /** |
| | | * sentinel dev å°å |
| | | */ |
| | | //String SENTINEL_DEV_ADDR = "127.0.0.1:8858"; |
| | | |
| | | /** |
| | | * sentinel prod å°å |
| | | */ |
| | | //String SENTINEL_PROD_ADDR = "172.30.0.58:8858"; |
| | | |
| | | /** |
| | | * sentinel test å°å |
| | | */ |
| | | //String SENTINEL_TEST_ADDR = "172.30.0.58:8858"; |
| | | |
| | | /** |
| | | * seata dev å°å |
| | | */ |
| | | String SEATA_DEV_ADDR = "127.0.0.1:8091"; |
| | | |
| | | /** |
| | | * seata prod å°å |
| | | */ |
| | | String SEATA_PROD_ADDR = "172.30.0.68:8091"; |
| | | |
| | | /** |
| | | * seata test å°å |
| | | */ |
| | | String SEATA_TEST_ADDR = "172.30.0.68:8091"; |
| | | |
| | | /** |
| | | * zipkin dev å°å |
| | | */ |
| | | String ZIPKIN_DEV_ADDR = "http://dev.vci-tech.com:38006"; |
| | | |
| | | /** |
| | | * zipkin prod å°å |
| | | */ |
| | | String ZIPKIN_PROD_ADDR = "http://172.30.0.71:9411"; |
| | | |
| | | /** |
| | | * zipkin test å°å |
| | | */ |
| | | String ZIPKIN_TEST_ADDR = "http://172.30.0.71:9411"; |
| | | |
| | | /** |
| | | * elk dev å°å |
| | | */ |
| | | String ELK_DEV_ADDR = "dev.vci-tech.com:38002"; |
| | | |
| | | /** |
| | | * elk prod å°å |
| | | */ |
| | | String ELK_PROD_ADDR = "dev.vci-tech.com:38002"; |
| | | |
| | | /** |
| | | * elk test å°å |
| | | */ |
| | | String ELK_TEST_ADDR = "dev.vci-tech.com:38002"; |
| | | |
| | | /** |
| | | * seata fileæ¨¡å¼ |
| | | */ |
| | | String FILE_MODE = "file"; |
| | | |
| | | /** |
| | | * seata nacosæ¨¡å¼ |
| | | */ |
| | | String NACOS_MODE = "nacos"; |
| | | |
| | | /** |
| | | * seata defaultæ¨¡å¼ |
| | | */ |
| | | String DEFAULT_MODE = "default"; |
| | | |
| | | /** |
| | | * seata groupåç¼ |
| | | */ |
| | | String GROUP_NAME = "-group"; |
| | | |
| | | /** |
| | | * seata æå¡ç»æ ¼å¼ |
| | | * |
| | | * @param appName æå¡å |
| | | * @return group |
| | | */ |
| | | static String seataServiceGroup(String appName) { |
| | | return appName.concat(GROUP_NAME); |
| | | } |
| | | |
| | | /** |
| | | * 卿è·ånacoså°å |
| | | * |
| | | * @param profile ç¯å¢åé |
| | | * @return addr |
| | | */ |
| | | static String nacosAddr(String profile) { |
| | | switch (profile) { |
| | | case (AppConstant.PROD_CODE): |
| | | return NACOS_PROD_ADDR; |
| | | case (AppConstant.TEST_CODE): |
| | | return NACOS_TEST_ADDR; |
| | | default: |
| | | return NACOS_DEV_ADDR; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 卿è·åsentinelå°å |
| | | * |
| | | * @param profile ç¯å¢åé |
| | | * @return addr |
| | | */ |
| | | /* static String sentinelAddr(String profile) { |
| | | switch (profile) { |
| | | case (AppConstant.PROD_CODE): |
| | | return SENTINEL_PROD_ADDR; |
| | | case (AppConstant.TEST_CODE): |
| | | return SENTINEL_TEST_ADDR; |
| | | default: |
| | | return SENTINEL_DEV_ADDR; |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 卿è·åseataå°å |
| | | * |
| | | * @param profile ç¯å¢åé |
| | | * @return addr |
| | | */ |
| | | static String seataAddr(String profile) { |
| | | switch (profile) { |
| | | case (AppConstant.PROD_CODE): |
| | | return SEATA_PROD_ADDR; |
| | | case (AppConstant.TEST_CODE): |
| | | return SEATA_TEST_ADDR; |
| | | default: |
| | | return SEATA_DEV_ADDR; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 卿è·åzipkinå°å |
| | | * |
| | | * @param profile ç¯å¢åé |
| | | * @return addr |
| | | */ |
| | | static String zipkinAddr(String profile) { |
| | | switch (profile) { |
| | | case (AppConstant.PROD_CODE): |
| | | return ZIPKIN_PROD_ADDR; |
| | | case (AppConstant.TEST_CODE): |
| | | return ZIPKIN_TEST_ADDR; |
| | | default: |
| | | return ZIPKIN_DEV_ADDR; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 卿è·åelkå°å |
| | | * |
| | | * @param profile ç¯å¢åé |
| | | * @return addr |
| | | */ |
| | | static String elkAddr(String profile) { |
| | | switch (profile) { |
| | | case (AppConstant.PROD_CODE): |
| | | return ELK_PROD_ADDR; |
| | | case (AppConstant.TEST_CODE): |
| | | return ELK_TEST_ADDR; |
| | | default: |
| | | return ELK_DEV_ADDR; |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.constant; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç§æ·å¸¸é |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface TenantConstant { |
| | | |
| | | /** |
| | | * ç§æ·é»è®¤å¯ç KEY |
| | | */ |
| | | String PASSWORD_KEY = "tenant.default.password"; |
| | | |
| | | /** |
| | | * ç§æ·é»è®¤è´¦å·é¢åº¦KEY |
| | | */ |
| | | //String ACCOUNT_NUMBER_KEY = "tenant.default.accountNumber"; |
| | | |
| | | /** |
| | | * ç§æ·é»è®¤èåéåKEY |
| | | */ |
| | | String ACCOUNT_MENU_CODE_KEY = "tenant.default.menuCode"; |
| | | |
| | | /** |
| | | * ç§æ·é»è®¤å¯ç |
| | | */ |
| | | String DEFAULT_PASSWORD = "123456"; |
| | | |
| | | /** |
| | | * ç§æ·ææç é»è®¤16ä½å¯é¥ |
| | | */ |
| | | String DES_KEY = "0000000000000000"; |
| | | |
| | | /** |
| | | * ç§æ·é»è®¤è´¦å·é¢åº¦ |
| | | */ |
| | | //Integer DEFAULT_ACCOUNT_NUMBER = -1; |
| | | |
| | | /** |
| | | * ç§æ·é»è®¤èåéå |
| | | */ |
| | | List<String> MENU_CODES = Arrays.asList( |
| | | "desk", "flow", "work", "monitor", "Resource", "role", "user", "dept", "dictbiz", "topmenu" |
| | | ); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.launch; |
| | | |
| | | import com.vci.ubcs.common.constant.LauncherConstant; |
| | | import org.springblade.core.auto.service.AutoService; |
| | | import org.springblade.core.launch.service.LauncherService; |
| | | import org.springblade.core.launch.utils.PropsUtil; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * å¯å¨åæ°æå± |
| | | * |
| | | * @author smallchil |
| | | */ |
| | | @AutoService(LauncherService.class) |
| | | public class LauncherServiceImpl implements LauncherService { |
| | | |
| | | @Override |
| | | public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
| | | Properties props = System.getProperties(); |
| | | // éç¨æ³¨å |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | System.out.println( LauncherConstant.nacosAddr(profile)); |
| | | //PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.zipkin.base-url", LauncherConstant.zipkinAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false"); |
| | | |
| | | // å¼å¯elkæ¥å¿ |
| | | PropsUtil.setProperty(props, "blade.log.elk.destination", LauncherConstant.elkAddr(profile)); |
| | | |
| | | // seata注åå°å |
| | | // PropsUtil.setProperty(props, "seata.service.grouplist.default", LauncherConstant.seataAddr(profile)); |
| | | // seata注ågroupæ ¼å¼ |
| | | // PropsUtil.setProperty(props, "seata.tx-service-group", LauncherConstant.seataServiceGroup(appName)); |
| | | // seataé
ç½®æå¡group |
| | | // PropsUtil.setProperty(props, "seata.service.vgroup-mapping.".concat(LauncherConstant.seataServiceGroup(appName)), LauncherConstant.DEFAULT_MODE); |
| | | // seataæ³¨åæ¨¡å¼é
ç½® |
| | | // PropsUtil.setProperty(props, "seata.registry.type", LauncherConstant.NACOS_MODE); |
| | | // PropsUtil.setProperty(props, "seata.registry.nacos.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | // PropsUtil.setProperty(props, "seata.config.type", LauncherConstant.NACOS_MODE); |
| | | // PropsUtil.setProperty(props, "seata.config.nacos.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.common.utils; |
| | | |
| | | /** |
| | | * éç¨å·¥å
·ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class CommonUtil { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>UBCS</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-gateway</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-launch</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-undertow</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-launch</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-metrics</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-jwt</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | </dependency> |
| | | <!--Spring--> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-gateway</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bootstrap</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis-reactive</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>de.codecentric</groupId> |
| | | <artifactId>spring-boot-admin-starter-client</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway; |
| | | |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | /** |
| | | * 项ç®å¯å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @EnableScheduling |
| | | @EnableDiscoveryClient |
| | | @SpringBootApplication |
| | | public class GateWayApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_GATEWAY_NAME, GateWayApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.config; |
| | | |
| | | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.ubcs.gateway.handler.ErrorExceptionHandler; |
| | | import org.springframework.boot.autoconfigure.AutoConfigureBefore; |
| | | import org.springframework.boot.autoconfigure.web.ServerProperties; |
| | | import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * å¼å¸¸å¤çé
置类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AutoConfigureBefore(ErrorWebFluxAutoConfiguration.class) |
| | | @EnableConfigurationProperties({ServerProperties.class}) |
| | | public class ErrorHandlerConfiguration { |
| | | |
| | | @Bean |
| | | public ErrorExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) { |
| | | return new ErrorExceptionHandler(objectMapper); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.vci.ubcs.gateway.props.AuthProperties; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.http.server.reactive.ServerHttpResponse; |
| | | import org.springframework.web.cors.reactive.CorsUtils; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import org.springframework.web.server.WebFilter; |
| | | import org.springframework.web.server.WebFilterChain; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | /** |
| | | * è·¯ç±é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Slf4j |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | @EnableConfigurationProperties({AuthProperties.class}) |
| | | public class RouterFunctionConfiguration { |
| | | |
| | | /** |
| | | * è¿éä¸ºæ¯æç请æ±å¤´ï¼å¦ææèªå®ä¹çheaderåæ®µè¯·èªå·±æ·»å |
| | | */ |
| | | private static final String ALLOWED_HEADERS = "X-Requested-With, Tenant-Id, Blade-Auth, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, username, client, knfie4j-gateway-request, knife4j-gateway-code, request-origion"; |
| | | private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD"; |
| | | private static final String ALLOWED_ORIGIN = "*"; |
| | | private static final String ALLOWED_EXPOSE = "*"; |
| | | private static final String MAX_AGE = "18000L"; |
| | | |
| | | /** |
| | | * è·¨åé
ç½® |
| | | */ |
| | | @Bean |
| | | public WebFilter corsFilter() { |
| | | return (ServerWebExchange ctx, WebFilterChain chain) -> { |
| | | ServerHttpRequest request = ctx.getRequest(); |
| | | if (CorsUtils.isCorsRequest(request)) { |
| | | ServerHttpResponse response = ctx.getResponse(); |
| | | HttpHeaders headers = response.getHeaders(); |
| | | headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS); |
| | | headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS); |
| | | headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN); |
| | | headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE); |
| | | headers.add("Access-Control-Max-Age", MAX_AGE); |
| | | headers.add("Access-Control-Allow-Credentials", "true"); |
| | | if (request.getMethod() == HttpMethod.OPTIONS) { |
| | | response.setStatusCode(HttpStatus.OK); |
| | | return Mono.empty(); |
| | | } |
| | | } |
| | | return chain.filter(ctx); |
| | | }; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.dynamic; |
| | | |
| | | import org.springframework.cloud.gateway.event.RefreshRoutesEvent; |
| | | import org.springframework.cloud.gateway.route.RouteDefinition; |
| | | import org.springframework.cloud.gateway.route.RouteDefinitionWriter; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.context.ApplicationEventPublisherAware; |
| | | import org.springframework.stereotype.Service; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¨æè·¯ç±ä¸å¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class DynamicRouteService implements ApplicationEventPublisherAware { |
| | | |
| | | private final RouteDefinitionWriter routeDefinitionWriter; |
| | | |
| | | private ApplicationEventPublisher publisher; |
| | | |
| | | public DynamicRouteService(RouteDefinitionWriter routeDefinitionWriter) { |
| | | this.routeDefinitionWriter = routeDefinitionWriter; |
| | | } |
| | | |
| | | @Override |
| | | public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { |
| | | this.publisher = applicationEventPublisher; |
| | | } |
| | | |
| | | /** |
| | | * å¢å è·¯ç± |
| | | */ |
| | | public String save(RouteDefinition definition) { |
| | | try { |
| | | routeDefinitionWriter.save(Mono.just(definition)).subscribe(); |
| | | this.publisher.publishEvent(new RefreshRoutesEvent(this)); |
| | | return "save success"; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return "save failure"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è·¯ç± |
| | | */ |
| | | public String update(RouteDefinition definition) { |
| | | try { |
| | | this.routeDefinitionWriter.delete(Mono.just(definition.getId())); |
| | | this.routeDefinitionWriter.save(Mono.just(definition)).subscribe(); |
| | | this.publisher.publishEvent(new RefreshRoutesEvent(this)); |
| | | return "update success"; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return "update failure"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è·¯ç± |
| | | */ |
| | | public String updateList(List<RouteDefinition> routeDefinitions) { |
| | | routeDefinitions.forEach(this::update); |
| | | return "update done"; |
| | | } |
| | | |
| | | /** |
| | | * å é¤è·¯ç± |
| | | */ |
| | | public String delete(String id) { |
| | | try { |
| | | this.routeDefinitionWriter.delete(Mono.just(id)); |
| | | return "delete success"; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return "delete failure"; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.dynamic; |
| | | |
| | | import com.alibaba.cloud.nacos.NacosConfigProperties; |
| | | import com.alibaba.cloud.nacos.NacosDiscoveryProperties; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.nacos.api.NacosFactory; |
| | | import com.alibaba.nacos.api.PropertyKeyConst; |
| | | import com.alibaba.nacos.api.config.ConfigService; |
| | | import com.alibaba.nacos.api.config.listener.Listener; |
| | | import com.alibaba.nacos.api.exception.NacosException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.launch.constant.NacosConstant; |
| | | import org.springblade.core.launch.props.BladeProperties; |
| | | import org.springframework.cloud.context.config.annotation.RefreshScope; |
| | | import org.springframework.cloud.gateway.route.RouteDefinition; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | import java.util.Properties; |
| | | import java.util.concurrent.Executor; |
| | | |
| | | /** |
| | | * å¨æè·¯ç±çå¬å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Order |
| | | @Slf4j |
| | | @Component |
| | | @RefreshScope |
| | | public class DynamicRouteServiceListener { |
| | | |
| | | private final DynamicRouteService dynamicRouteService; |
| | | private final NacosDiscoveryProperties nacosDiscoveryProperties; |
| | | private final NacosConfigProperties nacosConfigProperties; |
| | | private final BladeProperties bladeProperties; |
| | | |
| | | public DynamicRouteServiceListener(DynamicRouteService dynamicRouteService, NacosDiscoveryProperties nacosDiscoveryProperties, NacosConfigProperties nacosConfigProperties, BladeProperties bladeProperties) { |
| | | this.dynamicRouteService = dynamicRouteService; |
| | | this.nacosDiscoveryProperties = nacosDiscoveryProperties; |
| | | this.nacosConfigProperties = nacosConfigProperties; |
| | | this.bladeProperties = bladeProperties; |
| | | dynamicRouteServiceListener(); |
| | | } |
| | | |
| | | /** |
| | | * çå¬Nacosä¸åçå¨æè·¯ç±é
ç½® |
| | | */ |
| | | private void dynamicRouteServiceListener() { |
| | | try { |
| | | String dataId = NacosConstant.dataId(bladeProperties.getName(), bladeProperties.getEnv(), NacosConstant.NACOS_CONFIG_JSON_FORMAT); |
| | | String group = nacosConfigProperties.getGroup(); |
| | | Properties properties = new Properties(); |
| | | properties.setProperty(PropertyKeyConst.SERVER_ADDR, nacosDiscoveryProperties.getServerAddr()); |
| | | properties.setProperty(PropertyKeyConst.NAMESPACE, nacosDiscoveryProperties.getNamespace()); |
| | | ConfigService configService = NacosFactory.createConfigService(properties); |
| | | configService.addListener(dataId, group, new Listener() { |
| | | @Override |
| | | public void receiveConfigInfo(String configInfo) { |
| | | List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class); |
| | | dynamicRouteService.updateList(routeDefinitions); |
| | | } |
| | | |
| | | @Override |
| | | public Executor getExecutor() { |
| | | return null; |
| | | } |
| | | }); |
| | | String configInfo = configService.getConfig(dataId, group, 5000); |
| | | if (configInfo != null) { |
| | | List<RouteDefinition> routeDefinitions = JSON.parseArray(configInfo, RouteDefinition.class); |
| | | dynamicRouteService.updateList(routeDefinitions); |
| | | } |
| | | } catch (NacosException ignored) { |
| | | ignored.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.dynamic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * è¿æ»¤å¨å®ä¹æ¨¡å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class GatewayFilter { |
| | | |
| | | /** |
| | | * è¿æ»¤å¨å¯¹åºçName |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 对åºçè·¯ç±è§å |
| | | */ |
| | | private Map<String, String> args = new LinkedHashMap<>(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.dynamic; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * è·¯ç±æè¨å®ä¹æ¨¡å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class GatewayPredicate { |
| | | |
| | | /** |
| | | * æè¨å¯¹åºçName |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * é
ç½®çæè¨è§å |
| | | */ |
| | | private Map<String, String> args = new LinkedHashMap<>(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.dynamic; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Gatewayçè·¯ç±å®ä¹æ¨¡å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class GatewayRoute { |
| | | |
| | | /** |
| | | * è·¯ç±çid |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * è·¯ç±æè¨éåé
ç½® |
| | | */ |
| | | private List<GatewayPredicate> predicates = new ArrayList<>(); |
| | | |
| | | /** |
| | | * è·¯ç±è¿æ»¤å¨éåé
ç½® |
| | | */ |
| | | private List<GatewayFilter> filters = new ArrayList<>(); |
| | | |
| | | /** |
| | | * è·¯ç±è§å转åçç®æ uri |
| | | */ |
| | | private String uri; |
| | | |
| | | /** |
| | | * è·¯ç±æ§è¡çé¡ºåº |
| | | */ |
| | | private int order = 0; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.filter; |
| | | |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.ubcs.gateway.provider.AuthProvider; |
| | | import com.vci.ubcs.gateway.provider.RequestProvider; |
| | | import com.vci.ubcs.gateway.provider.ResponseProvider; |
| | | import io.jsonwebtoken.Claims; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springblade.core.jwt.props.JwtProperties; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import com.vci.ubcs.gateway.props.AuthProperties; |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.core.io.buffer.DataBuffer; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.server.reactive.ServerHttpResponse; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.AntPathMatcher; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import reactor.core.publisher.Flux; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * é´æè®¤è¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @AllArgsConstructor |
| | | public class AuthFilter implements GlobalFilter, Ordered { |
| | | private final AuthProperties authProperties; |
| | | private final ObjectMapper objectMapper; |
| | | private final JwtProperties jwtProperties; |
| | | private final AntPathMatcher antPathMatcher = new AntPathMatcher(); |
| | | |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
| | | //æ ¡éª Token æ¾è¡ |
| | | String originalRequestUrl = RequestProvider.getOriginalRequestUrl(exchange); |
| | | String path = exchange.getRequest().getURI().getPath(); |
| | | if (isSkip(path) || isSkip(originalRequestUrl)) { |
| | | return chain.filter(exchange); |
| | | } |
| | | //æ ¡éª Token åæ³æ§ |
| | | ServerHttpResponse resp = exchange.getResponse(); |
| | | String headerToken = exchange.getRequest().getHeaders().getFirst(AuthProvider.AUTH_KEY); |
| | | String paramToken = exchange.getRequest().getQueryParams().getFirst(AuthProvider.AUTH_KEY); |
| | | if (StringUtils.isBlank(headerToken) && StringUtils.isBlank(paramToken)) { |
| | | return unAuth(resp, "缺失令ç,é´æå¤±è´¥"); |
| | | } |
| | | String auth = StringUtils.isBlank(headerToken) ? paramToken : headerToken; |
| | | String token = JwtUtil.getToken(auth); |
| | | Claims claims = JwtUtil.parseJWT(token); |
| | | if (token == null || claims == null) { |
| | | return unAuth(resp, "è¯·æ±æªææ"); |
| | | } |
| | | //夿 Token ç¶æ |
| | | if (jwtProperties.getState()) { |
| | | String tenantId = String.valueOf(claims.get(TokenConstant.TENANT_ID)); |
| | | String userId = String.valueOf(claims.get(TokenConstant.USER_ID)); |
| | | String accessToken = JwtUtil.getAccessToken(tenantId, userId, token); |
| | | if (!token.equalsIgnoreCase(accessToken)) { |
| | | return unAuth(resp, "令ç已失æ"); |
| | | } |
| | | } |
| | | return chain.filter(exchange); |
| | | } |
| | | |
| | | private boolean isSkip(String path) { |
| | | return AuthProvider.getDefaultSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path)) |
| | | || authProperties.getSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path)) |
| | | || authProperties.getAuth().stream().anyMatch(auth -> antPathMatcher.match(auth.getPattern(), path)) |
| | | || authProperties.getBasic().stream().anyMatch(basic -> antPathMatcher.match(basic.getPattern(), path)) |
| | | || authProperties.getSign().stream().anyMatch(sign -> antPathMatcher.match(sign.getPattern(), path)); |
| | | } |
| | | |
| | | private Mono<Void> unAuth(ServerHttpResponse resp, String msg) { |
| | | resp.setStatusCode(HttpStatus.UNAUTHORIZED); |
| | | resp.getHeaders().add("Content-Type", "application/json;charset=UTF-8"); |
| | | String result = ""; |
| | | try { |
| | | result = objectMapper.writeValueAsString(ResponseProvider.unAuth(msg)); |
| | | } catch (JsonProcessingException e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | DataBuffer buffer = resp.bufferFactory().wrap(result.getBytes(StandardCharsets.UTF_8)); |
| | | return resp.writeWith(Flux.just(buffer)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return -100; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.filter; |
| | | |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.vci.ubcs.gateway.provider.AuthProvider; |
| | | import com.vci.ubcs.gateway.provider.RequestProvider; |
| | | import io.jsonwebtoken.Claims; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.jwt.JwtUtil; |
| | | import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * webflux æ¥å¿è¯·æ±è®°å½ï¼æ¹ä¾¿å¼åè°è¯ãè¯·æ±æ¥å¿è¿æ»¤å¨æåºå°½éä½ã |
| | | * |
| | | * <p> |
| | | * 注æï¼ææ¶ä¸æ¯æç»æä½æå°ï¼æ³å®ç°ï¼è¯·çä¸é¢ç龿¥ã |
| | | * https://stackoverflow.com/questions/45240005/how-to-log-request-and-response-bodies-in-spring-webflux |
| | | * https://github.com/Silvmike/webflux-demo/blob/master/tests/src/test/java/ru/hardcoders/demo/webflux/web_handler/filters/logging |
| | | * </p> |
| | | * |
| | | * @author dream.lu |
| | | */ |
| | | @Slf4j |
| | | @Configuration(proxyBeanMethods = false) |
| | | @RequiredArgsConstructor |
| | | @ConditionalOnProperty(value = "blade.log.request.enabled", havingValue = "true", matchIfMissing = true) |
| | | public class GlobalRequestLogFilter implements GlobalFilter, Ordered { |
| | | private final WebEndpointProperties endpointProperties; |
| | | |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
| | | ServerHttpRequest request = exchange.getRequest(); |
| | | // æå°è¯·æ±è·¯å¾ |
| | | String path = request.getPath().pathWithinApplication().value(); |
| | | |
| | | // å¿½ç¥ endpoint è¯·æ± |
| | | String endpointBasePath = endpointProperties.getBasePath(); |
| | | if (StringUtils.isNotBlank(endpointBasePath) && path.startsWith(endpointBasePath)) { |
| | | return chain.filter(exchange); |
| | | } |
| | | |
| | | String requestUrl = RequestProvider.getOriginalRequestUrl(exchange); |
| | | |
| | | // æå»ºæä¸æ¡é¿ æ¥å¿ï¼é¿å
å¹¶å䏿¥å¿éä¹± |
| | | StringBuilder beforeReqLog = new StringBuilder(300); |
| | | // æ¥å¿åæ° |
| | | List<Object> beforeReqArgs = new ArrayList<>(); |
| | | beforeReqLog.append("\n\n================ Gateway Request Start ================\n"); |
| | | // æå°è·¯ç± |
| | | beforeReqLog.append("===> {}: {}\n"); |
| | | // åæ° |
| | | String requestMethod = request.getMethodValue(); |
| | | beforeReqArgs.add(requestMethod); |
| | | beforeReqArgs.add(requestUrl); |
| | | |
| | | // æå°è¯·æ±å¤´ |
| | | HttpHeaders headers = request.getHeaders(); |
| | | headers.forEach((headerName, headerValue) -> { |
| | | beforeReqLog.append("===Headers=== {}: {}\n"); |
| | | beforeReqArgs.add(headerName); |
| | | if (AuthProvider.AUTH_KEY.toLowerCase().equals(headerName)) { |
| | | String value = headerValue.get(0); |
| | | String token = JwtUtil.getToken(value); |
| | | Claims claims = JwtUtil.parseJWT(token); |
| | | beforeReqArgs.add((claims == null) ? "" : claims.toString()); |
| | | beforeReqLog.append("===Headers=== {}: {}\n"); |
| | | beforeReqArgs.add(headerName.concat("-original")); |
| | | beforeReqArgs.add(headerValue.toArray()); |
| | | } else { |
| | | beforeReqArgs.add(headerValue.toArray()); |
| | | } |
| | | }); |
| | | |
| | | beforeReqLog.append("================ Gateway Request End =================\n"); |
| | | // æå°æ§è¡æ¶é´ |
| | | log.info(beforeReqLog.toString(), beforeReqArgs.toArray()); |
| | | return chain.filter(exchange); |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return Ordered.LOWEST_PRECEDENCE; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.filter; |
| | | |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.http.server.reactive.ServerHttpResponse; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * webflux ç¸åºæ¥å¿ï¼æ¹ä¾¿å¼åè°è¯ï¼æ³¨ææåºè¦ä¼å
ã |
| | | * |
| | | * @author dream.lu |
| | | */ |
| | | @Slf4j |
| | | @Configuration(proxyBeanMethods = false) |
| | | @RequiredArgsConstructor |
| | | @ConditionalOnProperty(value = "blade.log.request.enabled", havingValue = "true", matchIfMissing = true) |
| | | public class GlobalResponseLogFilter implements GlobalFilter, Ordered { |
| | | private final WebEndpointProperties endpointProperties; |
| | | |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
| | | ServerHttpRequest request = exchange.getRequest(); |
| | | // æå°è¯·æ±è·¯å¾ |
| | | String path = request.getPath().pathWithinApplication().value(); |
| | | // å¿½ç¥ endpoint è¯·æ± |
| | | String endpointBasePath = endpointProperties.getBasePath(); |
| | | if (StringUtils.isNotBlank(endpointBasePath) && path.startsWith(endpointBasePath)) { |
| | | return chain.filter(exchange); |
| | | } |
| | | return chain.filter(exchange).then( |
| | | Mono.fromRunnable(() -> { |
| | | MultiValueMap<String, String> queryParams = request.getQueryParams(); |
| | | String requestUrl = UriComponentsBuilder.fromPath(path).queryParams(queryParams).build().toUriString(); |
| | | |
| | | // æå»ºæä¸æ¡é¿ æ¥å¿ï¼é¿å
å¹¶å䏿¥å¿éä¹± |
| | | StringBuilder responseLog = new StringBuilder(300); |
| | | // æ¥å¿åæ° |
| | | List<Object> responseArgs = new ArrayList<>(); |
| | | responseLog.append("\n\n================ Gateway Response Start ================\n"); |
| | | ServerHttpResponse response = exchange.getResponse(); |
| | | // æå°è·¯ç± 200 get: /api/xxx/xxx |
| | | responseLog.append("<=== {} {}: {}\n"); |
| | | // åæ° |
| | | String requestMethod = request.getMethodValue(); |
| | | responseArgs.add(response.getStatusCode().value()); |
| | | responseArgs.add(requestMethod); |
| | | responseArgs.add(requestUrl); |
| | | |
| | | // æå°è¯·æ±å¤´ |
| | | HttpHeaders headers = response.getHeaders(); |
| | | headers.forEach((headerName, headerValue) -> { |
| | | responseLog.append("===Headers=== {}: {}\n"); |
| | | responseArgs.add(headerName); |
| | | responseArgs.add(headerValue.toArray()); |
| | | }); |
| | | |
| | | responseLog.append("================ Gateway Response End =================\n"); |
| | | // æå°æ§è¡æ¶é´ |
| | | log.info(responseLog.toString(), responseArgs.toArray()); |
| | | }) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return Ordered.HIGHEST_PRECEDENCE; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.gateway.filter; |
| | | |
| | | import org.springframework.cloud.gateway.filter.GatewayFilterChain; |
| | | import org.springframework.cloud.gateway.filter.GlobalFilter; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR; |
| | | import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.addOriginalRequestUrl; |
| | | |
| | | /** |
| | | * <p> |
| | | * å
¨å±æ¦æªå¨ï¼ä½ç¨ææçå¾®æå¡ |
| | | * <p> |
| | | * 1. 对请æ±å¤´ä¸åæ°è¿è¡å¤ç from åæ°è¿è¡æ¸
æ´ |
| | | * 2. éåStripPrefix = 1,æ¯æå
¨å± |
| | | * |
| | | * @author lengleng |
| | | */ |
| | | @Component |
| | | public class RequestFilter implements GlobalFilter, Ordered { |
| | | |
| | | /** |
| | | * Process the Web request and (optionally) delegate to the next |
| | | * {@code WebFilter} through the given {@link GatewayFilterChain}. |
| | | * |
| | | * @param exchange the current server exchange |
| | | * @param chain provides a way to delegate to the next filter |
| | | * @return {@code Mono<Void>} to indicate when request processing is complete |
| | | */ |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
| | | // 1. æ¸
æ´è¯·æ±å¤´ä¸from åæ° |
| | | ServerHttpRequest request = exchange.getRequest().mutate() |
| | | .headers(httpHeaders -> httpHeaders.remove("X")) |
| | | .build(); |
| | | |
| | | // 2. éåStripPrefix |
| | | addOriginalRequestUrl(exchange, request.getURI()); |
| | | String rawPath = request.getURI().getRawPath(); |
| | | String newPath = "/" + Arrays.stream(StringUtils.tokenizeToStringArray(rawPath, "/")) |
| | | .skip(1L).collect(Collectors.joining("/")); |
| | | ServerHttpRequest newRequest = request.mutate() |
| | | .path(newPath) |
| | | .build(); |
| | | exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, newRequest.getURI()); |
| | | |
| | | return chain.filter(exchange.mutate().request(newRequest.mutate().build()).build()); |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return -1000; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.handler; |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.vci.ubcs.gateway.provider.ResponseProvider; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.core.io.buffer.DataBufferFactory; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.http.server.reactive.ServerHttpResponse; |
| | | import org.springframework.web.server.ResponseStatusException; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å¼å¸¸å¤ç |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Order(-1) |
| | | @RequiredArgsConstructor |
| | | public class ErrorExceptionHandler implements ErrorWebExceptionHandler { |
| | | |
| | | private final ObjectMapper objectMapper; |
| | | |
| | | @Override |
| | | public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) { |
| | | ServerHttpRequest request = exchange.getRequest(); |
| | | ServerHttpResponse response = exchange.getResponse(); |
| | | |
| | | if (response.isCommitted()) { |
| | | return Mono.error(ex); |
| | | } |
| | | |
| | | response.getHeaders().setContentType(MediaType.APPLICATION_JSON); |
| | | if (ex instanceof ResponseStatusException) { |
| | | response.setStatusCode(((ResponseStatusException) ex).getStatus()); |
| | | } |
| | | |
| | | return response.writeWith(Mono.fromSupplier(() -> { |
| | | DataBufferFactory bufferFactory = response.bufferFactory(); |
| | | try { |
| | | int status = 500; |
| | | if (response.getStatusCode() != null) { |
| | | status = response.getStatusCode().value(); |
| | | } |
| | | Map<String, Object> result = ResponseProvider.response(status, this.buildMessage(request, ex)); |
| | | return bufferFactory.wrap(objectMapper.writeValueAsBytes(result)); |
| | | } catch (JsonProcessingException e) { |
| | | return bufferFactory.wrap(new byte[0]); |
| | | } |
| | | })); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æå»ºå¼å¸¸ä¿¡æ¯ |
| | | */ |
| | | private String buildMessage(ServerHttpRequest request, Throwable ex) { |
| | | String uri = request.getURI().toString(); |
| | | if (uri.endsWith("doc.html")) { |
| | | return "[Swaggerèåç½å
³] å·²è¿ç§»è³ [blade-swagger] æå¡ï¼è¯·å¼å¯ [blade-swagger] æå¡å¹¶è®¿é® [http://127.0.0.1:18000/doc.html]"; |
| | | } |
| | | StringBuilder message = new StringBuilder("Failed to handle request ["); |
| | | message.append(request.getMethodValue()); |
| | | message.append(" "); |
| | | message.append(request.getURI()); |
| | | message.append("]"); |
| | | if (ex != null) { |
| | | message.append(": "); |
| | | message.append(ex.getMessage()); |
| | | } |
| | | return message.toString(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.props; |
| | | |
| | | import com.vci.ubcs.gateway.provider.AuthSecure; |
| | | import com.vci.ubcs.gateway.provider.BasicSecure; |
| | | import com.vci.ubcs.gateway.provider.SignSecure; |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.cloud.context.config.annotation.RefreshScope; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æéè¿æ»¤ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @RefreshScope |
| | | @ConfigurationProperties("blade.secure") |
| | | public class AuthProperties { |
| | | |
| | | /** |
| | | * æ¾è¡APIéå |
| | | */ |
| | | private final List<String> skipUrl = new ArrayList<>(); |
| | | |
| | | /** |
| | | * èªå®ä¹ææé
ç½® |
| | | */ |
| | | private final List<AuthSecure> auth = new ArrayList<>(); |
| | | |
| | | /** |
| | | * åºç¡è®¤è¯é
ç½® |
| | | */ |
| | | private final List<BasicSecure> basic = new ArrayList<>(); |
| | | |
| | | /** |
| | | * ç¾å认è¯é
ç½® |
| | | */ |
| | | private final List<SignSecure> sign = new ArrayList<>(); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.provider; |
| | | |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é´æé
ç½® |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class AuthProvider { |
| | | |
| | | public static final String AUTH_KEY = TokenConstant.HEADER; |
| | | private static final List<String> DEFAULT_SKIP_URL = new ArrayList<>(); |
| | | |
| | | static { |
| | | DEFAULT_SKIP_URL.add("/example"); |
| | | DEFAULT_SKIP_URL.add("/oauth/token/**"); |
| | | DEFAULT_SKIP_URL.add("/oauth/captcha/**"); |
| | | DEFAULT_SKIP_URL.add("/oauth/clear-cache/**"); |
| | | DEFAULT_SKIP_URL.add("/oauth/user-info"); |
| | | DEFAULT_SKIP_URL.add("/oauth/render/**"); |
| | | DEFAULT_SKIP_URL.add("/oauth/callback/**"); |
| | | DEFAULT_SKIP_URL.add("/oauth/revoke/**"); |
| | | DEFAULT_SKIP_URL.add("/oauth/refresh/**"); |
| | | DEFAULT_SKIP_URL.add("/token/**"); |
| | | DEFAULT_SKIP_URL.add("/actuator/**"); |
| | | DEFAULT_SKIP_URL.add("/v2/api-docs/**"); |
| | | DEFAULT_SKIP_URL.add("/auth/**"); |
| | | DEFAULT_SKIP_URL.add("/log/**"); |
| | | DEFAULT_SKIP_URL.add("/menu/routes"); |
| | | DEFAULT_SKIP_URL.add("/menu/auth-routes"); |
| | | DEFAULT_SKIP_URL.add("/menu/top-menu"); |
| | | DEFAULT_SKIP_URL.add("/tenant/info"); |
| | | DEFAULT_SKIP_URL.add("/process/Resource-view"); |
| | | DEFAULT_SKIP_URL.add("/process/diagram-view"); |
| | | DEFAULT_SKIP_URL.add("/manager/check-upload"); |
| | | DEFAULT_SKIP_URL.add("/error/**"); |
| | | DEFAULT_SKIP_URL.add("/assets/**"); |
| | | } |
| | | |
| | | /** |
| | | * é»è®¤æ éé´æçAPI |
| | | */ |
| | | public static List<String> getDefaultSkipUrl() { |
| | | return DEFAULT_SKIP_URL; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.provider; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * èªå®ä¹ææè§å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class AuthSecure { |
| | | /** |
| | | * 请æ±è·¯å¾ |
| | | */ |
| | | private String pattern; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.provider; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * åºç¡ææè§å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class BasicSecure { |
| | | /** |
| | | * 请æ±è·¯å¾ |
| | | */ |
| | | private String pattern; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.provider; |
| | | |
| | | import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import org.springframework.web.util.UriComponentsBuilder; |
| | | |
| | | import java.net.URI; |
| | | import java.util.LinkedHashSet; |
| | | |
| | | /** |
| | | * RequestProvider |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class RequestProvider { |
| | | |
| | | /** |
| | | * è·ååå§url |
| | | * |
| | | * @param exchange |
| | | * @return |
| | | */ |
| | | public static String getOriginalRequestUrl(ServerWebExchange exchange) { |
| | | ServerHttpRequest request = exchange.getRequest(); |
| | | LinkedHashSet<URI> uris = exchange.getRequiredAttribute(ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR); |
| | | URI requestUri = uris.stream().findFirst().orElse(request.getURI()); |
| | | MultiValueMap<String, String> queryParams = request.getQueryParams(); |
| | | return UriComponentsBuilder.fromPath(requestUri.getRawPath()).queryParams(queryParams).build().toUriString(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.provider; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 请æ±ååºè¿å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class ResponseProvider { |
| | | |
| | | /** |
| | | * æå |
| | | * |
| | | * @param message ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> success(String message) { |
| | | return response(200, message); |
| | | } |
| | | |
| | | /** |
| | | * 失败 |
| | | * |
| | | * @param message ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> fail(String message) { |
| | | return response(400, message); |
| | | } |
| | | |
| | | /** |
| | | * æªææ |
| | | * |
| | | * @param message ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> unAuth(String message) { |
| | | return response(401, message); |
| | | } |
| | | |
| | | /** |
| | | * æå¡å¨å¼å¸¸ |
| | | * |
| | | * @param message ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> error(String message) { |
| | | return response(500, message); |
| | | } |
| | | |
| | | /** |
| | | * æå»ºè¿åçJSONæ°æ®æ ¼å¼ |
| | | * |
| | | * @param status ç¶æç |
| | | * @param message ä¿¡æ¯ |
| | | * @return |
| | | */ |
| | | public static Map<String, Object> response(int status, String message) { |
| | | Map<String, Object> map = new HashMap<>(16); |
| | | map.put("code", status); |
| | | map.put("msg", message); |
| | | map.put("data", null); |
| | | return map; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.gateway.provider; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * ç¾åææè§å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class SignSecure { |
| | | /** |
| | | * 请æ±è·¯å¾ |
| | | */ |
| | | private String pattern; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>UBCS</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-ops-api</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>3.0.1.RELEASE</version> |
| | | <packaging>pom</packaging> |
| | | <description>BladeX å¾®æå¡APIéå</description> |
| | | |
| | | <modules> |
| | | <module>ubcs-flow-api</module> |
| | | <module>ubcs-resource-api</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-mybatis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-auto</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | <finalName>${project.name}</finalName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops-api</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-flow-api</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.constant; |
| | | |
| | | /** |
| | | * æµç¨å¸¸é. |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ProcessConstant { |
| | | |
| | | /** |
| | | * è¯·åæµç¨æ è¯ |
| | | */ |
| | | String LEAVE_KEY = "Leave"; |
| | | |
| | | /** |
| | | * æ¥éæµç¨æ è¯ |
| | | */ |
| | | String EXPENSE_KEY = "Expense"; |
| | | |
| | | /** |
| | | * åææ è¯ |
| | | */ |
| | | String PASS_KEY = "pass"; |
| | | |
| | | /** |
| | | * åæä»£å· |
| | | */ |
| | | String PASS_ALIAS = "ok"; |
| | | |
| | | /** |
| | | * åæé»è®¤æ¹å¤ |
| | | */ |
| | | String PASS_COMMENT = "åæ"; |
| | | |
| | | /** |
| | | * 驳åé»è®¤æ¹å¤ |
| | | */ |
| | | String NOT_PASS_COMMENT = "驳å"; |
| | | |
| | | /** |
| | | * å建人åéå |
| | | */ |
| | | String TASK_VARIABLE_CREATE_USER = "createUser"; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.entity; |
| | | |
| | | import com.vci.ubcs.flow.core.constant.ProcessConstant; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 工使µéç¨å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class BladeFlow implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä»»å¡ç¼å· |
| | | */ |
| | | private String taskId; |
| | | /** |
| | | * ä»»å¡åç§° |
| | | */ |
| | | private String taskName; |
| | | /** |
| | | * ä»»å¡å®ä¹Key |
| | | */ |
| | | private String taskDefinitionKey; |
| | | /** |
| | | * 任塿§è¡äººç¼å· |
| | | */ |
| | | private String assignee; |
| | | /** |
| | | * 任塿§è¡äººåç§° |
| | | */ |
| | | private String assigneeName; |
| | | /** |
| | | * æµç¨åç±» |
| | | */ |
| | | private String category; |
| | | /** |
| | | * æµç¨åç±»å |
| | | */ |
| | | private String categoryName; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private Date createTime; |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * ç¾æ¶æ¶é´ |
| | | */ |
| | | private Date claimTime; |
| | | /** |
| | | * åå²ä»»å¡ç»ææ¶é´ |
| | | */ |
| | | private Date historyTaskEndTime; |
| | | /** |
| | | * æ§è¡ID |
| | | */ |
| | | private String executionId; |
| | | /** |
| | | * æµç¨å®ä¾ID |
| | | */ |
| | | private String processInstanceId; |
| | | /** |
| | | * æµç¨ID |
| | | */ |
| | | private String processDefinitionId; |
| | | /** |
| | | * æµç¨æ è¯ |
| | | */ |
| | | private String processDefinitionKey; |
| | | /** |
| | | * æµç¨å |
| | | */ |
| | | private String processDefinitionName; |
| | | /** |
| | | * æµç¨çæ¬ |
| | | */ |
| | | private int processDefinitionVersion; |
| | | /** |
| | | * æµç¨è¯´æ |
| | | */ |
| | | private String processDefinitionDesc; |
| | | /** |
| | | * æµç¨ç®å¾å |
| | | */ |
| | | private String processDefinitionDiagramResName; |
| | | /** |
| | | * æµç¨éå½å |
| | | */ |
| | | private String processDefinitionResName; |
| | | /** |
| | | * åå²ä»»å¡æµç¨å®ä¾ID æ¥çæµç¨å¾ä¼ç¨å° |
| | | */ |
| | | private String historyProcessInstanceId; |
| | | /** |
| | | * æµç¨å®ä¾æ¯å¦ç»æ |
| | | */ |
| | | private String processIsFinished; |
| | | /** |
| | | * å岿´»å¨ID |
| | | */ |
| | | private String historyActivityId; |
| | | /** |
| | | * å岿´»å¨æµç¨ |
| | | */ |
| | | private String historyActivityName; |
| | | /** |
| | | * å岿´»å¨èæ¶ |
| | | */ |
| | | private String historyActivityDurationTime; |
| | | /** |
| | | * ä¸å¡ç»å®Table |
| | | */ |
| | | private String businessTable; |
| | | /** |
| | | * ä¸å¡ç»å®ID |
| | | */ |
| | | private String businessId; |
| | | /** |
| | | * ä»»å¡ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ä»»å¡æè§ |
| | | */ |
| | | private String comment; |
| | | /** |
| | | * æ¯å¦éè¿ |
| | | */ |
| | | private boolean isPass; |
| | | /** |
| | | * æ¯å¦éè¿ä»£å· |
| | | */ |
| | | private String flag; |
| | | /** |
| | | * å¼å§æ¥è¯¢æ¥æ |
| | | */ |
| | | private Date beginDate; |
| | | /** |
| | | * ç»ææ¥è¯¢æ¥æ |
| | | */ |
| | | private Date endDate; |
| | | /** |
| | | * æµç¨åæ° |
| | | */ |
| | | private Map<String, Object> variables; |
| | | |
| | | /** |
| | | * è·åæ¯å¦éè¿ |
| | | */ |
| | | public boolean isPass() { |
| | | return ProcessConstant.PASS_ALIAS.equals(flag) || ProcessConstant.PASS_COMMENT.equals(comment); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * FlowEntity |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class FlowEntity extends BaseEntity { |
| | | |
| | | @TableField(exist = false) |
| | | private BladeFlow flow; |
| | | |
| | | public BladeFlow getFlow() { |
| | | if (flow == null) { |
| | | flow = new BladeFlow(); |
| | | } |
| | | return flow; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * æµç¨ç±»åæä¸¾ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum FlowModeEnum { |
| | | |
| | | /** |
| | | * éç¨æµç¨ |
| | | */ |
| | | COMMON("common", 1), |
| | | |
| | | /** |
| | | * å®å¶æµç¨ |
| | | */ |
| | | CUSTOM("custom", 2), |
| | | ; |
| | | |
| | | final String name; |
| | | final int mode; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.feign; |
| | | |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 工使µè¿ç¨è°ç¨æ¥å£. |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_FLOW_NAME, |
| | | fallback = IFlowClientFallback.class |
| | | ) |
| | | public interface IFlowClient { |
| | | |
| | | String API_PREFIX = "/client"; |
| | | String START_PROCESS_INSTANCE_BY_ID = API_PREFIX + "/start-process-instance-by-id"; |
| | | String START_PROCESS_INSTANCE_BY_KEY = API_PREFIX + "/start-process-instance-by-key"; |
| | | String COMPLETE_TASK = API_PREFIX + "/complete-task"; |
| | | String TASK_VARIABLE = API_PREFIX + "/task-variable"; |
| | | String TASK_VARIABLES = API_PREFIX + "/task-variables"; |
| | | |
| | | /** |
| | | * å¼å¯æµç¨ |
| | | * |
| | | * @param processDefinitionId æµç¨id |
| | | * @param businessKey ä¸å¡key |
| | | * @param variables åæ° |
| | | * @return BladeFlow |
| | | */ |
| | | @PostMapping(START_PROCESS_INSTANCE_BY_ID) |
| | | R<BladeFlow> startProcessInstanceById(@RequestParam("processDefinitionId") String processDefinitionId, @RequestParam("businessKey") String businessKey, @RequestBody Map<String, Object> variables); |
| | | |
| | | /** |
| | | * å¼å¯æµç¨ |
| | | * |
| | | * @param processDefinitionKey æµç¨æ è¯ |
| | | * @param businessKey ä¸å¡key |
| | | * @param variables åæ° |
| | | * @return BladeFlow |
| | | */ |
| | | @PostMapping(START_PROCESS_INSTANCE_BY_KEY) |
| | | R<BladeFlow> startProcessInstanceByKey(@RequestParam("processDefinitionKey") String processDefinitionKey, @RequestParam("businessKey") String businessKey, @RequestBody Map<String, Object> variables); |
| | | |
| | | /** |
| | | * å®æä»»å¡ |
| | | * |
| | | * @param taskId ä»»å¡id |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param comment è¯è®º |
| | | * @param variables åæ° |
| | | * @return R |
| | | */ |
| | | @PostMapping(COMPLETE_TASK) |
| | | R completeTask(@RequestParam("taskId") String taskId, @RequestParam("processInstanceId") String processInstanceId, @RequestParam("comment") String comment, @RequestBody Map<String, Object> variables); |
| | | |
| | | /** |
| | | * è·åæµç¨åé |
| | | * |
| | | * @param taskId ä»»å¡id |
| | | * @param variableName åéå |
| | | * @return R |
| | | */ |
| | | @GetMapping(TASK_VARIABLE) |
| | | R<Object> taskVariable(@RequestParam("taskId") String taskId, @RequestParam("variableName") String variableName); |
| | | |
| | | /** |
| | | * è·åæµç¨åééå |
| | | * |
| | | * @param taskId ä»»å¡id |
| | | * @return R |
| | | */ |
| | | @GetMapping(TASK_VARIABLES) |
| | | R<Map<String, Object>> taskVariables(@RequestParam("taskId") String taskId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.feign; |
| | | |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨è¿ç¨è°ç¨å¤±è´¥å¤çç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Component |
| | | public class IFlowClientFallback implements IFlowClient { |
| | | |
| | | @Override |
| | | public R<BladeFlow> startProcessInstanceById(String processDefinitionId, String businessKey, Map<String, Object> variables) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<BladeFlow> startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String, Object> variables) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R completeTask(String taskId, String processInstanceId, String comment, Map<String, Object> variables) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Object> taskVariable(String taskId, String variableName) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Map<String, Object>> taskVariables(String taskId) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.utils; |
| | | |
| | | import com.vci.ubcs.flow.core.constant.ProcessConstant; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 工使µå·¥å
·ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class FlowUtil { |
| | | |
| | | /** |
| | | * å®ä¹æµç¨key对åºç表å |
| | | */ |
| | | private final static Map<String, String> BUSINESS_TABLE = new HashMap<>(); |
| | | |
| | | static { |
| | | BUSINESS_TABLE.put(ProcessConstant.LEAVE_KEY, "pl_wf_process_leave"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿æµç¨keyè·åä¸å¡è¡¨å |
| | | * |
| | | * @param key æµç¨key |
| | | */ |
| | | public static String getBusinessTable(String key) { |
| | | String businessTable = BUSINESS_TABLE.get(key); |
| | | if (Func.isEmpty(businessTable)) { |
| | | throw new RuntimeException("æµç¨å¯å¨å¤±è´¥,æªæ¾å°ç¸å
³ä¸å¡è¡¨"); |
| | | } |
| | | return businessTable; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡æ è¯ |
| | | * |
| | | * @param businessTable ä¸å¡è¡¨ |
| | | * @param businessId ä¸å¡è¡¨ä¸»é® |
| | | * @return businessKey |
| | | */ |
| | | public static String getBusinessKey(String businessTable, String businessId) { |
| | | return StringUtil.format("{}:{}", businessTable, businessId); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.core.utils; |
| | | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | import static org.springblade.core.launch.constant.FlowConstant.TASK_USR_PREFIX; |
| | | |
| | | /** |
| | | * 工使µä»»å¡å·¥å
·ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class TaskUtil { |
| | | |
| | | /** |
| | | * è·åä»»å¡ç¨æ·æ ¼å¼ |
| | | * |
| | | * @return taskUser |
| | | */ |
| | | public static String getTaskUser() { |
| | | return StringUtil.format("{}{}", TASK_USR_PREFIX, AuthUtil.getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * è·åä»»å¡ç¨æ·æ ¼å¼ |
| | | * |
| | | * @param userId ç¨æ·id |
| | | * @return taskUser |
| | | */ |
| | | public static String getTaskUser(String userId) { |
| | | return StringUtil.format("{}{}", TASK_USR_PREFIX, userId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åç¨æ·ä¸»é® |
| | | * |
| | | * @param taskUser ä»»å¡ç¨æ· |
| | | * @return userId |
| | | */ |
| | | public static Long getUserId(String taskUser) { |
| | | return Func.toLong(StringUtil.removePrefix(taskUser, TASK_USR_PREFIX)); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ç»æ ¼å¼ |
| | | * |
| | | * @return candidateGroup |
| | | */ |
| | | public static String getCandidateGroup() { |
| | | return AuthUtil.getUserRole(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops-api</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-resource-api</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-sms</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-tenant</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | /** |
| | | * é件表å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @TableName("pl_attach") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "Attach对象", description = "é件表") |
| | | public class Attach extends TenantEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * éä»¶å°å |
| | | */ |
| | | @ApiModelProperty(value = "éä»¶å°å") |
| | | private String link; |
| | | /** |
| | | * éä»¶åå |
| | | */ |
| | | @ApiModelProperty(value = "éä»¶åå") |
| | | private String domainUrl; |
| | | /** |
| | | * éä»¶åç§° |
| | | */ |
| | | @ApiModelProperty(value = "éä»¶åç§°") |
| | | private String name; |
| | | /** |
| | | * éä»¶åå |
| | | */ |
| | | @ApiModelProperty(value = "éä»¶åå") |
| | | private String originalName; |
| | | /** |
| | | * éä»¶æå±å |
| | | */ |
| | | @ApiModelProperty(value = "éä»¶æå±å") |
| | | private String extension; |
| | | /** |
| | | * éä»¶å¤§å° |
| | | */ |
| | | @ApiModelProperty(value = "é件大å°") |
| | | private Long attachSize; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | /** |
| | | * å®ä½ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @Data |
| | | @TableName("pl_sys_oss") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "Oss对象", description = "Oss对象") |
| | | public class Oss extends TenantEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * æå±åç±» |
| | | */ |
| | | @ApiModelProperty(value = "æå±åç±»") |
| | | private Integer category; |
| | | |
| | | /** |
| | | * èµæºç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "èµæºç¼å·") |
| | | private String ossCode; |
| | | |
| | | /** |
| | | * osså°å |
| | | */ |
| | | @ApiModelProperty(value = "èµæºå°å") |
| | | private String endpoint; |
| | | /** |
| | | * accessKey |
| | | */ |
| | | @ApiModelProperty(value = "accessKey") |
| | | private String accessKey; |
| | | /** |
| | | * secretKey |
| | | */ |
| | | @ApiModelProperty(value = "secretKey") |
| | | private String secretKey; |
| | | /** |
| | | * 空é´å |
| | | */ |
| | | @ApiModelProperty(value = "空é´å") |
| | | private String bucketName; |
| | | /** |
| | | * åºç¨ID TencentCOSéè¦ |
| | | */ |
| | | @ApiModelProperty(value = "åºç¨ID") |
| | | private String appId; |
| | | /** |
| | | * å°åç®ç§° TencentCOSéè¦ |
| | | */ |
| | | @ApiModelProperty(value = "å°åç®ç§°") |
| | | private String region; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | /** |
| | | * çä¿¡é
置表å®ä½ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @Data |
| | | @TableName("pl_sys_sms") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "Sms对象", description = "çä¿¡é
置表") |
| | | public class Sms extends TenantEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * èµæºç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "èµæºç¼å·") |
| | | private String smsCode; |
| | | |
| | | /** |
| | | * 模æ¿ID |
| | | */ |
| | | @ApiModelProperty(value = "模æ¿ID") |
| | | private String templateId; |
| | | /** |
| | | * åç±» |
| | | */ |
| | | @ApiModelProperty(value = "åç±»") |
| | | private Integer category; |
| | | /** |
| | | * accessKey |
| | | */ |
| | | @ApiModelProperty(value = "accessKey") |
| | | private String accessKey; |
| | | /** |
| | | * secretKey |
| | | */ |
| | | @ApiModelProperty(value = "secretKey") |
| | | private String secretKey; |
| | | /** |
| | | * regionId |
| | | */ |
| | | @ApiModelProperty(value = "regionId") |
| | | private String regionId; |
| | | /** |
| | | * çä¿¡ç¾å |
| | | */ |
| | | @ApiModelProperty(value = "çä¿¡ç¾å") |
| | | private String signName; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | |
| | | /** |
| | | * Smsèµæºç¼ç æä¸¾ç±» |
| | | * |
| | | * @author Chill |
| | | * @apiNote 该æä¸¾ç±»å¯¹åºçä¿¡é
置模åçèµæºç¼ç ï¼å¯æ ¹æ®ä¸å¡éæ±èªè¡æå± |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum SmsCodeEnum { |
| | | |
| | | /** |
| | | * é»è®¤ç¼å· |
| | | */ |
| | | DEFAULT(StringPool.EMPTY, 1), |
| | | |
| | | /** |
| | | * éªè¯ç ç¼å· |
| | | */ |
| | | VALIDATE("validate", 2), |
| | | |
| | | /** |
| | | * éç¥å
¬åç¼å· |
| | | */ |
| | | NOTICE("notice", 3), |
| | | |
| | | /** |
| | | * ä¸åéç¥ç¼å· |
| | | */ |
| | | ORDER("order", 4), |
| | | |
| | | /** |
| | | * ä¼è®®éç¥ç¼å· |
| | | */ |
| | | MEETING("meeting", 5), |
| | | ; |
| | | |
| | | final String name; |
| | | final int category; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.feign; |
| | | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.sms.model.SmsResponse; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * ISmsClient |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @FeignClient( |
| | | value = AppConstant.APPLICATION_RESOURCE_NAME, |
| | | fallback = ISmsClientFallback.class |
| | | ) |
| | | public interface ISmsClient { |
| | | String API_PREFIX = "/client"; |
| | | String SEND_MESSAGE = API_PREFIX + "/send-message"; |
| | | String SEND_VALIDATE = API_PREFIX + "/send-validate"; |
| | | String VALIDATE_MESSAGE = API_PREFIX + "/validate-message"; |
| | | |
| | | /** |
| | | * éç¨çä¿¡åé |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param params 模æ¿åæ° |
| | | * @param phones ææºå·éå |
| | | * @return R |
| | | */ |
| | | @PostMapping(SEND_MESSAGE) |
| | | R<SmsResponse> sendMessage(@RequestParam("code") String code, @RequestParam("params") String params, @RequestParam("phones") String phones); |
| | | |
| | | /** |
| | | * çä¿¡éªè¯ç åé |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param phone ææºå· |
| | | * @return R |
| | | */ |
| | | @PostMapping(SEND_VALIDATE) |
| | | R sendValidate(@RequestParam("code") String code, @RequestParam("phone") String phone); |
| | | |
| | | /** |
| | | * æ ¡éªçä¿¡ |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param id æ ¡éªid |
| | | * @param value æ ¡éªå¼ |
| | | * @param phone ææºå· |
| | | * @return R |
| | | */ |
| | | @PostMapping(VALIDATE_MESSAGE) |
| | | R validateMessage(@RequestParam("code") String code, @RequestParam("id") String id, @RequestParam("value") String value, @RequestParam("phone") String phone); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.feign; |
| | | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * æµç¨è¿ç¨è°ç¨å¤±è´¥å¤çç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Component |
| | | public class ISmsClientFallback implements ISmsClient { |
| | | @Override |
| | | public R sendMessage(String code, String params, String phones) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R sendValidate(String code, String phone) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R validateMessage(String code, String id, String value, String phone) { |
| | | return R.fail("è¿ç¨è°ç¨å¤±è´¥"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.utils; |
| | | |
| | | import org.springblade.core.sms.model.SmsCode; |
| | | import org.springblade.core.sms.model.SmsResponse; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.RandomType; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import com.vci.ubcs.resource.feign.ISmsClient; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * çä¿¡æå¡å·¥å
·ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class SmsUtil { |
| | | |
| | | public static final String PARAM_KEY = "code"; |
| | | public static final String SEND_SUCCESS = "çä¿¡åéæå"; |
| | | public static final String SEND_FAIL = "çä¿¡åé失败"; |
| | | public static final String VALIDATE_SUCCESS = "çä¿¡æ ¡éªæå"; |
| | | public static final String VALIDATE_FAIL = "çä¿¡æ ¡éªå¤±è´¥"; |
| | | |
| | | private static ISmsClient smsClient; |
| | | |
| | | /** |
| | | * è·åçä¿¡æå¡æå»ºç±» |
| | | * |
| | | * @return SmsBuilder |
| | | */ |
| | | public static ISmsClient getSmsClient() { |
| | | if (smsClient == null) { |
| | | smsClient = SpringUtil.getBean(ISmsClient.class); |
| | | } |
| | | return smsClient; |
| | | } |
| | | |
| | | /** |
| | | * è·åçä¿¡éªè¯ç åæ° |
| | | * |
| | | * @return éªè¯ç åæ° |
| | | */ |
| | | public static Map<String, String> getValidateParams() { |
| | | Map<String, String> params = new HashMap<>(1); |
| | | params.put(PARAM_KEY, StringUtil.random(6, RandomType.INT)); |
| | | return params; |
| | | } |
| | | |
| | | /** |
| | | * åéçä¿¡ |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param params 模æ¿åæ° |
| | | * @param phones ææºå·éå |
| | | * @return åéç»æ |
| | | */ |
| | | public static SmsResponse sendMessage(String code, Map<String, String> params, String phones) { |
| | | R<SmsResponse> result = getSmsClient().sendMessage(code, JsonUtil.toJson(params), phones); |
| | | return result.getData(); |
| | | } |
| | | |
| | | /** |
| | | * åééªè¯ç |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param phone ææºå· |
| | | * @return åéç»æ |
| | | */ |
| | | public static SmsCode sendValidate(String code, String phone) { |
| | | SmsCode smsCode = new SmsCode(); |
| | | R result = getSmsClient().sendValidate(code, phone); |
| | | if (result.isSuccess()) { |
| | | smsCode = JsonUtil.parse(JsonUtil.toJson(result.getData()), SmsCode.class); |
| | | } else { |
| | | smsCode.setSuccess(Boolean.FALSE); |
| | | } |
| | | return smsCode; |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªçä¿¡ |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param id æ ¡éªid |
| | | * @param value æ ¡éªå¼ |
| | | * @return åéç»æ |
| | | */ |
| | | public static boolean validateMessage(String code, String id, String value, String phone) { |
| | | R result = getSmsClient().validateMessage(code, id, value, phone); |
| | | return result.isSuccess(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | |
| | | /** |
| | | * é件表è§å¾å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "AttachVO对象", description = "é件表") |
| | | public class AttachVO extends Attach { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.resource.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | |
| | | /** |
| | | * OssVO |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "OssVO对象", description = "对象åå¨è¡¨") |
| | | public class OssVO extends Oss { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åç±»å |
| | | */ |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * æ¯å¦å¯ç¨ |
| | | */ |
| | | private String statusName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | |
| | | /** |
| | | * çä¿¡é
置表è§å¾å®ä½ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "SmsVO对象", description = "çä¿¡é
置表") |
| | | public class SmsVO extends Sms { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åç±»å |
| | | */ |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * æ¯å¦å¯ç¨ |
| | | */ |
| | | private String statusName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>UBCS</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-ops</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>3.0.1.RELEASE</version> |
| | | <packaging>pom</packaging> |
| | | |
| | | <modules> |
| | | <module>ubcs-admin</module> |
| | | <module>ubcs-develop</module> |
| | | <module>ubcs-flow</module> |
| | | <module>ubcs-log</module> |
| | | <module>ubcs-report</module> |
| | | <module>ubcs-resource</module> |
| | | <module>ubcs-swagger</module> |
| | | <module>ubcs-xxljob</module> |
| | | <module>ubcs-xxljob-admin</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-metrics</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>blade-admin</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-launch</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-launch</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-undertow</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-prometheus</artifactId> |
| | | </dependency> |
| | | <!-- Nacos --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.alibaba.nacos</groupId> |
| | | <artifactId>nacos-client</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.alibaba.nacos</groupId> |
| | | <artifactId>nacos-client</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba.nacos</groupId> |
| | | <artifactId>nacos-client</artifactId> |
| | | </dependency> |
| | | <!--Admin-Server--> |
| | | <dependency> |
| | | <groupId>de.codecentric</groupId> |
| | | <artifactId>spring-boot-admin-starter-server</artifactId> |
| | | </dependency> |
| | | <!--Security--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | <!--<dependency> |
| | | <groupId>org.springframework.security.oauth.boot</groupId> |
| | | <artifactId>spring-security-oauth2-autoconfigure</artifactId> |
| | | </dependency>--> |
| | | <!--Taobao-Sdk--> |
| | | <dependency> |
| | | <groupId>com.taobao</groupId> |
| | | <artifactId>taobao-sdk</artifactId> |
| | | <version>20201116</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.admin; |
| | | |
| | | import de.codecentric.boot.admin.server.config.EnableAdminServer; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | |
| | | /** |
| | | * adminå¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @EnableAdminServer |
| | | @EnableDiscoveryClient |
| | | @SpringBootApplication |
| | | public class AdminApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_ADMIN_NAME, AdminApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.admin.config; |
| | | |
| | | import com.vci.ubcs.admin.dingtalk.MonitorProperties; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * å¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @EnableConfigurationProperties(MonitorProperties.class) |
| | | public class AdminConfiguration { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.admin.config; |
| | | |
| | | import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; |
| | | import com.vci.ubcs.admin.dingtalk.DingTalkNotifier; |
| | | import com.vci.ubcs.admin.dingtalk.DingTalkService; |
| | | import com.vci.ubcs.admin.dingtalk.MonitorProperties; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.web.reactive.function.client.WebClient; |
| | | |
| | | /** |
| | | * ééèªå¨é
ç½® |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @ConditionalOnProperty(value = "monitor.ding-talk.enabled", havingValue = "true") |
| | | public class DingTalkConfiguration { |
| | | |
| | | @Bean |
| | | public DingTalkService dingTalkService(MonitorProperties properties, |
| | | WebClient.Builder builder) { |
| | | return new DingTalkService(properties, builder.build()); |
| | | } |
| | | |
| | | @Bean |
| | | public DingTalkNotifier dingTalkNotifier(MonitorProperties properties, |
| | | DingTalkService dingTalkService, |
| | | InstanceRepository repository, |
| | | Environment environment) { |
| | | return new DingTalkNotifier(dingTalkService, properties, environment, repository); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.admin.config; |
| | | |
| | | import de.codecentric.boot.admin.server.config.AdminServerProperties; |
| | | import com.vci.ubcs.admin.security.InternalAuthorizationManager; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; |
| | | import org.springframework.security.config.web.server.ServerHttpSecurity; |
| | | import org.springframework.security.web.server.SecurityWebFilterChain; |
| | | import org.springframework.security.web.server.authentication.RedirectServerAuthenticationSuccessHandler; |
| | | |
| | | import java.net.URI; |
| | | |
| | | /** |
| | | * çæ§å®å
¨é
ç½® |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @EnableWebFluxSecurity |
| | | @Configuration(proxyBeanMethods = false) |
| | | @EnableConfigurationProperties(AdminServerProperties.class) |
| | | public class SecurityConfiguration { |
| | | private final String contextPath; |
| | | |
| | | public SecurityConfiguration(AdminServerProperties adminServerProperties) { |
| | | this.contextPath = adminServerProperties.getContextPath(); |
| | | } |
| | | |
| | | @Bean |
| | | public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { |
| | | // @formatter:off |
| | | RedirectServerAuthenticationSuccessHandler successHandler = new RedirectServerAuthenticationSuccessHandler(); |
| | | successHandler.setLocation(URI.create(contextPath + "/")); |
| | | return http.headers().frameOptions().disable().and() |
| | | .authorizeExchange() |
| | | // æ¾å¼éææä»¶åç»é |
| | | .pathMatchers( |
| | | contextPath + "/assets/**" |
| | | , contextPath + "/login" |
| | | , contextPath + "/v1/agent/**" |
| | | , contextPath + "/v1/catalog/**" |
| | | , contextPath + "/v1/health/**" |
| | | ).permitAll() |
| | | // å
ç½å¯è®¿é® actuator |
| | | .pathMatchers(contextPath + "/actuator", contextPath + "/actuator/**").access(new InternalAuthorizationManager()) |
| | | .anyExchange().authenticated().and() |
| | | .formLogin().loginPage(contextPath + "/login") |
| | | .authenticationSuccessHandler(successHandler).and() |
| | | .logout().logoutUrl(contextPath + "/logout").and() |
| | | .httpBasic().disable() |
| | | .csrf().disable() |
| | | .build(); |
| | | // @formatter:on |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.admin.dingtalk; |
| | | |
| | | import de.codecentric.boot.admin.server.domain.entities.Instance; |
| | | import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; |
| | | import de.codecentric.boot.admin.server.domain.events.InstanceEvent; |
| | | import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; |
| | | import de.codecentric.boot.admin.server.domain.values.Registration; |
| | | import de.codecentric.boot.admin.server.domain.values.StatusInfo; |
| | | import de.codecentric.boot.admin.server.notify.AbstractEventNotifier; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.lang.NonNull; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | /** |
| | | * æå¡ä¸ä¸çº¿åè¦ |
| | | * |
| | | * <p> |
| | | * 注æï¼AbstractStatusChangeNotifier è¿ä¸ªäºä»¶ææ¯ç
|
| | | * </p> |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @Slf4j |
| | | public class DingTalkNotifier extends AbstractEventNotifier { |
| | | private final DingTalkService dingTalkService; |
| | | private final MonitorProperties properties; |
| | | private final Environment environment; |
| | | public static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | public DingTalkNotifier(DingTalkService dingTalkService, MonitorProperties properties, |
| | | Environment environment, InstanceRepository repository) { |
| | | super(repository); |
| | | this.dingTalkService = dingTalkService; |
| | | this.properties = properties; |
| | | this.environment = environment; |
| | | } |
| | | |
| | | @NonNull |
| | | @Override |
| | | protected Mono<Void> doNotify(@NonNull InstanceEvent event, @NonNull Instance instance) { |
| | | if (event instanceof InstanceStatusChangedEvent) { |
| | | // æé 请æ±ç»æ |
| | | return createAndPushMsg(event, instance); |
| | | } |
| | | return Mono.empty(); |
| | | } |
| | | |
| | | private Mono<Void> createAndPushMsg(InstanceEvent event, Instance instance) { |
| | | Registration registration = instance.getRegistration(); |
| | | // æå¡å |
| | | String appName = registration.getName(); |
| | | // æå¡å°å |
| | | String serviceUrl = registration.getServiceUrl(); |
| | | StatusInfo status = instance.getStatusInfo(); |
| | | // æ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.ofInstant(event.getTimestamp(), ZoneId.systemDefault()); |
| | | MonitorProperties.DingTalk dingTalk = properties.getDingTalk(); |
| | | String title = dingTalk.getService().getTitle(); |
| | | |
| | | String message = "## **" + title + "**\n" + |
| | | "#### **ãæå¡ã** " + appName + "\n" + |
| | | "#### **ãç¯å¢ã** " + environment.getActiveProfiles()[0] + "\n" + |
| | | "#### **ãå°åã** " + serviceUrl + "\n" + |
| | | "#### **ãç¶æã** " + statusCn(status) + "\n" + |
| | | "#### **ãæ¶é´ã** " + DATETIME_FORMATTER.format(localDateTime) + "\n" + |
| | | "#### **ã详æ
ã** " + dingTalk.getLink() + "\n"; |
| | | |
| | | return dingTalkService.pushMsg(title, message); |
| | | } |
| | | |
| | | private String statusCn(StatusInfo status) { |
| | | if (status.isUp()) { |
| | | return "åºç¨ä¸çº¿ï¼IS UPï¼"; |
| | | } else if (status.isDown()) { |
| | | return "åºç¨å®æºï¼IS DOWNï¼"; |
| | | } else if (status.isOffline()) { |
| | | return "åºç¨æçº¿ï¼IS OFFLINEï¼"; |
| | | } else if (status.isUnknown()) { |
| | | return "æªç¥ç¶æï¼UNKNOWNï¼"; |
| | | } else { |
| | | return "å¼å¸¸ç¶æ"; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.admin.dingtalk; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.util.Base64Utils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.reactive.function.BodyInserters; |
| | | import org.springframework.web.reactive.function.client.WebClient; |
| | | import org.springframework.web.util.UriUtils; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import javax.crypto.Mac; |
| | | import javax.crypto.SecretKey; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.net.URI; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * éé æå¡ |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @Slf4j |
| | | @RequiredArgsConstructor |
| | | public class DingTalkService { |
| | | private static final String DING_TALK_ROBOT_URL = "https://oapi.dingtalk.com/robot/send?access_token="; |
| | | private final MonitorProperties properties; |
| | | private final WebClient webClient; |
| | | |
| | | /** |
| | | * åéæ¶æ¯ |
| | | * |
| | | * @param title title |
| | | * @param text æ¶æ¯ |
| | | */ |
| | | public Mono<Void> pushMsg(String title, String text) { |
| | | log.info("ééæ¶æ¯ï¼[åå»ºæ¶æ¯ä½]title:{}, text:{}", title, text); |
| | | |
| | | HashMap<String, String> params = new HashMap<>(2); |
| | | params.put("title", title); |
| | | params.put("text", text); |
| | | |
| | | Map<String, Object> body = new HashMap<>(2); |
| | | body.put("msgtype", "markdown"); |
| | | body.put("markdown", params); |
| | | log.info("åå»ºæ¶æ¯ä½ jsonï¼{}", body); |
| | | |
| | | MonitorProperties.DingTalk dingTalk = properties.getDingTalk(); |
| | | String accessToken = dingTalk.getAccessToken(); |
| | | if (!StringUtils.hasText(accessToken)) { |
| | | log.error("DingTalk alert config accessToken ${monitor.ding-talk.access-token} is blank."); |
| | | return Mono.empty(); |
| | | } |
| | | |
| | | String urlString = DING_TALK_ROBOT_URL + dingTalk.getAccessToken(); |
| | | // æç§é¥è¦ç¾å |
| | | String secret = dingTalk.getSecret(); |
| | | if (StringUtils.hasText(secret)) { |
| | | long timestamp = System.currentTimeMillis(); |
| | | urlString += String.format("×tamp=%s&sign=%s", timestamp, getSign(secret, timestamp)); |
| | | } |
| | | return webClient.post() |
| | | .uri(URI.create(urlString)) |
| | | .contentType(MediaType.APPLICATION_JSON) |
| | | .body(BodyInserters.fromValue(body)) |
| | | .retrieve() |
| | | .bodyToMono(String.class) |
| | | .doOnSuccess((result) -> log.info("ééæ¶æ¯ï¼[æ¶æ¯è¿å]result:{}", result)) |
| | | .then(); |
| | | } |
| | | |
| | | private static String getSign(String secret, long timestamp) { |
| | | String stringToSign = timestamp + "\n" + secret; |
| | | byte[] hmacSha256Bytes = digestHmac(stringToSign, secret); |
| | | return UriUtils.encode(Base64Utils.encodeToString(hmacSha256Bytes), StandardCharsets.UTF_8); |
| | | } |
| | | |
| | | public static byte[] digestHmac(String data, String key) { |
| | | SecretKey secretKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256"); |
| | | try { |
| | | Mac mac = Mac.getInstance(secretKey.getAlgorithm()); |
| | | mac.init(secretKey); |
| | | return mac.doFinal(data.getBytes(StandardCharsets.UTF_8)); |
| | | } catch (NoSuchAlgorithmException | InvalidKeyException e) { |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.admin.dingtalk; |
| | | |
| | | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.cloud.context.config.annotation.RefreshScope; |
| | | |
| | | /** |
| | | * çæ§é
ç½® |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @RefreshScope |
| | | @ConfigurationProperties("monitor") |
| | | public class MonitorProperties { |
| | | private DingTalk dingTalk = new DingTalk(); |
| | | |
| | | @Getter |
| | | @Setter |
| | | public static class DingTalk { |
| | | /** |
| | | * å¯ç¨ééåè¦ï¼é»è®¤ä¸º true |
| | | */ |
| | | private boolean enabled = false; |
| | | /** |
| | | * ééæºå¨äºº token |
| | | */ |
| | | private String accessToken; |
| | | /** |
| | | * ç¾åï¼å¦ææ secret åè¿è¡ç¾åï¼å
¼å®¹èæ¥å£ |
| | | */ |
| | | private String secret; |
| | | /** |
| | | * å°åé
ç½® |
| | | */ |
| | | private String link; |
| | | private Service service = new Service(); |
| | | } |
| | | |
| | | @Getter |
| | | @Setter |
| | | public static class Service { |
| | | /** |
| | | * æå¡ ç¶æ title |
| | | */ |
| | | private String title = "æå¡ç¶æéç¥"; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | package com.vci.ubcs.admin.security; |
| | | |
| | | import org.springblade.core.launch.utils.INetUtil; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.security.authorization.AuthorizationDecision; |
| | | import org.springframework.security.authorization.ReactiveAuthorizationManager; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.web.server.authorization.AuthorizationContext; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | import reactor.core.publisher.Mono; |
| | | |
| | | import java.net.InetSocketAddress; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * å
ç½è®¤è¯ç®¡çï¼å
ç½æ¾è¡ï¼å¤ç½è®¤è¯ |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | public class InternalAuthorizationManager implements ReactiveAuthorizationManager<AuthorizationContext> { |
| | | private static final String HEADER_X_FORWARDED_FOR = "X-Forwarded-For"; |
| | | |
| | | @Override |
| | | public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, AuthorizationContext context) { |
| | | return Mono.just(getAuthorizationDecision(context)); |
| | | } |
| | | |
| | | private static AuthorizationDecision getAuthorizationDecision(AuthorizationContext context) { |
| | | return new AuthorizationDecision(isInternalNet(context)); |
| | | } |
| | | |
| | | /** |
| | | * 夿æ¯å¦å
ç½ ip è¯·æ± |
| | | * |
| | | * @param context AuthorizationContext |
| | | * @return æ¯å¦å
ç½ ip |
| | | */ |
| | | private static boolean isInternalNet(AuthorizationContext context) { |
| | | ServerHttpRequest request = Optional.ofNullable(context) |
| | | .map(AuthorizationContext::getExchange) |
| | | .map(ServerWebExchange::getRequest) |
| | | .orElse(null); |
| | | if (request == null) { |
| | | return false; |
| | | } |
| | | HttpHeaders headers = request.getHeaders(); |
| | | // å¦ææ²¡æ X-Forwarded-For 代表为 admin æå |
| | | if (!headers.containsKey(HEADER_X_FORWARDED_FOR)) { |
| | | return true; |
| | | } |
| | | return Optional.of(request) |
| | | .map(ServerHttpRequest::getRemoteAddress) |
| | | .map(InetSocketAddress::getAddress) |
| | | .map(INetUtil::isInternalIp) |
| | | .orElse(false); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0"?> |
| | | <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> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-ops</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>blade-develop</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-develop</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-swagger</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-dict-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop; |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * Developå¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class DevelopApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_DEVELOP_NAME, DevelopApplication.class, args); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.develop.entity.Code; |
| | | import com.vci.ubcs.develop.entity.Datasource; |
| | | import com.vci.ubcs.develop.entity.Model; |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | import io.swagger.annotations.*; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import com.vci.ubcs.develop.service.ICodeService; |
| | | import com.vci.ubcs.develop.service.IDatasourceService; |
| | | import com.vci.ubcs.develop.service.IModelPrototypeService; |
| | | import com.vci.ubcs.develop.service.IModelService; |
| | | import org.springblade.develop.support.BladeCodeGenerator; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/code") |
| | | @Api(value = "代ç çæ", tags = "代ç çæ") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class CodeController extends BladeController { |
| | | |
| | | private final ICodeService codeService; |
| | | private final IDatasourceService datasourceService; |
| | | private final IModelService modelService; |
| | | private final IModelPrototypeService modelPrototypeService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥code") |
| | | public R<Code> detail(Code code) { |
| | | Code detail = codeService.getOne(Condition.getQueryWrapper(code)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "codeName", value = "模åå", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "tableName", value = "表å", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "modelName", value = "å®ä½å", paramType = "query", dataType = "string") |
| | | }) |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥code") |
| | | public R<IPage<Code>> list(@ApiIgnore @RequestParam Map<String, Object> code, Query query) { |
| | | IPage<Code> pages = codeService.page(Condition.getPage(query), Condition.getQueryWrapper(code, Code.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥code") |
| | | public R submit(@Valid @RequestBody Code code) { |
| | | return R.status(codeService.submit(code)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(codeService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * å¤å¶ |
| | | */ |
| | | @PostMapping("/copy") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "å¤å¶", notes = "ä¼ å
¥id") |
| | | public R copy(@ApiParam(value = "主é®", required = true) @RequestParam Long id) { |
| | | Code code = codeService.getById(id); |
| | | code.setId(null); |
| | | code.setCodeName(code.getCodeName() + "-copy"); |
| | | return R.status(codeService.save(code)); |
| | | } |
| | | |
| | | /** |
| | | * 代ç çæ |
| | | */ |
| | | @PostMapping("/gen-code") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "代ç çæ", notes = "ä¼ å
¥ids") |
| | | public R genCode(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | Collection<Code> codes = codeService.listByIds(Func.toLongList(ids)); |
| | | codes.forEach(code -> { |
| | | BladeCodeGenerator generator = new BladeCodeGenerator(); |
| | | // 设置åºç¡æ¨¡å |
| | | Model model = modelService.getById(code.getModelId()); |
| | | generator.setModelCode(model.getModelCode()); |
| | | generator.setModelClass(model.getModelClass()); |
| | | // 设置模åéå |
| | | List<ModelPrototype> prototypes = modelPrototypeService.prototypeList(model.getId()); |
| | | generator.setModel(JsonUtil.readMap(JsonUtil.toJson(model))); |
| | | generator.setPrototypes(JsonUtil.readListMap(JsonUtil.toJson(prototypes))); |
| | | if (StringUtil.isNotBlank(code.getSubModelId())) { |
| | | Model subModel = modelService.getById(Func.toLong(code.getSubModelId())); |
| | | List<ModelPrototype> subPrototypes = modelPrototypeService.prototypeList(subModel.getId()); |
| | | generator.setSubModel(JsonUtil.readMap(JsonUtil.toJson(subModel))); |
| | | generator.setSubPrototypes(JsonUtil.readListMap(JsonUtil.toJson(subPrototypes))); |
| | | } |
| | | // è®¾ç½®æ°æ®æº |
| | | Datasource datasource = datasourceService.getById(model.getDatasourceId()); |
| | | generator.setDriverName(datasource.getDriverClass()); |
| | | generator.setUrl(datasource.getUrl()); |
| | | generator.setUsername(datasource.getUsername()); |
| | | generator.setPassword(datasource.getPassword()); |
| | | // 设置åºç¡é
ç½® |
| | | generator.setCodeStyle(code.getCodeStyle()); |
| | | generator.setCodeName(code.getCodeName()); |
| | | generator.setServiceName(code.getServiceName()); |
| | | generator.setPackageName(code.getPackageName()); |
| | | generator.setPackageDir(code.getApiPath()); |
| | | generator.setPackageWebDir(code.getWebPath()); |
| | | generator.setTablePrefix(Func.toStrArray(code.getTablePrefix())); |
| | | generator.setIncludeTables(Func.toStrArray(code.getTableName())); |
| | | // 设置模çä¿¡æ¯ |
| | | generator.setTemplateType(code.getTemplateType()); |
| | | generator.setAuthor(code.getAuthor()); |
| | | generator.setSubModelId(code.getSubModelId()); |
| | | generator.setSubFkId(code.getSubFkId()); |
| | | generator.setTreeId(code.getTreeId()); |
| | | generator.setTreePid(code.getTreePid()); |
| | | generator.setTreeName(code.getTreeName()); |
| | | // 设置æ¯å¦ç»§æ¿åºç¡ä¸å¡å段 |
| | | generator.setHasSuperEntity(code.getBaseMode() == 2); |
| | | // 设置æ¯å¦å¼å¯å
è£
卿¨¡å¼ |
| | | generator.setHasWrapper(code.getWrapMode() == 2); |
| | | // 设置æ¯å¦å¼å¯è¿ç¨è°ç¨æ¨¡å¼ |
| | | generator.setHasFeign(code.getFeignMode() == 2); |
| | | // 设置æ§å¶å¨æå¡ååç¼ |
| | | generator.setHasServiceName(Boolean.TRUE); |
| | | // å¯å¨ä»£ç çæ |
| | | generator.run(); |
| | | }); |
| | | return R.success("代ç çææå"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.develop.entity.Datasource; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.develop.service.IDatasourceService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®æºé
置表 æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/datasource") |
| | | @Api(value = "æ°æ®æºé
置表", tags = "æ°æ®æºé
置表æ¥å£") |
| | | public class DatasourceController extends BladeController { |
| | | |
| | | private final IDatasourceService datasourceService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥datasource") |
| | | public R<Datasource> detail(Datasource datasource) { |
| | | Datasource detail = datasourceService.getOne(Condition.getQueryWrapper(datasource)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * å页 æ°æ®æºé
置表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥datasource") |
| | | public R<IPage<Datasource>> list(Datasource datasource, Query query) { |
| | | IPage<Datasource> pages = datasourceService.page(Condition.getPage(query), Condition.getQueryWrapper(datasource)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ æ°æ®æºé
置表 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥datasource") |
| | | public R save(@Valid @RequestBody Datasource datasource) { |
| | | return R.status(datasourceService.save(datasource)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ æ°æ®æºé
置表 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥datasource") |
| | | public R update(@Valid @RequestBody Datasource datasource) { |
| | | return R.status(datasourceService.updateById(datasource)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ æ°æ®æºé
置表 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥datasource") |
| | | public R submit(@Valid @RequestBody Datasource datasource) { |
| | | datasource.setUrl(datasource.getUrl().replace("&", "&")); |
| | | return R.status(datasourceService.saveOrUpdate(datasource)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ æ°æ®æºé
置表 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(datasourceService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®æºå表 |
| | | */ |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "ä¸ææ°æ®æº", notes = "æ¥è¯¢å表") |
| | | public R<List<Datasource>> select() { |
| | | List<Datasource> list = datasourceService.list(); |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.generator.config.DataSourceConfig; |
| | | import com.baomidou.mybatisplus.generator.config.StrategyConfig; |
| | | import com.baomidou.mybatisplus.generator.config.builder.ConfigBuilder; |
| | | import com.baomidou.mybatisplus.generator.config.po.TableInfo; |
| | | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.develop.entity.Datasource; |
| | | import com.vci.ubcs.develop.entity.Model; |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | import com.vci.ubcs.develop.service.IDatasourceService; |
| | | import com.vci.ubcs.develop.service.IModelPrototypeService; |
| | | import com.vci.ubcs.develop.service.IModelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ°æ®æ¨¡å表 æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/model") |
| | | @Api(value = "æ°æ®æ¨¡å表", tags = "æ°æ®æ¨¡å表æ¥å£") |
| | | public class ModelController extends BladeController { |
| | | |
| | | private final IModelService modelService; |
| | | private final IModelPrototypeService modelPrototypeService; |
| | | private final IDatasourceService datasourceService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥model") |
| | | public R<Model> detail(Model model) { |
| | | Model detail = modelService.getOne(Condition.getQueryWrapper(model)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * å页 æ°æ®æ¨¡å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥model") |
| | | public R<IPage<Model>> list(Model model, Query query) { |
| | | IPage<Model> pages = modelService.page(Condition.getPage(query), Condition.getQueryWrapper(model)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ æ°æ®æ¨¡å表 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥model") |
| | | public R save(@Valid @RequestBody Model model) { |
| | | return R.status(modelService.save(model)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ æ°æ®æ¨¡å表 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥model") |
| | | public R update(@Valid @RequestBody Model model) { |
| | | return R.status(modelService.updateById(model)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ æ°æ®æ¨¡å表 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥model") |
| | | public R submit(@Valid @RequestBody Model model) { |
| | | return R.status(modelService.saveOrUpdate(model)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ æ°æ®æ¨¡å表 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(modelService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 模åå表 |
| | | */ |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "模åå表", notes = "模åå表") |
| | | public R<List<Model>> select() { |
| | | List<Model> list = modelService.list(); |
| | | list.forEach(model -> model.setModelName(model.getModelTable() + StringPool.COLON + StringPool.SPACE + model.getModelName())); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * è·åç©ç表å表 |
| | | */ |
| | | @GetMapping("/table-list") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "ç©ç表å表", notes = "ä¼ å
¥datasourceId") |
| | | public R<List<TableInfo>> tableList(Long datasourceId) { |
| | | Datasource datasource = datasourceService.getById(datasourceId); |
| | | ConfigBuilder config = getConfigBuilder(datasource); |
| | | List<TableInfo> tableInfoList = config.getTableInfoList().stream() |
| | | .filter(tableInfo -> !StringUtil.startsWithIgnoreCase(tableInfo.getName(), "ACT_")) |
| | | .map(tableInfo -> tableInfo.setComment(tableInfo.getName() + StringPool.COLON + tableInfo.getComment())) |
| | | .collect(Collectors.toList()); |
| | | return R.data(tableInfoList); |
| | | } |
| | | |
| | | /** |
| | | * è·åç©çè¡¨ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/table-info") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "ç©ç表信æ¯", notes = "ä¼ å
¥modelä¿¡æ¯") |
| | | public R<TableInfo> tableInfo(Long modelId, String tableName, Long datasourceId) { |
| | | if (StringUtil.isBlank(tableName)) { |
| | | Model model = modelService.getById(modelId); |
| | | tableName = model.getModelTable(); |
| | | } |
| | | TableInfo tableInfo = getTableInfo(tableName, datasourceId); |
| | | return R.data(tableInfo); |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ®µä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/model-prototype") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "ç©çè¡¨åæ®µä¿¡æ¯", notes = "ä¼ å
¥modelIdä¸datasourceId") |
| | | public R modelPrototype(Long modelId, Long datasourceId) { |
| | | List<ModelPrototype> modelPrototypeList = modelPrototypeService.list(Wrappers.<ModelPrototype>query().lambda().eq(ModelPrototype::getModelId, modelId)); |
| | | if (modelPrototypeList.size() > 0) { |
| | | return R.data(modelPrototypeList); |
| | | } |
| | | Model model = modelService.getById(modelId); |
| | | String tableName = model.getModelTable(); |
| | | TableInfo tableInfo = getTableInfo(tableName, datasourceId); |
| | | if (tableInfo != null) { |
| | | return R.data(tableInfo.getFields()); |
| | | } else { |
| | | return R.fail("æªè·å¾ç¸å
³è¡¨ä¿¡æ¯"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åè¡¨ä¿¡æ¯ |
| | | * |
| | | * @param tableName 表å |
| | | * @param datasourceId æ°æ®æºä¸»é® |
| | | */ |
| | | private TableInfo getTableInfo(String tableName, Long datasourceId) { |
| | | Datasource datasource = datasourceService.getById(datasourceId); |
| | | ConfigBuilder config = getConfigBuilder(datasource); |
| | | List<TableInfo> tableInfoList = config.getTableInfoList(); |
| | | TableInfo tableInfo = null; |
| | | Iterator<TableInfo> iterator = tableInfoList.stream().filter(table -> table.getName().equals(tableName)).collect(Collectors.toList()).iterator(); |
| | | if (iterator.hasNext()) { |
| | | tableInfo = iterator.next(); |
| | | tableInfo.setEntityName(tableInfo.getEntityName().replace(StringUtil.firstCharToUpper(tableName.split(StringPool.UNDERSCORE)[0]), StringPool.EMPTY)); |
| | | } |
| | | return tableInfo; |
| | | } |
| | | |
| | | /** |
| | | * è·å表é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param datasource æ°æ®æºä¿¡æ¯ |
| | | */ |
| | | private ConfigBuilder getConfigBuilder(Datasource datasource) { |
| | | StrategyConfig strategyConfig = new StrategyConfig.Builder() |
| | | .entityBuilder() |
| | | .naming(NamingStrategy.underline_to_camel) |
| | | .columnNaming(NamingStrategy.underline_to_camel).build(); |
| | | DataSourceConfig datasourceConfig = new DataSourceConfig.Builder( |
| | | datasource.getUrl(), datasource.getUsername(), datasource.getPassword() |
| | | ).build(); |
| | | return new ConfigBuilder(null, datasourceConfig, strategyConfig, null, null, null); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | import com.vci.ubcs.develop.service.IModelPrototypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®åå表 æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/model-prototype") |
| | | @Api(value = "æ°æ®åå表", tags = "æ°æ®åå表æ¥å£") |
| | | public class ModelPrototypeController extends BladeController { |
| | | |
| | | private final IModelPrototypeService modelPrototypeService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥modelPrototype") |
| | | public R<ModelPrototype> detail(ModelPrototype modelPrototype) { |
| | | ModelPrototype detail = modelPrototypeService.getOne(Condition.getQueryWrapper(modelPrototype)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * å页 æ°æ®åå表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥modelPrototype") |
| | | public R<IPage<ModelPrototype>> list(ModelPrototype modelPrototype, Query query) { |
| | | IPage<ModelPrototype> pages = modelPrototypeService.page(Condition.getPage(query), Condition.getQueryWrapper(modelPrototype)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ æ°æ®åå表 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥modelPrototype") |
| | | public R save(@Valid @RequestBody ModelPrototype modelPrototype) { |
| | | return R.status(modelPrototypeService.save(modelPrototype)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ æ°æ®åå表 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥modelPrototype") |
| | | public R update(@Valid @RequestBody ModelPrototype modelPrototype) { |
| | | return R.status(modelPrototypeService.updateById(modelPrototype)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ æ°æ®åå表 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥modelPrototype") |
| | | public R submit(@Valid @RequestBody ModelPrototype modelPrototype) { |
| | | return R.status(modelPrototypeService.saveOrUpdate(modelPrototype)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ°å¢æä¿®æ¹ æ°æ®åå表 |
| | | */ |
| | | @PostMapping("/submit-list") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "æ¹éæ°å¢æä¿®æ¹", notes = "ä¼ å
¥modelPrototypeéå") |
| | | public R submitList(@Valid @RequestBody List<ModelPrototype> modelPrototypes) { |
| | | return R.status(modelPrototypeService.submitList(modelPrototypes)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ æ°æ®åå表 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(modelPrototypeService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®ååå表 |
| | | */ |
| | | @GetMapping("/select") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "æ°æ®ååå表", notes = "æ°æ®ååå表") |
| | | public R<List<ModelPrototype>> select(@ApiParam(value = "æ°æ®æ¨¡åId", required = true) @RequestParam Long modelId) { |
| | | List<ModelPrototype> list = modelPrototypeService.list(Wrappers.<ModelPrototype>query().lambda().eq(ModelPrototype::getModelId, modelId)); |
| | | list.forEach(prototype -> prototype.setComment(prototype.getJdbcName() + StringPool.COLON + StringPool.SPACE + prototype.getComment())); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.dto; |
| | | |
| | | import com.vci.ubcs.develop.entity.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä»£ç æ¨¡åDTO |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class ModelDTO extends Model { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 代ç 建模åå |
| | | */ |
| | | private List<ModelPrototype> prototypes; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @TableName("pl_code") |
| | | @ApiModel(value = "Code对象", description = "Code对象") |
| | | public class Code implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty(value = "主é®") |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ°æ®æ¨¡åä¸»é® |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @ApiModelProperty(value = "æ°æ®æ¨¡å主é®") |
| | | private Long modelId; |
| | | |
| | | /** |
| | | * 模ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "æå¡åç§°") |
| | | private String serviceName; |
| | | |
| | | /** |
| | | * 模ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "模ååç§°") |
| | | private String codeName; |
| | | |
| | | /** |
| | | * 表å |
| | | */ |
| | | @ApiModelProperty(value = "表å") |
| | | private String tableName; |
| | | |
| | | /** |
| | | * å®ä½å |
| | | */ |
| | | @ApiModelProperty(value = "表åç¼") |
| | | private String tablePrefix; |
| | | |
| | | /** |
| | | * 主é®å |
| | | */ |
| | | @ApiModelProperty(value = "主é®å") |
| | | private String pkName; |
| | | |
| | | /** |
| | | * å端å
å |
| | | */ |
| | | @ApiModelProperty(value = "å端å
å") |
| | | private String packageName; |
| | | |
| | | /** |
| | | * 模çç±»å |
| | | */ |
| | | @ApiModelProperty(value = "模çç±»å") |
| | | private String templateType; |
| | | |
| | | /** |
| | | * ä½è
ä¿¡æ¯ |
| | | */ |
| | | @ApiModelProperty(value = "ä½è
ä¿¡æ¯") |
| | | private String author; |
| | | |
| | | /** |
| | | * å表模åä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "å表模å主é®") |
| | | private String subModelId; |
| | | |
| | | /** |
| | | * å表ç»å®å¤é® |
| | | */ |
| | | @ApiModelProperty(value = "å表ç»å®å¤é®") |
| | | private String subFkId; |
| | | |
| | | /** |
| | | * æ 主é®å段 |
| | | */ |
| | | @ApiModelProperty(value = "æ 主é®å段") |
| | | private String treeId; |
| | | |
| | | /** |
| | | * æ ç¶ä¸»é®å段 |
| | | */ |
| | | @ApiModelProperty(value = "æ ç¶ä¸»é®å段") |
| | | private String treePid; |
| | | |
| | | /** |
| | | * æ åç§°åæ®µ |
| | | */ |
| | | @ApiModelProperty(value = "æ åç§°åæ®µ") |
| | | private String treeName; |
| | | |
| | | /** |
| | | * åºç¡ä¸å¡æ¨¡å¼ |
| | | */ |
| | | @ApiModelProperty(value = "åºç¡ä¸å¡æ¨¡å¼") |
| | | private Integer baseMode; |
| | | |
| | | /** |
| | | * å
è£
卿¨¡å¼ |
| | | */ |
| | | @ApiModelProperty(value = "å
è£
卿¨¡å¼") |
| | | private Integer wrapMode; |
| | | |
| | | /** |
| | | * è¿ç¨è°ç¨æ¨¡å¼ |
| | | */ |
| | | @ApiModelProperty(value = "è¿ç¨è°ç¨æ¨¡å¼") |
| | | private Integer feignMode; |
| | | |
| | | /** |
| | | * 代ç 飿 ¼ |
| | | */ |
| | | @ApiModelProperty(value = "代ç 飿 ¼") |
| | | private String codeStyle; |
| | | |
| | | /** |
| | | * åç«¯è·¯å¾ |
| | | */ |
| | | @ApiModelProperty(value = "å端路å¾") |
| | | private String apiPath; |
| | | |
| | | /** |
| | | * åç«¯è·¯å¾ |
| | | */ |
| | | @ApiModelProperty(value = "å端路å¾") |
| | | private String webPath; |
| | | |
| | | /** |
| | | * æ¯å¦å·²å é¤ |
| | | */ |
| | | @TableLogic |
| | | @ApiModelProperty(value = "æ¯å¦å·²å é¤") |
| | | private Integer isDeleted; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * æ°æ®æºé
置表å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @TableName("pl_sys_datasource") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "Datasource对象", description = "æ°æ®æºé
置表") |
| | | public class Datasource extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åç§° |
| | | */ |
| | | @ApiModelProperty(value = "åç§°") |
| | | private String name; |
| | | /** |
| | | * 驱å¨ç±» |
| | | */ |
| | | @ApiModelProperty(value = "驱å¨ç±»") |
| | | private String driverClass; |
| | | /** |
| | | * è¿æ¥å°å |
| | | */ |
| | | @ApiModelProperty(value = "è¿æ¥å°å") |
| | | private String url; |
| | | /** |
| | | * ç¨æ·å |
| | | */ |
| | | @ApiModelProperty(value = "ç¨æ·å") |
| | | private String username; |
| | | /** |
| | | * å¯ç |
| | | */ |
| | | @ApiModelProperty(value = "å¯ç ") |
| | | private String password; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * æ°æ®æ¨¡å表å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @TableName("pl_model") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "Model对象", description = "æ°æ®æ¨¡å表") |
| | | public class Model extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * æ°æ®æºä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "æ°æ®æºä¸»é®") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long datasourceId; |
| | | /** |
| | | * 模ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "模ååç§°") |
| | | private String modelName; |
| | | /** |
| | | * 模åç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "模åç¼å·") |
| | | private String modelCode; |
| | | /** |
| | | * ç©ç表å |
| | | */ |
| | | @ApiModelProperty(value = "ç©ç表å") |
| | | private String modelTable; |
| | | /** |
| | | * 模åç±»å |
| | | */ |
| | | @ApiModelProperty(value = "模åç±»å") |
| | | private String modelClass; |
| | | /** |
| | | * 模å夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "模å夿³¨") |
| | | private String modelRemark; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | /** |
| | | * æ°æ®åå表å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @TableName("pl_model_prototype") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "ModelPrototype对象", description = "æ°æ®åå表") |
| | | public class ModelPrototype extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 模åä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "模å主é®") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long modelId; |
| | | /** |
| | | * ç©çåå |
| | | */ |
| | | @ApiModelProperty(value = "ç©çåå") |
| | | private String jdbcName; |
| | | /** |
| | | * ç©çç±»å |
| | | */ |
| | | @ApiModelProperty(value = "ç©çç±»å") |
| | | private String jdbcType; |
| | | /** |
| | | * å®ä½åå |
| | | */ |
| | | @ApiModelProperty(value = "å®ä½åå") |
| | | private String propertyName; |
| | | /** |
| | | * å®ä½ç±»å |
| | | */ |
| | | @ApiModelProperty(value = "å®ä½ç±»å") |
| | | private String propertyType; |
| | | /** |
| | | * å®ä½ç±»åå¼ç¨ |
| | | */ |
| | | @ApiModelProperty(value = "å®ä½ç±»åå¼ç¨") |
| | | private String propertyEntity; |
| | | /** |
| | | * 注é说æ |
| | | */ |
| | | @ApiModelProperty(value = "注é说æ") |
| | | private String comment; |
| | | /** |
| | | * å表æ¾ç¤º |
| | | */ |
| | | @ApiModelProperty(value = "å表æ¾ç¤º") |
| | | private Integer isList; |
| | | /** |
| | | * è¡¨åæ¾ç¤º |
| | | */ |
| | | @ApiModelProperty(value = "è¡¨åæ¾ç¤º") |
| | | private Integer isForm; |
| | | /** |
| | | * ç¬å ä¸è¡ |
| | | */ |
| | | @ApiModelProperty(value = "ç¬å ä¸è¡") |
| | | private Integer isRow; |
| | | /** |
| | | * ç»ä»¶ç±»å |
| | | */ |
| | | @ApiModelProperty(value = "ç»ä»¶ç±»å") |
| | | private String componentType; |
| | | /** |
| | | * åå
¸ç¼ç |
| | | */ |
| | | @ApiModelProperty(value = "åå
¸ç¼ç ") |
| | | private String dictCode; |
| | | /** |
| | | * æ¯å¦å¿
å¡« |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦å¿
å¡«") |
| | | private Integer isRequired; |
| | | /** |
| | | * æ¥è¯¢é
ç½® |
| | | */ |
| | | @ApiModelProperty(value = "æ¥è¯¢é
ç½®") |
| | | private Integer isQuery; |
| | | /** |
| | | * æ¥è¯¢ç±»å |
| | | */ |
| | | @ApiModelProperty(value = "æ¥è¯¢ç±»å") |
| | | private String queryType; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.develop.entity.Code; |
| | | |
| | | /** |
| | | * Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface CodeMapper extends BaseMapper<Code> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.develop.entity.Datasource; |
| | | |
| | | /** |
| | | * æ°æ®æºé
置表 Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface DatasourceMapper extends BaseMapper<Datasource> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.develop.entity.Model; |
| | | |
| | | /** |
| | | * æ°æ®æ¨¡å表 Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ModelMapper extends BaseMapper<Model> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | |
| | | /** |
| | | * æ°æ®åå表 Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ModelPrototypeMapper extends BaseMapper<ModelPrototype> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.develop.entity.Code; |
| | | |
| | | /** |
| | | * æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ICodeService extends IService<Code> { |
| | | |
| | | /** |
| | | * æäº¤ |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | boolean submit(Code code); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service; |
| | | |
| | | import com.vci.ubcs.develop.entity.Datasource; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * æ°æ®æºé
置表 æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface IDatasourceService extends BaseService<Datasource> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service; |
| | | |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®åå表 æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface IModelPrototypeService extends BaseService<ModelPrototype> { |
| | | |
| | | /** |
| | | * æ¹éæäº¤ |
| | | * |
| | | * @param modelPrototypes ååéå |
| | | * @return boolean |
| | | */ |
| | | boolean submitList(List<ModelPrototype> modelPrototypes); |
| | | |
| | | /** |
| | | * ååå表 |
| | | * |
| | | * @param modelId 模åID |
| | | * @return List<ModelPrototype> |
| | | */ |
| | | List<ModelPrototype> prototypeList(Long modelId); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service; |
| | | |
| | | import com.vci.ubcs.develop.entity.Model; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * æ°æ®æ¨¡å表 æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface IModelService extends BaseService<Model> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.develop.entity.Code; |
| | | import com.vci.ubcs.develop.mapper.CodeMapper; |
| | | import com.vci.ubcs.develop.service.ICodeService; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class CodeServiceImpl extends ServiceImpl<CodeMapper, Code> implements ICodeService { |
| | | |
| | | @Override |
| | | public boolean submit(Code code) { |
| | | code.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
| | | return saveOrUpdate(code); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service.impl; |
| | | |
| | | import com.vci.ubcs.develop.entity.Datasource; |
| | | import com.vci.ubcs.develop.mapper.DatasourceMapper; |
| | | import com.vci.ubcs.develop.service.IDatasourceService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æ°æ®æºé
置表 æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class DatasourceServiceImpl extends BaseServiceImpl<DatasourceMapper, Datasource> implements IDatasourceService { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.develop.entity.ModelPrototype; |
| | | import com.vci.ubcs.develop.mapper.ModelPrototypeMapper; |
| | | import com.vci.ubcs.develop.service.IModelPrototypeService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®åå表 æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class ModelPrototypeServiceImpl extends BaseServiceImpl<ModelPrototypeMapper, ModelPrototype> implements IModelPrototypeService { |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submitList(List<ModelPrototype> modelPrototypes) { |
| | | modelPrototypes.forEach(modelPrototype -> { |
| | | if (modelPrototype.getId() == null) { |
| | | this.save(modelPrototype); |
| | | } else { |
| | | this.updateById(modelPrototype); |
| | | } |
| | | }); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<ModelPrototype> prototypeList(Long modelId) { |
| | | return this.list(Wrappers.<ModelPrototype>lambdaQuery().eq(ModelPrototype::getModelId, modelId)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.develop.service.impl; |
| | | |
| | | import com.vci.ubcs.develop.entity.Model; |
| | | import com.vci.ubcs.develop.mapper.ModelMapper; |
| | | import com.vci.ubcs.develop.service.IModelService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æ°æ®æ¨¡å表 æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class ModelServiceImpl extends BaseServiceImpl<ModelMapper, Model> implements IModelService { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.develop.mapper.CodeMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="codeResultMap" type="com.vci.ubcs.develop.entity.Code"> |
| | | <id column="id" property="id"/> |
| | | <result column="datasource_id" property="modelId"/> |
| | | <result column="service_name" property="serviceName"/> |
| | | <result column="code_name" property="codeName"/> |
| | | <result column="table_name" property="tableName"/> |
| | | <result column="pk_name" property="pkName"/> |
| | | <result column="base_mode" property="baseMode"/> |
| | | <result column="wrap_mode" property="wrapMode"/> |
| | | <result column="table_prefix" property="tablePrefix"/> |
| | | <result column="package_name" property="packageName"/> |
| | | <result column="api_path" property="apiPath"/> |
| | | <result column="web_path" property="webPath"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.develop.mapper.DatasourceMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="datasourceResultMap" type="com.vci.ubcs.develop.entity.Datasource"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="driver_class" property="driverClass"/> |
| | | <result column="url" property="url"/> |
| | | <result column="username" property="username"/> |
| | | <result column="password" property="password"/> |
| | | <result column="remark" property="remark"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.develop.mapper.ModelMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="modelResultMap" type="com.vci.ubcs.develop.entity.Model"> |
| | | <id column="id" property="id"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="datasource_id" property="datasourceId"/> |
| | | <result column="model_name" property="modelName"/> |
| | | <result column="model_code" property="modelCode"/> |
| | | <result column="model_table" property="modelTable"/> |
| | | <result column="model_class" property="modelClass"/> |
| | | <result column="model_remark" property="modelRemark"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectModelPage" resultMap="modelResultMap"> |
| | | select * from blade_model where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.develop.mapper.ModelPrototypeMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="modelPrototypeResultMap" type="com.vci.ubcs.develop.entity.ModelPrototype"> |
| | | <id column="id" property="id"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="jdbc_name" property="jdbcName"/> |
| | | <result column="jdbc_type" property="jdbcType"/> |
| | | <result column="comment" property="comment"/> |
| | | <result column="property_type" property="propertyType"/> |
| | | <result column="property_entity" property="propertyEntity"/> |
| | | <result column="property_name" property="propertyName"/> |
| | | <result column="is_form" property="isForm"/> |
| | | <result column="is_row" property="isRow"/> |
| | | <result column="component_type" property="componentType"/> |
| | | <result column="dict_code" property="dictCode"/> |
| | | <result column="is_required" property="isRequired"/> |
| | | <result column="is_list" property="isList"/> |
| | | <result column="is_query" property="isQuery"/> |
| | | <result column="query_type" property="queryType"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectModelPrototypePage" resultMap="modelPrototypeResultMap"> |
| | | select * from blade_model_prototype where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.test; |
| | | |
| | | |
| | | import org.springblade.develop.constant.DevelopConstant; |
| | | import org.springblade.develop.support.BladeCodeGenerator; |
| | | |
| | | /** |
| | | * 代ç çæå¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class CodeGenerator { |
| | | |
| | | /** |
| | | * 代ç çæç模åå |
| | | */ |
| | | public static String CODE_NAME = "èµæºç®¡ç"; |
| | | /** |
| | | * ä»£ç æå¨æå¡å |
| | | */ |
| | | public static String SERVICE_NAME = "blade-develop"; |
| | | /** |
| | | * 代ç çæçå
å |
| | | */ |
| | | public static String PACKAGE_NAME = "org.springblade.develop"; |
| | | /** |
| | | * å端代ç çæé£æ ¼ |
| | | */ |
| | | public static String CODE_STYLE = DevelopConstant.SABER_NAME; |
| | | /** |
| | | * å端代ç çæå°å |
| | | */ |
| | | public static String PACKAGE_WEB_DIR = "/Users/chill/Workspaces/product/Saber"; |
| | | /** |
| | | * éè¦å»æç表åç¼ |
| | | */ |
| | | public static String[] TABLE_PREFIX = {"blade_"}; |
| | | /** |
| | | * éè¦çæç表å(两è
åªè½åå
¶ä¸) |
| | | */ |
| | | public static String[] INCLUDE_TABLES = {"pl_sys_datasource"}; |
| | | /** |
| | | * éè¦æé¤ç表å(两è
åªè½åå
¶ä¸) |
| | | */ |
| | | public static String[] EXCLUDE_TABLES = {}; |
| | | /** |
| | | * æ¯å¦å
å«åºç¡ä¸å¡å段 |
| | | */ |
| | | public static Boolean HAS_SUPER_ENTITY = Boolean.TRUE; |
| | | /** |
| | | * æ¯å¦å
å«è¿ç¨è°ç¨ |
| | | */ |
| | | private static Boolean HAS_FEIGN = Boolean.TRUE; |
| | | /** |
| | | * åºç¡ä¸å¡å段 |
| | | */ |
| | | public static String[] SUPER_ENTITY_COLUMNS = {"id", "create_time", "create_user", "create_dept", "update_time", "update_user", "status", "is_deleted"}; |
| | | |
| | | |
| | | /** |
| | | * RUN THIS |
| | | */ |
| | | public static void main(String[] args) { |
| | | BladeCodeGenerator generator = new BladeCodeGenerator(); |
| | | generator.setCodeName(CODE_NAME); |
| | | generator.setServiceName(SERVICE_NAME); |
| | | generator.setCodeStyle(CODE_STYLE); |
| | | generator.setPackageName(PACKAGE_NAME); |
| | | generator.setPackageWebDir(PACKAGE_WEB_DIR); |
| | | generator.setTablePrefix(TABLE_PREFIX); |
| | | generator.setIncludeTables(INCLUDE_TABLES); |
| | | generator.setExcludeTables(EXCLUDE_TABLES); |
| | | generator.setHasSuperEntity(HAS_SUPER_ENTITY); |
| | | generator.setHasFeign(HAS_FEIGN); |
| | | generator.setSuperEntityColumns(SUPER_ENTITY_COLUMNS); |
| | | generator.run(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-flow</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!-- Blade --> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-swagger</artifactId> |
| | | </dependency> |
| | | <!--<dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-transaction</artifactId> |
| | | </dependency>--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-dict-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-scope-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-auto</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-user-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-flow-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <!-- 工使µ --> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-flowable</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <!--è§£å³ä¸æ¯æçå符éé®é¢--> |
| | | <dependency> |
| | | <groupId>com.oracle.database.nls</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow; |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * Flowableå¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | //@SeataCloudApplication |
| | | @UbcsCloudApplication |
| | | public class FlowApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_FLOW_NAME, FlowApplication.class, args); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.business.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.flow.business.service.FlowBusinessService; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.flowable.engine.TaskService; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * æµç¨äºå¡éç¨æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("work") |
| | | @Api(value = "æµç¨äºå¡éç¨æ¥å£", tags = "æµç¨äºå¡éç¨æ¥å£") |
| | | public class WorkController { |
| | | |
| | | private final TaskService taskService; |
| | | private final FlowEngineService flowEngineService; |
| | | private final FlowBusinessService flowBusinessService; |
| | | |
| | | /** |
| | | * åèµ·äºå¡å表页 |
| | | */ |
| | | @GetMapping("start-list") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "åèµ·äºå¡å表页", notes = "ä¼ å
¥æµç¨ç±»å") |
| | | public R<IPage<FlowProcess>> startList(@ApiParam("æµç¨ç±»å") String category, Query query, @RequestParam(required = false, defaultValue = "1") Integer mode) { |
| | | IPage<FlowProcess> pages = flowEngineService.selectProcessPage(Condition.getPage(query), category, mode); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å¾
ç¾äºå¡å表页 |
| | | */ |
| | | @GetMapping("claim-list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å¾
ç¾äºå¡å表页", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R<IPage<BladeFlow>> claimList(@ApiParam("æµç¨ä¿¡æ¯") BladeFlow bladeFlow, Query query) { |
| | | IPage<BladeFlow> pages = flowBusinessService.selectClaimPage(Condition.getPage(query), bladeFlow); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å¾
åäºå¡å表页 |
| | | */ |
| | | @GetMapping("todo-list") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å¾
åäºå¡å表页", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R<IPage<BladeFlow>> todoList(@ApiParam("æµç¨ä¿¡æ¯") BladeFlow bladeFlow, Query query) { |
| | | IPage<BladeFlow> pages = flowBusinessService.selectTodoPage(Condition.getPage(query), bladeFlow); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å·²åäºå¡å表页 |
| | | */ |
| | | @GetMapping("send-list") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "å·²åäºå¡å表页", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R<IPage<BladeFlow>> sendList(@ApiParam("æµç¨ä¿¡æ¯") BladeFlow bladeFlow, Query query) { |
| | | IPage<BladeFlow> pages = flowBusinessService.selectSendPage(Condition.getPage(query), bladeFlow); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * åç»äºå¡å表页 |
| | | */ |
| | | @GetMapping("done-list") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "åç»äºå¡å表页", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R<IPage<BladeFlow>> doneList(@ApiParam("æµç¨ä¿¡æ¯") BladeFlow bladeFlow, Query query) { |
| | | IPage<BladeFlow> pages = flowBusinessService.selectDonePage(Condition.getPage(query), bladeFlow); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * ç¾æ¶äºå¡ |
| | | * |
| | | * @param taskId ä»»å¡id |
| | | */ |
| | | @PostMapping("claim-task") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "ç¾æ¶äºå¡", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R claimTask(@ApiParam("ä»»å¡id") String taskId) { |
| | | taskService.claim(taskId, TaskUtil.getTaskUser()); |
| | | return R.success("ç¾æ¶äºå¡æå"); |
| | | } |
| | | |
| | | /** |
| | | * å®æä»»å¡ |
| | | * |
| | | * @param flow 请åä¿¡æ¯ |
| | | */ |
| | | @PostMapping("complete-task") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "宿任å¡", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R completeTask(@ApiParam("ä»»å¡ä¿¡æ¯") @RequestBody BladeFlow flow) { |
| | | return R.status(flowBusinessService.completeTask(flow)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡ |
| | | * |
| | | * @param taskId ä»»å¡id |
| | | * @param reason å é¤åå |
| | | */ |
| | | @PostMapping("delete-task") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "å é¤ä»»å¡", notes = "ä¼ å
¥æµç¨ä¿¡æ¯") |
| | | public R deleteTask(@ApiParam("ä»»å¡id") String taskId, @ApiParam("å é¤åå ") String reason) { |
| | | taskService.deleteTask(taskId, reason); |
| | | return R.success("å é¤ä»»å¡æå"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.business.feign; |
| | | |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.core.feign.IFlowClient; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import org.flowable.engine.IdentityService; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨è¿ç¨è°ç¨å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class FlowClient implements IFlowClient { |
| | | |
| | | private final RuntimeService runtimeService; |
| | | private final IdentityService identityService; |
| | | private final TaskService taskService; |
| | | |
| | | @Override |
| | | @PostMapping(START_PROCESS_INSTANCE_BY_ID) |
| | | public R<BladeFlow> startProcessInstanceById(String processDefinitionId, String businessKey, @RequestBody Map<String, Object> variables) { |
| | | // 设置æµç¨å¯å¨ç¨æ· |
| | | identityService.setAuthenticatedUserId(TaskUtil.getTaskUser()); |
| | | // å¼å¯æµç¨ |
| | | ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, businessKey, variables); |
| | | // ç»è£
æµç¨éç¨ç±» |
| | | BladeFlow flow = new BladeFlow(); |
| | | flow.setProcessInstanceId(processInstance.getId()); |
| | | return R.data(flow); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(START_PROCESS_INSTANCE_BY_KEY) |
| | | public R<BladeFlow> startProcessInstanceByKey(String processDefinitionKey, String businessKey, @RequestBody Map<String, Object> variables) { |
| | | // 设置æµç¨å¯å¨ç¨æ· |
| | | identityService.setAuthenticatedUserId(TaskUtil.getTaskUser()); |
| | | // å¼å¯æµç¨ |
| | | ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey, variables); |
| | | // ç»è£
æµç¨éç¨ç±» |
| | | BladeFlow flow = new BladeFlow(); |
| | | flow.setProcessInstanceId(processInstance.getId()); |
| | | return R.data(flow); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(COMPLETE_TASK) |
| | | public R completeTask(String taskId, String processInstanceId, String comment, @RequestBody Map<String, Object> variables) { |
| | | // å¢å è¯è®º |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | | } |
| | | // éç©ºå¤æ |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | // å®æä»»å¡ |
| | | taskService.complete(taskId, variables); |
| | | return R.success("æµç¨æäº¤æå"); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(TASK_VARIABLE) |
| | | public R<Object> taskVariable(String taskId, String variableName) { |
| | | return R.data(taskService.getVariable(taskId, variableName)); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(TASK_VARIABLES) |
| | | public R<Map<String, Object>> taskVariables(String taskId) { |
| | | return R.data(taskService.getVariables(taskId)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.business.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | |
| | | /** |
| | | * æµç¨ä¸å¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface FlowBusinessService { |
| | | |
| | | /** |
| | | * æµç¨å¾
ç¾å表 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param bladeFlow æµç¨ç±» |
| | | * @return |
| | | */ |
| | | IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow); |
| | | |
| | | /** |
| | | * æµç¨å¾
åå表 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param bladeFlow æµç¨ç±» |
| | | * @return |
| | | */ |
| | | IPage<BladeFlow> selectTodoPage(IPage<BladeFlow> page, BladeFlow bladeFlow); |
| | | |
| | | /** |
| | | * æµç¨å·²åå表 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param bladeFlow æµç¨ç±» |
| | | * @return |
| | | */ |
| | | IPage<BladeFlow> selectSendPage(IPage<BladeFlow> page, BladeFlow bladeFlow); |
| | | |
| | | /** |
| | | * æµç¨åç»å表 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param bladeFlow æµç¨ç±» |
| | | * @return |
| | | */ |
| | | IPage<BladeFlow> selectDonePage(IPage<BladeFlow> page, BladeFlow bladeFlow); |
| | | |
| | | /** |
| | | * å®æä»»å¡ |
| | | * |
| | | * @param leave 请åä¿¡æ¯ |
| | | * @return boolean |
| | | */ |
| | | boolean completeTask(BladeFlow leave); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.business.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.flow.business.service.FlowBusinessService; |
| | | import com.vci.ubcs.flow.core.constant.ProcessConstant; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import com.vci.ubcs.flow.engine.utils.FlowCache; |
| | | import lombok.AllArgsConstructor; |
| | | import org.flowable.engine.HistoryService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.history.HistoricProcessInstanceQuery; |
| | | import org.flowable.task.api.TaskQuery; |
| | | import org.flowable.task.api.history.HistoricTaskInstance; |
| | | import org.flowable.task.api.history.HistoricTaskInstanceQuery; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨ä¸å¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class FlowBusinessServiceImpl implements FlowBusinessService { |
| | | |
| | | private final TaskService taskService; |
| | | private final HistoryService historyService; |
| | | |
| | | @Override |
| | | public IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow) { |
| | | String taskUser = TaskUtil.getTaskUser(); |
| | | String taskGroup = TaskUtil.getCandidateGroup(); |
| | | List<BladeFlow> flowList = new LinkedList<>(); |
| | | |
| | | // 个人çå¾
ç¾æ¶çä»»å¡ |
| | | TaskQuery claimUserQuery = taskService.createTaskQuery().taskCandidateUser(taskUser) |
| | | .includeProcessVariables().active().orderByTaskCreateTime().desc(); |
| | | // å®å¶æµç¨çå¾
ç¾æ¶çä»»å¡ |
| | | TaskQuery claimRoleWithTenantIdQuery = taskService.createTaskQuery().taskTenantId(AuthUtil.getTenantId()).taskCandidateGroupIn(Func.toStrList(taskGroup)) |
| | | .includeProcessVariables().active().orderByTaskCreateTime().desc(); |
| | | // éç¨æµç¨çå¾
ç¾æ¶çä»»å¡ |
| | | TaskQuery claimRoleWithoutTenantIdQuery = taskService.createTaskQuery().taskWithoutTenantId().taskCandidateGroupIn(Func.toStrList(taskGroup)) |
| | | .includeProcessVariables().active().orderByTaskCreateTime().desc(); |
| | | |
| | | // æå»ºåè¡¨æ°æ® |
| | | buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM); |
| | | buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM); |
| | | buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM); |
| | | |
| | | // è®¡ç®æ»æ° |
| | | long count = claimUserQuery.count() + claimRoleWithTenantIdQuery.count() + claimRoleWithoutTenantIdQuery.count(); |
| | | // è®¾ç½®é¡µæ° |
| | | page.setSize(count); |
| | | // è®¾ç½®æ»æ° |
| | | page.setTotal(count); |
| | | // è®¾ç½®æ°æ® |
| | | page.setRecords(flowList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<BladeFlow> selectTodoPage(IPage<BladeFlow> page, BladeFlow bladeFlow) { |
| | | String taskUser = TaskUtil.getTaskUser(); |
| | | List<BladeFlow> flowList = new LinkedList<>(); |
| | | |
| | | // å·²ç¾æ¶çä»»å¡ |
| | | TaskQuery todoQuery = taskService.createTaskQuery().taskAssignee(taskUser).active() |
| | | .includeProcessVariables().orderByTaskCreateTime().desc(); |
| | | |
| | | // æå»ºåè¡¨æ°æ® |
| | | buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO); |
| | | |
| | | // è®¡ç®æ»æ° |
| | | long count = todoQuery.count(); |
| | | // è®¾ç½®é¡µæ° |
| | | page.setSize(count); |
| | | // è®¾ç½®æ»æ° |
| | | page.setTotal(count); |
| | | // è®¾ç½®æ°æ® |
| | | page.setRecords(flowList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<BladeFlow> selectSendPage(IPage<BladeFlow> page, BladeFlow bladeFlow) { |
| | | String taskUser = TaskUtil.getTaskUser(); |
| | | List<BladeFlow> flowList = new LinkedList<>(); |
| | | |
| | | HistoricProcessInstanceQuery historyQuery = historyService.createHistoricProcessInstanceQuery().startedBy(taskUser).orderByProcessInstanceStartTime().desc(); |
| | | |
| | | if (bladeFlow.getCategory() != null) { |
| | | historyQuery.processDefinitionCategory(bladeFlow.getCategory()); |
| | | } |
| | | if (bladeFlow.getProcessDefinitionName() != null) { |
| | | historyQuery.processDefinitionName(bladeFlow.getProcessDefinitionName()); |
| | | } |
| | | if (bladeFlow.getBeginDate() != null) { |
| | | historyQuery.startedAfter(bladeFlow.getBeginDate()); |
| | | } |
| | | if (bladeFlow.getEndDate() != null) { |
| | | historyQuery.startedBefore(bladeFlow.getEndDate()); |
| | | } |
| | | |
| | | // æ¥è¯¢å表 |
| | | List<HistoricProcessInstance> historyList = historyQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize())); |
| | | |
| | | historyList.forEach(historicProcessInstance -> { |
| | | BladeFlow flow = new BladeFlow(); |
| | | // historicProcessInstance |
| | | flow.setCreateTime(historicProcessInstance.getStartTime()); |
| | | flow.setEndTime(historicProcessInstance.getEndTime()); |
| | | flow.setVariables(historicProcessInstance.getProcessVariables()); |
| | | String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); |
| | | if (businessKey.length > 1) { |
| | | flow.setBusinessTable(businessKey[0]); |
| | | flow.setBusinessId(businessKey[1]); |
| | | } |
| | | flow.setHistoryActivityName(historicProcessInstance.getName()); |
| | | flow.setProcessInstanceId(historicProcessInstance.getId()); |
| | | flow.setHistoryProcessInstanceId(historicProcessInstance.getId()); |
| | | // ProcessDefinition |
| | | FlowProcess processDefinition = FlowCache.getProcessDefinition(historicProcessInstance.getProcessDefinitionId()); |
| | | flow.setProcessDefinitionId(processDefinition.getId()); |
| | | flow.setProcessDefinitionName(processDefinition.getName()); |
| | | flow.setProcessDefinitionVersion(processDefinition.getVersion()); |
| | | flow.setProcessDefinitionKey(processDefinition.getKey()); |
| | | flow.setCategory(processDefinition.getCategory()); |
| | | flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); |
| | | flow.setProcessInstanceId(historicProcessInstance.getId()); |
| | | // HistoricTaskInstance |
| | | List<HistoricTaskInstance> historyTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list(); |
| | | if (Func.isNotEmpty(historyTasks)) { |
| | | HistoricTaskInstance historyTask = historyTasks.iterator().next(); |
| | | flow.setTaskId(historyTask.getId()); |
| | | flow.setTaskName(historyTask.getName()); |
| | | flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey()); |
| | | } |
| | | // Status |
| | | if (historicProcessInstance.getEndActivityId() != null) { |
| | | flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED); |
| | | } else { |
| | | flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED); |
| | | } |
| | | flow.setStatus(FlowEngineConstant.STATUS_FINISH); |
| | | flowList.add(flow); |
| | | }); |
| | | |
| | | // è®¡ç®æ»æ° |
| | | long count = historyQuery.count(); |
| | | // è®¾ç½®æ»æ° |
| | | page.setTotal(count); |
| | | page.setRecords(flowList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<BladeFlow> selectDonePage(IPage<BladeFlow> page, BladeFlow bladeFlow) { |
| | | String taskUser = TaskUtil.getTaskUser(); |
| | | List<BladeFlow> flowList = new LinkedList<>(); |
| | | |
| | | HistoricTaskInstanceQuery doneQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(taskUser).finished() |
| | | .includeProcessVariables().orderByHistoricTaskInstanceEndTime().desc(); |
| | | |
| | | if (bladeFlow.getCategory() != null) { |
| | | doneQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory())); |
| | | } |
| | | if (bladeFlow.getProcessDefinitionName() != null) { |
| | | doneQuery.processDefinitionName(bladeFlow.getProcessDefinitionName()); |
| | | } |
| | | if (bladeFlow.getBeginDate() != null) { |
| | | doneQuery.taskCompletedAfter(bladeFlow.getBeginDate()); |
| | | } |
| | | if (bladeFlow.getEndDate() != null) { |
| | | doneQuery.taskCompletedBefore(bladeFlow.getEndDate()); |
| | | } |
| | | |
| | | // æ¥è¯¢å表 |
| | | List<HistoricTaskInstance> doneList = doneQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize())); |
| | | doneList.forEach(historicTaskInstance -> { |
| | | BladeFlow flow = new BladeFlow(); |
| | | flow.setTaskId(historicTaskInstance.getId()); |
| | | flow.setTaskDefinitionKey(historicTaskInstance.getTaskDefinitionKey()); |
| | | flow.setTaskName(historicTaskInstance.getName()); |
| | | flow.setAssignee(historicTaskInstance.getAssignee()); |
| | | flow.setCreateTime(historicTaskInstance.getCreateTime()); |
| | | flow.setExecutionId(historicTaskInstance.getExecutionId()); |
| | | flow.setHistoryTaskEndTime(historicTaskInstance.getEndTime()); |
| | | flow.setVariables(historicTaskInstance.getProcessVariables()); |
| | | |
| | | FlowProcess processDefinition = FlowCache.getProcessDefinition(historicTaskInstance.getProcessDefinitionId()); |
| | | flow.setProcessDefinitionId(processDefinition.getId()); |
| | | flow.setProcessDefinitionName(processDefinition.getName()); |
| | | flow.setProcessDefinitionKey(processDefinition.getKey()); |
| | | flow.setProcessDefinitionVersion(processDefinition.getVersion()); |
| | | flow.setCategory(processDefinition.getCategory()); |
| | | flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); |
| | | |
| | | flow.setProcessInstanceId(historicTaskInstance.getProcessInstanceId()); |
| | | flow.setHistoryProcessInstanceId(historicTaskInstance.getProcessInstanceId()); |
| | | HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance((historicTaskInstance.getProcessInstanceId())); |
| | | if (Func.isNotEmpty(historicProcessInstance)) { |
| | | String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); |
| | | flow.setBusinessTable(businessKey[0]); |
| | | flow.setBusinessId(businessKey[1]); |
| | | if (historicProcessInstance.getEndActivityId() != null) { |
| | | flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED); |
| | | } else { |
| | | flow.setProcessIsFinished(FlowEngineConstant.STATUS_UNFINISHED); |
| | | } |
| | | } |
| | | flow.setStatus(FlowEngineConstant.STATUS_FINISH); |
| | | flowList.add(flow); |
| | | }); |
| | | // è®¡ç®æ»æ° |
| | | long count = doneQuery.count(); |
| | | // è®¾ç½®æ»æ° |
| | | page.setTotal(count); |
| | | page.setRecords(flowList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public boolean completeTask(BladeFlow flow) { |
| | | String taskId = flow.getTaskId(); |
| | | String processInstanceId = flow.getProcessInstanceId(); |
| | | String comment = Func.toStr(flow.getComment(), ProcessConstant.PASS_COMMENT); |
| | | // å¢å è¯è®º |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | | } |
| | | // å建åé |
| | | Map<String, Object> variables = flow.getVariables(); |
| | | if (variables == null) { |
| | | variables = Kv.create(); |
| | | } |
| | | variables.put(ProcessConstant.PASS_KEY, flow.isPass()); |
| | | // å®æä»»å¡ |
| | | taskService.complete(taskId, variables); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æå»ºæµç¨ |
| | | * |
| | | * @param bladeFlow æµç¨éç¨ç±» |
| | | * @param flowList æµç¨å表 |
| | | * @param taskQuery 任塿¥è¯¢ç±» |
| | | * @param status ç¶æ |
| | | */ |
| | | private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) { |
| | | if (bladeFlow.getCategory() != null) { |
| | | taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory())); |
| | | } |
| | | if (bladeFlow.getProcessDefinitionName() != null) { |
| | | taskQuery.processDefinitionName(bladeFlow.getProcessDefinitionName()); |
| | | } |
| | | if (bladeFlow.getBeginDate() != null) { |
| | | taskQuery.taskCreatedAfter(bladeFlow.getBeginDate()); |
| | | } |
| | | if (bladeFlow.getEndDate() != null) { |
| | | taskQuery.taskCreatedBefore(bladeFlow.getEndDate()); |
| | | } |
| | | taskQuery.list().forEach(task -> { |
| | | BladeFlow flow = new BladeFlow(); |
| | | flow.setTaskId(task.getId()); |
| | | flow.setTaskDefinitionKey(task.getTaskDefinitionKey()); |
| | | flow.setTaskName(task.getName()); |
| | | flow.setAssignee(task.getAssignee()); |
| | | flow.setCreateTime(task.getCreateTime()); |
| | | flow.setClaimTime(task.getClaimTime()); |
| | | flow.setExecutionId(task.getExecutionId()); |
| | | flow.setVariables(task.getProcessVariables()); |
| | | |
| | | HistoricProcessInstance historicProcessInstance = getHistoricProcessInstance(task.getProcessInstanceId()); |
| | | if (Func.isNotEmpty(historicProcessInstance)) { |
| | | String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); |
| | | flow.setBusinessTable(businessKey[0]); |
| | | flow.setBusinessId(businessKey[1]); |
| | | } |
| | | |
| | | FlowProcess processDefinition = FlowCache.getProcessDefinition(task.getProcessDefinitionId()); |
| | | flow.setCategory(processDefinition.getCategory()); |
| | | flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); |
| | | flow.setProcessDefinitionId(processDefinition.getId()); |
| | | flow.setProcessDefinitionName(processDefinition.getName()); |
| | | flow.setProcessDefinitionKey(processDefinition.getKey()); |
| | | flow.setProcessDefinitionVersion(processDefinition.getVersion()); |
| | | flow.setProcessInstanceId(task.getProcessInstanceId()); |
| | | flow.setStatus(status); |
| | | flowList.add(flow); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * è·åå岿µç¨ |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @return HistoricProcessInstance |
| | | */ |
| | | private HistoricProcessInstance getHistoricProcessInstance(String processInstanceId) { |
| | | return historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.flowable.spring.SpringProcessEngineConfiguration; |
| | | import org.flowable.spring.boot.EngineConfigurationConfigurer; |
| | | import org.flowable.spring.boot.FlowableProperties; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * Flowableé
置类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | @EnableConfigurationProperties(FlowableProperties.class) |
| | | public class FlowableConfiguration implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> { |
| | | private final FlowableProperties flowableProperties; |
| | | |
| | | @Override |
| | | public void configure(SpringProcessEngineConfiguration engineConfiguration) { |
| | | engineConfiguration.setActivityFontName(flowableProperties.getActivityFontName()); |
| | | engineConfiguration.setLabelFontName(flowableProperties.getLabelFontName()); |
| | | engineConfiguration.setAnnotationFontName(flowableProperties.getAnnotationFontName()); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.constant; |
| | | |
| | | /** |
| | | * æµç¨å¸¸é. |
| | | * |
| | | * @author zhuangqian |
| | | */ |
| | | public interface FlowEngineConstant { |
| | | |
| | | String FLOWABLE_BASE_PACKAGES = "org.flowable.ui"; |
| | | |
| | | String SUFFIX = ".bpmn20.xml"; |
| | | |
| | | String ACTIVE = "active"; |
| | | |
| | | String SUSPEND = "suspend"; |
| | | |
| | | String STATUS_TODO = "todo"; |
| | | |
| | | String STATUS_CLAIM = "claim"; |
| | | |
| | | String STATUS_SEND = "send"; |
| | | |
| | | String STATUS_DONE = "done"; |
| | | |
| | | String STATUS_FINISHED = "finished"; |
| | | |
| | | String STATUS_UNFINISHED = "unfinished"; |
| | | |
| | | String STATUS_FINISH = "finish"; |
| | | |
| | | String START_EVENT = "startEvent"; |
| | | |
| | | String END_EVENT = "endEvent"; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.flow.engine.entity.FlowExecution; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * æµç¨ç¶ææ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("follow") |
| | | @AllArgsConstructor |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class FlowFollowController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | | |
| | | /** |
| | | * æµç¨ç¶æå表 |
| | | */ |
| | | @GetMapping("list") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥notice") |
| | | public R<IPage<FlowExecution>> list(Query query, @ApiParam(value = "æµç¨å®ä¾id") String processInstanceId, @ApiParam(value = "æµç¨key") String processDefinitionKey) { |
| | | IPage<FlowExecution> pages = flowEngineService.selectFollowPage(Condition.getPage(query), processInstanceId, processDefinitionKey); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å 餿µç¨å®ä¾ |
| | | */ |
| | | @PostMapping("delete-process-instance") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥ä¸»é®éå") |
| | | public R deleteProcessInstance(@ApiParam(value = "æµç¨å®ä¾id") @RequestParam String processInstanceId, @ApiParam(value = "å é¤åå ") @RequestParam String deleteReason) { |
| | | boolean temp = flowEngineService.deleteProcessInstance(processInstanceId, deleteReason); |
| | | return R.status(temp); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * æµç¨ç®¡çæ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("manager") |
| | | @AllArgsConstructor |
| | | @Api(value = "æµç¨ç®¡çæ¥å£", tags = "æµç¨ç®¡çæ¥å£") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class FlowManagerController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @GetMapping("list") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥æµç¨ç±»å") |
| | | public R<IPage<FlowProcess>> list(@ApiParam("æµç¨ç±»å") String category, Query query, @RequestParam(required = false, defaultValue = "1") Integer mode) { |
| | | IPage<FlowProcess> pages = flowEngineService.selectProcessPage(Condition.getPage(query), category, mode); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åæ´æµç¨ç¶æ |
| | | * |
| | | * @param state ç¶æ |
| | | * @param processId æµç¨id |
| | | */ |
| | | @PostMapping("change-state") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "åæ´æµç¨ç¶æ", notes = "ä¼ å
¥state,processId") |
| | | public R changeState(@RequestParam String state, @RequestParam String processId) { |
| | | String msg = flowEngineService.changeState(state, processId); |
| | | return R.success(msg); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é¨ç½²æµç¨ |
| | | * |
| | | * @param deploymentIds é¨ç½²æµç¨idéå |
| | | */ |
| | | @PostMapping("delete-deployment") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å é¤é¨ç½²æµç¨", notes = "é¨ç½²æµç¨idéå") |
| | | public R deleteDeployment(String deploymentIds) { |
| | | return R.status(flowEngineService.deleteDeployment(deploymentIds)); |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥æµç¨æä»¶æ ¼å¼ |
| | | * |
| | | * @param file æµç¨æä»¶ |
| | | */ |
| | | @PostMapping("check-upload") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "ä¸ä¼ é¨ç½²æµç¨æä»¶", notes = "ä¼ å
¥æä»¶") |
| | | public R checkUpload(@RequestParam MultipartFile file) { |
| | | boolean temp = Objects.requireNonNull(file.getOriginalFilename()).endsWith(FlowEngineConstant.SUFFIX); |
| | | return R.data(Kv.create().set("name", file.getOriginalFilename()).set("success", temp)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ é¨ç½²æµç¨æä»¶ |
| | | * |
| | | * @param files æµç¨æä»¶ |
| | | * @param category ç±»å |
| | | */ |
| | | @PostMapping("deploy-upload") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¸ä¼ é¨ç½²æµç¨æä»¶", notes = "ä¼ å
¥æä»¶") |
| | | public R deployUpload(@RequestParam List<MultipartFile> files, |
| | | @RequestParam String category, |
| | | @RequestParam(required = false, defaultValue = "") String tenantIds) { |
| | | return R.status(flowEngineService.deployUpload(files, category, Func.toStrList(tenantIds))); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡åæ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("model") |
| | | @AllArgsConstructor |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | public class FlowModelController { |
| | | |
| | | private final FlowEngineService flowEngineService; |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "modelKey", value = "æ¨¡åæ è¯", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "模ååç§°", paramType = "query", dataType = "string") |
| | | }) |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥notice") |
| | | public R<IPage<FlowModel>> list(@ApiIgnore @RequestParam Map<String, Object> flow, Query query) { |
| | | IPage<FlowModel> pages = flowEngineService.page(Condition.getPage(query), Condition.getQueryWrapper(flow, FlowModel.class) |
| | | .select("id,model_key modelKey,name,description,version,created,last_updated lastUpdated") |
| | | .orderByDesc("last_updated")); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å é¤", notes = "ä¼ å
¥ä¸»é®éå") |
| | | public R remove(@ApiParam(value = "主é®éå") @RequestParam String ids) { |
| | | boolean temp = flowEngineService.removeByIds(Func.toStrList(ids)); |
| | | return R.status(temp); |
| | | } |
| | | |
| | | /** |
| | | * é¨ç½² |
| | | */ |
| | | @PostMapping("/deploy") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "é¨ç½²", notes = "ä¼ å
¥æ¨¡åidååç±»") |
| | | public R deploy(@ApiParam(value = "模åid") @RequestParam String modelId, |
| | | @ApiParam(value = "工使µåç±»") @RequestParam String category, |
| | | @ApiParam(value = "ç§æ·ID") @RequestParam(required = false, defaultValue = "") String tenantIds) { |
| | | boolean temp = flowEngineService.deployModel(modelId, category, Func.toStrList(tenantIds)); |
| | | return R.status(temp); |
| | | } |
| | | |
| | | @PostMapping("submit") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "ä¿å/ç¼è¾") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "模åid"), |
| | | @ApiImplicitParam(name = "name", value = "模ååç§°", required = true), |
| | | @ApiImplicitParam(name = "modelKey", value = "模åkey", required = true), |
| | | @ApiImplicitParam(name = "description", value = "模åæè¿°"), |
| | | @ApiImplicitParam(name = "xml", value = "模åxml", required = true), |
| | | }) |
| | | public R<FlowModel> submit(@RequestBody @ApiIgnore FlowModel model) { |
| | | return R.data(flowEngineService.submitModel(model)); |
| | | } |
| | | |
| | | @GetMapping("detail") |
| | | @ApiOperation(value = "详æ
") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "模åid", required = true), |
| | | }) |
| | | public R<FlowModel> detail(String id) { |
| | | return R.data(flowEngineService.getById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.controller; |
| | | |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµç¨éç¨æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @Slf4j |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("process") |
| | | public class FlowProcessController { |
| | | |
| | | private static final String IMAGE_NAME = "image"; |
| | | private final FlowEngineService flowEngineService; |
| | | |
| | | /** |
| | | * è·åæµè½¬åå²å表 |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param startActivityId å¼å§èç¹id |
| | | * @param endActivityId ç»æèç¹id |
| | | */ |
| | | @GetMapping(value = "history-flow-list") |
| | | public R<List<BladeFlow>> historyFlowList(@RequestParam String processInstanceId, String startActivityId, String endActivityId) { |
| | | return R.data(flowEngineService.historyFlowList(processInstanceId, startActivityId, endActivityId)); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨èç¹è¿ç¨å¾ |
| | | * |
| | | * @param processDefinitionId æµç¨id |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | */ |
| | | @GetMapping(value = "model-view") |
| | | public R modelView(String processDefinitionId, String processInstanceId) { |
| | | return R.data(flowEngineService.modelView(processDefinitionId, processInstanceId)); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨èç¹è¿ç¨å¾ |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param httpServletResponse httpååº |
| | | */ |
| | | @GetMapping(value = "diagram-view") |
| | | public void diagramView(String processInstanceId, HttpServletResponse httpServletResponse) { |
| | | flowEngineService.diagramView(processInstanceId, httpServletResponse); |
| | | } |
| | | |
| | | /** |
| | | * æµç¨å¾å±ç¤º |
| | | * |
| | | * @param processDefinitionId æµç¨id |
| | | * @param processInstanceId å®ä¾id |
| | | * @param resourceype èµæºç±»å |
| | | * @param response ååº |
| | | */ |
| | | @GetMapping("resource-view") |
| | | public void resourceView(@RequestParam String processDefinitionId, String processInstanceId, @RequestParam(defaultValue = IMAGE_NAME) String resourceype, HttpServletResponse response) { |
| | | flowEngineService.resourceView(processDefinitionId, processInstanceId, resourceype, response); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * è¿è¡å®ä½ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class FlowExecution implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String id; |
| | | private String name; |
| | | private String startUserId; |
| | | private String startUser; |
| | | private Date startTime; |
| | | private String taskDefinitionId; |
| | | private String taskDefinitionKey; |
| | | private String category; |
| | | private String categoryName; |
| | | private String processInstanceId; |
| | | private String processDefinitionId; |
| | | private String processDefinitionKey; |
| | | private String activityId; |
| | | private int suspensionState; |
| | | private String executionId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æµç¨æ¨¡å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @TableName("ACT_DE_MODEL") |
| | | public class FlowModel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public static final int MODEL_TYPE_BPMN = 0; |
| | | public static final int MODEL_TYPE_FORM = 2; |
| | | public static final int MODEL_TYPE_APP = 3; |
| | | public static final int MODEL_TYPE_DECISION_TABLE = 4; |
| | | public static final int MODEL_TYPE_CMMN = 5; |
| | | |
| | | private String id; |
| | | private String name; |
| | | private String modelKey; |
| | | private String description; |
| | | private Date created; |
| | | private Date lastUpdated; |
| | | private String createdBy; |
| | | private String lastUpdatedBy; |
| | | private Integer version; |
| | | private String modelEditorJson; |
| | | private String modelComment; |
| | | private Integer modelType; |
| | | private String tenantId; |
| | | private byte[] thumbnail; |
| | | private String modelEditorXml; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.entity; |
| | | |
| | | import com.vci.ubcs.flow.engine.utils.FlowCache; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntityImpl; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * FlowProcess |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class FlowProcess implements Serializable { |
| | | |
| | | private String id; |
| | | private String tenantId; |
| | | private String name; |
| | | private String key; |
| | | private String category; |
| | | private String categoryName; |
| | | private Integer version; |
| | | private String deploymentId; |
| | | private String ResourceName; |
| | | private String diagramResourceName; |
| | | private Integer suspensionState; |
| | | private Date deploymentTime; |
| | | |
| | | public FlowProcess(ProcessDefinitionEntityImpl entity) { |
| | | if (entity != null) { |
| | | this.id = entity.getId(); |
| | | this.tenantId = entity.getTenantId(); |
| | | this.name = entity.getName(); |
| | | this.key = entity.getKey(); |
| | | this.category = entity.getCategory(); |
| | | this.categoryName = FlowCache.getCategoryName(entity.getCategory()); |
| | | this.version = entity.getVersion(); |
| | | this.deploymentId = entity.getDeploymentId(); |
| | | this.ResourceName = entity.getResourceName(); |
| | | this.diagramResourceName = entity.getDiagramResourceName(); |
| | | this.suspensionState = entity.getSuspensionState(); |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * FlowMapper. |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface FlowMapper extends BaseMapper<FlowModel> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * @param page |
| | | * @param flowModel |
| | | * @return |
| | | */ |
| | | List<FlowModel> selectFlowPage(IPage page, FlowModel flowModel); |
| | | |
| | | /** |
| | | * è·å模å |
| | | * @param parentModelId |
| | | * @return |
| | | */ |
| | | List<FlowModel> findByParentModelId(String parentModelId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.engine.entity.FlowExecution; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * FlowService |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface FlowEngineService extends IService<FlowModel> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param flowModel æµç¨æ¨¡å |
| | | * @return |
| | | */ |
| | | IPage<FlowModel> selectFlowPage(IPage<FlowModel> page, FlowModel flowModel); |
| | | |
| | | /** |
| | | * æµç¨ç®¡çå表 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param category åç±» |
| | | * @param mode å½¢æ |
| | | * @return |
| | | */ |
| | | IPage<FlowProcess> selectProcessPage(IPage<FlowProcess> page, String category, Integer mode); |
| | | |
| | | /** |
| | | * æµç¨ç®¡çå表 |
| | | * |
| | | * @param page å页工å
· |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param processDefinitionKey æµç¨key |
| | | * @return |
| | | */ |
| | | IPage<FlowExecution> selectFollowPage(IPage<FlowExecution> page, String processInstanceId, String processDefinitionKey); |
| | | |
| | | /** |
| | | * è·åæµè½¬åå²å表 |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param startActivityId å¼å§èç¹id |
| | | * @param endActivityId ç»æèç¹id |
| | | * @return |
| | | */ |
| | | List<BladeFlow> historyFlowList(String processInstanceId, String startActivityId, String endActivityId); |
| | | |
| | | /** |
| | | * åæ´æµç¨ç¶æ |
| | | * |
| | | * @param state ç¶æ |
| | | * @param processId æµç¨ID |
| | | * @return |
| | | */ |
| | | String changeState(String state, String processId); |
| | | |
| | | /** |
| | | * å é¤é¨ç½²æµç¨ |
| | | * |
| | | * @param deploymentIds é¨ç½²æµç¨idéå |
| | | * @return |
| | | */ |
| | | boolean deleteDeployment(String deploymentIds); |
| | | |
| | | /** |
| | | * ä¸ä¼ é¨ç½²æµç¨ |
| | | * |
| | | * @param files æµç¨é
ç½®æä»¶ |
| | | * @param category æµç¨åç±» |
| | | * @param tenantIdList ç§æ·idéå |
| | | * @return |
| | | */ |
| | | boolean deployUpload(List<MultipartFile> files, String category, List<String> tenantIdList); |
| | | |
| | | /** |
| | | * é¨ç½²æµç¨ |
| | | * |
| | | * @param modelId 模åid |
| | | * @param category åç±» |
| | | * @param tenantIdList ç§æ·idéå |
| | | * @return |
| | | */ |
| | | boolean deployModel(String modelId, String category, List<String> tenantIdList); |
| | | |
| | | /** |
| | | * å 餿µç¨å®ä¾ |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param deleteReason å é¤åå |
| | | * @return |
| | | */ |
| | | boolean deleteProcessInstance(String processInstanceId, String deleteReason); |
| | | |
| | | |
| | | /** |
| | | * ä¿å/æ´æ°æ¨¡å |
| | | * |
| | | * @param model 模å |
| | | * @return 模å |
| | | */ |
| | | FlowModel submitModel(FlowModel model); |
| | | |
| | | /** |
| | | * æµç¨èç¹è¿ç¨å¾ |
| | | * |
| | | * @param processDefinitionId |
| | | * @param processInstanceId |
| | | * @return |
| | | */ |
| | | Map<String, Object> modelView(String processDefinitionId, String processInstanceId); |
| | | |
| | | /** |
| | | * æµç¨èç¹è¿ç¨å¾ |
| | | * |
| | | * @param processInstanceId |
| | | * @param httpServletResponse |
| | | */ |
| | | void diagramView(String processInstanceId, HttpServletResponse httpServletResponse); |
| | | |
| | | /** |
| | | * æµç¨å¾å±ç¤º |
| | | * |
| | | * @param processDefinitionId |
| | | * @param processInstanceId |
| | | * @param resourceType |
| | | * @param response |
| | | */ |
| | | void resourceView(String processDefinitionId, String processInstanceId, String resourceType, HttpServletResponse response); |
| | | |
| | | /** |
| | | * è·åXML |
| | | * |
| | | * @param model |
| | | * @return |
| | | */ |
| | | byte[] getModelEditorXML(FlowModel model); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.node.ObjectNode; |
| | | import com.vci.ubcs.flow.core.entity.BladeFlow; |
| | | import com.vci.ubcs.flow.core.enums.FlowModeEnum; |
| | | import com.vci.ubcs.flow.core.utils.TaskUtil; |
| | | import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; |
| | | import com.vci.ubcs.flow.engine.entity.FlowExecution; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import com.vci.ubcs.flow.engine.mapper.FlowMapper; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import com.vci.ubcs.flow.engine.utils.FlowCache; |
| | | import com.vci.ubcs.system.user.cache.UserCache; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.bpmn.converter.BpmnXMLConverter; |
| | | import org.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.Process; |
| | | import org.flowable.common.engine.impl.util.IoUtil; |
| | | import org.flowable.common.engine.impl.util.io.StringStreamSource; |
| | | import org.flowable.editor.language.json.converter.BpmnJsonConverter; |
| | | import org.flowable.engine.*; |
| | | import org.flowable.engine.history.HistoricActivityInstance; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl; |
| | | import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntityImpl; |
| | | import org.flowable.engine.repository.Deployment; |
| | | import org.flowable.engine.repository.ProcessDefinition; |
| | | import org.flowable.engine.repository.ProcessDefinitionQuery; |
| | | import org.flowable.engine.runtime.ProcessInstance; |
| | | import org.flowable.engine.runtime.ProcessInstanceQuery; |
| | | import org.flowable.engine.task.Comment; |
| | | import org.flowable.image.ProcessDiagramGenerator; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.FileUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 工使µæå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class FlowEngineServiceImpl extends ServiceImpl<FlowMapper, FlowModel> implements FlowEngineService { |
| | | private static final String ALREADY_IN_STATE = "already in state"; |
| | | private static final String USR_TASK = "userTask"; |
| | | private static final String IMAGE_NAME = "image"; |
| | | private static final String XML_NAME = "xml"; |
| | | private static final Integer INT_1024 = 1024; |
| | | private static final BpmnJsonConverter BPMN_JSON_CONVERTER = new BpmnJsonConverter(); |
| | | private static final BpmnXMLConverter BPMN_XML_CONVERTER = new BpmnXMLConverter(); |
| | | private final ObjectMapper objectMapper; |
| | | private final RepositoryService repositoryService; |
| | | private final RuntimeService runtimeService; |
| | | private final HistoryService historyService; |
| | | private final TaskService taskService; |
| | | private final ProcessEngine processEngine; |
| | | |
| | | @Override |
| | | public IPage<FlowModel> selectFlowPage(IPage<FlowModel> page, FlowModel flowModel) { |
| | | return page.setRecords(baseMapper.selectFlowPage(page, flowModel)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<FlowProcess> selectProcessPage(IPage<FlowProcess> page, String category, Integer mode) { |
| | | ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery().latestVersion().orderByProcessDefinitionKey().asc(); |
| | | // éç¨æµç¨ |
| | | if (mode == FlowModeEnum.COMMON.getMode()) { |
| | | processDefinitionQuery.processDefinitionWithoutTenantId(); |
| | | } |
| | | // å®å¶æµç¨ |
| | | else if (!AuthUtil.isAdministrator()) { |
| | | processDefinitionQuery.processDefinitionTenantId(AuthUtil.getTenantId()); |
| | | } |
| | | if (StringUtils.isNotEmpty(category)) { |
| | | processDefinitionQuery.processDefinitionCategory(category); |
| | | } |
| | | List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize())); |
| | | List<FlowProcess> flowProcessList = new ArrayList<>(); |
| | | processDefinitionList.forEach(processDefinition -> { |
| | | String deploymentId = processDefinition.getDeploymentId(); |
| | | Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult(); |
| | | FlowProcess flowProcess = new FlowProcess((ProcessDefinitionEntityImpl) processDefinition); |
| | | flowProcess.setDeploymentTime(deployment.getDeploymentTime()); |
| | | flowProcessList.add(flowProcess); |
| | | }); |
| | | page.setTotal(processDefinitionQuery.count()); |
| | | page.setRecords(flowProcessList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<FlowExecution> selectFollowPage(IPage<FlowExecution> page, String processInstanceId, String processDefinitionKey) { |
| | | ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery(); |
| | | if (StringUtil.isNotBlank(processInstanceId)) { |
| | | processInstanceQuery.processInstanceId(processInstanceId); |
| | | } |
| | | if (StringUtil.isNotBlank(processDefinitionKey)) { |
| | | processInstanceQuery.processDefinitionKey(processDefinitionKey); |
| | | } |
| | | List<FlowExecution> flowList = new ArrayList<>(); |
| | | List<ProcessInstance> procInsList = processInstanceQuery.listPage(Func.toInt((page.getCurrent() - 1) * page.getSize()), Func.toInt(page.getSize())); |
| | | procInsList.forEach(processInstance -> { |
| | | ExecutionEntityImpl execution = (ExecutionEntityImpl) processInstance; |
| | | FlowExecution flowExecution = new FlowExecution(); |
| | | flowExecution.setId(execution.getId()); |
| | | flowExecution.setName(execution.getName()); |
| | | flowExecution.setStartUserId(execution.getStartUserId()); |
| | | User taskUser = UserCache.getUserByTaskUser(execution.getStartUserId()); |
| | | if (taskUser != null) { |
| | | flowExecution.setStartUser(taskUser.getName()); |
| | | } |
| | | flowExecution.setStartTime(execution.getStartTime()); |
| | | flowExecution.setExecutionId(execution.getId()); |
| | | flowExecution.setProcessInstanceId(execution.getProcessInstanceId()); |
| | | flowExecution.setProcessDefinitionId(execution.getProcessDefinitionId()); |
| | | flowExecution.setProcessDefinitionKey(execution.getProcessDefinitionKey()); |
| | | flowExecution.setSuspensionState(execution.getSuspensionState()); |
| | | FlowProcess processDefinition = FlowCache.getProcessDefinition(execution.getProcessDefinitionId()); |
| | | flowExecution.setCategory(processDefinition.getCategory()); |
| | | flowExecution.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); |
| | | flowList.add(flowExecution); |
| | | }); |
| | | page.setTotal(processInstanceQuery.count()); |
| | | page.setRecords(flowList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public List<BladeFlow> historyFlowList(String processInstanceId, String startActivityId, String endActivityId) { |
| | | List<BladeFlow> flowList = new LinkedList<>(); |
| | | List<HistoricActivityInstance> historicActivityInstanceList = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).orderByHistoricActivityInstanceStartTime().asc().orderByHistoricActivityInstanceEndTime().asc().list(); |
| | | boolean start = false; |
| | | Map<String, Integer> activityMap = new HashMap<>(16); |
| | | for (int i = 0; i < historicActivityInstanceList.size(); i++) { |
| | | HistoricActivityInstance historicActivityInstance = historicActivityInstanceList.get(i); |
| | | // è¿æ»¤å¼å§èç¹åçèç¹ |
| | | if (StringUtil.isNotBlank(startActivityId) && startActivityId.equals(historicActivityInstance.getActivityId())) { |
| | | start = true; |
| | | } |
| | | if (StringUtil.isNotBlank(startActivityId) && !start) { |
| | | continue; |
| | | } |
| | | // æ¾ç¤ºå¼å§èç¹åç»æèç¹ï¼å¹¶ä¸æ§è¡äººä¸ä¸ºç©ºçä»»å¡ |
| | | if (StringUtils.equals(USR_TASK, historicActivityInstance.getActivityType()) |
| | | || FlowEngineConstant.START_EVENT.equals(historicActivityInstance.getActivityType()) |
| | | || FlowEngineConstant.END_EVENT.equals(historicActivityInstance.getActivityType())) { |
| | | // ç»èç¹å¢å åºå· |
| | | Integer activityNum = activityMap.get(historicActivityInstance.getActivityId()); |
| | | if (activityNum == null) { |
| | | activityMap.put(historicActivityInstance.getActivityId(), activityMap.size()); |
| | | } |
| | | BladeFlow flow = new BladeFlow(); |
| | | flow.setHistoryActivityId(historicActivityInstance.getActivityId()); |
| | | flow.setHistoryActivityName(historicActivityInstance.getActivityName()); |
| | | flow.setCreateTime(historicActivityInstance.getStartTime()); |
| | | flow.setEndTime(historicActivityInstance.getEndTime()); |
| | | String durationTime = DateUtil.secondToTime(Func.toLong(historicActivityInstance.getDurationInMillis(), 0L) / 1000); |
| | | flow.setHistoryActivityDurationTime(durationTime); |
| | | // è·åæµç¨å起人åç§° |
| | | if (FlowEngineConstant.START_EVENT.equals(historicActivityInstance.getActivityType())) { |
| | | List<HistoricProcessInstance> processInstanceList = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).orderByProcessInstanceStartTime().asc().list(); |
| | | if (processInstanceList.size() > 0) { |
| | | if (StringUtil.isNotBlank(processInstanceList.get(0).getStartUserId())) { |
| | | String taskUser = processInstanceList.get(0).getStartUserId(); |
| | | User user = UserCache.getUser(TaskUtil.getUserId(taskUser)); |
| | | if (user != null) { |
| | | flow.setAssignee(historicActivityInstance.getAssignee()); |
| | | flow.setAssigneeName(user.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // è·å任塿§è¡äººåç§° |
| | | if (StringUtil.isNotBlank(historicActivityInstance.getAssignee())) { |
| | | User user = UserCache.getUser(TaskUtil.getUserId(historicActivityInstance.getAssignee())); |
| | | if (user != null) { |
| | | flow.setAssignee(historicActivityInstance.getAssignee()); |
| | | flow.setAssigneeName(user.getName()); |
| | | } |
| | | } |
| | | // è·åæè§è¯è®ºå
容 |
| | | if (StringUtil.isNotBlank(historicActivityInstance.getTaskId())) { |
| | | List<Comment> commentList = taskService.getTaskComments(historicActivityInstance.getTaskId()); |
| | | if (commentList.size() > 0) { |
| | | flow.setComment(commentList.get(0).getFullMessage()); |
| | | } |
| | | } |
| | | flowList.add(flow); |
| | | } |
| | | // è¿æ»¤ç»æèç¹åçèç¹ |
| | | if (StringUtils.isNotBlank(endActivityId) && endActivityId.equals(historicActivityInstance.getActivityId())) { |
| | | boolean temp = false; |
| | | Integer activityNum = activityMap.get(historicActivityInstance.getActivityId()); |
| | | // 该活å¨èç¹ï¼åç»èç¹æ¯å¦å¨ç»æèç¹ä¹åï¼å¨åç»èç¹ä¸æ¯å¦åå¨ |
| | | for (int j = i + 1; j < historicActivityInstanceList.size(); j++) { |
| | | HistoricActivityInstance hi = historicActivityInstanceList.get(j); |
| | | Integer activityNumA = activityMap.get(hi.getActivityId()); |
| | | boolean numberTemp = activityNumA != null && activityNumA < activityNum; |
| | | boolean equalsTemp = StringUtils.equals(hi.getActivityId(), historicActivityInstance.getActivityId()); |
| | | if (numberTemp || equalsTemp) { |
| | | temp = true; |
| | | } |
| | | } |
| | | if (!temp) { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return flowList; |
| | | } |
| | | |
| | | @Override |
| | | public String changeState(String state, String processId) { |
| | | try { |
| | | if (state.equals(FlowEngineConstant.ACTIVE)) { |
| | | repositoryService.activateProcessDefinitionById(processId, true, null); |
| | | return StringUtil.format("æ¿æ´»ID为 [{}] çæµç¨æå", processId); |
| | | } else if (state.equals(FlowEngineConstant.SUSPEND)) { |
| | | repositoryService.suspendProcessDefinitionById(processId, true, null); |
| | | return StringUtil.format("æèµ·ID为 [{}] çæµç¨æå", processId); |
| | | } else { |
| | | return "ææ æµç¨åæ´"; |
| | | } |
| | | } catch (Exception e) { |
| | | if (e.getMessage().contains(ALREADY_IN_STATE)) { |
| | | return StringUtil.format("ID为 [{}] çæµç¨å·²æ¯æ¤ç¶æï¼æ éæä½", processId); |
| | | } |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteDeployment(String deploymentIds) { |
| | | Func.toStrList(deploymentIds).forEach(deploymentId -> repositoryService.deleteDeployment(deploymentId, true)); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean deployUpload(List<MultipartFile> files, String category, List<String> tenantIdList) { |
| | | files.forEach(file -> { |
| | | try { |
| | | String fileName = file.getOriginalFilename(); |
| | | InputStream fileInputStream = file.getInputStream(); |
| | | byte[] bytes = FileUtil.copyToByteArray(fileInputStream); |
| | | if (Func.isNotEmpty(tenantIdList)) { |
| | | tenantIdList.forEach(tenantId -> { |
| | | Deployment deployment = repositoryService.createDeployment().addBytes(fileName, bytes).tenantId(tenantId).deploy(); |
| | | deploy(deployment, category); |
| | | }); |
| | | } else { |
| | | Deployment deployment = repositoryService.createDeployment().addBytes(fileName, bytes).deploy(); |
| | | deploy(deployment, category); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean deployModel(String modelId, String category, List<String> tenantIdList) { |
| | | FlowModel model = this.getById(modelId); |
| | | if (model == null) { |
| | | throw new ServiceException("æªæ¾å°æ¨¡å id: " + modelId); |
| | | } |
| | | byte[] bytes = getBpmnXML(model); |
| | | String processName = model.getName(); |
| | | if (!StringUtil.endsWithIgnoreCase(processName, FlowEngineConstant.SUFFIX)) { |
| | | processName += FlowEngineConstant.SUFFIX; |
| | | } |
| | | String finalProcessName = processName; |
| | | if (Func.isNotEmpty(tenantIdList)) { |
| | | tenantIdList.forEach(tenantId -> { |
| | | Deployment deployment = repositoryService.createDeployment().addBytes(finalProcessName, bytes).name(model.getName()).key(model.getModelKey()).tenantId(tenantId).deploy(); |
| | | deploy(deployment, category); |
| | | }); |
| | | } else { |
| | | Deployment deployment = repositoryService.createDeployment().addBytes(finalProcessName, bytes).name(model.getName()).key(model.getModelKey()).deploy(); |
| | | deploy(deployment, category); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteProcessInstance(String processInstanceId, String deleteReason) { |
| | | runtimeService.deleteProcessInstance(processInstanceId, deleteReason); |
| | | return true; |
| | | } |
| | | |
| | | private void deploy(Deployment deployment, String category) { |
| | | log.debug("æµç¨é¨ç½²--------deploy: " + deployment + " åç±»---------->" + category); |
| | | List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).list(); |
| | | StringBuilder logBuilder = new StringBuilder(500); |
| | | List<Object> logArgs = new ArrayList<>(); |
| | | // 设置æµç¨åç±» |
| | | for (ProcessDefinition processDefinition : list) { |
| | | if (StringUtil.isNotBlank(category)) { |
| | | repositoryService.setProcessDefinitionCategory(processDefinition.getId(), category); |
| | | } |
| | | logBuilder.append("é¨ç½²æå,æµç¨ID={} \n"); |
| | | logArgs.add(processDefinition.getId()); |
| | | } |
| | | if (list.size() == 0) { |
| | | throw new ServiceException("é¨ç½²å¤±è´¥,æªæ¾å°æµç¨"); |
| | | } else { |
| | | log.info(logBuilder.toString(), logArgs.toArray()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public FlowModel submitModel(FlowModel model) { |
| | | FlowModel flowModel = new FlowModel(); |
| | | flowModel.setId(model.getId()); |
| | | flowModel.setVersion(Func.toInt(model.getVersion(), 0) + 1); |
| | | flowModel.setName(model.getName()); |
| | | flowModel.setModelKey(model.getModelKey()); |
| | | flowModel.setModelType(FlowModel.MODEL_TYPE_BPMN); |
| | | flowModel.setCreatedBy(TaskUtil.getTaskUser()); |
| | | flowModel.setDescription(model.getDescription()); |
| | | flowModel.setLastUpdated(Calendar.getInstance().getTime()); |
| | | flowModel.setLastUpdatedBy(TaskUtil.getTaskUser()); |
| | | flowModel.setTenantId(AuthUtil.getTenantId()); |
| | | flowModel.setModelEditorXml(model.getModelEditorXml()); |
| | | if (StringUtil.isBlank(model.getId())) { |
| | | flowModel.setCreated(Calendar.getInstance().getTime()); |
| | | } |
| | | if (StringUtil.isNotBlank(model.getModelEditorXml())) { |
| | | flowModel.setModelEditorJson(getBpmnJson(model.getModelEditorXml())); |
| | | } |
| | | this.saveOrUpdate(flowModel); |
| | | return flowModel; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> modelView(String processDefinitionId, String processInstanceId) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | // èç¹æ è®° |
| | | if (StringUtil.isNotBlank(processInstanceId)) { |
| | | result.put("flow", this.historyFlowList(processInstanceId, null, null)); |
| | | HistoricProcessInstance processInstance = historyService.createHistoricProcessInstanceQuery() |
| | | .processInstanceId(processInstanceId) |
| | | .singleResult(); |
| | | processDefinitionId = processInstance.getProcessDefinitionId(); |
| | | } |
| | | BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); |
| | | // æµç¨å¾å±ç¤º |
| | | result.put("xml", new String(new BpmnXMLConverter().convertToXML(bpmnModel))); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public void diagramView(String processInstanceId, HttpServletResponse httpServletResponse) { |
| | | // è·å¾å½åæ´»å¨çèç¹ |
| | | String processDefinitionId; |
| | | // 妿æµç¨å·²ç»ç»æï¼åå¾å°ç»æèç¹ |
| | | if (this.isFinished(processInstanceId)) { |
| | | HistoricProcessInstance pi = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); |
| | | processDefinitionId = pi.getProcessDefinitionId(); |
| | | } else { |
| | | // 妿æµç¨æ²¡æç»æï¼ååå½åæ´»å¨èç¹ |
| | | // æ ¹æ®æµç¨å®ä¾IDè·å¾å½åå¤äºæ´»å¨ç¶æçActivityIdåé |
| | | ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); |
| | | processDefinitionId = pi.getProcessDefinitionId(); |
| | | } |
| | | List<String> highLightedActivities = new ArrayList<>(); |
| | | |
| | | // è·å¾æ´»å¨çèç¹ |
| | | List<HistoricActivityInstance> highLightedActivityList = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).orderByHistoricActivityInstanceStartTime().asc().list(); |
| | | |
| | | for (HistoricActivityInstance tempActivity : highLightedActivityList) { |
| | | String activityId = tempActivity.getActivityId(); |
| | | highLightedActivities.add(activityId); |
| | | } |
| | | |
| | | List<String> flows = new ArrayList<>(); |
| | | // è·åæµç¨å¾ |
| | | BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); |
| | | ProcessEngineConfiguration engConf = processEngine.getProcessEngineConfiguration(); |
| | | |
| | | ProcessDiagramGenerator diagramGenerator = engConf.getProcessDiagramGenerator(); |
| | | InputStream in = diagramGenerator.generateDiagram(bpmnModel, "bmp", highLightedActivities, flows, engConf.getActivityFontName(), |
| | | engConf.getLabelFontName(), engConf.getAnnotationFontName(), engConf.getClassLoader(), 1.0, true); |
| | | OutputStream out = null; |
| | | byte[] buf = new byte[1024]; |
| | | int length; |
| | | try { |
| | | out = httpServletResponse.getOutputStream(); |
| | | while ((length = in.read(buf)) != -1) { |
| | | out.write(buf, 0, length); |
| | | } |
| | | } catch (IOException e) { |
| | | log.error("æä½å¼å¸¸", e); |
| | | } finally { |
| | | IoUtil.closeSilently(out); |
| | | IoUtil.closeSilently(in); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void resourceView(String processDefinitionId, String processInstanceId, String resourceType, HttpServletResponse response) { |
| | | if (StringUtil.isAllBlank(processDefinitionId, processInstanceId)) { |
| | | return; |
| | | } |
| | | if (StringUtil.isBlank(processDefinitionId)) { |
| | | ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); |
| | | processDefinitionId = processInstance.getProcessDefinitionId(); |
| | | } |
| | | ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); |
| | | String resourceName = ""; |
| | | if (resourceType.equals(IMAGE_NAME)) { |
| | | resourceName = processDefinition.getDiagramResourceName(); |
| | | } else if (resourceType.equals(XML_NAME)) { |
| | | resourceName = processDefinition.getResourceName(); |
| | | } |
| | | try { |
| | | InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName); |
| | | byte[] b = new byte[1024]; |
| | | int len; |
| | | while ((len = resourceAsStream.read(b, 0, INT_1024)) != -1) { |
| | | response.getOutputStream().write(b, 0, len); |
| | | } |
| | | } catch (Exception exception) { |
| | | exception.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public byte[] getModelEditorXML(FlowModel model) { |
| | | return getBpmnXML(model); |
| | | } |
| | | |
| | | /** |
| | | * æ¯å¦å·²å®ç» |
| | | * |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @return bool |
| | | */ |
| | | private boolean isFinished(String processInstanceId) { |
| | | return historyService.createHistoricProcessInstanceQuery().finished() |
| | | .processInstanceId(processInstanceId).count() > 0; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * xml转bpmn json |
| | | * |
| | | * @param xml xml |
| | | * @return json |
| | | */ |
| | | private String getBpmnJson(String xml) { |
| | | return BPMN_JSON_CONVERTER.convertToJson(getBpmnModel(xml)).toString(); |
| | | } |
| | | |
| | | /** |
| | | * xml转bpmnModel |
| | | * |
| | | * @param xml xml |
| | | * @return bpmnModel |
| | | */ |
| | | private BpmnModel getBpmnModel(String xml) { |
| | | return BPMN_XML_CONVERTER.convertToBpmnModel(new StringStreamSource(xml), false, false); |
| | | } |
| | | |
| | | private byte[] getBpmnXML(FlowModel model) { |
| | | BpmnModel bpmnModel = getBpmnModel(model); |
| | | return getBpmnXML(bpmnModel); |
| | | } |
| | | |
| | | private byte[] getBpmnXML(BpmnModel bpmnModel) { |
| | | for (Process process : bpmnModel.getProcesses()) { |
| | | if (StringUtils.isNotEmpty(process.getId())) { |
| | | char firstCharacter = process.getId().charAt(0); |
| | | if (Character.isDigit(firstCharacter)) { |
| | | process.setId("a" + process.getId()); |
| | | } |
| | | } |
| | | } |
| | | return BPMN_XML_CONVERTER.convertToXML(bpmnModel); |
| | | } |
| | | |
| | | private BpmnModel getBpmnModel(FlowModel model) { |
| | | BpmnModel bpmnModel; |
| | | try { |
| | | Map<String, FlowModel> formMap = new HashMap<>(16); |
| | | Map<String, FlowModel> decisionTableMap = new HashMap<>(16); |
| | | |
| | | List<FlowModel> referencedModels = baseMapper.findByParentModelId(model.getId()); |
| | | for (FlowModel childModel : referencedModels) { |
| | | if (FlowModel.MODEL_TYPE_FORM == childModel.getModelType()) { |
| | | formMap.put(childModel.getId(), childModel); |
| | | |
| | | } else if (FlowModel.MODEL_TYPE_DECISION_TABLE == childModel.getModelType()) { |
| | | decisionTableMap.put(childModel.getId(), childModel); |
| | | } |
| | | } |
| | | bpmnModel = getBpmnModel(model, formMap, decisionTableMap); |
| | | } catch (Exception e) { |
| | | log.error("Could not generate BPMN 2.0 model for {}", model.getId(), e); |
| | | throw new ServiceException("Could not generate BPMN 2.0 model"); |
| | | } |
| | | return bpmnModel; |
| | | } |
| | | |
| | | private BpmnModel getBpmnModel(FlowModel model, Map<String, FlowModel> formMap, Map<String, FlowModel> decisionTableMap) { |
| | | try { |
| | | ObjectNode editorJsonNode = (ObjectNode) objectMapper.readTree(model.getModelEditorJson()); |
| | | Map<String, String> formKeyMap = new HashMap<>(16); |
| | | for (FlowModel formModel : formMap.values()) { |
| | | formKeyMap.put(formModel.getId(), formModel.getModelKey()); |
| | | } |
| | | Map<String, String> decisionTableKeyMap = new HashMap<>(16); |
| | | for (FlowModel decisionTableModel : decisionTableMap.values()) { |
| | | decisionTableKeyMap.put(decisionTableModel.getId(), decisionTableModel.getModelKey()); |
| | | } |
| | | return BPMN_JSON_CONVERTER.convertToBpmnModel(editorJsonNode, formKeyMap, decisionTableKeyMap); |
| | | } catch (Exception e) { |
| | | log.error("Could not generate BPMN 2.0 model for {}", model.getId(), e); |
| | | throw new ServiceException("Could not generate BPMN 2.0 model"); |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.flow.engine.utils; |
| | | |
| | | import com.vci.ubcs.flow.engine.entity.FlowProcess; |
| | | import org.flowable.engine.RepositoryService; |
| | | import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntityImpl; |
| | | import org.flowable.engine.repository.ProcessDefinition; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.FLOW_CACHE; |
| | | |
| | | /** |
| | | * æµç¨ç¼å |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class FlowCache { |
| | | |
| | | private static final String FLOW_DEFINITION_ID = "definition:id:"; |
| | | private static RepositoryService repositoryService; |
| | | |
| | | private static RepositoryService getRepositoryService() { |
| | | if (repositoryService == null) { |
| | | repositoryService = SpringUtil.getBean(RepositoryService.class); |
| | | } |
| | | return repositoryService; |
| | | } |
| | | |
| | | /** |
| | | * è·å¾æµç¨å®ä¹å¯¹è±¡ |
| | | * |
| | | * @param processDefinitionId æµç¨å¯¹è±¡id |
| | | * @return |
| | | */ |
| | | public static FlowProcess getProcessDefinition(String processDefinitionId) { |
| | | return CacheUtil.get(FLOW_CACHE, FLOW_DEFINITION_ID, processDefinitionId, () -> { |
| | | ProcessDefinition processDefinition = getRepositoryService().createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult(); |
| | | ProcessDefinitionEntityImpl processDefinitionEntity = BeanUtil.copy(processDefinition, ProcessDefinitionEntityImpl.class); |
| | | return new FlowProcess(processDefinitionEntity); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * è·åæµç¨ç±»åå |
| | | * |
| | | * @param category æµç¨ç±»å |
| | | * @return |
| | | */ |
| | | public static String getCategoryName(String category) { |
| | | String[] categoryArr = category.split(StringPool.UNDERSCORE); |
| | | if (categoryArr.length <= 1) { |
| | | return StringPool.EMPTY; |
| | | } else { |
| | | return DictCache.getValue(category.split(StringPool.UNDERSCORE)[0], Func.toInt(category.split(StringPool.UNDERSCORE)[1])); |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.flow.engine.mapper.FlowMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="flowModelResultMap" type="com.vci.ubcs.flow.engine.entity.FlowModel"> |
| | | <result column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="model_key" property="modelKey"/> |
| | | <result column="description" property="description"/> |
| | | <result column="model_comment" property="modelComment"/> |
| | | <result column="created" property="created"/> |
| | | <result column="created_by" property="createdBy"/> |
| | | <result column="last_updated" property="lastUpdated"/> |
| | | <result column="last_updated_by" property="lastUpdatedBy"/> |
| | | <result column="version" property="version"/> |
| | | <result column="model_editor_json" property="modelEditorJson"/> |
| | | <result column="thumbnail" property="thumbnail"/> |
| | | <result column="model_type" property="modelType"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectFlowPage" resultMap="flowModelResultMap"> |
| | | SELECT |
| | | a.id, |
| | | a.name, |
| | | a.model_key, |
| | | a.description, |
| | | a.model_comment, |
| | | a.created, |
| | | a.created_by, |
| | | a.last_updated, |
| | | a.last_updated_by, |
| | | a.version, |
| | | a.model_editor_json, |
| | | a.thumbnail, |
| | | a.model_type, |
| | | a.tenant_id |
| | | FROM |
| | | ACT_DE_MODEL a |
| | | WHERE |
| | | 1 = 1 |
| | | ORDER BY |
| | | a.created DESC |
| | | </select> |
| | | |
| | | <select id="findByParentModelId" parameterType="string" resultMap="flowModelResultMap"> |
| | | select model.* from ACT_DE_MODEL_RELATION modelrelation |
| | | inner join ACT_DE_MODEL model on modelrelation.model_id = model.id |
| | | where modelrelation.parent_model_id = #{_parameter} |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.flow.test; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.junit.jupiter.api.extension.ExtendWith; |
| | | import org.springblade.core.test.BladeBootTest; |
| | | import org.springblade.core.test.BladeSpringExtension; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import com.vci.ubcs.flow.engine.entity.FlowModel; |
| | | import com.vci.ubcs.flow.engine.service.FlowEngineService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Bladeåå
æµè¯ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @ExtendWith(BladeSpringExtension.class) |
| | | @BladeBootTest(appName = "blade-flow", enableLoader = true) |
| | | public class BladeTest { |
| | | |
| | | @Autowired |
| | | private FlowEngineService service; |
| | | |
| | | @Test |
| | | public void contextLoads() { |
| | | System.out.println("=====æ°æ®è¿ç§»å¯å¨====="); |
| | | |
| | | // è·å ACT_DE_MODEL 表éè¦è½¬æ¢çæ°æ® |
| | | List<FlowModel> list = service.list(); |
| | | // 循ç¯è½¬æ¢ |
| | | list.forEach(flowModel -> { |
| | | if (StringUtil.isBlank(flowModel.getModelEditorXml())) { |
| | | service.update(Wrappers.<FlowModel>lambdaUpdate() |
| | | .set(FlowModel::getModelEditorXml, new String(service.getModelEditorXML(flowModel))) |
| | | .ge(FlowModel::getId, flowModel.getId()) |
| | | ); |
| | | } |
| | | }); |
| | | |
| | | System.out.println("=====æ°æ®è¿ç§»å®æ¯====="); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.flow.test.launch; |
| | | |
| | | import com.vci.ubcs.common.constant.LauncherConstant; |
| | | import org.springblade.core.auto.service.AutoService; |
| | | import org.springblade.core.launch.service.LauncherService; |
| | | import org.springblade.core.launch.utils.PropsUtil; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * å¯å¨åæ°æå± |
| | | * |
| | | * @author smallchil |
| | | */ |
| | | @AutoService(LauncherService.class) |
| | | public class LauncherTestServiceImpl implements LauncherService { |
| | | |
| | | @Override |
| | | public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { |
| | | Properties props = System.getProperties(); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); |
| | | PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "false"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>blade-log</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-tenant</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log; |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * æ¥å¿æå¡ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class LogApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_LOG_NAME, LogApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.core.log.model.LogApi; |
| | | import com.vci.ubcs.core.log.service.ILogApiService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/api") |
| | | public class LogApiController { |
| | | |
| | | private final ILogApiService logService; |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡ |
| | | */ |
| | | @GetMapping("/detail") |
| | | public R<LogApi> detail(LogApi log) { |
| | | return R.data(logService.getOne(Condition.getQueryWrapper(log))); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æ¡(å页) |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<IPage<LogApi>> list(@ApiIgnore @RequestParam Map<String, Object> log, Query query) { |
| | | IPage<LogApi> pages = logService.page(Condition.getPage(query.setDescs("create_time")), Condition.getQueryWrapper(log, LogApi.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.core.log.model.LogError; |
| | | import com.vci.ubcs.core.log.service.ILogErrorService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/error") |
| | | public class LogErrorController { |
| | | |
| | | private final ILogErrorService errorLogService; |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡ |
| | | */ |
| | | @GetMapping("/detail") |
| | | public R<LogError> detail(LogError logError) { |
| | | return R.data(errorLogService.getOne(Condition.getQueryWrapper(logError))); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æ¡(å页) |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<IPage<LogError>> list(@ApiIgnore @RequestParam Map<String, Object> logError, Query query) { |
| | | IPage<LogError> pages = errorLogService.page(Condition.getPage(query.setDescs("create_time")), Condition.getQueryWrapper(logError, LogError.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.core.log.model.LogUsual; |
| | | import com.vci.ubcs.core.log.service.ILogUsualService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/usual") |
| | | public class LogUsualController { |
| | | |
| | | private final ILogUsualService logService; |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡ |
| | | */ |
| | | @GetMapping("/detail") |
| | | public R<LogUsual> detail(LogUsual log) { |
| | | return R.data(logService.getOne(Condition.getQueryWrapper(log))); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æ¡(å页) |
| | | */ |
| | | @GetMapping("/list") |
| | | public R<IPage<LogUsual>> list(@ApiIgnore @RequestParam Map<String, Object> log, Query query) { |
| | | IPage<LogUsual> pages = logService.page(Condition.getPage(query), Condition.getQueryWrapper(log, LogUsual.class)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.feign; |
| | | |
| | | import com.vci.ubcs.core.log.model.LogApi; |
| | | import com.vci.ubcs.core.log.model.LogError; |
| | | import com.vci.ubcs.core.log.model.LogUsual; |
| | | import com.vci.ubcs.core.log.service.ILogApiService; |
| | | import com.vci.ubcs.core.log.service.ILogErrorService; |
| | | import com.vci.ubcs.core.log.service.ILogUsualService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * æ¥å¿æå¡Feignå®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class LogClient implements ILogClient { |
| | | |
| | | private final ILogUsualService usualLogService; |
| | | |
| | | private final ILogApiService apiLogService; |
| | | |
| | | private final ILogErrorService errorLogService; |
| | | |
| | | @Override |
| | | @PostMapping(API_PREFIX + "/saveUsualLog") |
| | | public R<Boolean> saveUsualLog(@RequestBody LogUsual log) { |
| | | log.setParams(log.getParams().replace("&", "&")); |
| | | return R.data(usualLogService.save(log)); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(API_PREFIX + "/saveApiLog") |
| | | public R<Boolean> saveApiLog(@RequestBody LogApi log) { |
| | | log.setParams(log.getParams().replace("&", "&")); |
| | | return R.data(apiLogService.save(log)); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(API_PREFIX + "/saveErrorLog") |
| | | public R<Boolean> saveErrorLog(@RequestBody LogError log) { |
| | | log.setParams(log.getParams().replace("&", "&")); |
| | | return R.data(errorLogService.save(log)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.core.log.model.LogApi; |
| | | |
| | | /** |
| | | * Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface LogApiMapper extends BaseMapper<LogApi> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.core.log.model.LogError; |
| | | |
| | | /** |
| | | * Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface LogErrorMapper extends BaseMapper<LogError> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.core.log.model.LogUsual; |
| | | |
| | | /** |
| | | * Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface LogUsualMapper extends BaseMapper<LogUsual> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.core.log.model.LogApi; |
| | | |
| | | /** |
| | | * æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ILogApiService extends IService<LogApi> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.core.log.model.LogError; |
| | | |
| | | /** |
| | | * æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ILogErrorService extends IService<LogError> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.core.log.model.LogUsual; |
| | | |
| | | /** |
| | | * æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface ILogUsualService extends IService<LogUsual> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.core.log.mapper.LogApiMapper; |
| | | import com.vci.ubcs.core.log.model.LogApi; |
| | | import com.vci.ubcs.core.log.service.ILogApiService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class LogApiServiceImpl extends ServiceImpl<LogApiMapper, LogApi> implements ILogApiService { |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.core.log.mapper.LogErrorMapper; |
| | | import com.vci.ubcs.core.log.model.LogError; |
| | | import com.vci.ubcs.core.log.service.ILogErrorService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class LogErrorServiceImpl extends ServiceImpl<LogErrorMapper, LogError> implements ILogErrorService { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.core.log.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.core.log.mapper.LogUsualMapper; |
| | | import com.vci.ubcs.core.log.model.LogUsual; |
| | | import com.vci.ubcs.core.log.service.ILogUsualService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class LogUsualServiceImpl extends ServiceImpl<LogUsualMapper, LogUsual> implements ILogUsualService { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.core.log.mapper.LogApiMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="logResultMap" type="org.springblade.core.log.model.LogApi"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="service_id" property="serviceId"/> |
| | | <result column="server_host" property="serverHost"/> |
| | | <result column="server_ip" property="serverIp"/> |
| | | <result column="env" property="env"/> |
| | | <result column="type" property="type"/> |
| | | <result column="title" property="title"/> |
| | | <result column="method" property="method"/> |
| | | <result column="request_uri" property="requestUri"/> |
| | | <result column="user_agent" property="userAgent"/> |
| | | <result column="remote_ip" property="remoteIp"/> |
| | | <result column="method_class" property="methodClass"/> |
| | | <result column="method_name" property="methodName"/> |
| | | <result column="params" property="params"/> |
| | | <result column="time" property="time"/> |
| | | <result column="create_by" property="createBy"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.core.log.mapper.LogErrorMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="errorLogResultMap" type="org.springblade.core.log.model.LogError"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="service_id" property="serviceId"/> |
| | | <result column="server_host" property="serverHost"/> |
| | | <result column="server_ip" property="serverIp"/> |
| | | <result column="env" property="env"/> |
| | | <result column="method" property="method"/> |
| | | <result column="request_uri" property="requestUri"/> |
| | | <result column="user_agent" property="userAgent"/> |
| | | <result column="stack_trace" property="stackTrace"/> |
| | | <result column="exception_name" property="exceptionName"/> |
| | | <result column="message" property="message"/> |
| | | <result column="line_number" property="lineNumber"/> |
| | | <result column="method_class" property="methodClass"/> |
| | | <result column="file_name" property="fileName"/> |
| | | <result column="method_name" property="methodName"/> |
| | | <result column="params" property="params"/> |
| | | <result column="create_by" property="createBy"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.core.log.mapper.LogUsualMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="logResultMap" type="org.springblade.core.log.model.LogUsual"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="service_id" property="serviceId"/> |
| | | <result column="server_host" property="serverHost"/> |
| | | <result column="server_ip" property="serverIp"/> |
| | | <result column="env" property="env"/> |
| | | <result column="log_level" property="logLevel"/> |
| | | <result column="log_data" property="logData"/> |
| | | <result column="method" property="method"/> |
| | | <result column="request_uri" property="requestUri"/> |
| | | <result column="user_agent" property="userAgent"/> |
| | | <result column="params" property="params"/> |
| | | <result column="create_by" property="createBy"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-report</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-tenant</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-report</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.report; |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * UReportå¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class ReportApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_REPORT_NAME, ReportApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.report.config; |
| | | |
| | | import com.vci.ubcs.core.report.datasource.ReportDataSource; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * æ¥è¡¨é
置类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @ConditionalOnProperty(value = "report.enabled", havingValue = "true", matchIfMissing = true) |
| | | public class BladeReportConfiguration { |
| | | |
| | | /** |
| | | * èªå®ä¹æ¥è¡¨å¯éæ°æ®æº |
| | | */ |
| | | @Bean |
| | | public ReportDataSource reportDataSource(DataSource dataSource) { |
| | | return new ReportDataSource(dataSource); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | FROM bladex/alpine-java:openjdk8-openj9_cn_slim |
| | | |
| | | MAINTAINER bladejava@qq.com |
| | | |
| | | RUN mkdir -p /blade/Resource |
| | | |
| | | WORKDIR /blade/Resource |
| | | |
| | | EXPOSE 36007 |
| | | |
| | | ADD ./target/blade-Resource.jar ./app.jar |
| | | |
| | | ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"] |
| | | |
| | | CMD ["--spring.profiles.active=dev"] |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-resource</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-boot</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-swagger</artifactId> |
| | | </dependency> |
| | | <!--Oss--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-oss</artifactId> |
| | | </dependency> |
| | | <!--Sms--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-sms</artifactId> |
| | | </dependency> |
| | | <!--MinIO--> |
| | | <dependency> |
| | | <groupId>io.minio</groupId> |
| | | <artifactId>minio</artifactId> |
| | | </dependency> |
| | | <!--Alioss--> |
| | | <dependency> |
| | | <groupId>com.aliyun.oss</groupId> |
| | | <artifactId>aliyun-sdk-oss</artifactId> |
| | | </dependency> |
| | | <!--AliSms--> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>aliyun-java-sdk-core</artifactId> |
| | | </dependency> |
| | | <!--è
¾è®¯COS--> |
| | | <dependency> |
| | | <groupId>com.qcloud</groupId> |
| | | <artifactId>cos_api</artifactId> |
| | | </dependency> |
| | | <!--è
¾è®¯SMS--> |
| | | <dependency> |
| | | <groupId>com.github.qcloudsms</groupId> |
| | | <artifactId>qcloudsms</artifactId> |
| | | </dependency> |
| | | <!--QiNiu--> |
| | | <dependency> |
| | | <groupId>com.qiniu</groupId> |
| | | <artifactId>qiniu-java-sdk</artifactId> |
| | | </dependency> |
| | | <!--YunPian--> |
| | | <dependency> |
| | | <groupId>com.yunpian.sdk</groupId> |
| | | <artifactId>yunpian-java-sdk</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-resource-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-dict-api</artifactId> |
| | | <version>${bladex.project.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource; |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * èµæºå¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class ResourceApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_REPORT_NAME, ResourceApplication.class, args); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.oss; |
| | | |
| | | import com.aliyun.oss.ClientConfiguration; |
| | | import com.aliyun.oss.OSSClient; |
| | | import com.aliyun.oss.common.auth.CredentialsProvider; |
| | | import com.aliyun.oss.common.auth.DefaultCredentialProvider; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.AliossTemplate; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import org.springblade.core.oss.rule.OssRule; |
| | | |
| | | /** |
| | | * é¿éäºåå¨æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class AliOssBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static OssTemplate template(Oss oss, OssRule ossRule) { |
| | | // å建ClientConfigurationãClientConfigurationæ¯OSSClientçé
置类ï¼å¯é
置代çãè¿æ¥è¶
æ¶ãæå¤§è¿æ¥æ°çåæ°ã |
| | | ClientConfiguration conf = new ClientConfiguration(); |
| | | // 设置OSSClientå
许æå¼çæå¤§HTTPè¿æ¥æ°ï¼é»è®¤ä¸º1024个ã |
| | | conf.setMaxConnections(1024); |
| | | // 设置Socketå±ä¼ è¾æ°æ®çè¶
æ¶æ¶é´ï¼é»è®¤ä¸º50000毫ç§ã |
| | | conf.setSocketTimeout(50000); |
| | | // 设置建ç«è¿æ¥çè¶
æ¶æ¶é´ï¼é»è®¤ä¸º50000毫ç§ã |
| | | conf.setConnectionTimeout(50000); |
| | | // 设置ä»è¿æ¥æ± ä¸è·åè¿æ¥çè¶
æ¶æ¶é´ï¼åä½ï¼æ¯«ç§ï¼ï¼é»è®¤ä¸è¶
æ¶ã |
| | | conf.setConnectionRequestTimeout(1000); |
| | | // è®¾ç½®è¿æ¥ç©ºé²è¶
æ¶æ¶é´ãè¶
æ¶åå
³éè¿æ¥ï¼é»è®¤ä¸º60000毫ç§ã |
| | | conf.setIdleConnectionTime(60000); |
| | | // 设置失败请æ±éè¯æ¬¡æ°ï¼é»è®¤ä¸º3次ã |
| | | conf.setMaxErrorRetry(5); |
| | | OssProperties ossProperties = new OssProperties(); |
| | | ossProperties.setEndpoint(oss.getEndpoint()); |
| | | ossProperties.setAccessKey(oss.getAccessKey()); |
| | | ossProperties.setSecretKey(oss.getSecretKey()); |
| | | ossProperties.setBucketName(oss.getBucketName()); |
| | | CredentialsProvider credentialsProvider = new DefaultCredentialProvider(ossProperties.getAccessKey(), ossProperties.getSecretKey()); |
| | | OSSClient ossClient = new OSSClient(ossProperties.getEndpoint(), credentialsProvider, conf); |
| | | return new AliossTemplate(ossClient, ossProperties, ossRule); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.oss; |
| | | |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import io.minio.MinioClient; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.MinioTemplate; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import org.springblade.core.oss.rule.OssRule; |
| | | |
| | | /** |
| | | * Minioäºåå¨æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class MinioOssBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static OssTemplate template(Oss oss, OssRule ossRule) { |
| | | MinioClient minioClient = MinioClient.builder() |
| | | .endpoint(oss.getEndpoint()) |
| | | .credentials(oss.getAccessKey(), oss.getSecretKey()) |
| | | .build(); |
| | | OssProperties ossProperties = new OssProperties(); |
| | | ossProperties.setEndpoint(oss.getEndpoint()); |
| | | ossProperties.setAccessKey(oss.getAccessKey()); |
| | | ossProperties.setSecretKey(oss.getSecretKey()); |
| | | ossProperties.setBucketName(oss.getBucketName()); |
| | | return new MinioTemplate(minioClient, ossRule, ossProperties); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.oss; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import com.vci.ubcs.resource.service.IOssService; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.enums.OssEnum; |
| | | import org.springblade.core.oss.enums.OssStatusEnum; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import org.springblade.core.oss.rule.BladeOssRule; |
| | | import org.springblade.core.oss.rule.OssRule; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; |
| | | |
| | | /** |
| | | * Ossäºåå¨ç»ä¸æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class OssBuilder { |
| | | |
| | | public static final String OSS_CODE = "oss:code:"; |
| | | public static final String OSS_PARAM_KEY = "code"; |
| | | |
| | | private final OssProperties ossProperties; |
| | | private final IOssService ossService; |
| | | |
| | | public OssBuilder(OssProperties ossProperties, IOssService ossService) { |
| | | this.ossProperties = ossProperties; |
| | | this.ossService = ossService; |
| | | } |
| | | |
| | | /** |
| | | * OssTemplateé
ç½®ç¼åæ± |
| | | */ |
| | | private final Map<String, OssTemplate> templatePool = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * ossé
ç½®ç¼åæ± |
| | | */ |
| | | private final Map<String, Oss> ossPool = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * è·åtemplate |
| | | * |
| | | * @return OssTemplate |
| | | */ |
| | | public OssTemplate template() { |
| | | return template(StringPool.EMPTY); |
| | | } |
| | | |
| | | /** |
| | | * è·åtemplate |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @return OssTemplate |
| | | */ |
| | | public OssTemplate template(String code) { |
| | | String tenantId = AuthUtil.getTenantId(); |
| | | Oss oss = getOss(tenantId, code); |
| | | Oss ossCached = ossPool.get(tenantId); |
| | | OssTemplate template = templatePool.get(tenantId); |
| | | // è¥ä¸ºç©ºæè
ä¸ä¸è´ï¼åéæ°å è½½ |
| | | if (Func.hasEmpty(template, ossCached) || !oss.getEndpoint().equals(ossCached.getEndpoint()) || !oss.getAccessKey().equals(ossCached.getAccessKey())) { |
| | | synchronized (OssBuilder.class) { |
| | | template = templatePool.get(tenantId); |
| | | if (Func.hasEmpty(template, ossCached) || !oss.getEndpoint().equals(ossCached.getEndpoint()) || !oss.getAccessKey().equals(ossCached.getAccessKey())) { |
| | | OssRule ossRule; |
| | | // è¥éç¨é»è®¤è®¾ç½®åå¼å¯å¤ç§æ·æ¨¡å¼, è¥æ¯ç¨æ·èªå®ä¹ossåä¸å¼å¯ |
| | | if (oss.getEndpoint().equals(ossProperties.getEndpoint()) && oss.getAccessKey().equals(ossProperties.getAccessKey()) && ossProperties.getTenantMode()) { |
| | | ossRule = new BladeOssRule(Boolean.TRUE); |
| | | } else { |
| | | ossRule = new BladeOssRule(Boolean.FALSE); |
| | | } |
| | | if (oss.getCategory() == OssEnum.MINIO.getCategory()) { |
| | | template = MinioOssBuilder.template(oss, ossRule); |
| | | } else if (oss.getCategory() == OssEnum.QINIU.getCategory()) { |
| | | template = QiniuOssBuilder.template(oss, ossRule); |
| | | } else if (oss.getCategory() == OssEnum.ALI.getCategory()) { |
| | | template = AliOssBuilder.template(oss, ossRule); |
| | | } else if (oss.getCategory() == OssEnum.TENCENT.getCategory()) { |
| | | template = TencentOssBuilder.template(oss, ossRule); |
| | | } |
| | | templatePool.put(tenantId, template); |
| | | ossPool.put(tenantId, oss); |
| | | } |
| | | } |
| | | } |
| | | return template; |
| | | } |
| | | |
| | | /** |
| | | * è·å对象åå¨å®ä½ |
| | | * |
| | | * @param tenantId ç§æ·ID |
| | | * @return Oss |
| | | */ |
| | | public Oss getOss(String tenantId, String code) { |
| | | String key = tenantId; |
| | | LambdaQueryWrapper<Oss> lqw = Wrappers.<Oss>query().lambda().eq(Oss::getTenantId, tenantId); |
| | | // è·åä¼ åçèµæºç¼å·å¹¶æ¥è¯¢ï¼è¥æåè¿åï¼è¥æ²¡æåè°å¯ç¨çé
ç½® |
| | | String ossCode = StringUtil.isBlank(code) ? WebUtil.getParameter(OSS_PARAM_KEY) : code; |
| | | if (StringUtil.isNotBlank(ossCode)) { |
| | | key = key.concat(StringPool.DASH).concat(ossCode); |
| | | lqw.eq(Oss::getOssCode, ossCode); |
| | | } else { |
| | | lqw.eq(Oss::getStatus, OssStatusEnum.ENABLE.getNum()); |
| | | } |
| | | Oss oss = CacheUtil.get(RESOURCE_CACHE, OSS_CODE, key, () -> { |
| | | Oss o = ossService.getOne(lqw); |
| | | // è¥ä¸ºç©ºåè°ç¨é»è®¤é
ç½® |
| | | if ((Func.isEmpty(o))) { |
| | | Oss defaultOss = new Oss(); |
| | | defaultOss.setId(0L); |
| | | defaultOss.setCategory(OssEnum.of(ossProperties.getName()).getCategory()); |
| | | defaultOss.setEndpoint(ossProperties.getEndpoint()); |
| | | defaultOss.setBucketName(ossProperties.getBucketName()); |
| | | defaultOss.setAccessKey(ossProperties.getAccessKey()); |
| | | defaultOss.setSecretKey(ossProperties.getSecretKey()); |
| | | return defaultOss; |
| | | } else { |
| | | return o; |
| | | } |
| | | }); |
| | | if (oss == null || oss.getId() == null) { |
| | | throw new ServiceException("æªè·åå°å¯¹åºç对象åå¨é
ç½®"); |
| | | } else { |
| | | return oss; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.oss; |
| | | |
| | | import com.qiniu.storage.BucketManager; |
| | | import com.qiniu.storage.Configuration; |
| | | import com.qiniu.storage.Region; |
| | | import com.qiniu.storage.UploadManager; |
| | | import com.qiniu.util.Auth; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.QiniuTemplate; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import org.springblade.core.oss.rule.OssRule; |
| | | |
| | | /** |
| | | * ä¸çäºåå¨æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class QiniuOssBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static OssTemplate template(Oss oss, OssRule ossRule) { |
| | | Configuration cfg = new Configuration(Region.autoRegion()); |
| | | Auth auth = Auth.create(oss.getAccessKey(), oss.getSecretKey()); |
| | | UploadManager uploadManager = new UploadManager(cfg); |
| | | BucketManager bucketManager = new BucketManager(auth, cfg); |
| | | OssProperties ossProperties = new OssProperties(); |
| | | ossProperties.setEndpoint(oss.getEndpoint()); |
| | | ossProperties.setAccessKey(oss.getAccessKey()); |
| | | ossProperties.setSecretKey(oss.getSecretKey()); |
| | | ossProperties.setBucketName(oss.getBucketName()); |
| | | return new QiniuTemplate(auth, uploadManager, bucketManager, ossProperties, ossRule); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.oss; |
| | | |
| | | import com.qcloud.cos.COSClient; |
| | | import com.qcloud.cos.ClientConfig; |
| | | import com.qcloud.cos.auth.BasicCOSCredentials; |
| | | import com.qcloud.cos.auth.COSCredentials; |
| | | import com.qcloud.cos.region.Region; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import org.springblade.core.oss.rule.OssRule; |
| | | import org.springblade.core.oss.TencentCosTemplate; |
| | | |
| | | /** |
| | | * è
¾è®¯äºåå¨æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class TencentOssBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static OssTemplate template(Oss oss, OssRule ossRule) { |
| | | // å建é
置类 |
| | | OssProperties ossProperties = new OssProperties(); |
| | | ossProperties.setEndpoint(oss.getEndpoint()); |
| | | ossProperties.setAccessKey(oss.getAccessKey()); |
| | | ossProperties.setSecretKey(oss.getSecretKey()); |
| | | ossProperties.setBucketName(oss.getBucketName()); |
| | | ossProperties.setAppId(oss.getAppId()); |
| | | ossProperties.setRegion(oss.getRegion()); |
| | | // åå§åç¨æ·èº«ä»½ä¿¡æ¯ï¼secretId, secretKeyï¼ |
| | | COSCredentials credentials = new BasicCOSCredentials(ossProperties.getAccessKey(), ossProperties.getSecretKey()); |
| | | // 设置 bucket çåºå, COS å°åçç®ç§°è¯·åç
§ https://cloud.tencent.com/document/product/436/6224 |
| | | Region region = new Region(ossProperties.getRegion()); |
| | | // clientConfig ä¸å
å«äºè®¾ç½® region, https(é»è®¤ http), è¶
æ¶, 代çç set æ¹æ³, 使ç¨å¯åè§æºç æè
常è§é®é¢ Java SDK é¨åã |
| | | ClientConfig clientConfig = new ClientConfig(region); |
| | | // 设置OSSClientå
许æå¼çæå¤§HTTPè¿æ¥æ°ï¼é»è®¤ä¸º1024个ã |
| | | clientConfig.setMaxConnectionsCount(1024); |
| | | // 设置Socketå±ä¼ è¾æ°æ®çè¶
æ¶æ¶é´ï¼é»è®¤ä¸º50000毫ç§ã |
| | | clientConfig.setSocketTimeout(50000); |
| | | // 设置建ç«è¿æ¥çè¶
æ¶æ¶é´ï¼é»è®¤ä¸º50000毫ç§ã |
| | | clientConfig.setConnectionTimeout(50000); |
| | | // 设置ä»è¿æ¥æ± ä¸è·åè¿æ¥çè¶
æ¶æ¶é´ï¼åä½ï¼æ¯«ç§ï¼ï¼é»è®¤ä¸è¶
æ¶ã |
| | | clientConfig.setConnectionRequestTimeout(1000); |
| | | COSClient cosClient = new COSClient(credentials, clientConfig); |
| | | return new TencentCosTemplate(cosClient, ossProperties, ossRule); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.sms; |
| | | |
| | | import com.aliyuncs.DefaultAcsClient; |
| | | import com.aliyuncs.IAcsClient; |
| | | import com.aliyuncs.profile.DefaultProfile; |
| | | import com.aliyuncs.profile.IClientProfile; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.sms.SmsTemplate; |
| | | import org.springblade.core.sms.AliSmsTemplate; |
| | | import org.springblade.core.sms.props.SmsProperties; |
| | | |
| | | /** |
| | | * é¿éäºçä¿¡æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class AliSmsBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static SmsTemplate template(Sms sms, BladeRedis bladeRedis) { |
| | | SmsProperties smsProperties = new SmsProperties(); |
| | | smsProperties.setTemplateId(sms.getTemplateId()); |
| | | smsProperties.setAccessKey(sms.getAccessKey()); |
| | | smsProperties.setSecretKey(sms.getSecretKey()); |
| | | smsProperties.setRegionId(sms.getRegionId()); |
| | | smsProperties.setSignName(sms.getSignName()); |
| | | IClientProfile profile = DefaultProfile.getProfile(smsProperties.getRegionId(), smsProperties.getAccessKey(), smsProperties.getSecretKey()); |
| | | IAcsClient acsClient = new DefaultAcsClient(profile); |
| | | return new AliSmsTemplate(smsProperties, acsClient, bladeRedis); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.sms; |
| | | |
| | | import com.qiniu.sms.SmsManager; |
| | | import com.qiniu.util.Auth; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.sms.SmsTemplate; |
| | | import org.springblade.core.sms.props.SmsProperties; |
| | | import org.springblade.core.sms.QiniuSmsTemplate; |
| | | |
| | | /** |
| | | * ä¸çäºçä¿¡æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class QiniuSmsBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static SmsTemplate template(Sms sms, BladeRedis bladeRedis) { |
| | | SmsProperties smsProperties = new SmsProperties(); |
| | | smsProperties.setTemplateId(sms.getTemplateId()); |
| | | smsProperties.setAccessKey(sms.getAccessKey()); |
| | | smsProperties.setSecretKey(sms.getSecretKey()); |
| | | smsProperties.setSignName(sms.getSignName()); |
| | | Auth auth = Auth.create(smsProperties.getAccessKey(), smsProperties.getSecretKey()); |
| | | SmsManager smsManager = new SmsManager(auth); |
| | | return new QiniuSmsTemplate(smsProperties, smsManager, bladeRedis); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.sms; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.vci.ubcs.resource.service.ISmsService; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.sms.SmsTemplate; |
| | | import org.springblade.core.sms.enums.SmsEnum; |
| | | import org.springblade.core.sms.enums.SmsStatusEnum; |
| | | import org.springblade.core.sms.props.SmsProperties; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; |
| | | |
| | | /** |
| | | * Smsçä¿¡æå¡ç»ä¸æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class SmsBuilder { |
| | | |
| | | public static final String SMS_CODE = "sms:code:"; |
| | | public static final String SMS_PARAM_KEY = "code"; |
| | | |
| | | private final SmsProperties smsProperties; |
| | | private final ISmsService smsService; |
| | | private final BladeRedis bladeRedis; |
| | | |
| | | |
| | | public SmsBuilder(SmsProperties smsProperties, ISmsService smsService, BladeRedis bladeRedis) { |
| | | this.smsProperties = smsProperties; |
| | | this.smsService = smsService; |
| | | this.bladeRedis = bladeRedis; |
| | | } |
| | | |
| | | /** |
| | | * SmsTemplateé
ç½®ç¼åæ± |
| | | */ |
| | | private final Map<String, SmsTemplate> templatePool = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * Smsé
ç½®ç¼åæ± |
| | | */ |
| | | private final Map<String, Sms> smsPool = new ConcurrentHashMap<>(); |
| | | |
| | | |
| | | /** |
| | | * è·åtemplate |
| | | * |
| | | * @return SmsTemplate |
| | | */ |
| | | public SmsTemplate template() { |
| | | return template(StringPool.EMPTY); |
| | | } |
| | | |
| | | /** |
| | | * è·åtemplate |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @return SmsTemplate |
| | | */ |
| | | public SmsTemplate template(String code) { |
| | | String tenantId = AuthUtil.getTenantId(); |
| | | Sms sms = getSms(tenantId, code); |
| | | Sms smsCached = smsPool.get(tenantId); |
| | | SmsTemplate template = templatePool.get(tenantId); |
| | | // è¥ä¸ºç©ºæè
ä¸ä¸è´ï¼åéæ°å è½½ |
| | | if (Func.hasEmpty(template, smsCached) || !sms.getTemplateId().equals(smsCached.getTemplateId()) || !sms.getAccessKey().equals(smsCached.getAccessKey())) { |
| | | synchronized (SmsBuilder.class) { |
| | | template = templatePool.get(tenantId); |
| | | if (Func.hasEmpty(template, smsCached) || !sms.getTemplateId().equals(smsCached.getTemplateId()) || !sms.getAccessKey().equals(smsCached.getAccessKey())) { |
| | | if (sms.getCategory() == SmsEnum.YUNPIAN.getCategory()) { |
| | | template = YunpianSmsBuilder.template(sms, bladeRedis); |
| | | } else if (sms.getCategory() == SmsEnum.QINIU.getCategory()) { |
| | | template = QiniuSmsBuilder.template(sms, bladeRedis); |
| | | } else if (sms.getCategory() == SmsEnum.ALI.getCategory()) { |
| | | template = AliSmsBuilder.template(sms, bladeRedis); |
| | | } else if (sms.getCategory() == SmsEnum.TENCENT.getCategory()) { |
| | | template = TencentSmsBuilder.template(sms, bladeRedis); |
| | | } |
| | | templatePool.put(tenantId, template); |
| | | smsPool.put(tenantId, sms); |
| | | } |
| | | } |
| | | } |
| | | return template; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åçä¿¡å®ä½ |
| | | * |
| | | * @param tenantId ç§æ·ID |
| | | * @return Sms |
| | | */ |
| | | public Sms getSms(String tenantId, String code) { |
| | | String key = tenantId; |
| | | LambdaQueryWrapper<Sms> lqw = Wrappers.<Sms>query().lambda().eq(Sms::getTenantId, tenantId); |
| | | // è·åä¼ åçèµæºç¼å·å¹¶æ¥è¯¢ï¼è¥æåè¿åï¼è¥æ²¡æåè°å¯ç¨çé
ç½® |
| | | String smsCode = StringUtil.isBlank(code) ? WebUtil.getParameter(SMS_PARAM_KEY) : code; |
| | | if (StringUtil.isNotBlank(smsCode)) { |
| | | key = key.concat(StringPool.DASH).concat(smsCode); |
| | | lqw.eq(Sms::getSmsCode, smsCode); |
| | | } else { |
| | | lqw.eq(Sms::getStatus, SmsStatusEnum.ENABLE.getNum()); |
| | | } |
| | | Sms sms = CacheUtil.get(RESOURCE_CACHE, SMS_CODE, key, () -> { |
| | | Sms s = smsService.getOne(lqw); |
| | | // è¥ä¸ºç©ºåè°ç¨é»è®¤é
ç½® |
| | | if ((Func.isEmpty(s))) { |
| | | Sms defaultSms = new Sms(); |
| | | defaultSms.setId(0L); |
| | | defaultSms.setTemplateId(smsProperties.getTemplateId()); |
| | | defaultSms.setRegionId(smsProperties.getRegionId()); |
| | | defaultSms.setCategory(SmsEnum.of(smsProperties.getName()).getCategory()); |
| | | defaultSms.setAccessKey(smsProperties.getAccessKey()); |
| | | defaultSms.setSecretKey(smsProperties.getSecretKey()); |
| | | defaultSms.setSignName(smsProperties.getSignName()); |
| | | return defaultSms; |
| | | } else { |
| | | return s; |
| | | } |
| | | }); |
| | | if (sms == null || sms.getId() == null) { |
| | | throw new ServiceException("æªè·åå°å¯¹åºççä¿¡é
ç½®"); |
| | | } else { |
| | | return sms; |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.sms; |
| | | |
| | | import com.github.qcloudsms.SmsMultiSender; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.sms.SmsTemplate; |
| | | import org.springblade.core.sms.props.SmsProperties; |
| | | import org.springblade.core.sms.TencentSmsTemplate; |
| | | import org.springblade.core.tool.utils.Func; |
| | | |
| | | /** |
| | | * è
¾è®¯äºçä¿¡æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class TencentSmsBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static SmsTemplate template(Sms sms, BladeRedis bladeRedis) { |
| | | SmsProperties smsProperties = new SmsProperties(); |
| | | smsProperties.setTemplateId(sms.getTemplateId()); |
| | | smsProperties.setAccessKey(sms.getAccessKey()); |
| | | smsProperties.setSecretKey(sms.getSecretKey()); |
| | | smsProperties.setSignName(sms.getSignName()); |
| | | SmsMultiSender smsSender = new SmsMultiSender(Func.toInt(smsProperties.getAccessKey()), sms.getSecretKey()); |
| | | return new TencentSmsTemplate(smsProperties, smsSender, bladeRedis); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.builder.sms; |
| | | |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.yunpian.sdk.YunpianClient; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.sms.SmsTemplate; |
| | | import org.springblade.core.sms.props.SmsProperties; |
| | | import org.springblade.core.sms.YunpianSmsTemplate; |
| | | |
| | | /** |
| | | * äºççä¿¡æå»ºç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class YunpianSmsBuilder { |
| | | |
| | | @SneakyThrows |
| | | public static SmsTemplate template(Sms sms, BladeRedis bladeRedis) { |
| | | SmsProperties smsProperties = new SmsProperties(); |
| | | smsProperties.setTemplateId(sms.getTemplateId()); |
| | | smsProperties.setAccessKey(sms.getAccessKey()); |
| | | smsProperties.setSignName(sms.getSignName()); |
| | | YunpianClient client = new YunpianClient(smsProperties.getAccessKey()).init(); |
| | | return new YunpianSmsTemplate(smsProperties, client, bladeRedis); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.oss.props.OssProperties; |
| | | import com.vci.ubcs.resource.builder.oss.OssBuilder; |
| | | import com.vci.ubcs.resource.service.IOssService; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * Ossé
置类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | public class BladeOssConfiguration { |
| | | |
| | | private final OssProperties ossProperties; |
| | | |
| | | private final IOssService ossService; |
| | | |
| | | @Bean |
| | | public OssBuilder ossBuilder() { |
| | | return new OssBuilder(ossProperties, ossService); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.config; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.sms.props.SmsProperties; |
| | | import com.vci.ubcs.resource.builder.sms.SmsBuilder; |
| | | import com.vci.ubcs.resource.service.ISmsService; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * Smsé
置类 |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | @AllArgsConstructor |
| | | public class BladeSmsConfiguration { |
| | | |
| | | private final SmsProperties smsProperties; |
| | | |
| | | private final ISmsService smsService; |
| | | |
| | | private final BladeRedis bladeRedis; |
| | | |
| | | @Bean |
| | | public SmsBuilder smsBuilder() { |
| | | return new SmsBuilder(smsProperties, smsService, bladeRedis); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import com.vci.ubcs.resource.service.IAttachService; |
| | | import com.vci.ubcs.resource.vo.AttachVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * é件表 æ§å¶å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/attach") |
| | | @Api(value = "éä»¶", tags = "éä»¶") |
| | | public class AttachController extends BladeController { |
| | | |
| | | private final IAttachService attachService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥attach") |
| | | public R<Attach> detail(Attach attach) { |
| | | Attach detail = attachService.getOne(Condition.getQueryWrapper(attach)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * å页 é件表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥attach") |
| | | public R<IPage<Attach>> list(Attach attach, Query query) { |
| | | IPage<Attach> pages = attachService.page(Condition.getPage(query), Condition.getQueryWrapper(attach)); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * èªå®ä¹å页 é件表 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥attach") |
| | | public R<IPage<AttachVO>> page(AttachVO attach, Query query) { |
| | | IPage<AttachVO> pages = attachService.selectAttachPage(Condition.getPage(query), attach); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ é件表 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥attach") |
| | | public R save(@Valid @RequestBody Attach attach) { |
| | | return R.status(attachService.save(attach)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ é件表 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥attach") |
| | | public R update(@Valid @RequestBody Attach attach) { |
| | | return R.status(attachService.updateById(attach)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ é件表 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥attach") |
| | | public R submit(@Valid @RequestBody Attach attach) { |
| | | return R.status(attachService.saveOrUpdate(attach)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ é件表 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | return R.status(attachService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import com.vci.ubcs.resource.service.IOssService; |
| | | import com.vci.ubcs.resource.vo.OssVO; |
| | | import com.vci.ubcs.resource.wrapper.OssWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; |
| | | |
| | | /** |
| | | * æ§å¶å¨ |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/oss") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | @Api(value = "对象å卿¥å£", tags = "对象å卿¥å£") |
| | | public class OssController extends BladeController { |
| | | |
| | | private final IOssService ossService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥oss") |
| | | public R<OssVO> detail(Oss oss) { |
| | | Oss detail = ossService.getOne(Condition.getQueryWrapper(oss)); |
| | | return R.data(OssWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥oss") |
| | | public R<IPage<OssVO>> list(Oss oss, Query query) { |
| | | IPage<Oss> pages = ossService.page(Condition.getPage(query), Condition.getQueryWrapper(oss)); |
| | | return R.data(OssWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥oss") |
| | | public R<IPage<OssVO>> page(OssVO oss, Query query) { |
| | | IPage<OssVO> pages = ossService.selectOssPage(Condition.getPage(query), oss); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥oss") |
| | | public R save(@Valid @RequestBody Oss oss) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(ossService.save(oss)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥oss") |
| | | public R update(@Valid @RequestBody Oss oss) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(ossService.updateById(oss)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥oss") |
| | | public R submit(@Valid @RequestBody Oss oss) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(ossService.submit(oss)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(ossService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¯ç¨ |
| | | */ |
| | | @PostMapping("/enable") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "é
ç½®å¯ç¨", notes = "ä¼ å
¥id") |
| | | public R enable(@ApiParam(value = "主é®", required = true) @RequestParam Long id) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(ossService.enable(id)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.vci.ubcs.resource.service.ISmsService; |
| | | import com.vci.ubcs.resource.vo.SmsVO; |
| | | import com.vci.ubcs.resource.wrapper.SmsWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE; |
| | | |
| | | /** |
| | | * çä¿¡é
置表 æ§å¶å¨ |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @NonDS |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/sms") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | @Api(value = "çä¿¡é
置表", tags = "çä¿¡é
置表æ¥å£") |
| | | public class SmsController extends BladeController { |
| | | |
| | | private final ISmsService smsService; |
| | | |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详æ
", notes = "ä¼ å
¥sms") |
| | | public R<SmsVO> detail(Sms sms) { |
| | | Sms detail = smsService.getOne(Condition.getQueryWrapper(sms)); |
| | | return R.data(SmsWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * å页 çä¿¡é
置表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥sms") |
| | | public R<IPage<SmsVO>> list(Sms sms, Query query) { |
| | | IPage<Sms> pages = smsService.page(Condition.getPage(query), Condition.getQueryWrapper(sms)); |
| | | return R.data(SmsWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * èªå®ä¹å页 çä¿¡é
置表 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å页", notes = "ä¼ å
¥sms") |
| | | public R<IPage<SmsVO>> page(SmsVO sms, Query query) { |
| | | IPage<SmsVO> pages = smsService.selectSmsPage(Condition.getPage(query), sms); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ çä¿¡é
置表 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢", notes = "ä¼ å
¥sms") |
| | | public R save(@Valid @RequestBody Sms sms) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(smsService.save(sms)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ çä¿¡é
置表 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å
¥sms") |
| | | public R update(@Valid @RequestBody Sms sms) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(smsService.updateById(sms)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ çä¿¡é
置表 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥sms") |
| | | public R submit(@Valid @RequestBody Sms sms) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(smsService.submit(sms)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ çä¿¡é
置表 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å
¥ids") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(smsService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * å¯ç¨ |
| | | */ |
| | | @PostMapping("/enable") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "é
ç½®å¯ç¨", notes = "ä¼ å
¥id") |
| | | public R enable(@ApiParam(value = "主é®", required = true) @RequestParam Long id) { |
| | | CacheUtil.clear(RESOURCE_CACHE); |
| | | return R.status(smsService.enable(id)); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.endpoint; |
| | | |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.FileUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import com.vci.ubcs.resource.builder.oss.OssBuilder; |
| | | import com.vci.ubcs.resource.service.IAttachService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 对象åå¨ç«¯ç¹ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/oss/endpoint") |
| | | @Api(value = "对象åå¨ç«¯ç¹", tags = "对象åå¨ç«¯ç¹") |
| | | public class OssEndpoint { |
| | | |
| | | /** |
| | | * 对象åå¨æå»ºç±» |
| | | */ |
| | | private final OssBuilder ossBuilder; |
| | | |
| | | /** |
| | | * é件表æå¡ |
| | | */ |
| | | private final IAttachService attachService; |
| | | |
| | | /** |
| | | * å建å卿¡¶ |
| | | * |
| | | * @param bucketName å卿¡¶åç§° |
| | | * @return Bucket |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/make-bucket") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R makeBucket(@RequestParam String bucketName) { |
| | | ossBuilder.template().makeBucket(bucketName); |
| | | return R.success("å建æå"); |
| | | } |
| | | |
| | | /** |
| | | * å建å卿¡¶ |
| | | * |
| | | * @param bucketName å卿¡¶åç§° |
| | | * @return R |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-bucket") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeBucket(@RequestParam String bucketName) { |
| | | ossBuilder.template().removeBucket(bucketName); |
| | | return R.success("å 餿å"); |
| | | } |
| | | |
| | | /** |
| | | * æ·è´æä»¶ |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @param destBucketName ç®æ å卿¡¶åç§° |
| | | * @param destFileName ç®æ å卿¡¶å¯¹è±¡åç§° |
| | | * @return R |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/copy-file") |
| | | public R copyFile(@RequestParam String fileName, @RequestParam String destBucketName, String destFileName) { |
| | | ossBuilder.template().copyFile(fileName, destBucketName, destFileName); |
| | | return R.success("æä½æå"); |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶ä¿¡æ¯ |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @return InputStream |
| | | */ |
| | | @SneakyThrows |
| | | @GetMapping("/stat-file") |
| | | public R<OssFile> statFile(@RequestParam String fileName) { |
| | | return R.data(ossBuilder.template().statFile(fileName)); |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶ç¸å¯¹è·¯å¾ |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @return String |
| | | */ |
| | | @SneakyThrows |
| | | @GetMapping("/file-path") |
| | | public R<String> filePath(@RequestParam String fileName) { |
| | | return R.data(ossBuilder.template().filePath(fileName)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åæä»¶å¤é¾ |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @return String |
| | | */ |
| | | @SneakyThrows |
| | | @GetMapping("/file-link") |
| | | public R<String> fileLink(@RequestParam String fileName) { |
| | | return R.data(ossBuilder.template().fileLink(fileName)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶ |
| | | * |
| | | * @param file æä»¶ |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file") |
| | | public R<BladeFile> putFile(@RequestParam MultipartFile file) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(file.getOriginalFilename(), file.getInputStream()); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶ |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @param file æä»¶ |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-by-name") |
| | | public R<BladeFile> putFile(@RequestParam String fileName, @RequestParam MultipartFile file) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶å¹¶ä¿åè³é件表 |
| | | * |
| | | * @param file æä»¶ |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-attach") |
| | | public R<BladeFile> putFileAttach(@RequestParam MultipartFile file) { |
| | | String fileName = file.getOriginalFilename(); |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile); |
| | | bladeFile.setAttachId(attachId); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶å¹¶ä¿åè³é件表 |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @param file æä»¶ |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-attach-by-name") |
| | | public R<BladeFile> putFileAttach(@RequestParam String fileName, @RequestParam MultipartFile file) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream()); |
| | | Long attachId = buildAttach(fileName, file.getSize(), bladeFile); |
| | | bladeFile.setAttachId(attachId); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * æå»ºé件表 |
| | | * |
| | | * @param fileName æä»¶å |
| | | * @param fileSize æä»¶å¤§å° |
| | | * @param bladeFile 对象å卿件 |
| | | * @return attachId |
| | | */ |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile) { |
| | | String fileExtension = FileUtil.getFileExtension(fileName); |
| | | Attach attach = new Attach(); |
| | | attach.setDomainUrl(bladeFile.getDomain()); |
| | | attach.setLink(bladeFile.getLink()); |
| | | attach.setName(bladeFile.getName()); |
| | | attach.setOriginalName(bladeFile.getOriginalName()); |
| | | attach.setAttachSize(fileSize); |
| | | attach.setExtension(fileExtension); |
| | | attachService.save(attach); |
| | | return attach.getId(); |
| | | } |
| | | |
| | | /** |
| | | * å 餿件 |
| | | * |
| | | * @param fileName å卿¡¶å¯¹è±¡åç§° |
| | | * @return R |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-file") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeFile(@RequestParam String fileName) { |
| | | ossBuilder.template().removeFile(fileName); |
| | | return R.success("æä½æå"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå 餿件 |
| | | * |
| | | * @param fileNames å卿¡¶å¯¹è±¡åç§°éå |
| | | * @return R |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/remove-files") |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R removeFiles(@RequestParam String fileNames) { |
| | | ossBuilder.template().removeFiles(Func.toStrList(fileNames)); |
| | | return R.success("æä½æå"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.endpoint; |
| | | |
| | | import com.vci.ubcs.resource.utils.SmsUtil; |
| | | import com.vci.ubcs.resource.builder.sms.SmsBuilder; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springblade.core.sms.model.SmsCode; |
| | | import org.springblade.core.sms.model.SmsData; |
| | | import org.springblade.core.sms.model.SmsResponse; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * çä¿¡æå¡ç«¯ç¹ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/sms/endpoint") |
| | | @Api(value = "çä¿¡æå¡ç«¯ç¹", tags = "çä¿¡æå¡ç«¯ç¹") |
| | | public class SmsEndpoint { |
| | | |
| | | /** |
| | | * çä¿¡æå¡æå»ºç±» |
| | | */ |
| | | private final SmsBuilder smsBuilder; |
| | | |
| | | //================================= çä¿¡æå¡æ ¡éª ================================= |
| | | |
| | | /** |
| | | * çä¿¡éªè¯ç åé |
| | | * |
| | | * @param phone ææºå· |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/send-validate") |
| | | public R sendValidate(@RequestParam String phone) { |
| | | Map<String, String> params = SmsUtil.getValidateParams(); |
| | | SmsCode smsCode = smsBuilder.template().sendValidate(new SmsData(params).setKey(SmsUtil.PARAM_KEY), phone); |
| | | return smsCode.isSuccess() ? R.data(smsCode, SmsUtil.SEND_SUCCESS) : R.fail(SmsUtil.SEND_FAIL); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªçä¿¡ |
| | | * |
| | | * @param smsCode çä¿¡æ ¡éªä¿¡æ¯ |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/validate-message") |
| | | public R validateMessage(SmsCode smsCode) { |
| | | boolean validate = smsBuilder.template().validateMessage(smsCode); |
| | | return validate ? R.success(SmsUtil.VALIDATE_SUCCESS) : R.fail(SmsUtil.VALIDATE_FAIL); |
| | | } |
| | | |
| | | //========== éç¨çä¿¡èªå®ä¹åé(æ¯æèªå®ä¹paramsåæ°ä¼ é, æ¨èç¨äºæµè¯, 䏿¨èç¨äºç产ç¯å¢) ========== |
| | | |
| | | /** |
| | | * åéä¿¡æ¯ |
| | | * |
| | | * @param params èªå®ä¹çä¿¡åæ° |
| | | * @param phones ææºå·éå |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/send-message") |
| | | public R sendMessage(@RequestParam String code, @RequestParam String params, @RequestParam String phones) { |
| | | SmsData smsData = new SmsData(JsonUtil.readMap(params, String.class, String.class)); |
| | | return send(code, smsData, phones); |
| | | } |
| | | |
| | | //========== æå®çä¿¡æå¡åé(坿 ¹æ®åç§åºæ¯èªå®æå±å®å¶, æå¤±çµæ´»æ§å¢å å®å
¨æ§, æ¨èç¨äºç产ç¯å¢) ========== |
| | | |
| | | /** |
| | | * çä¿¡éç¥ |
| | | * |
| | | * @param phones ææºå·éå |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/send-notice") |
| | | public R sendNotice(@RequestParam String phones) { |
| | | Map<String, String> params = new HashMap<>(3); |
| | | params.put("title", "éç¥æ é¢"); |
| | | params.put("content", "éç¥å
容"); |
| | | params.put("date", "éç¥æ¶é´"); |
| | | SmsData smsData = new SmsData(params); |
| | | return send(smsData, phones); |
| | | } |
| | | |
| | | /** |
| | | * 订åéç¥ |
| | | * |
| | | * @param phones ææºå·éå |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/send-order") |
| | | public R sendOrder(@RequestParam String phones) { |
| | | Map<String, String> params = new HashMap<>(3); |
| | | params.put("orderNo", "订åç¼å·"); |
| | | params.put("packageNo", "å¿«éåå·"); |
| | | params.put("user", "æ¶ä»¶äºº"); |
| | | SmsData smsData = new SmsData(params); |
| | | return send(smsData, phones); |
| | | } |
| | | |
| | | /** |
| | | * ä¼è®®éç¥ |
| | | * |
| | | * @param phones ææºå·éå |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/send-meeting") |
| | | public R sendMeeting(@RequestParam String phones) { |
| | | Map<String, String> params = new HashMap<>(2); |
| | | params.put("roomId", "ä¼è®®å®¤"); |
| | | params.put("topic", "ä¼è®®ä¸»é¢"); |
| | | params.put("date", "ä¼è®®æ¶é´"); |
| | | SmsData smsData = new SmsData(params); |
| | | return send(smsData, phones); |
| | | } |
| | | |
| | | //================================= éç¨çä¿¡åéæ¥å£ ================================= |
| | | |
| | | /** |
| | | * éç¨çä¿¡åéæ¥å£ |
| | | * |
| | | * @param smsData çä¿¡å
容 |
| | | * @param phones ææºå·å表 |
| | | * @return æ¯å¦åéæå |
| | | */ |
| | | private R send(SmsData smsData, String phones) { |
| | | SmsResponse response = smsBuilder.template().sendMessage(smsData, Func.toStrList(phones)); |
| | | return response.isSuccess() ? R.success(SmsUtil.SEND_SUCCESS) : R.fail(SmsUtil.SEND_FAIL); |
| | | } |
| | | |
| | | /** |
| | | * éç¨çä¿¡åéæ¥å£ |
| | | * |
| | | * @param code èµæºç¼å· |
| | | * @param smsData çä¿¡å
容 |
| | | * @param phones ææºå·å表 |
| | | * @return æ¯å¦åéæå |
| | | */ |
| | | private R send(String code, SmsData smsData, String phones) { |
| | | SmsResponse response = smsBuilder.template(code).sendMessage(smsData, Func.toStrList(phones)); |
| | | return response.isSuccess() ? R.success(SmsUtil.SEND_SUCCESS) : R.fail(SmsUtil.SEND_FAIL); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.feign; |
| | | |
| | | import com.vci.ubcs.resource.utils.SmsUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import com.vci.ubcs.resource.builder.sms.SmsBuilder; |
| | | import org.springblade.core.sms.model.SmsCode; |
| | | import org.springblade.core.sms.model.SmsData; |
| | | import org.springblade.core.sms.model.SmsResponse; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * çä¿¡è¿ç¨è°ç¨æå¡ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class SmsClient implements ISmsClient { |
| | | |
| | | private final SmsBuilder smsBuilder; |
| | | |
| | | @Override |
| | | @PostMapping(SEND_MESSAGE) |
| | | public R<SmsResponse> sendMessage(String code, String params, String phones) { |
| | | SmsData smsData = new SmsData(JsonUtil.readMap(params, String.class, String.class)); |
| | | SmsResponse response = smsBuilder.template(code).sendMessage(smsData, Func.toStrList(phones)); |
| | | return R.data(response); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(SEND_VALIDATE) |
| | | public R sendValidate(String code, String phone) { |
| | | Map<String, String> params = SmsUtil.getValidateParams(); |
| | | SmsCode smsCode = smsBuilder.template(code).sendValidate(new SmsData(params).setKey(SmsUtil.PARAM_KEY), phone); |
| | | return smsCode.isSuccess() ? R.data(smsCode, SmsUtil.SEND_SUCCESS) : R.fail(SmsUtil.SEND_FAIL); |
| | | } |
| | | |
| | | @Override |
| | | @PostMapping(VALIDATE_MESSAGE) |
| | | public R validateMessage(String code, String id, String value, String phone) { |
| | | SmsCode smsCode = new SmsCode().setId(id).setValue(value).setPhone(phone); |
| | | boolean validate = smsBuilder.template(code).validateMessage(smsCode); |
| | | return validate ? R.success(SmsUtil.VALIDATE_SUCCESS) : R.fail(SmsUtil.VALIDATE_FAIL); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import com.vci.ubcs.resource.vo.AttachVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é件表 Mapper æ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface AttachMapper extends BaseMapper<Attach> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param attach |
| | | * @return |
| | | */ |
| | | List<AttachVO> selectAttachPage(IPage page, AttachVO attach); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import com.vci.ubcs.resource.vo.OssVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Mapper æ¥å£ |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | public interface OssMapper extends BaseMapper<Oss> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param oss |
| | | * @return |
| | | */ |
| | | List<OssVO> selectOssPage(IPage page, OssVO oss); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.mapper; |
| | | |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.vci.ubcs.resource.vo.SmsVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * çä¿¡é
置表 Mapper æ¥å£ |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | public interface SmsMapper extends BaseMapper<Sms> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param sms |
| | | * @return |
| | | */ |
| | | List<SmsVO> selectSmsPage(IPage page, SmsVO sms); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import com.vci.ubcs.resource.vo.AttachVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * é件表 æå¡ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public interface IAttachService extends BaseService<Attach> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param attach |
| | | * @return |
| | | */ |
| | | IPage<AttachVO> selectAttachPage(IPage<AttachVO> page, AttachVO attach); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import com.vci.ubcs.resource.vo.OssVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * æå¡ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | public interface IOssService extends BaseService<Oss> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param oss |
| | | * @return |
| | | */ |
| | | IPage<OssVO> selectOssPage(IPage<OssVO> page, OssVO oss); |
| | | |
| | | /** |
| | | * æäº¤ossä¿¡æ¯ |
| | | * |
| | | * @param oss |
| | | * @return |
| | | */ |
| | | boolean submit(Oss oss); |
| | | |
| | | /** |
| | | * å¯å¨é
ç½® |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean enable(Long id); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.vci.ubcs.resource.vo.SmsVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | | /** |
| | | * çä¿¡é
置表 æå¡ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | public interface ISmsService extends BaseService<Sms> { |
| | | |
| | | /** |
| | | * èªå®ä¹å页 |
| | | * |
| | | * @param page |
| | | * @param sms |
| | | * @return |
| | | */ |
| | | IPage<SmsVO> selectSmsPage(IPage<SmsVO> page, SmsVO sms); |
| | | |
| | | /** |
| | | * æäº¤ossä¿¡æ¯ |
| | | * |
| | | * @param oss |
| | | * @return |
| | | */ |
| | | boolean submit(Sms oss); |
| | | |
| | | /** |
| | | * å¯å¨é
ç½® |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean enable(Long id); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.resource.entity.Attach; |
| | | import com.vci.ubcs.resource.mapper.AttachMapper; |
| | | import com.vci.ubcs.resource.service.IAttachService; |
| | | import com.vci.ubcs.resource.vo.AttachVO; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * é件表 æå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | public class AttachServiceImpl extends BaseServiceImpl<AttachMapper, Attach> implements IAttachService { |
| | | |
| | | @Override |
| | | public IPage<AttachVO> selectAttachPage(IPage<AttachVO> page, AttachVO attach) { |
| | | return page.setRecords(baseMapper.selectAttachPage(page, attach)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import com.vci.ubcs.resource.mapper.OssMapper; |
| | | import com.vci.ubcs.resource.service.IOssService; |
| | | import com.vci.ubcs.resource.vo.OssVO; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * æå¡å®ç°ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @Service |
| | | public class OssServiceImpl extends BaseServiceImpl<OssMapper, Oss> implements IOssService { |
| | | |
| | | @Override |
| | | public IPage<OssVO> selectOssPage(IPage<OssVO> page, OssVO oss) { |
| | | return page.setRecords(baseMapper.selectOssPage(page, oss)); |
| | | } |
| | | |
| | | @Override |
| | | public boolean submit(Oss oss) { |
| | | LambdaQueryWrapper<Oss> lqw = Wrappers.<Oss>query().lambda() |
| | | .eq(Oss::getOssCode, oss.getOssCode()).eq(Oss::getTenantId, AuthUtil.getTenantId()); |
| | | Long cnt = baseMapper.selectCount(Func.isEmpty(oss.getId()) ? lqw : lqw.notIn(Oss::getId, oss.getId())); |
| | | if (cnt > 0L) { |
| | | throw new ServiceException("å½åèµæºç¼å·å·²åå¨!"); |
| | | } |
| | | return this.saveOrUpdate(oss); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean enable(Long id) { |
| | | // å
ç¦ç¨ |
| | | boolean temp1 = this.update(Wrappers.<Oss>update().lambda().set(Oss::getStatus, 1)); |
| | | // å¨å¯ç¨ |
| | | boolean temp2 = this.update(Wrappers.<Oss>update().lambda().set(Oss::getStatus, 2).eq(Oss::getId, id)); |
| | | return temp1 && temp2; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.vci.ubcs.resource.mapper.SmsMapper; |
| | | import com.vci.ubcs.resource.service.ISmsService; |
| | | import com.vci.ubcs.resource.vo.SmsVO; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * çä¿¡é
置表 æå¡å®ç°ç±» |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | @Service |
| | | public class SmsServiceImpl extends BaseServiceImpl<SmsMapper, Sms> implements ISmsService { |
| | | |
| | | @Override |
| | | public IPage<SmsVO> selectSmsPage(IPage<SmsVO> page, SmsVO sms) { |
| | | return page.setRecords(baseMapper.selectSmsPage(page, sms)); |
| | | } |
| | | |
| | | @Override |
| | | public boolean submit(Sms sms) { |
| | | LambdaQueryWrapper<Sms> lqw = Wrappers.<Sms>query().lambda() |
| | | .eq(Sms::getSmsCode, sms.getSmsCode()).eq(Sms::getTenantId, AuthUtil.getTenantId()); |
| | | Long cnt = baseMapper.selectCount(Func.isEmpty(sms.getId()) ? lqw : lqw.notIn(Sms::getId, sms.getId())); |
| | | if (cnt > 0L) { |
| | | throw new ServiceException("å½åèµæºç¼å·å·²åå¨!"); |
| | | } |
| | | return this.saveOrUpdate(sms); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean enable(Long id) { |
| | | // å
ç¦ç¨ |
| | | boolean temp1 = this.update(Wrappers.<Sms>update().lambda().set(Sms::getStatus, 1)); |
| | | // å¨å¯ç¨ |
| | | boolean temp2 = this.update(Wrappers.<Sms>update().lambda().set(Sms::getStatus, 2).eq(Sms::getId, id)); |
| | | return temp1 && temp2; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.wrapper; |
| | | |
| | | import com.vci.ubcs.resource.entity.Oss; |
| | | import com.vci.ubcs.resource.vo.OssVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | | import com.vci.ubcs.system.enums.DictEnum; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * å
è£
ç±»,è¿åè§å¾å±æéçåæ®µ |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | public class OssWrapper extends BaseEntityWrapper<Oss, OssVO> { |
| | | |
| | | public static OssWrapper build() { |
| | | return new OssWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public OssVO entityVO(Oss oss) { |
| | | OssVO ossVO = Objects.requireNonNull(BeanUtil.copy(oss, OssVO.class)); |
| | | String categoryName = DictCache.getValue(DictEnum.OSS, oss.getCategory()); |
| | | String statusName = DictCache.getValue(DictEnum.YES_NO, oss.getStatus()); |
| | | ossVO.setCategoryName(categoryName); |
| | | ossVO.setStatusName(statusName); |
| | | return ossVO; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.resource.wrapper; |
| | | |
| | | import com.vci.ubcs.resource.entity.Sms; |
| | | import com.vci.ubcs.resource.vo.SmsVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | | import com.vci.ubcs.system.enums.DictEnum; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * çä¿¡é
置表å
è£
ç±»,è¿åè§å¾å±æéçåæ®µ |
| | | * |
| | | * @author BladeX |
| | | */ |
| | | public class SmsWrapper extends BaseEntityWrapper<Sms, SmsVO> { |
| | | |
| | | public static SmsWrapper build() { |
| | | return new SmsWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public SmsVO entityVO(Sms sms) { |
| | | SmsVO smsVO = Objects.requireNonNull(BeanUtil.copy(sms, SmsVO.class)); |
| | | String categoryName = DictCache.getValue(DictEnum.SMS, sms.getCategory()); |
| | | String statusName = DictCache.getValue(DictEnum.YES_NO, sms.getStatus()); |
| | | smsVO.setCategoryName(categoryName); |
| | | smsVO.setStatusName(statusName); |
| | | return smsVO; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.resource.mapper.AttachMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="attachResultMap" type="com.vci.ubcs.resource.entity.Attach"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="link" property="link"/> |
| | | <result column="domain_url" property="domainUrl"/> |
| | | <result column="name" property="name"/> |
| | | <result column="original_name" property="originalName"/> |
| | | <result column="extension" property="extension"/> |
| | | <result column="attach_size" property="attachSize"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectAttachPage" resultMap="attachResultMap"> |
| | | select * from blade_attach where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.resource.mapper.OssMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="ossResultMap" type="com.vci.ubcs.resource.entity.Oss"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="oss_code" property="ossCode"/> |
| | | <result column="category" property="category"/> |
| | | <result column="endpoint" property="endpoint"/> |
| | | <result column="access_key" property="accessKey"/> |
| | | <result column="secret_key" property="secretKey"/> |
| | | <result column="bucket_name" property="bucketName"/> |
| | | <result column="app_id" property="appId"/> |
| | | <result column="region" property="region"/> |
| | | <result column="remark" property="remark"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectOssPage" resultMap="ossResultMap"> |
| | | select * from pl_sys_oss where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.vci.ubcs.resource.mapper.SmsMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="smsResultMap" type="com.vci.ubcs.resource.entity.Sms"> |
| | | <result column="id" property="id"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="create_dept" property="createDept"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | <result column="sms_code" property="smsCode"/> |
| | | <result column="template_id" property="templateId"/> |
| | | <result column="category" property="category"/> |
| | | <result column="access_key" property="accessKey"/> |
| | | <result column="secret_key" property="secretKey"/> |
| | | <result column="region_id" property="regionId"/> |
| | | <result column="sign_name" property="signName"/> |
| | | <result column="remark" property="remark"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectSmsPage" resultMap="smsResultMap"> |
| | | select * from pl_sys_sms where is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-swagger</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-cloud</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-aggregation-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.swagger; |
| | | |
| | | |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | |
| | | /** |
| | | * swaggerèåå¯å¨å¨ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class SwaggerApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(AppConstant.APPLICATION_SWAGGER_NAME, SwaggerApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | ## ãåå¸å¼ä»»å¡è°åº¦å¹³å°XXL-JOBã |
| | | |
| | | [](https://github.com/xuxueli/xxl-job/actions) |
| | | [](https://maven-badges.herokuapp.com/maven-central/com.xuxueli/xxl-job/) |
| | | [](https://github.com/xuxueli/xxl-job/releases) |
| | | [](https://github.com/xuxueli/xxl-job/) |
| | | [](https://hub.docker.com/r/xuxueli/xxl-job-admin/) |
| | | [](http://www.gnu.org/licenses/gpl-3.0.html) |
| | | [](https://www.xuxueli.com/page/donate.html) |
| | | |
| | | [TOCM] |
| | | |
| | | [TOC] |
| | | |
| | | ## ä¸ãç®ä» |
| | | |
| | | ### 1.1 æ¦è¿° |
| | | XXL-JOBæ¯ä¸ä¸ªåå¸å¼ä»»å¡è°åº¦å¹³å°ï¼å
¶æ ¸å¿è®¾è®¡ç®æ æ¯å¼åè¿
éãå¦ä¹ ç®åãè½»éçº§ãææ©å±ãç°å·²å¼æ¾æºä»£ç å¹¶æ¥å
¥å¤å®¶å
¬å¸çº¿ä¸äº§å线ï¼å¼ç®±å³ç¨ã |
| | | |
| | | ### 1.2 社åºäº¤æµ |
| | | - [社åºäº¤æµ](https://www.xuxueli.com/page/community.html) |
| | | |
| | | ### 1.3 ç¹æ§ |
| | | - 1ãç®åï¼æ¯æéè¿Web页é¢å¯¹ä»»å¡è¿è¡CRUDæä½ï¼æä½ç®åï¼ä¸åéä¸æï¼ |
| | | - 2ãå¨æï¼æ¯æå¨æä¿®æ¹ä»»å¡ç¶æãå¯å¨/忢任å¡ï¼ä»¥åç»æ¢è¿è¡ä¸ä»»å¡ï¼å³æ¶çæï¼ |
| | | - 3ãè°åº¦ä¸å¿HAï¼ä¸å¿å¼ï¼ï¼è°åº¦éç¨ä¸å¿å¼è®¾è®¡ï¼âè°åº¦ä¸å¿âèªç è°åº¦ç»ä»¶å¹¶æ¯æé群é¨ç½²ï¼å¯ä¿è¯è°åº¦ä¸å¿HAï¼ |
| | | - 4ãæ§è¡å¨HAï¼åå¸å¼ï¼ï¼ä»»å¡åå¸å¼æ§è¡ï¼ä»»å¡"æ§è¡å¨"æ¯æé群é¨ç½²ï¼å¯ä¿è¯ä»»å¡æ§è¡HAï¼ |
| | | - 5ãæ³¨åä¸å¿: æ§è¡å¨ä¼å¨ææ§èªå¨æ³¨åä»»å¡, è°åº¦ä¸å¿å°ä¼èªå¨åç°æ³¨åçä»»å¡å¹¶è§¦åæ§è¡ãåæ¶ï¼ä¹æ¯ææå¨å½å
¥æ§è¡å¨å°åï¼ |
| | | - 6ãå¼¹æ§æ©å®¹ç¼©å®¹ï¼ä¸æ¦ææ°æ§è¡å¨æºå¨ä¸çº¿æè
ä¸çº¿ï¼ä¸æ¬¡è°åº¦æ¶å°ä¼éæ°åé
ä»»å¡ï¼ |
| | | - 7ãè·¯ç±çç¥ï¼æ§è¡å¨é群é¨ç½²æ¶æä¾ä¸°å¯çè·¯ç±çç¥ï¼å
æ¬ï¼ç¬¬ä¸ä¸ªãæåä¸ä¸ªã轮询ãéæºãä¸è´æ§HASHãæä¸ç»å¸¸ä½¿ç¨ãæè¿æä¹
æªä½¿ç¨ãæ
é转移ãå¿ç¢è½¬ç§»çï¼ |
| | | - 8ãæ
é转移ï¼ä»»å¡è·¯ç±çç¥éæ©"æ
é转移"æ
åµä¸ï¼å¦ææ§è¡å¨éç¾¤ä¸æä¸å°æºå¨æ
éï¼å°ä¼èªå¨Failover忢å°ä¸å°æ£å¸¸çæ§è¡å¨åéè°åº¦è¯·æ±ã |
| | | - 9ãé»å¡å¤ççç¥ï¼è°åº¦è¿äºå¯éæ§è¡å¨æ¥ä¸åå¤çæ¶çå¤ççç¥ï¼çç¥å
æ¬ï¼åæºä¸²è¡ï¼é»è®¤ï¼ã丢å¼åç»è°åº¦ãè¦çä¹åè°åº¦ï¼ |
| | | - 10ãä»»å¡è¶
æ¶æ§å¶ï¼æ¯æèªå®ä¹ä»»å¡è¶
æ¶æ¶é´ï¼ä»»å¡è¿è¡è¶
æ¶å°ä¼ä¸»å¨ä¸æä»»å¡ï¼ |
| | | - 11ãä»»å¡å¤±è´¥éè¯ï¼æ¯æèªå®ä¹ä»»å¡å¤±è´¥éè¯æ¬¡æ°ï¼å½ä»»å¡å¤±è´¥æ¶å°ä¼æç
§é¢è®¾ç失败éè¯æ¬¡æ°ä¸»å¨è¿è¡éè¯ï¼å
¶ä¸åç任塿¯æåçç²åº¦ç失败éè¯ï¼ |
| | | - 12ãä»»å¡å¤±è´¥åè¦ï¼é»è®¤æä¾é®ä»¶æ¹å¼å¤±è´¥åè¦ï¼åæ¶é¢çæ©å±æ¥å£ï¼å¯æ¹ä¾¿çæ©å±çä¿¡ãééçåè¦æ¹å¼ï¼ |
| | | - 13ãåç广æä»»å¡ï¼æ§è¡å¨é群é¨ç½²æ¶ï¼ä»»å¡è·¯ç±çç¥éæ©"åç广æ"æ
åµä¸ï¼ä¸æ¬¡ä»»å¡è°åº¦å°ä¼å¹¿æè§¦åéç¾¤ä¸æææ§è¡å¨æ§è¡ä¸æ¬¡ä»»å¡ï¼å¯æ ¹æ®åçåæ°å¼ååçä»»å¡ï¼ |
| | | - 14ã卿åçï¼åç广æä»»å¡ä»¥æ§è¡å¨ä¸ºç»´åº¦è¿è¡åçï¼æ¯æå¨ææ©å®¹æ§è¡å¨é群ä»è卿å¢å åçæ°éï¼ååè¿è¡ä¸å¡å¤çï¼å¨è¿è¡å¤§æ°æ®éä¸å¡æä½æ¶å¯æ¾èæåä»»å¡å¤çè½ååé度ã |
| | | - 15ãäºä»¶è§¦åï¼é¤äº"Cronæ¹å¼"å"ä»»å¡ä¾èµæ¹å¼"触å任塿§è¡ä¹å¤ï¼æ¯æåºäºäºä»¶ç触å任塿¹å¼ãè°åº¦ä¸å¿æä¾è§¦åä»»å¡å次æ§è¡çAPIæå¡ï¼å¯æ ¹æ®ä¸å¡äºä»¶çµæ´»è§¦åã |
| | | - 16ãä»»å¡è¿åº¦çæ§ï¼æ¯æå®æ¶çæ§ä»»å¡è¿åº¦ï¼ |
| | | - 17ãRolling宿¶æ¥å¿ï¼æ¯æå¨çº¿æ¥çè°åº¦ç»æï¼å¹¶ä¸æ¯æä»¥Rollingæ¹å¼å®æ¶æ¥çæ§è¡å¨è¾åºç宿´çæ§è¡æ¥å¿ï¼ |
| | | - 18ãGLUEï¼æä¾Web IDEï¼æ¯æå¨çº¿å¼åä»»å¡é»è¾ä»£ç ï¼å¨æåå¸ï¼å®æ¶ç¼è¯çæï¼çç¥é¨ç½²ä¸çº¿çè¿ç¨ãæ¯æ30ä¸ªçæ¬çåå²çæ¬å溯ã |
| | | - 19ãèæ¬ä»»å¡ï¼æ¯æä»¥GLUE模å¼å¼ååè¿è¡èæ¬ä»»å¡ï¼å
æ¬ShellãPythonãNodeJSãPHPãPowerShellçç±»åèæ¬; |
| | | - 20ãå½ä»¤è¡ä»»å¡ï¼åçæä¾éç¨å½ä»¤è¡ä»»å¡Handlerï¼Beanä»»å¡ï¼"CommandJobHandler"ï¼ï¼ä¸å¡æ¹åªéè¦æä¾å½ä»¤è¡å³å¯ï¼ |
| | | - 21ãä»»å¡ä¾èµï¼æ¯æé
ç½®åä»»å¡ä¾èµï¼å½ç¶ä»»å¡æ§è¡ç»æä¸æ§è¡æååå°ä¼ä¸»å¨è§¦å䏿¬¡åä»»å¡çæ§è¡, å¤ä¸ªåä»»å¡ç¨éå·åéï¼ |
| | | - 22ãä¸è´æ§ï¼âè°åº¦ä¸å¿âéè¿DBéä¿è¯é群åå¸å¼è°åº¦çä¸è´æ§, 䏿¬¡ä»»å¡è°åº¦åªä¼è§¦å䏿¬¡æ§è¡ï¼ |
| | | - 23ãèªå®ä¹ä»»å¡åæ°ï¼æ¯æå¨çº¿é
ç½®è°åº¦ä»»å¡å
¥åï¼å³æ¶çæï¼ |
| | | - 24ãè°åº¦çº¿ç¨æ± ï¼è°åº¦ç³»ç»å¤çº¿ç¨è§¦åè°åº¦è¿è¡ï¼ç¡®ä¿è°åº¦ç²¾ç¡®æ§è¡ï¼ä¸è¢«å µå¡ï¼ |
| | | - 25ãæ°æ®å å¯ï¼è°åº¦ä¸å¿åæ§è¡å¨ä¹é´çé讯è¿è¡æ°æ®å å¯ï¼æåè°åº¦ä¿¡æ¯å®å
¨æ§ï¼ |
| | | - 26ãé®ä»¶æ¥è¦ï¼ä»»å¡å¤±è´¥æ¶æ¯æé®ä»¶æ¥è¦ï¼æ¯æé
ç½®å¤é®ä»¶å°åç¾¤åæ¥è¦é®ä»¶ï¼ |
| | | - 27ãæ¨émavenä¸å¤®ä»åº: å°ä¼æææ°ç¨³å®çæ¨éå°mavenä¸å¤®ä»åº, æ¹ä¾¿ç¨æ·æ¥å
¥å使ç¨; |
| | | - 28ãè¿è¡æ¥è¡¨ï¼æ¯æå®æ¶æ¥çè¿è¡æ°æ®ï¼å¦ä»»å¡æ°éãè°åº¦æ¬¡æ°ãæ§è¡å¨æ°éçï¼ä»¥åè°åº¦æ¥è¡¨ï¼å¦è°åº¦æ¥æåå¸å¾ï¼è°åº¦æååå¸å¾çï¼ |
| | | - 29ãå
¨å¼æ¥ï¼ä»»å¡è°åº¦æµç¨å
¨å¼æ¥å设计å®ç°ï¼å¦å¼æ¥è°åº¦ã弿¥è¿è¡ã弿¥åè°çï¼ææå¯¹å¯éè°åº¦è¿è¡æµéåå³°ï¼çè®ºä¸æ¯æä»»ææ¶é¿ä»»å¡çè¿è¡ï¼ |
| | | - 30ã跨平å°ï¼åçæä¾éç¨HTTPä»»å¡Handlerï¼Beanä»»å¡ï¼"HttpJobHandler"ï¼ï¼ä¸å¡æ¹åªéè¦æä¾HTTP龿¥å³å¯ï¼ä¸éå¶è¯è¨ãå¹³å°ï¼ |
| | | - 31ãå½é
åï¼è°åº¦ä¸å¿æ¯æå½é
åè®¾ç½®ï¼æä¾ä¸æãè±æä¸¤ç§å¯éè¯è¨ï¼é»è®¤ä¸ºä¸æï¼ |
| | | - 32ã容å¨åï¼æä¾å®æ¹dockeréåï¼å¹¶å®æ¶æ´æ°æ¨édockerhubï¼è¿ä¸æ¥å®ç°äº§åå¼ç®±å³ç¨ï¼ |
| | | - 33ãçº¿ç¨æ± é离ï¼è°åº¦çº¿ç¨æ± è¿è¡é离æåï¼æ
¢ä»»å¡èªå¨é级è¿å
¥"Slow"çº¿ç¨æ± ï¼é¿å
èå°½è°åº¦çº¿ç¨ï¼æé«ç³»ç»ç¨³å®æ§ï¼ |
| | | - 34ãç¨æ·ç®¡çï¼æ¯æå¨çº¿ç®¡çç³»ç»ç¨æ·ï¼åå¨ç®¡çåãæ®éç¨æ·ä¸¤ç§è§è²ï¼ |
| | | - 35ãæéæ§å¶ï¼æ§è¡å¨ç»´åº¦è¿è¡æéæ§å¶ï¼ç®¡ç忥æå
¨éæéï¼æ®éç¨æ·éè¦åé
æ§è¡å¨æéåæå
许ç¸å
³æä½ï¼ |
| | | |
| | | |
| | | ### 1.4 åå± |
| | | äº2015å¹´ä¸ï¼æå¨githubä¸å建XXL-JOB项ç®ä»åºå¹¶æäº¤ç¬¬ä¸ä¸ªcommitï¼éä¹è¿è¡ç³»ç»ç»æè®¾è®¡ï¼UIéåï¼äº¤äºè®¾è®¡â¦â¦ |
| | | |
| | | äº2015-11æï¼XXL-JOBç»äºRELEASEäºç¬¬ä¸ä¸ªå¤§çæ¬V1.0ï¼ éåæå°ä¹åå¸å°OSCHINAï¼XXL-JOBå¨OSCHINAä¸è·å¾äº@红è¯çç鍿¨èï¼åæåå«è¾¾å°äºOSCHINAçâçé¨å¨å¼¹âæè¡ç¬¬ä¸ågit.oschinaç弿ºè½¯ä»¶æç度æè¡ç¬¬ä¸ï¼å¨æ¤ç¹å«æè°¢çº¢è¯ï¼æè°¢å¤§å®¶çå
³æ³¨åæ¯æã |
| | | |
| | | äº2015-12æï¼æå°XXL-JOBåè¡¨å°æå¸å
é¨ç¥è¯åºï¼å¹¶ä¸å¾å°å
é¨åäºè®¤å¯ã |
| | | |
| | | äº2016-01æï¼æå¸å±å¼XXL-JOBçå
鍿¥å
¥åå®å¶å·¥ä½ï¼å¨æ¤æè°¢è¢æåå°¹æä¸¤ä½åäºçè´¡ç®ï¼åæ¶ä¹æè°¢å
é¨å
¶ä»ç»ä¸å
³æ³¨ä¸æ¯æçåäºã |
| | | |
| | | äº2017-05-13ï¼å¨ä¸æµ·ä¸¾åç "[第62æå¼æºä¸å½æºåä¼](https://www.oschina.net/event/2236961)" ç "æ¾ç è¿æ¥" ç¯èï¼æç»å°å¯¹XXL-JOBåäºæ¼è®²ï¼å°ä¸äºç¾ä½å¨åºè§ä¼ååççï¼[徿å顾](https://www.oschina.net/question/2686220_2242120) ï¼ã |
| | | |
| | | äº2017-10-22ï¼åæäº Open Talk èå Spring Cloud ä¸å½ç¤¾åºä¸¾åç "[è¿å»çå¾®æå¡å®ææ´¾ä¸æµ·ç«](https://opentalk.upyun.com/303.html)"ï¼æç»å°å¯¹XXL-JOBåäºæ¼è®²ï¼ç°åºè§ä¼ååççå¹¶å¨ä¼åä¸XXL-JOBç¨æ·çç讨论交æµã |
| | | |
| | | äº2017-12-11ï¼XXL-JOBæå¹¸åä¼ã[InfoQ ArchSummitå
¨çæ¶æå¸å³°ä¼](http://bj2017.archsummit.com/)ãï¼å¹¶è¢«ææè´·æ¶ææ»ç"æ¨æ³¢èå¸"å¨ä¸é¢ "[å¾®æå¡åçãåºç¡æ¶æå弿ºå®è·µ](http://bj2017.archsummit.com/training/2)" ä¸ç°åºä»ç»ã |
| | | |
| | | äº2017-12-18ï¼XXL-JOBåä¸"[2017年度æå欢è¿ä¸å½å¼æºè½¯ä»¶](http://www.oschina.net/project/top_cn_2017?sort=1)"è¯æ¯ï¼å¨å½æ¶å·²å½å
¥ç约ä¹å个å½äº§å¼æºé¡¹ç®ä¸è§éï¼æç»è¿å
¥äºå30强ã |
| | | |
| | | äº2018-01-15ï¼XXL-JOBåä¸"[2017ç äºæç«å¼æºé¡¹ç®](https://www.oschina.net/news/92438/2017-mayun-top-50)"è¯æ¯ï¼å¨å½æ¶å·²å½å
¥ç约å
åäºç¾ä¸ªç äºé¡¹ç®ä¸è§éï¼æç»è¿å»äºå20强ã |
| | | |
| | | äº2018-04-14ï¼iTechPluså¨ä¸æµ·ä¸¾åç "[2018äºèç½å¼åè
大ä¼](http://www.itdks.com/eventlist/detail/2065)"ï¼æç»å°å¯¹XXL-JOBåäºæ¼è®²ï¼ç°åºè§ä¼ååççå¹¶å¨ä¼åä¸XXL-JOBç¨æ·çç讨论交æµã |
| | | |
| | | äº2018-05-27ï¼å¨ä¸æµ·ä¸¾åç "[第75æå¼æºä¸å½æºåä¼](https://www.oschina.net/event/2278742)" ç "æ¶æ" 主é¢ä¸åºï¼æç»å°è¿è¡âåºç¡æ¶æä¸ä¸é´ä»¶å¾è°±â䏻颿¼è®²ï¼å°ä¸ä¸åä½å¨åºè§ä¼ååççï¼[徿å顾](https://www.oschina.net/question/3802184_2280606) ï¼ã |
| | | |
| | | äº2018-12-05ï¼XXL-JOBåä¸"[2018年度æå欢è¿ä¸å½å¼æºè½¯ä»¶](https://www.oschina.net/project/top_cn_2018?sort=1)"è¯æ¯ï¼å¨å½æ¶å·²å½å
¥çä¸ä¸å¤ä¸ªå¼æºé¡¹ç®ä¸è§éï¼æç»æå第19åã |
| | | |
| | | äº2019-12-10ï¼XXL-JOBåä¸"[2019年度æå欢è¿ä¸å½å¼æºè½¯ä»¶](https://www.oschina.net/project/top_cn_2019)"è¯æ¯ï¼å¨å½æ¶å·²å½å
¥çä¸ä¸å¤ä¸ªå¼æºé¡¹ç®ä¸è§éï¼æç»æå"å¼åæ¡æ¶ååºç¡ç»ä»¶ç±»"第9åã |
| | | |
| | | > æå¸å¤§ä¼ç¹è¯ç®åå·²æ¥å
¥XXL-JOBï¼å
é¨å«åãFerrariãï¼FerrariåºäºXXL-JOBçV1.1çæ¬å®å¶èæï¼æ°æ¥å
¥åºç¨æ¨èåçº§ææ°çæ¬ï¼ã |
| | | æ®ææ°ç»è®¡, èª2016-01-21æ¥å
¥è³2017-12-01æé´ï¼è¯¥ç³»ç»å·²è°åº¦çº¦100䏿¬¡ï¼è¡¨ç°ä¼å¼ãæ°æ¥å
¥åºç¨æ¨èä½¿ç¨ææ°çæ¬ï¼å 为ç»è¿æ°åä¸ªçæ¬çæ´æ°ï¼ç³»ç»ç任塿¨¡åãUIäº¤äºæ¨¡å以ååºå±è°åº¦é讯模å齿äºè¾å¤§çä¼ååæåï¼æ ¸å¿åè½æ´å 稳å®é«æã |
| | | |
| | | è³ä»ï¼XXL-JOBå·²æ¥å
¥å¤å®¶å
¬å¸ç线ä¸äº§åçº¿ï¼æ¥å
¥åºæ¯å¦çµåä¸å¡ï¼O2Oä¸å¡åå¤§æ°æ®ä½ä¸çï¼æªæ¢ææ°ç»è®¡æ¶é´ä¸ºæ¢ï¼XXL-JOBå·²æ¥å
¥çå
¬å¸å
æ¬ä¸éäºï¼ |
| | | |
| | | - 1ã大ä¼ç¹è¯ãç¾å¢ç¹è¯ã |
| | | - 2ãå±±ä¸å¦èç½ç»ç§ææéå
¬å¸ï¼ |
| | | - 3ãå®å¾½æ
§éäºèç§ææéå
¬å¸ï¼ |
| | | - 4ã人人èè´¢éæï¼ |
| | | - 5ã䏿µ·æ£ 棣信æ¯ç§æè¡ä»½æéå
¬å¸ |
| | | - 6ãè¿æ»¡æ»¡ãè¿æ»¡æ»¡ã |
| | | - 7ãç±³å
¶æ (ä¸å½åº)ãç±³å
¶æã |
| | | - 8ãå¦å¦èç |
| | | - 9ã乿¨±å¤©ä¸ï¼å京ï¼ä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 10ã䏿®ææ¯ç§ææéå
¬å¸ãä¸å ææºã |
| | | - 11ã䏿µ·äº¿ä¿å¥åº·ç®¡çæéå
¬å¸ |
| | | - 12ãæµ·å°é¦¨å¨ãæµ·å°ã |
| | | - 13ãæ²³å大红å
çµåå塿éå
¬å¸ |
| | | - 14ãæé½é¡ºç¹ç§ææéå
¬å¸ |
| | | - 15ãæ·±å³å¸æ¡äºé |
| | | - 16ãæ·±å³éº¦äºä¿¡ç§æè¡ä»½æéå
¬å¸ |
| | | - 17ã䏿µ·åè¹ç§æä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 18ãä¸å½å¹³å®ç§ææéå
¬å¸ãä¸å½å¹³å®ã |
| | | - 19ãæå·ç¥æ¶ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 20ãåè¹ç§æï¼ä¸æµ·ï¼æéå
¬å¸ |
| | | - 21ãæé½ä¾è½è¡ä»½æé责任å
¬å¸ |
| | | - 22ãæ¹åé«é³éèä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 23ãæ·±å³å¸é¦å¾·æåå屿éå
¬å¸ |
| | | - 24ãç¦å»ºé¿æå¯ç½ç»æè²æéå
¬å¸ |
| | | - 25ãä¼ä¿¡äºæè½¦ãä¼ä¿¡ã |
| | | - 26ã䏿µ·æ æ¸¸å æèµåå±è¡ä»½æéå
¬å¸ãæ æ¸¸å ã |
| | | - 27ãå京ç²ç¬èå¤©ç§ææéå
¬å¸ |
| | | - 28ãä¸ç§ç§æ(æ é¡)æéå
¬å¸ |
| | | - 29ãæ¦æ±ç©ºå¿ç§ææéå
¬å¸ |
| | | - 30ãå京èè飿´ç§ææéå
¬å¸ |
| | | - 31ãåå·äºå®è¾¾ç§ææéå
¬å¸ |
| | | - 32ãé±å
è¡äºï¼å京ï¼ç§ææéå
¬å¸ |
| | | - 33ãéåºæ¬£æéå¢ |
| | | - 34ãåªåäºå¨å¨±ä¹æéå
¬å¸ãä¸å½ç§»å¨ã |
| | | - 35ãå京诺亦è
¾ç§ææéå
¬å¸ |
| | | - 36ãå¢é¿å¼æ(å京)ä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 37ãå京è±è´æç§ææéå
¬å¸ |
| | | - 38ãåæ³°éå¢ |
| | | - 39ãæ·±å³æ³°ä¹
ä¿¡æ¯ç³»ç»è¡ä»½æéå
¬å¸ |
| | | - 40ãéè¡ä»æ¯ä»æéå
¬å¸ |
| | | - 41ã广å·çåç½ç»ç§ææéå
¬å¸ |
| | | - 42ã享ç¹ç§ææéå
¬å¸ |
| | | - 43ãæå·æ¯æºç§ææéå
¬å¸ |
| | | - 44ãå³ä¸´ç线ç½ç»ç§ææéå
¬å¸ |
| | | - 45ã广å·ç¥è¯åç½ç»ç§ææéå
¬å¸ |
| | | - 46ãå½èªåä¸ä¸æµ·æéå
¬å¸ |
| | | - 47ãæµ·å°æ¶è´¹éèæéå
¬å¸ï¼å¨ä»ãå¤è±ãæµ·å°ã |
| | | - 48ã广å·å·´å¾é²ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 49ãæ·±å³å¸é¹æµ·è¿çµåæ°æ®äº¤æ¢æéå
¬å¸ |
| | | - 50ãæ·±å³å¸äºé£çµåå塿éå
¬å¸ |
| | | - 51ã䏿µ·è¶£å»ç½ç»æéå
¬å¸ |
| | | - 52ãèéèµæ¬ |
| | | - 53ãåäº¬ç¶æ¯é¦ç½ç»ç§ææéå
¬å¸ |
| | | - 54ãä¸å±±å
èµ«è½¯ä»¶ç§ææéå
¬å¸ |
| | | - 55ãä¸åæ æ°(å京)çµåå塿éå
¬å¸ |
| | | - 56ãå¯äº¬éå¢ |
| | | - 57ãåå¤ç¥¨èï¼å京ï¼ç§ææéå
¬å¸ |
| | | - 58ãææè´·ãææè´·ã |
| | | - 59ãå京å°å¾·æºæå¨çº¿æè²æéå
¬å¸ |
| | | - 60ãä»»åè¡è¡ä»½æéå
¬å¸ |
| | | - 61ãåäº¬æ¶æçµåå塿éå
¬å¸ |
| | | - 62ãæ·±å³å·ç®ç½ç»ç§ææéå
¬å¸ |
| | | - 63ãå京å®åéç§æè¡ä»½æéå
¬å¸ |
| | | - 64ãæªæ¥æ çº¿ç½ |
| | | - 65ãå¦é¨ç·ç¦§ç½ç»æéå
¬å¸ |
| | | - 66ãå京éèç§è½¯ä»¶è¡ä»½æéå
¬å¸ |
| | | - 67ãéå·åæµ·è½¯ä»¶ç§æå
¬å¸ |
| | | - 68ãåäº¬å½æ§ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 69ãæµªæ½®è½¯ä»¶éå¢ |
| | | - 70ãå¤ç«æ(å京)ä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 71ãå¹¿å·æè¿
客信æ¯ç§ææéå
¬å¸ |
| | | - 72ã赫åºï¼ä¸å½ï¼éå¢è¡ä»½æéå
¬å¸ |
| | | - 73ãæµ·ææ± |
| | | - 74ã䏿µ·æ¶¦çåä¸åµåå¨ç®¡çè¡ä»½æéå
¬å¸ |
| | | - 75ãæ±çº³æ£®ï¼å¦é¨ï¼æ°æ®è¡ä»½æéå
¬å¸ |
| | | - 76ãå®ä¿¡ä¿¡æ |
| | | - 77ãå²åè´¢å¯ |
| | | - 78ãæ·é软件 |
| | | - 79ãæ¹å享ä¸ç½ç»ç§ææéå
¬å¸ |
| | | - 80ãæ¹åååç§æè´£ä»»æéå
¬å¸ |
| | | - 81ãæ·±å³å°å®æ¶ä»£äºèç½éèæå¡æéå
¬å¸ |
| | | - 82ãæ¹å享ä¸ç½ç»ç§ææéå
¬å¸ |
| | | - 83ãé±å
è¡äº(å京)ç§ææéå
¬å¸ |
| | | - 84ã360éèã360ã |
| | | - 85ãæä¼ç§ |
| | | - 86ãæ©è´ï¼ä¸æµ·ï¼çç©ç§ææéå
¬å¸ |
| | | - 87ã广ä¸è¯æºæ
§ç§ææéå
¬å¸ |
| | | - 88ãèæ³éå¢ãèæ³ã |
| | | - 89ãæªå
½å
çµ |
| | | - 90ãè¡å汽车 |
| | | - 91ãæ·±å³åºåºéç§æé®ç®±å
¬å¸ |
| | | - 92ã京ä¸ã京ä¸ã |
| | | - 93ãç±³åºçè´¢ |
| | | - 94ãå塿è |
| | | - 95ãæ¢§æ¡è¯é |
| | | - 96ãæå¤§å°äº§ãæå¤§ã |
| | | - 97ãææé¾æ
§ |
| | | - 98ã䏿µ·æ¶©ç¶è½¯ä»¶ |
| | | - 99ãæä¿¡ãç½æã |
| | | - 100ãéæ¿è¡ |
| | | - 101ãæå·äºè¥ç½ç»ç§ææéå
¬å¸ |
| | | - 102ãç¹ç¾æ ï¼ä¸å½ï¼æéå
¬å¸ |
| | | - 103ã常山ä¼å¡è¿åä¾åºé¾ç®¡çæéå
¬å¸ |
| | | - 104ãæ·±å³ç«åçµåå塿éå
¬å¸ |
| | | - 105ãæå·æºè¯ºç§æè¡ä»½æéå
¬å¸ |
| | | - 106ãåäº¬äºæ¼¾ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 107ãæ·±å³å¸å¤é¶ç§ææéå
¬å¸ |
| | | - 108ã亲å®å® |
| | | - 109ã䏿µ·åå¡è½¯ä»¶ç§ææéå
¬å¸ |
| | | - 110ãæºæ
§æ å¨çº¿æè²å¹³å° |
| | | - 111ãç±³æéè |
| | | - 112ãå京辰森ä¸çºª |
| | | - 113ãäºåæ»å»é |
| | | - 114ã广å·å¸åé¢ç½ç»ç§ææé责任å
¬å¸ |
| | | - 115ãæµæ±å¾®è½ç§ææéå
¬å¸ |
| | | - 116ã䏿µ·é¦¨é£çµåå塿éå
¬å¸ |
| | | - 117ã䏿µ·å®å°çµåå塿éå
¬å¸ |
| | | - 118ãç´å®¢éç§æææ¯æéå
¬å¸ |
| | | - 119ãç§åº¦ç§ææéå
¬å¸ |
| | | - 120ã䏿µ·æ°æ
§ç³»ç»ææ¯æéå
¬å¸ |
| | | - 121ãæçå»è¯ç½ |
| | | - 122ãå¤ç²å¹³å° |
| | | - 123ãéç²äºææº |
| | | - 124ã䏿µ·æµ·æ°å¾æ°æ®ææ¯æéå
¬å¸ |
| | | - 125ãæ·±å³å¸çç±ç½ä¿¡æ¯ææ¯æéå
¬å¸ãçç±ç½ã |
| | | - 126ãå°èè |
| | | - 127ãåè£æ°ç§æ |
| | | - 128ã䏿µ·æºåä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 129ã广å·èæ¯ç½ç»æéå
¬å¸ãèæFMã |
| | | - 130ãæå·éªå®ç§ææéå
¬å¸ |
| | | - 131ãå京äºèæ°ç½ç§æå屿éå
¬å¸ |
| | | - 132ãèªéç§æ |
| | | - 133ã山西å
çæ¿å°äº§å¼åæéå
¬å¸ |
| | | - 134ãå京èç¿éè¾¾ç§ææéå
¬å¸ |
| | | - 135ãæäº®å°å±ï¼ä¸å½ï¼æéå
¬å¸ãèæäº®ã |
| | | - 136ãéå²å½çä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 137ãåé
äºè®¡ç®ï¼åäº¬ï¼æéå
¬å¸ |
| | | - 138ãåæ³°è¯å¸é¦æ¸¯åå
¬å¸ |
| | | - 139ãæå·ä¸æ¹éä¿¡è½¯ä»¶ææ¯æéå
¬å¸ |
| | | - 140ãæ¦æ±åæå®å
¨ææ¯è¡ä»½æéå
¬å¸ |
| | | - 141ãæ·±å³å¸å
度人åç§ææéå
¬å¸ |
| | | - 142ãæå·è¶£ç»´ç§ææéå
¬å¸ï¼å°å½±ï¼ |
| | | - 143ã宿³¢åè½¦ä¾ ä¹å®¶ç§ææéå
¬å¸ãåè½¦ä¾ ã |
| | | - 144ãä¸ä¸äºåº·ä¿¡æ¯ç§æï¼åäº¬ï¼æéå
¬å¸ |
| | | - 145ãäºé±è¢ |
| | | - 146ãå京ä¸å
´åç»´ |
| | | - 147ã䏿µ·ç½æéä¿¡ææ¯æéå
¬å¸ |
| | | - 148ãæ·±å³è¨ç§ç§æ |
| | | - 149ãä¸éæåç«ç§ææé责任å
¬å¸ |
| | | - 150ãæ·±å³å¸å¯¹åºç§ææéå
¬å¸ |
| | | - 151ãä¸è¯æä¿¡æ¯ç½ç»æéå
¬å¸ |
| | | - 152ãæå·ç«ç§äºç§ææéå
¬å¸ãå©ç¤¼çºªã |
| | | - 153ã天津éèæç§ææéå
¬å¸ãèæå¤´æ¡ã |
| | | - 154ãé¿é£å
纤å
ç¼è¡ä»½æéå
¬å¸ |
| | | - 155ãä¸çºªå¯æï¼å京ï¼å»çç§ææéå
¬å¸ |
| | | - 156ãæµæ±éæ¢æ§è¡æéå
¬å¸ |
| | | - 157ãæ±è¥¿è
¾é£ç½ç»ææ¯æéå
¬å¸ |
| | | - 158ãå®è¿
ç©æµæéå
¬å¸ |
| | | - 159ãèèç½ |
| | | - 160ãå京å广梯影广åä¼ åªæéå
¬å¸ |
| | | - 161ã䏿µ·æ°æ
§ç³»ç»ææ¯æéå
¬å¸ |
| | | - 162ã大å¿å¤©æ |
| | | - 163ã䏿µ·äºé¹å» |
| | | - 164ã䏿µ·äºé¹å» |
| | | - 165ã墨迹天æ°ã墨迹天æ°ã |
| | | - 166ã䏿µ·é¸æ©ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 167ãæ²
æç©è |
| | | - 168ãæå·æçäºèç½ç»ç§ææéå
¬å¸ |
| | | - 169ã绿米èå |
| | | - 170ãéåºæå® ç§ææéå
¬å¸ |
| | | - 171ãå®å¾½å¼èªç§ææéå
¬å¸ï¼ä¹èç½ï¼ |
| | | - 172ã䏿µ·æ°èå»ä¿¡ä¼ä¸å屿éå
¬å¸ |
| | | - 173ãè¯å½¬å»ºæ |
| | | - 174ãæå·æ±æ¯ååç½ç»ç§ææéå
¬å¸ |
| | | - 175ãè·é©¬å½é
|
| | | - 176ãç¹éç½ |
| | | - 177ãæ·±å³å¸åæå
çµææ¯æéå
¬å¸ |
| | | - 178ãå¦é¨ç¥å·é¹°è½¯ä»¶ç§ææéå
¬å¸ |
| | | - 179ãæ·±å³å¸æå信诺人寿ä¿é©æéå
¬å¸ |
| | | - 180ã䏿µ·å¥½å±ç½ä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 181ãæµ·ä¿¡éå¢ãæµ·ä¿¡ã |
| | | - 182ãä¿¡åå¯ä¿¡æ¯ç§æï¼ä¸æµ·ï¼æéå
¬å¸ |
| | | - 183ãé¿æ¥å¤©æç§æå屿éå
¬å¸ |
| | | - 184ãç¨åéèä¿¡æ¯ææ¯è¡ä»½æéå
¬å¸ãç¨åã |
| | | - 185ãå京å塿èæéå
¬å¸ |
| | | - 186ã彿çé¶åºé管çæéå
¬å¸ |
| | | - 187ãææ¾(䏿µ·)ç½ç»ä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 188ãæ·±å³å¸éæç§ææéå
¬å¸ãéæè®°ã |
| | | - 189ãæ·±å³æ°´å¡ç§ææéå
¬å¸ |
| | | - 190ãæä¼ç§ãæä¼ç§ã |
| | | - 191ãå京ç£äºç§æ |
| | | - 192ãåäº¬èæ³°äºèç½ç§ææéå
¬å¸ |
| | | - 193ãç« é±¼ç´æ |
| | | - 194ãå¥å¤å¤ç§æ |
| | | - 195ã天津å¸ç¥å·åé¾ç§æè¡ä»½æéå
¬å¸ |
| | | - 196ã岩å¿ç§æ |
| | | - 197ã车ç ç§æï¼åäº¬ï¼æéå
¬å¸ |
| | | - 198ãè´µé³å¸æèµæ§è¡éå¢ |
| | | - 199ã康æè¡ä»½ |
| | | - 200ãé¾è
¾åºè¡ |
| | | - 201ãæå·åé软件 |
| | | - 202ãåè¥é¡¶å²å»çç§ææéå
¬å¸ |
| | | - 203ãéåºè¡¨è¾¾å¼ç§ææéå
¬å¸ |
| | | - 204ã䏿µ·ç±³éä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 205ãå京çåä¼ç§ææéå
¬å¸ |
| | | - 206ãå京èè´¯çµåå塿éå
¬å¸ |
| | | - 207ãä¸å½å¤æ±äº¤æä¸å¿ |
| | | - 208ãä¸å½å¤è¿è¡ä»½æéå
¬å¸ |
| | | - 209ãä¸å½ä¸æµ·æåæè²ç§ææéå
¬å¸ |
| | | - 210ãæ®è软件è¡ä»½æéå
¬å¸ |
| | | - 211ãå京ç§è软件è¡ä»½æéå
¬å¸ |
| | | - 212ãæ±èæ¯è¯ºç©èç§ææéå
¬å¸ |
| | | - 213ãå京æç-çåãæçã |
| | | - 214ãæ°å¤§éç½åéè |
| | | - 215ãå±±ä¸ç¥ç ä¸ç¨ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 216ãæ²³åæ±é¡ºç½ç»ç§ææéå
¬å¸ |
| | | - 217ãå京å夿æºç§æå屿éå
¬å¸ |
| | | - 218ã䏿µ·ä¸æ®ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 219ã䏿µ·é¸£åç½ç»ç§ææéå
¬å¸ |
| | | - 220ã广ä¸å¦èæè²å屿éå
¬å¸ |
| | | - 221ãæ·±å³å¼ºæ¶ç§ææéå
¬å¸ |
| | | - 222ã䏿µ·äºç ºä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 223ãéåºæå®¢è¡ç½ç»æéå
¬å¸ |
| | | - 224ãæ°äº |
| | | - 225ãå½å®¶çµç½è¿æ£é¨ |
| | | - 226ãæå·æ¾è¶£ |
| | | - 227ãæµ©é²¸äºè®¡ç®ç§æè¡ä»½æéå
¬å¸ |
| | | - 228ãç§å¤§è®¯é£ãç§å¤§è®¯é£ã |
| | | - 229ãæå·è¡è£
ç½ç»ç§ææéå
¬å¸ |
| | | - 230ã峿åæéè |
| | | - 231ãæ·±å³æ³å¸å¾·ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 232ã䏿µ·åå¤ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 233ãæå·äºåäºè®¡ç®æéå
¬å¸ |
| | | - 234ãæå®¶æ°å®¿(æå®¶ç¾å®¿) |
| | | - 235ãå京赢ééè½¯ä»¶ææ¯æéå
¬å¸ |
| | | - 236ãæµæ±èæè´¢éèæå¡å¤å
æéå
¬å¸ |
| | | - 237ãæææºæ±(å京)ç§ææéå
¬å¸ |
| | | - 238ãåè¥é¡¶å²å»çç§æå¼åæéå
¬å¸ |
| | | - 239ã车è¹å®(æ·±å³)æç©ç§ææéå
¬å¸) |
| | | - 240ã广å·å¯åå°äº§æéå
¬å¸ |
| | | - 241ãæ°¢è¯¾ï¼ä¸æµ·ï¼æè²ç§ææéå
¬å¸ |
| | | - 242ãæ¦æ±æ°ªç»èç½ç»ææ¯æéå
¬å¸ |
| | | - 243ãæå·æäºç§ææéå
¬å¸ |
| | | - 244ã䏿µ·ä»è±æºè½æºå¨äººæéå
¬å¸ |
| | | - 245ãæå¡ææ¯ä»è¡ä»½æéå
¬å¸ãæå¡æã |
| | | - 246ãè彩å°èºè¡ä»½æéå
¬å¸ |
| | | - 247ãå京æ°å¾®ç§ææéå
¬å¸ |
| | | - 248ãå¹¿ä¸æºçç§ææéå
¬å¸ |
| | | - 249ãæ¾é¢ç½ |
| | | - 250ã乿ºç½ |
| | | - 251ãæå·è·è·ç½ç»ç§ææéå
¬å¸ |
| | | - 252ãæ·±å³æªæ¥äºé |
| | | - 253ãæå·æ¯æ¥ç»åç§ææéå
¬å¸ |
| | | - 254ã䏿µ·é½çä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 255ãæ»´æ»´åºè¡ãæ»´æ»´ã |
| | | - 256ãåè¥äºè¯ä¿¡æ¯ç§ææéå
¬å¸ |
| | | - 257ãäºç¥å£°æºè½ç§æè¡ä»½æéå
¬å¸ |
| | | - 258ãå京å¦éç§ææéå
¬å¸ |
| | | - 259ãç±ä¹ä¼ï¼äºæå¹³å°ï¼ |
| | | - 260ãç«ç¼çµå½±ï¼ç§æåé¨ç½²ï¼ãç«ç¼çµå½±ã |
| | | - 261ãç¾å¢å¤§è±¡ï¼ç§æåé¨ç½²ï¼ãç¾å¢å¤§è±¡ã |
| | | - 262ãä½ä¸å¸®æè²ç§æï¼åäº¬ï¼æéå
¬å¸ãä½ä¸å¸®ã |
| | | - 263ãå京å°å¹´ç³äºèç½ææ¯æéå
¬å¸ |
| | | - 264ãå±±ä¸ç©éµè½¯ä»¶å·¥ç¨è¡ä»½æéå
¬å¸ |
| | | - 265ãé西å½é©¿è½¯ä»¶ç§ææéå
¬å¸ |
| | | - 266ãåå¼ä¿¡æ¯ç§æ |
| | | - 267ãæé¸ç½ç»ç§ææé责任å
¬å¸ |
| | | - 268ãäºåå½é
ä¿¡ææéå
¬å¸ |
| | | - 269ãéæºæè² |
| | | - 270ãç æµ·å¸çå·¢ç§ææéå
¬å¸ |
| | | - 271ã䏿µ·ç¾è软件è¡ä»½æéå
¬å¸ |
| | | - 272ãæ·±å³å¸ç§ç¾ç§ææéå
¬å¸ |
| | | - 273ãåå°åºè¡ãåå°ã |
| | | - 274ãéèå
»è½¦ãéèã |
| | | - 275ã塿伿´¾äººåèµæºéå¢ |
| | | - 276ãå京è§ä¸ºæºæ
§è½¯ä»¶ç§ææéå
¬å¸ |
| | | - 277ãæå·åå¸å¤§èç§ææéå
¬å¸ |
| | | - 278ãç¿è¾
导ãç¿è¾
导ã |
| | | - 279ãæ´é³å¥åç½ç»ç§ææéå
¬å¸ |
| | | - 280ãéåè³æµ |
| | | - 281ã亿é³ä¿¡é |
| | | - 282ã䏿µ·æé²¤ç§ææéå
¬å¸ |
| | | - 283ãåå·åæ
æ å¿§ç§ææå¡æéå
¬å¸ |
| | | - 284ãUUè·è
¿ |
| | | - 285ãå京èèè¯å¸ãèèè¯å¸ã |
| | | - 286ãæ æ´»çå§ï¼å京ï¼ç½ç»ç§ææéå
¬å¸ |
| | | - 287ãF5æªæ¥ååº |
| | | - 288ãæ·±å³ç¯é³éä¿¡æ¯ææ¯æéå
¬å¸ |
| | | - 289ãé å³é»ä¿¡ |
| | | - â¦â¦ |
| | | |
| | | > æ´å¤æ¥å
¥çå
¬å¸ï¼æ¬¢è¿å¨ [ç»è®°å°å](https://github.com/xuxueli/xxl-job/issues/1 ) ç»è®°ï¼ç»è®°ä»
ä»
为äºäº§åæ¨å¹¿ã |
| | | |
| | | 欢è¿å¤§å®¶çå
³æ³¨å使ç¨ï¼XXL-JOBä¹å°æ¥æ±ååï¼æç»åå±ã |
| | | |
| | | |
| | | ### 1.5 ä¸è½½ |
| | | |
| | | #### ææ¡£å°å |
| | | |
| | | - [ä¸æææ¡£](https://www.xuxueli.com/xxl-job/) |
| | | - [English Documentation](https://www.xuxueli.com/xxl-job/en/) |
| | | |
| | | #### æºç ä»åºå°å |
| | | |
| | | æºç ä»åºå°å | Release Download |
| | | --- | --- |
| | | [https://github.com/xuxueli/xxl-job](https://github.com/xuxueli/xxl-job) | [Download](https://github.com/xuxueli/xxl-job/releases) |
| | | [http://gitee.com/xuxueli0323/xxl-job](http://gitee.com/xuxueli0323/xxl-job) | [Download](http://gitee.com/xuxueli0323/xxl-job/releases) |
| | | |
| | | |
| | | #### ä¸å¤®ä»åºå°å |
| | | |
| | | ``` |
| | | <!-- http://repo1.maven.org/maven2/com/xuxueli/xxl-job-core/ --> |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>${ææ°ç¨³å®çæ¬}</version> |
| | | </dependency> |
| | | ``` |
| | | |
| | | |
| | | ### 1.6 ç¯å¢ |
| | | - Maven3+ |
| | | - Jdk1.7+ |
| | | - Mysql5.7+ |
| | | |
| | | |
| | | ## äºãå¿«éå
¥é¨ |
| | | |
| | | ### 2.1 åå§åâè°åº¦æ°æ®åºâ |
| | | 请ä¸è½½é¡¹ç®æºç å¹¶è§£åï¼è·å "è°åº¦æ°æ®åºåå§åSQLèæ¬" å¹¶æ§è¡å³å¯ã |
| | | |
| | | "è°åº¦æ°æ®åºåå§åSQLèæ¬" ä½ç½®ä¸º: |
| | | |
| | | /xxl-job/doc/db/tables_xxl_job.sql |
| | | |
| | | è°åº¦ä¸å¿æ¯æé群é¨ç½²ï¼é群æ
åµä¸åèç¹å¡å¿
è¿æ¥åä¸ä¸ªmysqlå®ä¾; |
| | | |
| | | 妿mysqlå主ä»,è°åº¦ä¸å¿é群èç¹å¡å¿
强å¶èµ°ä¸»åº; |
| | | |
| | | ### 2.2 ç¼è¯æºç |
| | | è§£åæºç ,æç
§mavenæ ¼å¼å°æºç 导å
¥IDE, 使ç¨mavenè¿è¡ç¼è¯å³å¯ï¼æºç ç»æå¦ä¸ï¼ |
| | | |
| | | xxl-job-adminï¼è°åº¦ä¸å¿ |
| | | xxl-job-coreï¼å
Œ
±ä¾èµ |
| | | xxl-job-executor-samplesï¼æ§è¡å¨Sample示ä¾ï¼éæ©åéççæ¬æ§è¡å¨ï¼å¯ç´æ¥ä½¿ç¨ï¼ä¹å¯ä»¥åèå
¶å¹¶å°ç°æé¡¹ç®æ¹é ææ§è¡å¨ï¼ |
| | | ï¼xxl-job-executor-sample-springbootï¼Springbootçæ¬ï¼éè¿Springbootç®¡çæ§è¡å¨ï¼æ¨èè¿ç§æ¹å¼ï¼ |
| | | ï¼xxl-job-executor-sample-springï¼Springçæ¬ï¼éè¿Spring容å¨ç®¡çæ§è¡å¨ï¼æ¯è¾éç¨ï¼ |
| | | ï¼xxl-job-executor-sample-framelessï¼æ æ¡æ¶çæ¬ï¼ |
| | | ï¼xxl-job-executor-sample-jfinalï¼JFinalçæ¬ï¼éè¿JFinalç®¡çæ§è¡å¨ï¼ |
| | | ï¼xxl-job-executor-sample-nutzï¼Nutzçæ¬ï¼éè¿Nutzç®¡çæ§è¡å¨ï¼ |
| | | ï¼xxl-job-executor-sample-jbootï¼jbootçæ¬ï¼éè¿jbootç®¡çæ§è¡å¨ï¼ |
| | | |
| | | |
| | | ### 2.3 é
ç½®é¨ç½²âè°åº¦ä¸å¿â |
| | | |
| | | è°åº¦ä¸å¿é¡¹ç®ï¼xxl-job-admin |
| | | ä½ç¨ï¼ç»ä¸ç®¡çä»»å¡è°åº¦å¹³å°ä¸è°åº¦ä»»å¡ï¼è´è´£è§¦åè°åº¦æ§è¡ï¼å¹¶ä¸æä¾ä»»å¡ç®¡çå¹³å°ã |
| | | |
| | | #### æ¥éª¤ä¸ï¼è°åº¦ä¸å¿é
ç½®ï¼ |
| | | è°åº¦ä¸å¿é
ç½®æä»¶å°åï¼ |
| | | |
| | | /xxl-job/xxl-job-admin/src/main/resources/application.properties |
| | | |
| | | |
| | | è°åº¦ä¸å¿é
ç½®å
容说æï¼ |
| | | |
| | | ### è°åº¦ä¸å¿JDBC龿¥ï¼é¾æ¥å°åè¯·ä¿æå 2.1ç« è æå建çè°åº¦æ°æ®åºçå°åä¸è´ |
| | | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?Unicode=true&characterEncoding=UTF-8 |
| | | spring.datasource.username=root |
| | | spring.datasource.password=root_pwd |
| | | spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
| | | |
| | | ### æ¥è¦é®ç®± |
| | | spring.mail.host=smtp.qq.com |
| | | spring.mail.port=25 |
| | | spring.mail.username=xxx@qq.com |
| | | spring.mail.password=xxx |
| | | spring.mail.properties.mail.smtp.auth=true |
| | | spring.mail.properties.mail.smtp.starttls.enable=true |
| | | spring.mail.properties.mail.smtp.starttls.required=true |
| | | spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory |
| | | |
| | | ### è°åº¦ä¸å¿é讯TOKEN [éå¡«]ï¼é空æ¶å¯ç¨ï¼ |
| | | xxl.job.accessToken= |
| | | |
| | | ### è°åº¦ä¸å¿å½é
åé
ç½® [éå¡«]ï¼ é»è®¤ä¸ºç©ºï¼è¡¨ç¤ºä¸æ; "en" è¡¨ç¤ºè±æï¼ |
| | | xxl.job.i18n= |
| | | |
| | | ## è°åº¦çº¿ç¨æ± æå¤§çº¿ç¨é
ç½®ãå¿
å¡«ã |
| | | xxl.job.triggerpool.fast.max=200 |
| | | xxl.job.triggerpool.slow.max=100 |
| | | |
| | | ### è°åº¦ä¸å¿æ¥å¿è¡¨æ°æ®ä¿åå¤©æ° [å¿
å¡«]ï¼è¿ææ¥å¿èªå¨æ¸
çï¼éå¶å¤§äºçäº7æ¶çæï¼å¦å, å¦-1ï¼å
³éèªå¨æ¸
çåè½ï¼ |
| | | xxl.job.logretentiondays=30 |
| | | |
| | | |
| | | |
| | | #### æ¥éª¤äºï¼é¨ç½²é¡¹ç®ï¼ |
| | | å¦æå·²ç»æ£ç¡®è¿è¡ä¸è¿°é
ç½®ï¼å¯å°é¡¹ç®ç¼è¯æå
é¨ç½²ã |
| | | |
| | | è°åº¦ä¸å¿è®¿é®å°åï¼http://localhost:8080/xxl-job-admin (该å°åæ§è¡å¨å°ä¼ä½¿ç¨å°ï¼ä½ä¸ºåè°å°å) |
| | | |
| | | é»è®¤ç»å½è´¦å· "admin/123456", ç»å½åè¿è¡çé¢å¦ä¸å¾æç¤ºã |
| | | |
| | |  |
| | | |
| | | è³æ¤âè°åº¦ä¸å¿â项ç®å·²ç»é¨ç½²æåã |
| | | |
| | | #### æ¥éª¤ä¸ï¼è°åº¦ä¸å¿é群ï¼å¯éï¼ï¼ |
| | | è°åº¦ä¸å¿æ¯æé群é¨ç½²ï¼æåè°åº¦ç³»ç»å®¹ç¾åå¯ç¨æ§ã |
| | | |
| | | è°åº¦ä¸å¿é群é¨ç½²æ¶ï¼å ç¹è¦æ±åå»ºè®®ï¼ |
| | | - DBé
ç½®ä¿æä¸è´ï¼ |
| | | - é群æºå¨æ¶éä¿æä¸è´ï¼åæºé群忽è§ï¼ï¼ |
| | | - å»ºè®®ï¼æ¨èéè¿nginx为è°åº¦ä¸å¿é群åè´è½½åè¡¡ï¼åé
ååãè°åº¦ä¸å¿è®¿é®ãæ§è¡å¨åè°é
ç½®ãè°ç¨APIæå¡çæä½åéè¿è¯¥ååè¿è¡ã |
| | | |
| | | |
| | | #### å
¶ä»ï¼Docker éåæ¹å¼æå»ºè°åº¦ä¸å¿ï¼ |
| | | |
| | | - ä¸è½½éå |
| | | |
| | | ``` |
| | | // Dockerå°åï¼https://hub.docker.com/r/xuxueli/xxl-job-admin/ (建议æå®çæ¬å·) |
| | | docker pull xuxueli/xxl-job-admin |
| | | ``` |
| | | |
| | | - å建容å¨å¹¶è¿è¡ |
| | | |
| | | ``` |
| | | docker run -p 8080:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin |
| | | |
| | | /** |
| | | * å¦éèªå®ä¹ mysql çé
ç½®ï¼å¯éè¿ "PARAMS" æå®ï¼åæ°æ ¼å¼ RAMS="--key=value --key2=value2" ï¼ |
| | | * é
置项åèæä»¶ï¼/xxl-job/xxl-job-admin/src/main/Autowireds/application.properties |
| | | */ |
| | | docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?Unicode=true&characterEncoding=UTF-8" -p 8080:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin |
| | | ``` |
| | | |
| | | |
| | | ### 2.4 é
ç½®é¨ç½²âæ§è¡å¨é¡¹ç®â |
| | | |
| | | âæ§è¡å¨â项ç®ï¼xxl-job-executor-sample-springboot (æä¾å¤ç§çæ¬æ§è¡å¨ä¾éæ©ï¼ç°ä»¥ springboot çæ¬ä¸ºä¾ï¼å¯ç´æ¥ä½¿ç¨ï¼ä¹å¯ä»¥åèå
¶å¹¶å°ç°æé¡¹ç®æ¹é ææ§è¡å¨) |
| | | ä½ç¨ï¼è´è´£æ¥æ¶âè°åº¦ä¸å¿âçè°åº¦å¹¶æ§è¡ï¼å¯ç´æ¥é¨ç½²æ§è¡å¨ï¼ä¹å¯ä»¥å°æ§è¡å¨éæå°ç°æä¸å¡é¡¹ç®ä¸ã |
| | | |
| | | #### æ¥éª¤ä¸ï¼mavenä¾èµ |
| | | 确认pomæä»¶ä¸å¼å
¥äº "xxl-job-core" çmavenä¾èµï¼ |
| | | |
| | | #### æ¥éª¤äºï¼æ§è¡å¨é
ç½® |
| | | æ§è¡å¨é
ç½®ï¼é
ç½®æä»¶å°åï¼ |
| | | |
| | | /xxl-job/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/Autowireds/application.properties |
| | | |
| | | æ§è¡å¨é
ç½®ï¼é
ç½®å
容说æï¼ |
| | | |
| | | ### è°åº¦ä¸å¿é¨ç½²è·å°å [éå¡«]ï¼å¦è°åº¦ä¸å¿é群é¨ç½²åå¨å¤ä¸ªå°ååç¨éå·åéãæ§è¡å¨å°ä¼ä½¿ç¨è¯¥å°åè¿è¡"æ§è¡å¨å¿è·³æ³¨å"å"ä»»å¡ç»æåè°"ï¼ä¸ºç©ºåå
³éèªå¨æ³¨åï¼ |
| | | xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin |
| | | |
| | | ### æ§è¡å¨AppName [éå¡«]ï¼æ§è¡å¨å¿è·³æ³¨ååç»ä¾æ®ï¼ä¸ºç©ºåå
³éèªå¨æ³¨å |
| | | xxl.job.executor.appname=xxl-job-executor-sample |
| | | |
| | | ### æ§è¡å¨IP [éå¡«]ï¼é»è®¤ä¸ºç©ºè¡¨ç¤ºèªå¨è·åIPï¼å¤ç½å¡æ¶å¯æå¨è®¾ç½®æå®IPï¼è¯¥IPä¸ä¼ç»å®Hostä»
ä½ä¸ºé讯å®ç¨ï¼å°åä¿¡æ¯ç¨äº "æ§è¡å¨æ³¨å" å "è°åº¦ä¸å¿è¯·æ±å¹¶è§¦åä»»å¡"ï¼ |
| | | xxl.job.executor.ip= |
| | | |
| | | ### æ§è¡å¨ç«¯å£å· [éå¡«]ï¼å°äºçäº0åèªå¨è·åï¼é»è®¤ç«¯å£ä¸º9999ï¼åæºé¨ç½²å¤ä¸ªæ§è¡å¨æ¶ï¼æ³¨æè¦é
ç½®ä¸åæ§è¡å¨ç«¯å£ï¼ |
| | | xxl.job.executor.port=9999 |
| | | |
| | | ### æ§è¡å¨é讯TOKEN [éå¡«]ï¼é空æ¶å¯ç¨ï¼ |
| | | xxl.job.accessToken= |
| | | |
| | | ### æ§è¡å¨è¿è¡æ¥å¿æä»¶åå¨ç£çè·¯å¾ [éå¡«] ï¼éè¦å¯¹è¯¥è·¯å¾æ¥æè¯»åæéï¼ä¸ºç©ºå使ç¨é»è®¤è·¯å¾ï¼ |
| | | xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler |
| | | |
| | | ### æ§è¡å¨æ¥å¿æä»¶ä¿åå¤©æ° [éå¡«] ï¼ è¿ææ¥å¿èªå¨æ¸
ç, éå¶å¼å¤§äºçäº3æ¶çæ; å¦å, å¦-1, å
³éèªå¨æ¸
çåè½ï¼ |
| | | xxl.job.executor.logretentiondays=30 |
| | | |
| | | |
| | | #### æ¥éª¤ä¸ï¼æ§è¡å¨ç»ä»¶é
ç½® |
| | | |
| | | æ§è¡å¨ç»ä»¶ï¼é
ç½®æä»¶å°åï¼ |
| | | |
| | | /xxl-job/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/core/config/XxlJobConfig.java |
| | | |
| | | æ§è¡å¨ç»ä»¶ï¼é
ç½®å
容说æï¼ |
| | | |
| | | ``` |
| | | @Bean |
| | | public XxlJobSpringExecutor xxlJobExecutor() { |
| | | logger.info(">>>>>>>>>>> xxl-job config init."); |
| | | XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); |
| | | xxlJobSpringExecutor.setAdminAddresses(adminAddresses); |
| | | xxlJobSpringExecutor.setAppName(appName); |
| | | xxlJobSpringExecutor.setIp(ip); |
| | | xxlJobSpringExecutor.setPort(port); |
| | | xxlJobSpringExecutor.setAccessToken(accessToken); |
| | | xxlJobSpringExecutor.setLogPath(logPath); |
| | | xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); |
| | | |
| | | return xxlJobSpringExecutor; |
| | | } |
| | | ``` |
| | | |
| | | #### æ¥éª¤åï¼é¨ç½²æ§è¡å¨é¡¹ç®ï¼ |
| | | å¦æå·²ç»æ£ç¡®è¿è¡ä¸è¿°é
ç½®ï¼å¯å°æ§è¡å¨é¡¹ç®ç¼è¯æé¨ç½²ï¼ç³»ç»æä¾å¤ç§æ§è¡å¨Sample示ä¾é¡¹ç®ï¼éæ©å
¶ä¸ä¸ä¸ªå³å¯ï¼åèªçé¨ç½²æ¹å¼å¦ä¸ã |
| | | |
| | | xxl-job-executor-sample-springbootï¼é¡¹ç®ç¼è¯æå
æspringbootç±»åç坿§è¡JARå
ï¼å½ä»¤å¯å¨å³å¯ï¼ |
| | | xxl-job-executor-sample-springï¼é¡¹ç®ç¼è¯æå
æWARå
ï¼å¹¶é¨ç½²å°tomcatä¸ã |
| | | xxl-job-executor-sample-jfinalï¼åä¸ |
| | | xxl-job-executor-sample-nutzï¼åä¸ |
| | | xxl-job-executor-sample-jbootï¼åä¸ |
| | | |
| | | |
| | | è³æ¤âæ§è¡å¨â项ç®å·²ç»é¨ç½²ç»æã |
| | | |
| | | #### æ¥éª¤äºï¼æ§è¡å¨é群ï¼å¯éï¼ï¼ |
| | | æ§è¡å¨æ¯æé群é¨ç½²ï¼æåè°åº¦ç³»ç»å¯ç¨æ§ï¼åæ¶æåä»»å¡å¤çè½åã |
| | | |
| | | æ§è¡å¨é群é¨ç½²æ¶ï¼å ç¹è¦æ±åå»ºè®®ï¼ |
| | | - æ§è¡å¨åè°å°åï¼xxl.job.admin.addressesï¼éè¦ä¿æä¸è´ï¼æ§è¡å¨æ ¹æ®è¯¥é
ç½®è¿è¡æ§è¡å¨èªå¨æ³¨åçæä½ã |
| | | - åä¸ä¸ªæ§è¡å¨é群å
AppNameï¼xxl.job.executor.appnameï¼éè¦ä¿æä¸è´ï¼è°åº¦ä¸å¿æ ¹æ®è¯¥é
ç½®å¨æåç°ä¸åé群çå¨çº¿æ§è¡å¨å表ã |
| | | |
| | | |
| | | ### 2.5 å¼å第ä¸ä¸ªä»»å¡âHello Worldâ |
| | | æ¬ç¤ºä¾ä»¥æ°å»ºä¸ä¸ª âGLUE模å¼(Java)â è¿è¡æ¨¡å¼çä»»å¡ä¸ºä¾ãæ´å¤æå
³ä»»å¡ç详ç»é
ç½®ï¼è¯·æ¥çâç« èä¸ï¼ä»»å¡è¯¦è§£âã |
| | | ï¼ âGLUE模å¼(Java)âçæ§è¡ä»£ç æç®¡å°è°åº¦ä¸å¿å¨çº¿ç»´æ¤ï¼ç¸æ¯âBean模å¼ä»»å¡âéè¦å¨æ§è¡å¨é¡¹ç®å¼åé¨ç½²ä¸çº¿ï¼æ´å ç®ä¾¿è½»éï¼ |
| | | |
| | | > åæï¼è¯·ç¡®è®¤âè°åº¦ä¸å¿âåâæ§è¡å¨â项ç®å·²ç»æåé¨ç½²å¹¶å¯å¨ï¼ |
| | | |
| | | #### æ¥éª¤ä¸ï¼æ°å»ºä»»å¡ï¼ |
| | | ç»å½è°åº¦ä¸å¿ï¼ç¹å»ä¸å¾æç¤ºâæ°å»ºä»»å¡âæé®ï¼æ°å»ºç¤ºä¾ä»»å¡ãç¶åï¼åèä¸é¢æªå¾ä¸ä»»å¡çåæ°é
ç½®ï¼ç¹å»ä¿åã |
| | | |
| | |  |
| | | |
| | |  |
| | | |
| | | |
| | | #### æ¥éª¤äºï¼âGLUE模å¼(Java)â ä»»å¡å¼åï¼ |
| | | 请ç¹å»ä»»å¡å³ä¾§ âGLUEâ æé®ï¼è¿å
¥ âGLUEç¼è¾å¨å¼åçé¢â ï¼è§ä¸å¾ãâGLUE模å¼(Java)â è¿è¡æ¨¡å¼çä»»å¡é»è®¤å·²ç»åå§åäºç¤ºä¾ä»»å¡ä»£ç ï¼å³æå°Hello Worldã |
| | | ï¼ âGLUE模å¼(Java)â è¿è¡æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µç»§æ¿èªIJobHandlerçJava类代ç ï¼å®å¨æ§è¡å¨é¡¹ç®ä¸è¿è¡ï¼å¯ä½¿ç¨@Autowired/@Autowire注å
¥æ§è¡å¨éä¸çå
¶ä»æå¡ï¼è¯¦ç»ä»ç»è¯·æ¥ç第ä¸ç« èï¼ |
| | | |
| | |  |
| | | |
| | |  |
| | | |
| | | #### æ¥éª¤ä¸ï¼è§¦åæ§è¡ï¼ |
| | | 请ç¹å»ä»»å¡å³ä¾§ âæ§è¡â æé®ï¼å¯æå¨è§¦å䏿¬¡ä»»å¡æ§è¡ï¼é常æ
åµä¸ï¼éè¿é
ç½®Cron表达å¼è¿è¡ä»»å¡è°åº¦åºåï¼ã |
| | | |
| | | #### æ¥éª¤åï¼æ¥çæ¥å¿ï¼ |
| | | 请ç¹å»ä»»å¡å³ä¾§ âæ¥å¿â æé®ï¼å¯åå¾ä»»å¡æ¥å¿ç颿¥ç任塿¥å¿ã |
| | | å¨ä»»å¡æ¥å¿çé¢ä¸ï¼å¯æ¥ç该任å¡çåå²è°åº¦è®°å½ä»¥åæ¯ä¸æ¬¡è°åº¦çä»»å¡è°åº¦ä¿¡æ¯ãæ§è¡åæ°åæ§è¡ä¿¡æ¯ãè¿è¡ä¸çä»»å¡ç¹å»å³ä¾§çâæ§è¡æ¥å¿âæé®ï¼å¯è¿å
¥æ¥å¿æ§å¶å°æ¥ç宿¶æ§è¡æ¥å¿ã |
| | | |
| | |  |
| | | |
| | | 卿¥å¿æ§å¶å°ï¼å¯ä»¥Rollingæ¹å¼å®æ¶æ¥çä»»å¡å¨æ§è¡å¨ä¸ä¾§è¿è¡è¾åºçæ¥å¿ä¿¡æ¯ï¼å®æ¶çæ§ä»»å¡è¿åº¦ï¼ |
| | | |
| | |  |
| | | |
| | | ## ä¸ãä»»å¡è¯¦è§£ |
| | | |
| | | ### é
ç½®å±æ§è¯¦ç»è¯´æï¼ |
| | | |
| | | - æ§è¡å¨ï¼ä»»å¡çç»å®çæ§è¡å¨ï¼ä»»å¡è§¦åè°åº¦æ¶å°ä¼èªå¨åç°æ³¨åæåçæ§è¡å¨, å®ç°ä»»å¡èªå¨åç°åè½; å¦ä¸æ¹é¢ä¹å¯ä»¥æ¹ä¾¿çè¿è¡ä»»å¡åç»ãæ¯ä¸ªä»»å¡å¿
é¡»ç»å®ä¸ä¸ªæ§è¡å¨, å¯å¨ "æ§è¡å¨ç®¡ç" è¿è¡è®¾ç½®; |
| | | - ä»»å¡æè¿°ï¼ä»»å¡çæè¿°ä¿¡æ¯ï¼ä¾¿äºä»»å¡ç®¡çï¼ |
| | | - è·¯ç±çç¥ï¼å½æ§è¡å¨é群é¨ç½²æ¶ï¼æä¾ä¸°å¯çè·¯ç±çç¥ï¼å
æ¬ï¼ |
| | | FIRSTï¼ç¬¬ä¸ä¸ªï¼ï¼åºå®éæ©ç¬¬ä¸ä¸ªæºå¨ï¼ |
| | | LASTï¼æåä¸ä¸ªï¼ï¼åºå®éæ©æåä¸ä¸ªæºå¨ï¼ |
| | | ROUNDï¼è½®è¯¢ï¼ï¼ï¼ |
| | | RANDOMï¼éæºï¼ï¼éæºéæ©å¨çº¿çæºå¨ï¼ |
| | | CONSISTENT_HASHï¼ä¸è´æ§HASHï¼ï¼æ¯ä¸ªä»»å¡æç
§Hashç®æ³åºå®éæ©æä¸å°æºå¨ï¼ä¸ææä»»å¡å忣åå¨ä¸åæºå¨ä¸ã |
| | | LEAST_FREQUENTLY_USEDï¼æä¸ç»å¸¸ä½¿ç¨ï¼ï¼ä½¿ç¨é¢çæä½çæºå¨ä¼å
被éä¸¾ï¼ |
| | | LEAST_RECENTLY_USEDï¼æè¿æä¹
æªä½¿ç¨ï¼ï¼æä¹
为使ç¨çæºå¨ä¼å
被éä¸¾ï¼ |
| | | FAILOVERï¼æ
é转移ï¼ï¼æç
§é¡ºåºä¾æ¬¡è¿è¡å¿è·³æ£æµï¼ç¬¬ä¸ä¸ªå¿è·³æ£æµæåçæºå¨éå®ä¸ºç®æ æ§è¡å¨å¹¶åèµ·è°åº¦ï¼ |
| | | BUSYOVERï¼å¿ç¢è½¬ç§»ï¼ï¼æç
§é¡ºåºä¾æ¬¡è¿è¡ç©ºé²æ£æµï¼ç¬¬ä¸ä¸ªç©ºé²æ£æµæåçæºå¨éå®ä¸ºç®æ æ§è¡å¨å¹¶åèµ·è°åº¦ï¼ |
| | | SHARDING_BROADCAST(åç广æ)ï¼å¹¿æè§¦å对åºéç¾¤ä¸æææºå¨æ§è¡ä¸æ¬¡ä»»å¡ï¼åæ¶ç³»ç»èªå¨ä¼ éåçåæ°ï¼å¯æ ¹æ®åçåæ°å¼ååçä»»å¡ï¼ |
| | | |
| | | - Cronï¼è§¦å任塿§è¡çCron表达å¼ï¼ |
| | | - è¿è¡æ¨¡å¼ï¼ |
| | | BEAN模å¼ï¼ä»»å¡ä»¥JobHandleræ¹å¼ç»´æ¤å¨æ§è¡å¨ç«¯ï¼éè¦ç»å "JobHandler" 屿§å¹é
æ§è¡å¨ä¸ä»»å¡ï¼ |
| | | GLUE模å¼(Java)ï¼ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼è¯¥æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µç»§æ¿èªIJobHandlerçJava类代ç å¹¶ "groovy" æºç æ¹å¼ç»´æ¤ï¼å®å¨æ§è¡å¨é¡¹ç®ä¸è¿è¡ï¼å¯ä½¿ç¨@Autowired/@Autowire注å
¥æ§è¡å¨éä¸çå
¶ä»æå¡ï¼ |
| | | GLUE模å¼(Shell)ï¼ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼è¯¥æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µ "shell" èæ¬ï¼ |
| | | GLUE模å¼(Python)ï¼ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼è¯¥æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µ "python" èæ¬ï¼ |
| | | GLUE模å¼(PHP)ï¼ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼è¯¥æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µ "php" èæ¬ï¼ |
| | | GLUE模å¼(NodeJS)ï¼ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼è¯¥æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µ "nodejs" èæ¬ï¼ |
| | | GLUE模å¼(PowerShell)ï¼ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼è¯¥æ¨¡å¼çä»»å¡å®é
䏿¯ä¸æ®µ "PowerShell" èæ¬ï¼ |
| | | - JobHandlerï¼è¿è¡æ¨¡å¼ä¸º "BEAN模å¼" æ¶çæï¼å¯¹åºæ§è¡å¨ä¸æ°å¼åçJobHandlerç±»â@JobHandlerâæ³¨è§£èªå®ä¹çvalueå¼ï¼ |
| | | - é»å¡å¤ççç¥ï¼è°åº¦è¿äºå¯éæ§è¡å¨æ¥ä¸åå¤çæ¶çå¤ççç¥ï¼ |
| | | åæºä¸²è¡ï¼é»è®¤ï¼ï¼è°åº¦è¯·æ±è¿å
¥åæºæ§è¡å¨åï¼è°åº¦è¯·æ±è¿å
¥FIFOéåå¹¶ä»¥ä¸²è¡æ¹å¼è¿è¡ï¼ |
| | | 丢å¼åç»è°åº¦ï¼è°åº¦è¯·æ±è¿å
¥åæºæ§è¡å¨åï¼åç°æ§è¡å¨åå¨è¿è¡çè°åº¦ä»»å¡ï¼æ¬æ¬¡è¯·æ±å°ä¼è¢«ä¸¢å¼å¹¶æ è®°ä¸ºå¤±è´¥ï¼ |
| | | è¦çä¹åè°åº¦ï¼è°åº¦è¯·æ±è¿å
¥åæºæ§è¡å¨åï¼åç°æ§è¡å¨åå¨è¿è¡çè°åº¦ä»»å¡ï¼å°ä¼ç»æ¢è¿è¡ä¸çè°åº¦ä»»å¡å¹¶æ¸
空éåï¼ç¶åè¿è¡æ¬å°è°åº¦ä»»å¡ï¼ |
| | | - åä»»å¡ï¼æ¯ä¸ªä»»å¡é½æ¥æä¸ä¸ªå¯ä¸çä»»å¡ID(ä»»å¡IDå¯ä»¥ä»ä»»å¡å表è·å)ï¼å½æ¬ä»»å¡æ§è¡ç»æå¹¶ä¸æ§è¡æåæ¶ï¼å°ä¼è§¦ååä»»å¡IDæå¯¹åºçä»»å¡ç䏿¬¡ä¸»å¨è°åº¦ã |
| | | - ä»»å¡è¶
æ¶æ¶é´ï¼æ¯æèªå®ä¹ä»»å¡è¶
æ¶æ¶é´ï¼ä»»å¡è¿è¡è¶
æ¶å°ä¼ä¸»å¨ä¸æä»»å¡ï¼ |
| | | - 失败éè¯æ¬¡æ°ï¼æ¯æèªå®ä¹ä»»å¡å¤±è´¥éè¯æ¬¡æ°ï¼å½ä»»å¡å¤±è´¥æ¶å°ä¼æç
§é¢è®¾ç失败éè¯æ¬¡æ°ä¸»å¨è¿è¡éè¯ï¼ |
| | | - æ¥è¦é®ä»¶ï¼ä»»å¡è°åº¦å¤±è´¥æ¶é®ä»¶éç¥çé®ç®±å°åï¼æ¯æé
ç½®å¤é®ç®±å°åï¼é
ç½®å¤ä¸ªé®ç®±å°åæ¶ç¨éå·åéï¼ |
| | | - è´è´£äººï¼ä»»å¡çè´è´£äººï¼ |
| | | - æ§è¡åæ°ï¼ä»»å¡æ§è¡æéçåæ°ï¼ |
| | | |
| | | |
| | | ### 3.1 BEAN模å¼ï¼ç±»å½¢å¼ï¼ |
| | | |
| | | åºäºç±»çBean模å¼å¼åæ¹å¼ï¼è¿æ¯æ¯è¾åå§çä¸ç§å¼åæ¹å¼ã |
| | | |
| | | - ä¼ç¹ï¼å
¼å®¹æ§å¥½ãä¸éå¶é¡¹ç®ç¯å¢ï¼å³ä½¿æ¯æ æ¡æ¶é¡¹ç®ï¼å¦mainæ¹æ³ç´æ¥å¯å¨ç项ç®ä¹å¯ä»¥æä¾æ¯æï¼å¯ä»¥åè示ä¾é¡¹ç® "xxl-job-executor-sample-frameless"ï¼ |
| | | - 缺ç¹ï¼æ¯ä¸ªä»»å¡éè¦å ç¨ä¸ä¸ªJavaç±»ï¼æ¯è¾æµªè´¹èµæºï¼èä¸ï¼ä¸æ¯æèªå¨æ«æä»»å¡æ³¨å
¥å°æ§è¡å¨å®¹å¨ï¼éè¦æå¨æ³¨å
¥ã |
| | | |
| | | #### æ¥éª¤ä¸ï¼æ§è¡å¨é¡¹ç®ä¸ï¼å¼åJobç±»ï¼ |
| | | |
| | | - 1ãå¼åä¸ä¸ªç»§æ¿èª"com.xxl.job.core.handler.IJobHandler"çJobHandlerç±»ã |
| | | - 2ãæå¨éè¿å¦ä¸æ¹å¼æ³¨å
¥å°æ§è¡å¨å®¹å¨ã |
| | | ``` |
| | | XxlJobExecutor.registJobHandler("demoJobHandler", new DemoJobHandler()); |
| | | ``` |
| | | |
| | | #### æ¥éª¤äºï¼è°åº¦ä¸å¿ï¼æ°å»ºè°åº¦ä»»å¡ |
| | | åç»æ¥éª¤å "3.2 BEAN模å¼ï¼æ¹æ³å½¢å¼ï¼"ä¸è´ï¼å¯ä»¥åå¾åèã |
| | | |
| | | |
| | | ### 3.2 BEAN模å¼ï¼æ¹æ³å½¢å¼ï¼ |
| | | |
| | | åºäºæ¹æ³çBean模å¼å¼åæ¹å¼ï¼è¿æ¯æ¯è¾æ¨èçå¼åæ¹å¼ã |
| | | |
| | | - ä¼ç¹ï¼æ¯ä¸ªä»»å¡åªéè¦å¼åä¸ä¸ªæ¹æ³ï¼æ·»å "@XxlJob"注解å³å¯ãæ´å æ¹ä¾¿ãå¿«éãä¼èªå¨æ«æä»»å¡æ³¨å
¥å°æ§è¡å¨å®¹å¨ã |
| | | - 缺ç¹ï¼è¦æ±Spring容å¨ç¯å¢ï¼ |
| | | |
| | | >åºäºæ¹æ³å¼åçä»»å¡ï¼åºå±ä¼çæJobHandler代çï¼ååºäºç±»çæ¹å¼ä¸æ ·ï¼ä»»å¡ä¹ä¼ä»¥JobHandlerçå½¢å¼åå¨äºæ§è¡å¨ä»»å¡å®¹å¨ä¸ã |
| | | |
| | | #### æ¥éª¤ä¸ï¼æ§è¡å¨é¡¹ç®ä¸ï¼å¼åJobæ¹æ³ï¼ |
| | | |
| | | - 1ãå¨Spring Beanå®ä¾ä¸ï¼å¼åJobæ¹æ³ï¼æ¹å¼æ ¼å¼è¦æ±ä¸º "public ReturnT<String> execute(String param)" |
| | | - 2ã为Jobæ¹æ³æ·»å 注解 "@XxlJob(value="èªå®ä¹jobhandleråç§°", init = "JobHandleråå§åæ¹æ³", destroy = "JobHandleréæ¯æ¹æ³")"ï¼æ³¨è§£valueå¼å¯¹åºçæ¯è°åº¦ä¸å¿æ°å»ºä»»å¡çJobHandler屿§çå¼ã |
| | | - 3ãæ§è¡æ¥å¿ï¼éè¦éè¿ "XxlJobLogger.log" æå°æ§è¡æ¥å¿ï¼ |
| | | |
| | | ``` |
| | | // å¯åèSampleç¤ºä¾æ§è¡å¨ä¸ç "com.xxl.job.executor.service.jobhandler.SampleXxlJob" ï¼å¦ä¸ï¼ |
| | | @XxlJob("demoJobHandler") |
| | | public ReturnT<String> execute(String param) { |
| | | |
| | | XxlJobLogger.log("hello world."); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | ``` |
| | | |
| | | #### æ¥éª¤äºï¼è°åº¦ä¸å¿ï¼æ°å»ºè°åº¦ä»»å¡ |
| | | åè䏿âé
ç½®å±æ§è¯¦ç»è¯´æâ对æ°å»ºçä»»å¡è¿è¡åæ°é
ç½®ï¼è¿è¡æ¨¡å¼éä¸ "BEAN模å¼"ï¼JobHandler屿§å¡«å任塿³¨è§£â@XxlJobâä¸å®ä¹çå¼ï¼ |
| | | |
| | |  |
| | | |
| | | #### åçå
ç½®Bean模å¼ä»»å¡ |
| | | 为æ¹ä¾¿ç¨æ·åèä¸å¿«éå®ç¨ï¼ç¤ºä¾æ§è¡å¨å
åçæä¾å¤ä¸ªBean模å¼ä»»å¡Handlerï¼å¯ä»¥ç´æ¥é
ç½®å®ç¨ï¼å¦ä¸ï¼ |
| | | |
| | | - demoJobHandlerï¼ç®å示ä¾ä»»å¡ï¼ä»»å¡å
鍿¨¡æèæ¶ä»»å¡é»è¾ï¼ç¨æ·å¯å¨çº¿ä½éªRolling Logçåè½ï¼ |
| | | - shardingJobHandlerï¼åç示ä¾ä»»å¡ï¼ä»»å¡å
鍿¨¡æå¤çåçåæ°ï¼å¯åèçæåçä»»å¡ï¼ |
| | | - httpJobHandlerï¼éç¨HTTPä»»å¡Handlerï¼ä¸å¡æ¹åªéè¦æä¾HTTP龿¥å³å¯ï¼ä¸éå¶è¯è¨ãå¹³å°ï¼ |
| | | - commandJobHandlerï¼éç¨å½ä»¤è¡ä»»å¡Handlerï¼ä¸å¡æ¹åªéè¦æä¾å½ä»¤è¡å³å¯ï¼å¦ âpwdâå½ä»¤ï¼ |
| | | |
| | | |
| | | ### 3.3 GLUE模å¼(Java) |
| | | ä»»å¡ä»¥æºç æ¹å¼ç»´æ¤å¨è°åº¦ä¸å¿ï¼æ¯æéè¿Web IDEå¨çº¿æ´æ°ï¼å®æ¶ç¼è¯åçæï¼å æ¤ä¸éè¦æå®JobHandlerãå¼åæµç¨å¦ä¸ï¼ |
| | | |
| | | #### æ¥éª¤ä¸ï¼è°åº¦ä¸å¿ï¼æ°å»ºè°åº¦ä»»å¡ï¼ |
| | | åè䏿âé
ç½®å±æ§è¯¦ç»è¯´æâ对æ°å»ºçä»»å¡è¿è¡åæ°é
ç½®ï¼è¿è¡æ¨¡å¼éä¸ "GLUE模å¼(Java)"ï¼ |
| | | |
| | |  |
| | | |
| | | #### æ¥éª¤äºï¼å¼åä»»å¡ä»£ç ï¼ |
| | | é䏿å®ä»»å¡ï¼ç¹å»è¯¥ä»»å¡å³ä¾§âGLUEâæé®ï¼å°ä¼åå¾GLUEä»»å¡çWeb IDEçé¢ï¼å¨è¯¥ç颿¯æå¯¹ä»»å¡ä»£ç è¿è¡å¼åï¼ä¹å¯ä»¥å¨IDEä¸å¼å宿åï¼å¤å¶ç²è´´å°ç¼è¾ä¸ï¼ã |
| | | |
| | | çæ¬åæº¯åè½ï¼æ¯æ30ä¸ªçæ¬ççæ¬åæº¯ï¼ï¼å¨GLUEä»»å¡çWeb IDEçé¢ï¼éæ©å³ä¸è§ä¸ææ¡âçæ¬åæº¯âï¼ä¼ååºè¯¥GLUEçæ´æ°åå²ï¼éæ©ç¸åºçæ¬å³å¯æ¾ç¤ºè¯¥çæ¬ä»£ç ï¼ä¿ååGLUE代ç å³åéå°å¯¹åºçåå²çæ¬ï¼ |
| | | |
| | |  |
| | | |
| | | ### 3.4 GLUE模å¼(Shell) |
| | | |
| | | #### æ¥éª¤ä¸ï¼è°åº¦ä¸å¿ï¼æ°å»ºè°åº¦ä»»å¡ |
| | | åè䏿âé
ç½®å±æ§è¯¦ç»è¯´æâ对æ°å»ºçä»»å¡è¿è¡åæ°é
ç½®ï¼è¿è¡æ¨¡å¼éä¸ "GLUE模å¼(Shell)"ï¼ |
| | | |
| | | #### æ¥éª¤äºï¼å¼åä»»å¡ä»£ç ï¼ |
| | | é䏿å®ä»»å¡ï¼ç¹å»è¯¥ä»»å¡å³ä¾§âGLUEâæé®ï¼å°ä¼åå¾GLUEä»»å¡çWeb IDEçé¢ï¼å¨è¯¥ç颿¯æå¯¹ä»»å¡ä»£ç è¿è¡å¼åï¼ä¹å¯ä»¥å¨IDEä¸å¼å宿åï¼å¤å¶ç²è´´å°ç¼è¾ä¸ï¼ã |
| | | |
| | | 该模å¼çä»»å¡å®é
䏿¯ä¸æ®µ "shell" èæ¬ï¼ |
| | | |
| | |  |
| | | |
| | | ### 3.4 GLUE模å¼(Python) |
| | | |
| | | #### æ¥éª¤ä¸ï¼è°åº¦ä¸å¿ï¼æ°å»ºè°åº¦ä»»å¡ |
| | | åè䏿âé
ç½®å±æ§è¯¦ç»è¯´æâ对æ°å»ºçä»»å¡è¿è¡åæ°é
ç½®ï¼è¿è¡æ¨¡å¼éä¸ "GLUE模å¼(Python)"ï¼ |
| | | |
| | | #### æ¥éª¤äºï¼å¼åä»»å¡ä»£ç ï¼ |
| | | é䏿å®ä»»å¡ï¼ç¹å»è¯¥ä»»å¡å³ä¾§âGLUEâæé®ï¼å°ä¼åå¾GLUEä»»å¡çWeb IDEçé¢ï¼å¨è¯¥ç颿¯æå¯¹ä»»å¡ä»£ç è¿è¡å¼åï¼ä¹å¯ä»¥å¨IDEä¸å¼å宿åï¼å¤å¶ç²è´´å°ç¼è¾ä¸ï¼ã |
| | | |
| | | 该模å¼çä»»å¡å®é
䏿¯ä¸æ®µ "python" èæ¬ï¼ |
| | | |
| | |  |
| | | |
| | | ### 3.5 GLUE模å¼(NodeJS) |
| | | |
| | | #### æ¥éª¤ä¸ï¼è°åº¦ä¸å¿ï¼æ°å»ºè°åº¦ä»»å¡ |
| | | åè䏿âé
ç½®å±æ§è¯¦ç»è¯´æâ对æ°å»ºçä»»å¡è¿è¡åæ°é
ç½®ï¼è¿è¡æ¨¡å¼éä¸ "GLUE模å¼(NodeJS)"ï¼ |
| | | |
| | | #### æ¥éª¤äºï¼å¼åä»»å¡ä»£ç ï¼ |
| | | é䏿å®ä»»å¡ï¼ç¹å»è¯¥ä»»å¡å³ä¾§âGLUEâæé®ï¼å°ä¼åå¾GLUEä»»å¡çWeb IDEçé¢ï¼å¨è¯¥ç颿¯æå¯¹ä»»å¡ä»£ç è¿è¡å¼åï¼ä¹å¯ä»¥å¨IDEä¸å¼å宿åï¼å¤å¶ç²è´´å°ç¼è¾ä¸ï¼ã |
| | | |
| | | 该模å¼çä»»å¡å®é
䏿¯ä¸æ®µ "nodeJS" èæ¬ï¼ |
| | | |
| | | ### 3.6 GLUE模å¼(PHP) |
| | | åä¸ |
| | | |
| | | ### 3.7 GLUE模å¼(PowerShell) |
| | | åä¸ |
| | | |
| | | |
| | | |
| | | ## åãæä½æå |
| | | |
| | | ### 4.1 é
ç½®æ§è¡å¨ |
| | | ç¹å»è¿å
¥"æ§è¡å¨ç®¡ç"çé¢, å¦ä¸å¾: |
| | |  |
| | | |
| | | 1ã"è°åº¦ä¸å¿OnLine:"å³ä¾§æ¾ç¤ºå¨çº¿ç"è°åº¦ä¸å¿"å表, 任塿§è¡ç»æå, å°ä¼ä»¥failoverçæ¨¡å¼è¿è¡åè°è°åº¦ä¸å¿éç¥æ§è¡ç»æ, é¿å
åè°çåç¹é£é©; |
| | | 2ã"æ§è¡å¨å表" 䏿¾ç¤ºå¨çº¿çæ§è¡å¨å表, å¯éè¿"OnLine æºå¨"æ¥çå¯¹åºæ§è¡å¨çé群æºå¨ã |
| | | |
| | | ç¹å»æé® "+æ°å¢æ§è¡å¨" å¼¹æ¡å¦ä¸å¾, 坿°å¢æ§è¡å¨é
ç½®: |
| | | |
| | |  |
| | | |
| | | æ§è¡å¨å±æ§è¯´æ |
| | | |
| | | AppName: æ¯æ¯ä¸ªæ§è¡å¨é群çå¯ä¸æ 示AppName, æ§è¡å¨ä¼å¨ææ§ä»¥AppName为对象è¿è¡èªå¨æ³¨åãå¯éè¿è¯¥é
ç½®èªå¨åç°æ³¨åæåçæ§è¡å¨, ä¾ä»»å¡è°åº¦æ¶ä½¿ç¨; |
| | | åç§°: æ§è¡å¨çåç§°, å 为AppNameéå¶åæ¯æ°åçç»æ,å¯è¯»æ§ä¸å¼º, åç§°ä¸ºäºæé«æ§è¡å¨çå¯è¯»æ§; |
| | | æåº: æ§è¡å¨çæåº, ç³»ç»ä¸éè¦æ§è¡å¨çå°æ¹,å¦ä»»å¡æ°å¢, å°ä¼æç
§è¯¥æåºè¯»åå¯ç¨çæ§è¡å¨å表; |
| | | æ³¨åæ¹å¼ï¼è°åº¦ä¸å¿è·åæ§è¡å¨å°åçæ¹å¼ï¼ |
| | | èªå¨æ³¨åï¼æ§è¡å¨èªå¨è¿è¡æ§è¡å¨æ³¨åï¼è°åº¦ä¸å¿éè¿åºå±æ³¨å表å¯ä»¥å¨æåç°æ§è¡å¨æºå¨å°åï¼ |
| | | æå¨å½å
¥ï¼äººå·¥æå¨å½å
¥æ§è¡å¨çå°åä¿¡æ¯ï¼å¤å°åéå·åéï¼ä¾è°åº¦ä¸å¿ä½¿ç¨ï¼ |
| | | æºå¨å°åï¼"æ³¨åæ¹å¼"为"æå¨å½å
¥"æ¶ææï¼æ¯æäººå·¥ç»´æ¤æ§è¡å¨çå°åä¿¡æ¯ï¼ |
| | | |
| | | ### 4.2 æ°å»ºä»»å¡ |
| | | è¿å
¥ä»»å¡ç®¡ççé¢ï¼ç¹å»âæ°å¢ä»»å¡âæé®ï¼å¨å¼¹åºçâæ°å¢ä»»å¡âçé¢é
置任å¡å±æ§åä¿åå³å¯ã详æ
页åèç« è "ä¸ãä»»å¡è¯¦è§£"ã |
| | | |
| | | ### 4.3 ç¼è¾ä»»å¡ |
| | | è¿å
¥ä»»å¡ç®¡ççé¢ï¼é䏿å®ä»»å¡ãç¹å»è¯¥ä»»å¡å³ä¾§âç¼è¾âæé®ï¼å¨å¼¹åºçâç¼è¾ä»»å¡âç颿´æ°ä»»å¡å±æ§åä¿åå³å¯ï¼å¯ä»¥ä¿®æ¹è®¾ç½®çä»»å¡å±æ§ä¿¡æ¯ï¼ |
| | | |
| | | ### 4.4 ç¼è¾GLUE代ç |
| | | |
| | | 该æä½ä»
é对GLUEä»»å¡ã |
| | | |
| | | é䏿å®ä»»å¡ï¼ç¹å»è¯¥ä»»å¡å³ä¾§âGLUEâæé®ï¼å°ä¼åå¾GLUEä»»å¡çWeb IDEçé¢ï¼å¨è¯¥ç颿¯æå¯¹ä»»å¡ä»£ç è¿è¡å¼åãå¯åèç« è "3.3 GLUE模å¼(Java)"ã |
| | | |
| | | ### 4.5 å¯å¨/åæ¢ä»»å¡ |
| | | å¯å¯¹ä»»å¡è¿è¡âå¯å¨âåâ忢âæä½ã |
| | | éè¦æ³¨æçæ¯ï¼æ¤å¤çå¯å¨/忢ä»
é对任å¡çåç»è°åº¦è§¦åè¡ä¸ºï¼ä¸ä¼å½±åå°å·²ç»è§¦åçè°åº¦ä»»å¡ï¼å¦éç»æ¢å·²ç»è§¦åçè°åº¦ä»»å¡ï¼å¯æ¥çâ4.9 ç»æ¢è¿è¡ä¸çä»»å¡â |
| | | |
| | |  |
| | | |
| | | ### 4.6 æå¨è§¦å䏿¬¡è°åº¦ |
| | | ç¹å»âæ§è¡âæé®ï¼å¯æå¨è§¦å䏿¬¡ä»»å¡è°åº¦ï¼ä¸å½±ååæè°åº¦è§åã |
| | | |
| | |  |
| | | |
| | | ### 4.7 æ¥çè°åº¦æ¥å¿ |
| | | ç¹å»âæ¥å¿âæé®ï¼å¯ä»¥æ¥çä»»å¡åå²è°åº¦æ¥å¿ãå¨åå²è°å
¥æ¥å¿çé¢å¯æ¥çæ¯æ¬¡ä»»å¡è°åº¦çè°åº¦ç»æãæ§è¡ç»æçï¼ç¹å»âæ§è¡æ¥å¿âæé®å¯æ¥çæ§è¡å¨å®æ´æ¥å¿ã |
| | | |
| | |  |
| | | |
| | |  |
| | | |
| | | è°åº¦æ¶é´ï¼"è°åº¦ä¸å¿"è§¦åæ¬æ¬¡è°åº¦å¹¶å"æ§è¡å¨"åé任塿§è¡ä¿¡å·çæ¶é´ï¼ |
| | | è°åº¦ç»æï¼"è°åº¦ä¸å¿"è§¦åæ¬æ¬¡è°åº¦çç»æï¼200表示æåï¼500æå
¶ä»è¡¨ç¤ºå¤±è´¥ï¼ |
| | | è°åº¦å¤æ³¨ï¼"è°åº¦ä¸å¿"è§¦åæ¬æ¬¡è°åº¦çæ¥å¿ä¿¡æ¯ï¼ |
| | | æ§è¡å¨å°åï¼æ¬æ¬¡ä»»å¡æ§è¡çæºå¨å°å |
| | | è¿è¡æ¨¡å¼ï¼è§¦åè°åº¦æ¶ä»»å¡çè¿è¡æ¨¡å¼ï¼è¿è¡æ¨¡å¼å¯åèç« è "ä¸ãä»»å¡è¯¦è§£"ï¼ |
| | | ä»»å¡åæ°ï¼æ¬å°ä»»å¡æ§è¡çå
¥å |
| | | æ§è¡æ¶é´ï¼"æ§è¡å¨"䏿¬æ¬¡ä»»å¡æ§è¡ç»æååè°çæ¶é´ï¼ |
| | | æ§è¡ç»æï¼"æ§è¡å¨"䏿¬æ¬¡ä»»å¡æ§è¡çç»æï¼200表示æåï¼500æå
¶ä»è¡¨ç¤ºå¤±è´¥ï¼ |
| | | æ§è¡å¤æ³¨ï¼"æ§è¡å¨"䏿¬æ¬¡ä»»å¡æ§è¡çæ¥å¿ä¿¡æ¯ï¼ |
| | | æä½ï¼ |
| | | "æ§è¡æ¥å¿"æé®ï¼ç¹å»å¯æ¥çæ¬å°ä»»å¡æ§è¡çè¯¦ç»æ¥å¿ä¿¡æ¯ï¼è¯¦è§â4.8 æ¥çæ§è¡æ¥å¿âï¼ |
| | | "ç»æ¢ä»»å¡"æé®ï¼ç¹å»å¯ç»æ¢æ¬å°è°åº¦å¯¹åºæ§è¡å¨ä¸æ¬ä»»å¡çæ§è¡çº¿ç¨ï¼å
æ¬æªæ§è¡çé»å¡ä»»å¡ä¸å¹¶è¢«ç»æ¢ï¼ |
| | | |
| | | ### 4.8 æ¥çæ§è¡æ¥å¿ |
| | | ç¹å»æ§è¡æ¥å¿å³ä¾§ç âæ§è¡æ¥å¿â æé®ï¼å¯è·³è½¬è³æ§è¡æ¥å¿çé¢ï¼å¯ä»¥æ¥çä¸å¡ä»£ç 䏿å°ç宿´æ¥å¿ï¼å¦ä¸å¾ï¼ |
| | | |
| | |  |
| | | |
| | | ### 4.9 ç»æ¢è¿è¡ä¸çä»»å¡ |
| | | ä»
é对æ§è¡ä¸çä»»å¡ã |
| | | å¨ä»»å¡æ¥å¿çé¢ï¼ç¹å»å³ä¾§çâç»æ¢ä»»å¡âæé®ï¼å°ä¼åæ¬æ¬¡ä»»å¡å¯¹åºçæ§è¡å¨åéä»»å¡ç»æ¢è¯·æ±ï¼å°ä¼ç»æ¢ææ¬æ¬¡ä»»å¡ï¼åæ¶ä¼æ¸
ç©ºææ´ä¸ªä»»å¡æ§è¡éåã |
| | | |
| | |  |
| | | |
| | | ä»»å¡ç»æ¢æ¶éè¿ "interrupt" æ§è¡çº¿ç¨çæ¹å¼å®ç°, å°ä¼è§¦å "InterruptedException" å¼å¸¸ãå æ¤å¦æJobHandlerå
é¨catchå°äºè¯¥å¼å¸¸å¹¶æ¶åæçè¯, ä»»å¡ç»æ¢åè½å°ä¸å¯ç¨ã |
| | | |
| | | å æ¤, 妿éå°ä¸è¿°ä»»å¡ç»æ¢ä¸å¯ç¨çæ
åµ, éè¦å¨JobHandlerä¸åºè¯¥é对 "InterruptedException" å¼å¸¸è¿è¡ç¹æ®å¤ç (å䏿åº) , æ£ç¡®é»è¾å¦ä¸: |
| | | ``` |
| | | try{ |
| | | // do something |
| | | } catch (Exception e) { |
| | | if (e instanceof InterruptedException) { |
| | | throw e; |
| | | } |
| | | logger.warn("{}", e); |
| | | } |
| | | ``` |
| | | |
| | | èä¸ï¼å¨JobHandlerä¸å¼å¯åçº¿ç¨æ¶ï¼å线ç¨ä¹ä¸å¯catchå¤ç"InterruptedException"ï¼åºè¯¥ä¸»å¨å䏿åºã |
| | | |
| | | ä»»å¡ç»æ¢æ¶ä¼æ§è¡å¯¹åºJobHandlerç"destroy()"æ¹æ³ï¼å¯ä»¥åå©è¯¥æ¹æ³å¤çä¸äºèµæºåæ¶çé»è¾ã |
| | | |
| | | |
| | | ### 4.10 å 餿§è¡æ¥å¿ |
| | | å¨ä»»å¡æ¥å¿çé¢ï¼é䏿§è¡å¨åä»»å¡ä¹åï¼ç¹å»å³ä¾§ç"å é¤"æé®å°ä¼åºç°"æ¥å¿æ¸
ç"å¼¹æ¡ï¼å¼¹æ¡ä¸æ¯æéæ©ä¸åç±»åçæ¥å¿æ¸
ççç¥ï¼éä¸åç¹å»"ç¡®å®"æé®å³å¯è¿è¡æ¥å¿æ¸
çæä½ï¼ |
| | |  |
| | | |
| | |  |
| | | |
| | | ### 4.11 å é¤ä»»å¡ |
| | | ç¹å»å 餿é®ï¼å¯ä»¥å é¤å¯¹åºä»»å¡ã |
| | | |
| | |  |
| | | |
| | | ### 4.12 ç¨æ·ç®¡ç |
| | | è¿å
¥ "ç¨æ·ç®¡ç" çé¢ï¼å¯æ¥çå管çç¨æ·ä¿¡æ¯ï¼ |
| | | |
| | | ç®åç¨æ·å为两ç§è§è²ï¼ |
| | | - 管çåï¼æ¥æå
¨éæéï¼æ¯æå¨çº¿ç®¡çç¨æ·ä¿¡æ¯ï¼ä¸ºç¨æ·åé
æéï¼æéåé
ç²åº¦ä¸ºæ§è¡å¨ï¼ |
| | | - æ®éç¨æ·ï¼ä»
æ¥æè¢«åé
æéçæ§è¡å¨ï¼åç¸å
³ä»»å¡çæä½æéï¼ |
| | | |
| | |  |
| | | |
| | |  |
| | | |
| | | |
| | | ## äºãæ»ä½è®¾è®¡ |
| | | ### 5.1 æºç ç®å½ä»ç» |
| | | - /doc :ææ¡£èµæ |
| | | - /db :âè°åº¦æ°æ®åºâå»ºè¡¨èæ¬ |
| | | - /xxl-job-admin :è°åº¦ä¸å¿ï¼é¡¹ç®æºç |
| | | - /xxl-job-core :å
Œ
±Jarä¾èµ |
| | | - /xxl-job-executor-samples :æ§è¡å¨ï¼Sample示ä¾é¡¹ç®ï¼å¤§å®¶å¯ä»¥å¨è¯¥é¡¹ç®ä¸è¿è¡å¼åï¼ä¹å¯ä»¥å°ç°æé¡¹ç®æ¹é çææ§è¡å¨é¡¹ç®ï¼ |
| | | |
| | | ### 5.2 âè°åº¦æ°æ®åºâé
ç½® |
| | | XXL-JOBè°åº¦æ¨¡ååºäºèªç è°åº¦ç»ä»¶å¹¶æ¯æé群é¨ç½²ï¼è°åº¦æ°æ®åºè¡¨è¯´æå¦ä¸ï¼ |
| | | |
| | | - xxl_job_lockï¼ä»»å¡è°åº¦éè¡¨ï¼ |
| | | - xxl_job_groupï¼æ§è¡å¨ä¿¡æ¯è¡¨ï¼ç»´æ¤ä»»å¡æ§è¡å¨ä¿¡æ¯ï¼ |
| | | - xxl_job_infoï¼è°åº¦æ©å±ä¿¡æ¯è¡¨ï¼ ç¨äºä¿åXXL-JOBè°åº¦ä»»å¡çæ©å±ä¿¡æ¯ï¼å¦ä»»å¡åç»ãä»»å¡åãæºå¨å°åãæ§è¡å¨ãæ§è¡å
¥å忥è¦é®ä»¶ççï¼ |
| | | - xxl_job_logï¼è°åº¦æ¥å¿è¡¨ï¼ ç¨äºä¿åXXL-JOBä»»å¡è°åº¦çåå²ä¿¡æ¯ï¼å¦è°åº¦ç»æãæ§è¡ç»æãè°åº¦å
¥åãè°åº¦æºå¨åæ§è¡å¨ççï¼ |
| | | - xxl_job_log_reportï¼è°åº¦æ¥å¿æ¥è¡¨ï¼ç¨æ·åå¨XXL-JOBä»»å¡è°åº¦æ¥å¿çæ¥è¡¨ï¼è°åº¦ä¸å¿æ¥è¡¨åè½é¡µé¢ä¼ç¨å°ï¼ |
| | | - xxl_job_logglueï¼ä»»å¡GLUEæ¥å¿ï¼ç¨äºä¿åGLUEæ´æ°åå²ï¼ç¨äºæ¯æGLUEççæ¬åæº¯åè½ï¼ |
| | | - xxl_job_registryï¼æ§è¡å¨æ³¨å表ï¼ç»´æ¤å¨çº¿çæ§è¡å¨åè°åº¦ä¸å¿æºå¨å°åä¿¡æ¯ï¼ |
| | | - xxl_job_userï¼ç³»ç»ç¨æ·è¡¨ï¼ |
| | | |
| | | |
| | | ### 5.3 æ¶æè®¾è®¡ |
| | | #### 5.3.1 è®¾è®¡ææ³ |
| | | å°è°åº¦è¡ä¸ºæ½è±¡å½¢æâè°åº¦ä¸å¿âå
Œ
±å¹³å°ï¼èå¹³å°èªèº«å¹¶ä¸æ¿æ
ä¸å¡é»è¾ï¼âè°åº¦ä¸å¿âè´è´£åèµ·è°åº¦è¯·æ±ã |
| | | |
| | | å°ä»»å¡æ½è±¡æåæ£çJobHandlerï¼äº¤ç±âæ§è¡å¨âç»ä¸ç®¡çï¼âæ§è¡å¨âè´è´£æ¥æ¶è°åº¦è¯·æ±å¹¶æ§è¡å¯¹åºçJobHandlerä¸ä¸å¡é»è¾ã |
| | | |
| | | å æ¤ï¼âè°åº¦âåâä»»å¡â两é¨åå¯ä»¥ç¸äºè§£è¦ï¼æé«ç³»ç»æ´ä½ç¨³å®æ§åæ©å±æ§ï¼ |
| | | |
| | | #### 5.3.2 ç³»ç»ç»æ |
| | | - **è°åº¦æ¨¡åï¼è°åº¦ä¸å¿ï¼**ï¼ |
| | | è´è´£ç®¡çè°åº¦ä¿¡æ¯ï¼æç
§è°åº¦é
ç½®ååºè°åº¦è¯·æ±ï¼èªèº«ä¸æ¿æ
ä¸å¡ä»£ç ãè°åº¦ç³»ç»ä¸ä»»å¡è§£è¦ï¼æé«äºç³»ç»å¯ç¨æ§åç¨³å®æ§ï¼åæ¶è°åº¦ç³»ç»æ§è½ä¸ååéäºä»»å¡æ¨¡åï¼ |
| | | æ¯æå¯è§åãç®åä¸å¨æç管çè°åº¦ä¿¡æ¯ï¼å
æ¬ä»»å¡æ°å»ºï¼æ´æ°ï¼å é¤ï¼GLUEå¼åå任塿¥è¦çï¼ææä¸è¿°æä½é½ä¼å®æ¶çæï¼åæ¶æ¯æçæ§è°åº¦ç»æä»¥åæ§è¡æ¥å¿ï¼æ¯ææ§è¡å¨Failoverã |
| | | - **æ§è¡æ¨¡åï¼æ§è¡å¨ï¼**ï¼ |
| | | è´è´£æ¥æ¶è°åº¦è¯·æ±å¹¶æ§è¡ä»»å¡é»è¾ã任塿¨¡å䏿³¨äºä»»å¡çæ§è¡çæä½ï¼å¼ååç»´æ¤æ´å ç®ååé«æï¼ |
| | | æ¥æ¶âè°åº¦ä¸å¿âçæ§è¡è¯·æ±ãç»æ¢è¯·æ±åæ¥å¿è¯·æ±çã |
| | | |
| | | #### 5.3.3 æ¶æå¾ |
| | | |
| | |  |
| | | |
| | | ### 5.4 è°åº¦æ¨¡ååæ |
| | | #### 5.4.1 quartzçä¸è¶³ |
| | | Quartzä½ä¸ºå¼æºä½ä¸è°åº¦ä¸ç佼佼è
ï¼æ¯ä½ä¸è°åº¦çé¦éã使¯é群ç¯å¢ä¸Quartzéç¨APIçæ¹å¼å¯¹ä»»å¡è¿è¡ç®¡çï¼ä»èå¯ä»¥é¿å
ä¸è¿°é®é¢ï¼ä½æ¯åæ ·åå¨ä»¥ä¸é®é¢ï¼ |
| | | |
| | | - é®é¢ä¸ï¼è°ç¨APIççæ¹å¼æä½ä»»å¡ï¼ä¸äººæ§åï¼ |
| | | - é®é¢äºï¼éè¦æä¹
åä¸å¡QuartzJobBeanå°åºå±æ°æ®è¡¨ä¸ï¼ç³»ç»ä¾µå
¥æ§ç¸å½ä¸¥éã |
| | | - é®é¢ä¸ï¼è°åº¦é»è¾åQuartzJobBeanè¦åå¨åä¸ä¸ªé¡¹ç®ä¸ï¼è¿å°å¯¼è´ä¸ä¸ªé®é¢ï¼å¨è°åº¦ä»»å¡æ°é鿏å¢å¤ï¼åæ¶è°åº¦ä»»å¡é»è¾éæ¸å éçæ
åµä¸ï¼æ¤æ¶è°åº¦ç³»ç»çæ§è½å°å¤§å¤§åéäºä¸å¡ï¼ |
| | | - é®é¢åï¼quartzåºå±ä»¥âæ¢å å¼âè·åDBéå¹¶ç±æ¢å æåèç¹è´è´£è¿è¡ä»»å¡ï¼ä¼å¯¼è´èç¹è´è½½æ¬æ®é常大ï¼èXXL-JOBéè¿æ§è¡å¨å®ç°âåååé
å¼âè¿è¡ä»»å¡ï¼å
å忥é群ä¼å¿ï¼è´è½½åèç¹åè¡¡ã |
| | | |
| | | XXL-JOB弥补äºquartzçä¸è¿°ä¸è¶³ä¹å¤ã |
| | | |
| | | #### 5.4.2 èªç è°åº¦æ¨¡å |
| | | XXL-JOBæç»éæ©èªç è°åº¦ç»ä»¶ï¼æ©æè°åº¦ç»ä»¶åºäºQuartzï¼ï¼ä¸æ¹é¢æ¯ä¸ºäºç²¾ç®ç³»ç»éä½åä½ä¾èµï¼å¦ä¸æ¹é¢æ¯ä¸ºäºæä¾ç³»ç»ç坿§åº¦ä¸ç¨³å®æ§ï¼ |
| | | |
| | | XXL-JOBä¸âè°åº¦æ¨¡åâåâ任塿¨¡åâå®å
¨è§£è¦ï¼è°åº¦æ¨¡åè¿è¡ä»»å¡è°åº¦æ¶ï¼å°ä¼è§£æä¸åçä»»å¡åæ°åèµ·è¿ç¨è°ç¨ï¼è°ç¨åèªçè¿ç¨æ§è¡å¨æå¡ãè¿ç§è°ç¨æ¨¡å类似RPCè°ç¨ï¼è°åº¦ä¸å¿æä¾è°ç¨ä»£ççåè½ï¼èæ§è¡å¨æä¾è¿ç¨æå¡çåè½ã |
| | | |
| | | #### 5.4.3 è°åº¦ä¸å¿HAï¼éç¾¤ï¼ |
| | | åºäºæ°æ®åºçéç¾¤æ¹æ¡ï¼æ°æ®åºéç¨Mysqlï¼é群åå¸å¼å¹¶åç¯å¢ä¸è¿è¡å®æ¶ä»»å¡è°åº¦æ¶ï¼ä¼å¨å个èç¹ä¼ä¸æ¥ä»»å¡ï¼åå°æ°æ®åºä¸ï¼æ§è¡æ¶ä¼ä»æ°æ®åºä¸ååºè§¦å卿¥æ§è¡ï¼å¦æè§¦åå¨çåç§°åæ§è¡æ¶é´ç¸åï¼ååªæä¸ä¸ªèç¹å»æ§è¡æ¤ä»»å¡ã |
| | | |
| | | #### 5.4.4 è°åº¦çº¿ç¨æ± |
| | | è°åº¦éç¨çº¿ç¨æ± æ¹å¼å®ç°ï¼é¿å
å线ç¨å é»å¡èå¼èµ·ä»»å¡è°åº¦å»¶è¿ã |
| | | |
| | | |
| | | #### 5.4.5 å¹¶è¡è°åº¦ |
| | | XXL-JOBè°åº¦æ¨¡åé»è®¤éç¨å¹¶è¡æºå¶ï¼å¨å¤çº¿ç¨è°åº¦çæ
åµä¸ï¼è°åº¦æ¨¡å被é»å¡çå çå¾ä½ï¼å¤§å¤§æé«äºè°åº¦ç³»ç»çæ¿è½½éã |
| | | |
| | | XXL-JOBçæ¯ä¸ªè°åº¦ä»»å¡è½ç¶å¨è°åº¦æ¨¡åæ¯å¹¶è¡è°åº¦æ§è¡çï¼ä½æ¯ä»»å¡è°åº¦ä¼ éå°ä»»å¡æ¨¡åçâæ§è¡å¨âç¡®å®ä¸²è¡æ§è¡çï¼åæ¶æ¯æä»»å¡ç»æ¢ã |
| | | |
| | | #### 5.4.6 è¿æå¤ççç¥ |
| | | ä»»å¡è°åº¦éè¿è§¦åæ¶é´æ¶çå¤ççç¥ï¼ |
| | | - å¯è½åå ï¼æå¡éå¯ï¼è°åº¦çº¿ç¨è¢«é»å¡ï¼çº¿ç¨è¢«èå°½ï¼ä¸æ¬¡è°åº¦æç»é»å¡ï¼ä¸æ¬¡è°åº¦è¢«éè¿ï¼ |
| | | - å¤ççç¥ï¼ |
| | | - è¿æè¶
5sï¼æ¬æ¬¡å¿½ç¥ï¼å½åæ¶é´å¼å§è®¡ç®ä¸æ¬¡è§¦åæ¶é´ |
| | | - è¿æ5så
ï¼ç«å³è§¦å䏿¬¡ï¼å½åæ¶é´å¼å§è®¡ç®ä¸æ¬¡è§¦åæ¶é´ |
| | | |
| | | |
| | | #### 5.4.7 æ¥å¿åè°æå¡ |
| | | è°åº¦æ¨¡åçâè°åº¦ä¸å¿âä½ä¸ºWebæå¡é¨ç½²æ¶ï¼ä¸æ¹é¢æ¿æ
è°åº¦ä¸å¿åè½ï¼å¦ä¸æ¹é¢ä¹ä¸ºæ§è¡å¨æä¾APIæå¡ã |
| | | |
| | | è°åº¦ä¸å¿æä¾ç"æ¥å¿åè°æå¡APIæå¡"代ç ä½ç½®å¦ä¸ï¼ |
| | | ``` |
| | | xxl-job-admin#com.xxl.job.admin.controller.JobApiController.callback |
| | | ``` |
| | | |
| | | âæ§è¡å¨â卿¥æ¶å°ä»»å¡æ§è¡è¯·æ±åï¼æ§è¡ä»»å¡ï¼å¨æ§è¡ç»æä¹åä¼å°æ§è¡ç»æåè°éç¥âè°åº¦ä¸å¿âï¼ |
| | | |
| | | #### 5.4.8 ä»»å¡HAï¼Failoverï¼ |
| | | æ§è¡å¨å¦è¥é群é¨ç½²ï¼è°åº¦ä¸å¿å°ä¼æç¥å°å¨çº¿çæææ§è¡å¨ï¼å¦â127.0.0.1:9997, 127.0.0.1:9998, 127.0.0.1:9999âã |
| | | |
| | | å½ä»»å¡"è·¯ç±çç¥"éæ©"æ
é转移(FAILOVER)"æ¶ï¼å½è°åº¦ä¸å¿æ¯æ¬¡åèµ·è°åº¦è¯·æ±æ¶ï¼ä¼æç
§é¡ºåºå¯¹æ§è¡å¨ååºå¿è·³æ£æµè¯·æ±ï¼ç¬¬ä¸ä¸ªæ£æµä¸ºåæ´»ç¶æçæ§è¡å¨å°ä¼è¢«éå®å¹¶åéè°åº¦è¯·æ±ã |
| | | |
| | | è°åº¦æååï¼å¯å¨æ¥å¿çæ§ç颿¥çâè°åº¦å¤æ³¨âï¼å¦ä¸ï¼ |
| | |  |
| | | |
| | | âè°åº¦å¤æ³¨âå¯ä»¥çåºæ¬å°è°åº¦è¿è¡è½¨è¿¹ï¼æ§è¡å¨ç"æ³¨åæ¹å¼"ã"å°åå表"åä»»å¡ç"è·¯ç±çç¥"ã"æ
é转移(FAILOVER)"è·¯ç±çç¥ä¸ï¼è°åº¦ä¸å¿é¦å
对第ä¸ä¸ªå°åè¿è¡å¿è·³æ£æµï¼å¿è·³å¤±è´¥å æ¤èªå¨è·³è¿ï¼ç¬¬äºä¸ªä¾ç¶å¿è·³æ£æµå¤±è´¥â¦â¦ |
| | | ç´è³å¿è·³æ£æµç¬¬ä¸ä¸ªå°åâ127.0.0.1:9999âæåï¼éå®ä¸ºâç®æ æ§è¡å¨âï¼ç¶å对âç®æ æ§è¡å¨âåéè°åº¦è¯·æ±ï¼è°åº¦æµç¨ç»æï¼çå¾
æ§è¡å¨åè°æ§è¡ç»æã |
| | | |
| | | #### 5.4.9 è°åº¦æ¥å¿ |
| | | è°åº¦ä¸å¿æ¯æ¬¡è¿è¡ä»»å¡è°åº¦ï¼é½ä¼è®°å½ä¸æ¡ä»»å¡æ¥å¿ï¼ä»»å¡æ¥å¿ä¸»è¦å
æ¬ä»¥ä¸ä¸é¨åå
å®¹ï¼ |
| | | |
| | | - ä»»å¡ä¿¡æ¯ï¼å
æ¬âæ§è¡å¨å°åâãâJobHandlerâåâæ§è¡åæ°âç屿§ï¼ç¹å»ä»»å¡IDæé®å¯æ¥çï¼æ ¹æ®è¿äºåæ°ï¼å¯ä»¥ç²¾ç¡®çå®ä½ä»»å¡æ§è¡çå
·ä½æºå¨åä»»å¡ä»£ç ï¼ |
| | | - è°åº¦ä¿¡æ¯ï¼å
æ¬âè°åº¦æ¶é´âãâè°åº¦ç»æâåâè°åº¦æ¥å¿âçï¼æ ¹æ®è¿äºåæ°ï¼å¯ä»¥äºè§£âè°åº¦ä¸å¿âåèµ·è°åº¦è¯·æ±æ¶å
·ä½æ
åµã |
| | | - æ§è¡ä¿¡æ¯ï¼å
æ¬âæ§è¡æ¶é´âãâæ§è¡ç»æâåâæ§è¡æ¥å¿âçï¼æ ¹æ®è¿äºåæ°ï¼å¯ä»¥äºè§£å¨âæ§è¡å¨âç«¯ä»»å¡æ§è¡çå
·ä½æ
åµï¼ |
| | | |
| | | è°åº¦æ¥å¿ï¼é坹忬¡è°åº¦ï¼å±æ§è¯´æå¦ä¸ï¼ |
| | | - æ§è¡å¨å°åï¼ä»»å¡æ§è¡çæºå¨å°åï¼ |
| | | - JobHandlerï¼Bean模å¼è¡¨ç¤ºä»»å¡æ§è¡çJobHandleråç§°ï¼ |
| | | - ä»»å¡åæ°ï¼ä»»å¡æ§è¡çå
¥åï¼ |
| | | - è°åº¦æ¶é´ï¼è°åº¦ä¸å¿ï¼åèµ·è°åº¦çæ¶é´ï¼ |
| | | - è°åº¦ç»æï¼è°åº¦ä¸å¿ï¼åèµ·è°åº¦çç»æï¼SUCCESSæFAILï¼ |
| | | - è°åº¦å¤æ³¨ï¼è°åº¦ä¸å¿ï¼åèµ·è°åº¦ç夿³¨ä¿¡æ¯ï¼å¦å°åå¿è·³æ£æµæ¥å¿çï¼ |
| | | - æ§è¡æ¶é´ï¼æ§è¡å¨ï¼ä»»å¡æ§è¡ç»æååè°çæ¶é´ï¼ |
| | | - æ§è¡ç»æï¼æ§è¡å¨ï¼ä»»å¡æ§è¡çç»æï¼SUCCESSæFAILï¼ |
| | | - æ§è¡å¤æ³¨ï¼æ§è¡å¨ï¼ä»»å¡æ§è¡ç夿³¨ä¿¡æ¯ï¼å¦å¼å¸¸æ¥å¿çï¼ |
| | | - æ§è¡æ¥å¿ï¼ä»»å¡æ§è¡è¿ç¨ä¸ï¼ä¸å¡ä»£ç 䏿å°ç宿´æ§è¡æ¥å¿ï¼è§â4.8 æ¥çæ§è¡æ¥å¿âï¼ |
| | | |
| | | #### 5.4.10 ä»»å¡ä¾èµ |
| | | åçï¼XXL-JOB䏿¯ä¸ªä»»å¡é½å¯¹åºæä¸ä¸ªä»»å¡IDï¼åæ¶ï¼æ¯ä¸ªä»»å¡æ¯æè®¾ç½®å±æ§âåä»»å¡IDâï¼å æ¤ï¼éè¿âä»»å¡IDâå¯ä»¥å¹é
ä»»å¡ä¾èµå
³ç³»ã |
| | | |
| | | å½ç¶ä»»å¡æ§è¡ç»æå¹¶ä¸æ§è¡æåæ¶ï¼å°ä¼æ ¹æ®âåä»»å¡IDâå¹é
åä»»å¡ä¾èµï¼å¦æå¹é
å°åä»»å¡ï¼å°ä¼ä¸»å¨è§¦å䏿¬¡åä»»å¡çæ§è¡ã |
| | | |
| | | å¨ä»»å¡æ¥å¿çé¢ï¼ç¹å»ä»»å¡çâæ§è¡å¤æ³¨âçâæ¥çâæé®ï¼å¯ä»¥çå°å¹é
åä»»å¡ä»¥å触åå任塿§è¡çæ¥å¿ä¿¡æ¯ï¼å¦æ ä¿¡æ¯å表示æªè§¦åå任塿§è¡ï¼å¯åèä¸å¾ã |
| | | |
| | |  |
| | | |
| | |  |
| | | |
| | | #### 5.4.11 å
¨å¼æ¥å & è½»é级 |
| | | |
| | | - å
¨å¼æ¥å设计ï¼XXL-JOBç³»ç»ä¸ä¸å¡é»è¾å¨è¿ç¨æ§è¡å¨æ§è¡ï¼è§¦åæµç¨å
¨å¼æ¥å设计ãç¸æ¯ç´æ¥å¨è°åº¦ä¸å¿å
鍿§è¡ä¸å¡é»è¾ï¼æå¤§çéä½äºè°åº¦çº¿ç¨å ç¨æ¶é´ï¼ |
| | | - 弿¥è°åº¦ï¼è°åº¦ä¸å¿æ¯æ¬¡ä»»å¡è§¦åæ¶ä»
åé䏿¬¡è°åº¦è¯·æ±ï¼è¯¥è°åº¦è¯·æ±é¦å
æ¨éâ弿¥è°åº¦éåâï¼ç¶å弿¥æ¨éç»è¿ç¨æ§è¡å¨ |
| | | - 弿¥æ§è¡ï¼æ§è¡å¨ä¼å°è¯·æ±åå
¥â弿¥æ§è¡éåâå¹¶ä¸ç«å³ååºè°åº¦ä¸å¿ï¼å¼æ¥è¿è¡ã |
| | | - è½»é级设计ï¼XXL-JOBè°åº¦ä¸å¿ä¸æ¯ä¸ªJOBé»è¾é常 âè½»âï¼å¨å
¨å¼æ¥åçåºç¡ä¸ï¼å个JOB䏿¬¡è¿è¡å¹³åèæ¶åºæ¬å¨ "10ms" ä¹å
ï¼åºæ¬ä¸ºä¸æ¬¡è¯·æ±çç½ç»å¼éï¼ï¼å æ¤ï¼å¯ä»¥ä¿è¯ä½¿ç¨æéççº¿ç¨æ¯æå¤§éçJOBå¹¶åè¿è¡ï¼ |
| | | |
| | | å¾çäºä¸è¿°ä¸¤ç¹ä¼åï¼ç论ä¸é»è®¤é
ç½®ä¸çè°åº¦ä¸å¿ï¼åæºè½å¤æ¯æ 5000 ä»»å¡å¹¶åè¿è¡ç¨³å®è¿è¡ï¼ |
| | | |
| | | å®é
åºæ¯ä¸ï¼ç±äºè°åº¦ä¸å¿ä¸æ§è¡å¨ç½ç»pingå»¶è¿ä¸åãDB读åèæ¶ä¸åãä»»å¡è°åº¦å¯éç¨åº¦ä¸åï¼ä¼å¯¼è´ä»»å¡éä¸éä¼ä¸ä¸æ³¢å¨ã |
| | | |
| | | å¦è¥éè¦æ¯ææ´å¤çä»»å¡éï¼å¯ä»¥éè¿ "è°å¤§è°åº¦çº¿ç¨æ°" ã"éä½è°åº¦ä¸å¿ä¸æ§è¡å¨pingå»¶è¿" å "æåæºå¨é
ç½®" å ç§æ¹å¼ä¼åã |
| | | |
| | | #### 5.4.12 åè¡¡è°åº¦ |
| | | |
| | | è°åº¦ä¸å¿å¨é群é¨ç½²æ¶ä¼èªå¨è¿è¡ä»»å¡å¹³ååé
ï¼è§¦åç»ä»¶æ¯æ¬¡è·åä¸çº¿ç¨æ± æ°éï¼è°åº¦ä¸å¿æ¯æèªå®ä¹è°åº¦çº¿ç¨æ± 大å°ï¼ç¸å
³æ°éçä»»å¡ï¼é¿å
大éä»»å¡éä¸å¨å个è°åº¦ä¸å¿é群èç¹ï¼ |
| | | |
| | | |
| | | ### 5.5 ä»»å¡ "è¿è¡æ¨¡å¼" åæ |
| | | #### 5.5.1 "Bean模å¼" ä»»å¡ |
| | | å¼åæ¥éª¤ï¼å¯åè "ç« èä¸" ï¼ |
| | | åçï¼æ¯ä¸ªBean模å¼ä»»å¡é½æ¯ä¸ä¸ªSpringçBeanç±»å®ä¾ï¼å®è¢«ç»´æ¤å¨âæ§è¡å¨â项ç®çSpring容å¨ä¸ãä»»å¡ç±»éè¦å â@JobHandler(value="åç§°")âæ³¨è§£ï¼å ä¸ºâæ§è¡å¨â伿 ¹æ®è¯¥æ³¨è§£è¯å«Spring容å¨ä¸çä»»å¡ãä»»å¡ç±»éè¦ç»§æ¿ç»ä¸æ¥å£âIJobHandlerâï¼ä»»å¡é»è¾å¨executeæ¹æ³ä¸å¼åï¼å ä¸ºâæ§è¡å¨â卿¥æ¶å°è°åº¦ä¸å¿çè°åº¦è¯·æ±æ¶ï¼å°ä¼è°ç¨âIJobHandlerâçexecuteæ¹æ³ï¼æ§è¡ä»»å¡é»è¾ã |
| | | |
| | | #### 5.5.2 "GLUE模å¼(Java)" ä»»å¡ |
| | | å¼åæ¥éª¤ï¼å¯åè "ç« èä¸" ï¼ |
| | | åçï¼æ¯ä¸ª "GLUE模å¼(Java)" ä»»å¡ç代ç ï¼å®é
䏿¯âä¸ä¸ªç»§æ¿èªâIJobHandlerâçå®ç°ç±»ç类代ç âï¼âæ§è¡å¨âæ¥æ¶å°âè°åº¦ä¸å¿âçè°åº¦è¯·æ±æ¶ï¼ä¼éè¿Groovyç±»å è½½å¨å è½½æ¤ä»£ç ï¼å®ä¾åæJava对象ï¼åæ¶æ³¨å
¥æ¤ä»£ç ä¸å£°æçSpringæå¡ï¼è¯·ç¡®ä¿Glue代ç ä¸çæå¡åç±»å¼ç¨å¨âæ§è¡å¨â项ç®ä¸åå¨ï¼ï¼ç¶åè°ç¨è¯¥å¯¹è±¡çexecuteæ¹æ³ï¼æ§è¡ä»»å¡é»è¾ã |
| | | |
| | | #### 5.5.3 GLUE模å¼(Shell) + GLUE模å¼(Python) + GLUE模å¼(NodeJS) |
| | | å¼åæ¥éª¤ï¼å¯åè "ç« èä¸" ï¼ |
| | | åçï¼èæ¬ä»»å¡çæºç æç®¡å¨è°åº¦ä¸å¿ï¼èæ¬é»è¾å¨æ§è¡å¨è¿è¡ãå½è§¦åèæ¬ä»»å¡æ¶ï¼æ§è¡å¨ä¼å è½½èæ¬æºç 卿§è¡å¨æºå¨ä¸çæä¸ä»½èæ¬æä»¶ï¼ç¶åéè¿Java代ç è°ç¨è¯¥èæ¬ï¼å¹¶ä¸å®æ¶å°èæ¬è¾åºæ¥å¿åå°ä»»å¡æ¥å¿æä»¶ä¸ï¼ä»èå¨è°åº¦ä¸å¿å¯ä»¥å®æ¶çæ§èæ¬è¿è¡æ
åµï¼ |
| | | |
| | | ç®åæ¯æçèæ¬ç±»åå¦ä¸ï¼ |
| | | |
| | | - shellèæ¬ï¼ä»»å¡è¿è¡æ¨¡å¼éæ©ä¸º "GLUE模å¼(Shell)"æ¶æ¯æ "shell" èæ¬ä»»å¡ï¼ |
| | | - pythonèæ¬ï¼ä»»å¡è¿è¡æ¨¡å¼éæ©ä¸º "GLUE模å¼(Python)"æ¶æ¯æ "python" èæ¬ä»»å¡ï¼ |
| | | - nodejsèæ¬ï¼å¡è¿è¡æ¨¡å¼éæ©ä¸º "GLUE模å¼(NodeJS)"æ¶æ¯æ "nodejs" èæ¬ä»»å¡ï¼ |
| | | |
| | | èæ¬ä»»å¡éè¿ Exit Code 夿任塿§è¡ç»æï¼ç¶æç å¯åèç« è "5.15 任塿§è¡ç»æè¯´æ"ï¼ |
| | | |
| | | #### 5.5.4 æ§è¡å¨ |
| | | æ§è¡å¨å®é
䏿¯ä¸ä¸ªå
åµçServerï¼é»è®¤ç«¯å£9999ï¼é
置项ï¼xxl.job.executor.portï¼ã |
| | | |
| | | å¨é¡¹ç®å¯å¨æ¶ï¼æ§è¡å¨ä¼éè¿â@JobHandlerâè¯å«Spring容å¨ä¸âBean模å¼ä»»å¡âï¼ä»¥æ³¨è§£çvalue屿§ä¸ºkey管çèµ·æ¥ã |
| | | |
| | | âæ§è¡å¨âæ¥æ¶å°âè°åº¦ä¸å¿âçè°åº¦è¯·æ±æ¶ï¼å¦æä»»å¡ç±»å为âBean模å¼âï¼å°ä¼å¹é
Spring容å¨ä¸çâBean模å¼ä»»å¡âï¼ç¶åè°ç¨å
¶executeæ¹æ³ï¼æ§è¡ä»»å¡é»è¾ã妿任å¡ç±»å为âGLUE模å¼âï¼å°ä¼å è½½GLue代ç ï¼å®ä¾åJavaå¯¹è±¡ï¼æ³¨å
¥ä¾èµçSpringæå¡ï¼æ³¨æï¼Glue代ç 䏿³¨å
¥çSpringæå¡ï¼å¿
é¡»åå¨ä¸è¯¥âæ§è¡å¨â项ç®çSpring容å¨ä¸ï¼ï¼ç¶åè°ç¨executeæ¹æ³ï¼æ§è¡ä»»å¡é»è¾ã |
| | | |
| | | #### 5.5.5 任塿¥å¿ |
| | | XXL-JOBä¼ä¸ºæ¯æ¬¡è°åº¦è¯·æ±çæä¸ä¸ªåç¬çæ¥å¿æä»¶ï¼éè¦éè¿ "XxlJobLogger.log" æå°æ§è¡æ¥å¿ï¼âè°åº¦ä¸å¿âæ¥çæ§è¡æ¥å¿æ¶å°ä¼å 载对åºçæ¥å¿æä»¶ã |
| | | |
| | | (åå²çæ¬éè¿éåLOG4JçAppenderå®ç°ï¼åå¨ä¾èµéå¶ï¼è¯¥æ¹å¼å¨æ°çæ¬å·²ç»è¢«æå¼) |
| | | |
| | | æ¥å¿æä»¶åæ¾çä½ç½®å¯å¨âæ§è¡å¨âé
ç½®æä»¶è¿è¡èªå®ä¹ï¼é»è®¤ç®å½æ ¼å¼ä¸ºï¼/data/applogs/xxl-job/jobhandler/âæ ¼å¼åæ¥æâ/âæ°æ®åºè°åº¦æ¥å¿è®°å½ç主é®ID.logâã |
| | | |
| | | å¨JobHandlerä¸å¼å¯åçº¿ç¨æ¶ï¼å线ç¨å°ä¼å°ä¼ææ¥å¿æå°å¨ç¶çº¿ç¨å³JobHandlerçæ§è¡æ¥å¿ä¸ï¼æ¹ä¾¿æ¥å¿è¿½è¸ªã |
| | | |
| | | ### 5.6 é讯模ååæ |
| | | |
| | | #### 5.6.1 䏿¬¡å®æ´çä»»å¡è°åº¦é讯æµç¨ |
| | | - 1ãâè°åº¦ä¸å¿âåâæ§è¡å¨âåéhttpè°åº¦è¯·æ±: âæ§è¡å¨â䏿¥æ¶è¯·æ±çæå¡ï¼å®é
䏿¯ä¸å°å
åµServerï¼é»è®¤ç«¯å£9999; |
| | | - 2ãâæ§è¡å¨âæ§è¡ä»»å¡é»è¾ï¼ |
| | | - 3ãâæ§è¡å¨âhttpåè°âè°åº¦ä¸å¿âè°åº¦ç»æ: âè°åº¦ä¸å¿â䏿¥æ¶åè°çæå¡ï¼æ¯é对æ§è¡å¨å¼æ¾ä¸å¥APIæå¡; |
| | | |
| | | #### 5.6.2 éè®¯æ°æ®å å¯ |
| | | è°åº¦ä¸å¿åæ§è¡å¨åéçè°åº¦è¯·æ±æ¶ä½¿ç¨RequestModelåResponseModel两个对象å°è£
è°åº¦è¯·æ±åæ°åååºæ°æ®, å¨è¿è¡é讯ä¹ååºå±ä¼å°ä¸è¿°ä¸¤ä¸ªå¯¹è±¡å¯¹è±¡åºååï¼å¹¶è¿è¡æ°æ®åè®®ä»¥åæ¶é´æ³æ£éª,ä»èè¾¾å°æ°æ®å å¯çåè½; |
| | | |
| | | ### 5.7 任塿³¨å, ä»»å¡èªå¨åç° |
| | | èªv1.5çæ¬ä¹å, ä»»å¡åæ¶äº"任塿§è¡æºå¨"屿§, æ¹ä¸ºéè¿ä»»å¡æ³¨ååèªå¨åç°çæ¹å¼, 卿è·åè¿ç¨æ§è¡å¨å°åå¹¶æ§è¡ã |
| | | |
| | | AppName: æ¯ä¸ªæ§è¡å¨æºå¨é群çå¯ä¸æ 示, 任塿³¨å以 "æ§è¡å¨" 为æå°ç²åº¦è¿è¡æ³¨å; æ¯ä¸ªä»»å¡éè¿å
¶ç»å®çæ§è¡å¨å¯æç¥å¯¹åºçæ§è¡å¨æºå¨å表; |
| | | 注å表: è§"xxl_job_registry"表, "æ§è¡å¨" å¨è¿è¡ä»»å¡æ³¨åæ¶å°ä¼å¨ææ§ç»´æ¤ä¸æ¡æ³¨åè®°å½ï¼å³æºå¨å°ååAppNameçç»å®å
³ç³»; "è°åº¦ä¸å¿" ä»èå¯ä»¥å¨ææç¥æ¯ä¸ªAppNameå¨çº¿çæºå¨å表; |
| | | æ§è¡å¨æ³¨å: 任塿³¨åBeat卿é»è®¤30s; æ§è¡å¨ä»¥ä¸åBeatè¿è¡æ§è¡å¨æ³¨å, è°åº¦ä¸å¿ä»¥ä¸åBeatè¿è¡å¨æä»»å¡åç°; 注åä¿¡æ¯çå¤±ææ¶é´ä¸ºä¸åBeat; |
| | | æ§è¡å¨æ³¨åæé¤ï¼æ§è¡å¨éæ¯æ¶ï¼å°ä¼ä¸»å¨ä¸æ¥è°åº¦ä¸å¿å¹¶æé¤å¯¹åºçæ§è¡å¨æºå¨ä¿¡æ¯ï¼æé«å¿è·³æ³¨åç宿¶æ§ï¼ |
| | | |
| | | |
| | | 为ä¿è¯ç³»ç»"è½»é级"å¹¶ä¸éä½å¦ä¹ é¨ç½²ææ¬ï¼æ²¡æéç¨Zookeeperä½ä¸ºæ³¨åä¸å¿ï¼éç¨DBæ¹å¼è¿è¡ä»»å¡æ³¨ååç°ï¼ |
| | | |
| | | ### 5.8 任塿§è¡ç»æ |
| | | èªv1.6.2ä¹åï¼ä»»å¡æ§è¡ç»æéè¿ "IJobHandler" çè¿åå¼ "ReturnT" è¿è¡å¤æï¼ |
| | | å½è¿åå¼ç¬¦å "ReturnT.code == ReturnT.SUCCESS_CODE" æ¶è¡¨ç¤ºä»»å¡æ§è¡æåï¼å¦åè¡¨ç¤ºä»»å¡æ§è¡å¤±è´¥ï¼èä¸å¯ä»¥éè¿ "ReturnT.msg" åè°é误信æ¯ç»è°åº¦ä¸å¿ï¼ |
| | | ä»èï¼å¨ä»»å¡é»è¾ä¸å¯ä»¥æ¹ä¾¿çæ§å¶ä»»å¡æ§è¡ç»æï¼ |
| | | |
| | | ### 5.9 åç广æ & 卿åç |
| | | æ§è¡å¨é群é¨ç½²æ¶ï¼ä»»å¡è·¯ç±çç¥éæ©"åç广æ"æ
åµä¸ï¼ä¸æ¬¡ä»»å¡è°åº¦å°ä¼å¹¿æè§¦å对åºéç¾¤ä¸æææ§è¡å¨æ§è¡ä¸æ¬¡ä»»å¡ï¼åæ¶ç³»ç»èªå¨ä¼ éåçåæ°ï¼å¯æ ¹æ®åçåæ°å¼ååçä»»å¡ï¼ |
| | | |
| | | "åç广æ" 以æ§è¡å¨ä¸ºç»´åº¦è¿è¡åçï¼æ¯æå¨ææ©å®¹æ§è¡å¨é群ä»è卿å¢å åçæ°éï¼ååè¿è¡ä¸å¡å¤çï¼å¨è¿è¡å¤§æ°æ®éä¸å¡æä½æ¶å¯æ¾èæåä»»å¡å¤çè½ååé度ã |
| | | |
| | | "åç广æ" åæ®éä»»å¡å¼åæµç¨ä¸è´ï¼ä¸åä¹å¤å¨äºå¯ä»¥å¯ä»¥è·ååçåæ°ï¼è·ååçåæ°è¿è¡åçä¸å¡å¤çã |
| | | |
| | | - Javaè¯è¨ä»»å¡è·ååçåæ°æ¹å¼ï¼BEANãGLUE模å¼(Java) |
| | | ``` |
| | | // å¯åèSampleç¤ºä¾æ§è¡å¨ä¸ç示ä¾ä»»å¡"ShardingJobHandler"äºè§£è¯ç¨ |
| | | ShardingUtil.ShardingVO shardingVO = ShardingUtil.getShardingVo(); |
| | | ``` |
| | | - èæ¬è¯è¨ä»»å¡è·ååçåæ°æ¹å¼ï¼GLUE模å¼(Shell)ãGLUE模å¼(Python)ãGLUE模å¼(Nodejs) |
| | | ``` |
| | | // èæ¬ä»»å¡å
¥ååºå®ä¸ºä¸ä¸ªï¼ä¾æ¬¡ä¸ºï¼ä»»å¡ä¼ åãåçåºå·ãåçæ»æ°ã以Shell模å¼ä»»å¡ä¸ºä¾ï¼è·ååç忰代ç å¦ä¸ |
| | | echo "åçåºå· index = $2" |
| | | echo "åçæ»æ° total = $3" |
| | | ``` |
| | | |
| | | åç忰屿§è¯´æï¼ |
| | | |
| | | indexï¼å½ååçåºå·(ä»0å¼å§)ï¼æ§è¡å¨é群å表ä¸å½åæ§è¡å¨çåºå·ï¼ |
| | | totalï¼æ»åçæ°ï¼æ§è¡å¨éç¾¤çæ»æºå¨æ°éï¼ |
| | | |
| | | è¯¥ç¹æ§éç¨åºæ¯å¦ï¼ |
| | | - 1ãåçä»»å¡åºæ¯ï¼10个æ§è¡å¨çé群æ¥å¤ç10wæ¡æ°æ®ï¼æ¯å°æºå¨åªéè¦å¤ç1wæ¡æ°æ®ï¼èæ¶éä½10åï¼ |
| | | - 2ã广æä»»å¡åºæ¯ï¼å¹¿ææ§è¡å¨æºå¨è¿è¡shellèæ¬ã广æé群èç¹è¿è¡ç¼åæ´æ°ç |
| | | |
| | | ### 5.10 访é®ä»¤çï¼AccessTokenï¼ |
| | | 为æåç³»ç»å®å
¨æ§ï¼è°åº¦ä¸å¿åæ§è¡å¨è¿è¡å®å
¨æ§æ ¡éªï¼åæ¹AccessTokenå¹é
æå
许éè®¯ï¼ |
| | | |
| | | è°åº¦ä¸å¿åæ§è¡å¨ï¼å¯éè¿é
置项 "xxl.job.accessToken" è¿è¡AccessTokenç设置ã |
| | | |
| | | è°åº¦ä¸å¿åæ§è¡å¨ï¼å¦æéè¦æ£å¸¸é讯ï¼åªæä¸¤ç§è®¾ç½®ï¼ |
| | | |
| | | - 设置ä¸ï¼è°åº¦ä¸å¿åæ§è¡å¨ï¼åä¸è®¾ç½®AccessTokenï¼å
³éå®å
¨æ§æ ¡éªï¼ |
| | | - 设置äºï¼è°åº¦ä¸å¿åæ§è¡å¨ï¼è®¾ç½®äºç¸åçAccessTokenï¼ |
| | | |
| | | ### 5.11 è°åº¦ä¸å¿APIæå¡ |
| | | |
| | | è°åº¦ä¸å¿æä¾äºAPIæå¡ï¼ä¸»è¦å为两ç§ç±»åï¼ |
| | | #### 5.11.1 æä¾ç»æ§è¡å¨çAPIæå¡ï¼ |
| | | 1ãä»»å¡ç»æåè°æå¡ï¼ |
| | | 2ãæ§è¡å¨æ³¨åæå¡ï¼ |
| | | 3ãæ§è¡å¨æ³¨åæé¤æå¡ï¼ |
| | | 4ã触åä»»å¡å次æ§è¡æå¡ï¼æ¯æä»»å¡æ ¹æ®ä¸å¡äºä»¶è§¦åï¼ |
| | | |
| | | APIæå¡ä½ç½®ï¼com.xxl.job.core.biz.AdminBiz.java |
| | | APIæå¡è¯·æ±åè代ç ï¼com.xxl.job.adminbiz.AdminBizTest.java |
| | | |
| | | #### 5.11.2 æä¾ç»ä¸å¡çAPIæå¡ï¼ |
| | | 1ãä»»å¡å表æ¥è¯¢ï¼ |
| | | 2ã任塿°å¢ï¼ |
| | | 3ã任塿´æ°ï¼ |
| | | 4ãä»»å¡å é¤ï¼ |
| | | 5ãä»»å¡å¯å¨ï¼ |
| | | 6ãä»»å¡åæ¢ï¼ |
| | | 7ãä»»å¡è§¦åï¼ |
| | | |
| | | APIæå¡ä½ç½®ï¼com.xxl.job.admin.controller.JobInfoController.java |
| | | APIæå¡è¯·æ±åè代ç ï¼å¯åèä»»å¡ç颿ä½çajax请æ±ãä»»ä½ajaxæ¥å£åå¯é
ç½®æä¸ºAPIæå¡ï¼åªéå¨å¾
å¯ç¨çAPIæå¡ä¸æ·»å â@PermissionLimit(limit = false)â æ³¨è§£åæ¶ç»éææ¦æªå³å¯ï¼ |
| | | |
| | | ### 5.12 æ§è¡å¨APIæå¡ |
| | | æ§è¡å¨æä¾äºAPIæå¡ï¼ä¾è°åº¦ä¸å¿éæ©ä½¿ç¨ï¼ç®åæä¾çAPIæå¡æï¼ |
| | | |
| | | 1ãå¿è·³æ£æµï¼è°åº¦ä¸å¿ä½¿ç¨ |
| | | 2ãå¿ç¢æ£æµï¼è°åº¦ä¸å¿ä½¿ç¨ |
| | | 3ã触å任塿§è¡ï¼è°åº¦ä¸å¿ä½¿ç¨ï¼æ¬å°è¿è¡ä»»å¡å¼åæ¶ï¼å¯ä½¿ç¨è¯¥APIæå¡æ¨¡æè§¦åä»»å¡ï¼ |
| | | 4ãè·åRolling Logï¼è°åº¦ä¸å¿ä½¿ç¨ |
| | | 5ãç»æ¢ä»»å¡ï¼è°åº¦ä¸å¿ä½¿ç¨ |
| | | |
| | | APIæå¡ä½ç½®ï¼com.xxl.job.core.biz.ExecutorBiz |
| | | APIæå¡è¯·æ±åè代ç ï¼com.xxl.job.executor.ExecutorBizTest |
| | | |
| | | ### 5.13 æ
é转移 & 失败éè¯ |
| | | 䏿¬¡å®æ´ä»»å¡æµç¨å
æ¬"è°åº¦ï¼è°åº¦ä¸å¿ï¼ + æ§è¡ï¼æ§è¡å¨ï¼"ä¸¤ä¸ªé¶æ®µã |
| | | |
| | | - "æ
é转移"åçå¨è°åº¦é¶æ®µï¼å¨æ§è¡å¨é群é¨ç½²æ¶ï¼å¦ææä¸å°æ§è¡å¨åçæ
éï¼è¯¥çç¥æ¯æèªå¨è¿è¡Failover忢å°ä¸å°æ£å¸¸çæ§è¡å¨æºå¨å¹¶ä¸å®æè°åº¦è¯·æ±æµç¨ã |
| | | - "失败éè¯"åçå¨"è°åº¦ + æ§è¡"ä¸¤ä¸ªé¶æ®µï¼æ¯æéè¿èªå®ä¹ä»»å¡å¤±è´¥éè¯æ¬¡æ°ï¼å½ä»»å¡å¤±è´¥æ¶å°ä¼æç
§é¢è®¾ç失败éè¯æ¬¡æ°ä¸»å¨è¿è¡éè¯ï¼ |
| | | |
| | | ### 5.14 æ§è¡å¨ç°åº¦ä¸çº¿ |
| | | è°åº¦ä¸å¿ä¸ä¸å¡è§£è¦ï¼åªéé¨ç½²ä¸æ¬¡å常年ä¸éè¦ç»´æ¤ã使¯ï¼æ§è¡å¨ä¸æç®¡è¿è¡çä¸å¡ä½ä¸ï¼ä½ä¸ä¸çº¿ååæ´éè¦é坿§è¡å¨ï¼å°¤å
¶æ¯Bean模å¼ä»»å¡ã |
| | | æ§è¡å¨éå¯å¯è½ä¼ä¸æè¿è¡ä¸çä»»å¡ã使¯ï¼XXL-JOBå¾çäºèªå»ºæ§è¡å¨ä¸èªå»ºæ³¨åä¸å¿ï¼å¯ä»¥éè¿ç°åº¦ä¸çº¿çæ¹å¼ï¼é¿å
å éå¯å¯¼è´çä»»å¡ä¸æçé®é¢ã |
| | | |
| | | æ¥éª¤å¦ä¸ï¼ |
| | | - 1ãæ§è¡å¨æ¹ä¸ºæå¨æ³¨åï¼ä¸çº¿ä¸åæºå¨å表ï¼Aç»ï¼ï¼çº¿ä¸è¿è¡å¦ä¸åæºå¨å表ï¼Bç»ï¼ï¼ |
| | | - 2ãçå¾
Aç»æºå¨ä»»å¡è¿è¡ç»æå¹¶ç¼è¯ä¸çº¿ï¼æ§è¡å¨æ³¨åå°åæ¿æ¢ä¸ºAç»ï¼ |
| | | - 3ãçå¾
Bç»æºå¨ä»»å¡è¿è¡ç»æå¹¶ç¼è¯ä¸çº¿ï¼æ§è¡å¨æ³¨åå°åæ¿æ¢ä¸ºAç»+Bç»ï¼ |
| | | æä½ç»æï¼ |
| | | |
| | | ### 5.15 任塿§è¡ç»æè¯´æ |
| | | ç³»ç»æ ¹æ®ä»¥ä¸æ å夿任塿§è¡ç»æï¼å¯åèä¹ã |
| | | |
| | | -- | Bean/Glue(Java) | Glue(Shell) çèæ¬ä»»å¡ |
| | | --- | --- | --- |
| | | æå | IJobHandler.SUCCESS | 0 |
| | | 失败 | IJobHandler.FAIL | -1ï¼é0ç¶æç ï¼ |
| | | |
| | | ### 5.16 ä»»å¡è¶
æ¶æ§å¶ |
| | | æ¯æè®¾ç½®ä»»å¡è¶
æ¶æ¶é´ï¼ä»»å¡è¿è¡è¶
æ¶çæ
åµä¸ï¼å°ä¼ä¸»å¨ä¸æä»»å¡ï¼ |
| | | |
| | | éè¦æ³¨æçæ¯ï¼ä»»å¡è¶
æ¶ä¸ææ¶ä¸ä»»å¡ç»æ¢æºå¶ï¼å¯æ¥çâ4.9 ç»æ¢è¿è¡ä¸çä»»å¡âï¼ç±»ä¼¼ï¼ä¹æ¯éè¿ "interrupt" 䏿任å¡ï¼å æ¤ä¸å¡ä»£ç éè¦å° "InterruptedException" 夿ï¼å¦ååè½ä¸å¯ç¨ã |
| | | |
| | | ### 5.17 è·¨å¹³å° & è·¨è¯è¨ |
| | | 跨平å°ãè·¨è¯è¨ä¸»è¦ä½ç°å¨ä»¥ä¸ä¸¤ä¸ªæ¹é¢ï¼ |
| | | - 1ãæä¾JavaãPythonãPHPâ¦â¦ç忥ç§ä»»å¡æ¨¡å¼ï¼å¯åèç« è â5.5 ä»»å¡ "è¿è¡æ¨¡å¼" âï¼ç论ä¸å¯æ©å±ä»»æè¯è¨ä»»å¡æ¨¡å¼ï¼ |
| | | - 2ãæä¾åºäºHTTPçä»»å¡Handlerï¼Beanä»»å¡ï¼JobHandler="HttpJobHandler"ï¼ï¼ä¸å¡æ¹åªéè¦æä¾HTTP龿¥å³å¯ï¼ä¸éå¶è¯è¨ãå¹³å°ï¼ |
| | | |
| | | ### 5.18 ä»»å¡å¤±è´¥åè¦ |
| | | é»è®¤æä¾é®ä»¶å¤±è´¥åè¦ï¼å¯æ©å±çä¿¡ãééçæ¹å¼ï¼æ©å±ä»£ç ä½ç½®ä¸º "JobFailMonitorHelper.failAlarm"ï¼ |
| | | |
| | | ### 5.19 è°åº¦ä¸å¿Dockeréåæå»º |
| | | å¯ä»¥éè¿ä»¥ä¸å½ä»¤å¿«éæå»ºè°åº¦ä¸å¿ï¼å¹¶å¯å¨è¿è¡ï¼ |
| | | ``` |
| | | mvn clean package |
| | | docker build -t xuxueli/xxl-job-admin ./xxl-job-admin |
| | | docker run --name xxl-job-admin -p 8080:8080 -d xuxueli/xxl-job-admin |
| | | ``` |
| | | |
| | | ### 5.20 é¿å
ä»»å¡é夿§è¡ |
| | | è°åº¦å¯éæè
èæ¶ä»»å¡å¯è½ä¼å¯¼è´ä»»å¡é»å¡ï¼é群æ
åµä¸è°åº¦ç»ä»¶å°æ¦çæ
åµä¸ä¼éå¤è§¦åï¼ |
| | | é对ä¸è¿°æ
åµï¼å¯ä»¥éè¿ç»å "åæºè·¯ç±çç¥ï¼å¦ï¼ç¬¬ä¸å°ãä¸è´æ§åå¸ï¼" + "é»å¡çç¥ï¼å¦ï¼åæºä¸²è¡ã丢å¼åç»è°åº¦ï¼" æ¥è§é¿ï¼æç»é¿å
ä»»å¡é夿§è¡ã |
| | | |
| | | ### 5.21 å½ä»¤è¡ä»»å¡ |
| | | åçæä¾éç¨å½ä»¤è¡ä»»å¡Handlerï¼Beanä»»å¡ï¼"CommandJobHandler"ï¼ï¼ä¸å¡æ¹åªéè¦æä¾å½ä»¤è¡å³å¯ï¼ |
| | | å¦ä»»å¡åæ° "pwd" å°ä¼æ§è¡å½ä»¤å¹¶è¾åºæ°æ®ï¼ |
| | | |
| | | ### 5.22 æ¥å¿èªå¨æ¸
ç |
| | | XXL-JOBæ¥å¿ä¸»è¦å
å«å¦ä¸ä¸¤é¨åï¼åæ¯ææ¥å¿èªå¨æ¸
çï¼è¯´æå¦ä¸ï¼ |
| | | - è°åº¦ä¸å¿æ¥å¿è¡¨æ°æ®ï¼å¯åå©é
置项 "xxl.job.logretentiondays" 设置æ¥å¿è¡¨æ°æ®ä¿å天æ°ï¼è¿ææ¥å¿èªå¨æ¸
çï¼è¯¦æ
坿¥ç䏿é
置说æï¼ |
| | | - æ§è¡å¨æ¥å¿æä»¶æ°æ®ï¼å¯åå©é
置项 "xxl.job.executor.logretentiondays" 设置æ¥å¿æä»¶æ°æ®ä¿å天æ°ï¼è¿ææ¥å¿èªå¨æ¸
çï¼è¯¦æ
坿¥ç䏿é
置说æï¼ |
| | | |
| | | |
| | | ## å
ãçæ¬æ´æ°æ¥å¿ |
| | | ### 6.1 çæ¬ V1.1.xï¼æ°ç¹æ§[2015-12-05] |
| | | **ãäºV1.1.xçæ¬ï¼XXL-JOBæ£å¼åºç¨äºæå¸ï¼å
é¨å®å¶å«å为 âFerrariâï¼æ°æ¥å
¥åºç¨æ¨èä½¿ç¨ææ°çæ¬ã** |
| | | - 1ãç®åï¼æ¯æéè¿Web页é¢å¯¹ä»»å¡è¿è¡CRUDæä½ï¼æä½ç®åï¼ä¸åéä¸æï¼ |
| | | - 2ãå¨æï¼æ¯æå¨æä¿®æ¹ä»»å¡ç¶æï¼å¨ææå/æ¢å¤ä»»å¡ï¼å³æ¶çæï¼ |
| | | - 3ãæå¡HAï¼ä»»å¡ä¿¡æ¯æä¹
åå°mysqlä¸ï¼Jobæå¡å¤©ç¶æ¯æé群ï¼ä¿è¯æå¡HAï¼ |
| | | - 4ãä»»å¡HAï¼æå°Jobæå¡ææï¼ä»»å¡ä¼å¹³æ»åé
ç»å
¶ä»çæä¸å°åæ´»æå¡ï¼å³ä½¿æææå¡ææï¼é坿¶æè¡¥å¿æ§è¡ä¸¢å¤±ä»»å¡ï¼ |
| | | - 5ãä¸ä¸ªä»»å¡åªä¼å¨å
¶ä¸ä¸å°æå¡å¨ä¸æ§è¡ï¼ |
| | | - 6ãä»»å¡ä¸²è¡æ§è¡ï¼ |
| | | - 7ãæ¯æèªå®ä¹åæ°ï¼ |
| | | - 8ãæ¯æè¿ç¨ä»»å¡æ§è¡ç»æ¢ï¼ |
| | | |
| | | ### 6.2 çæ¬ V1.2.xï¼æ°ç¹æ§[2016-01-17] |
| | | - 1ãæ¯æä»»å¡åç»ï¼ |
| | | - 2ãæ¯æâæ¬å°ä»»å¡âãâè¿ç¨ä»»å¡âï¼ |
| | | - 3ãåºå±éè®¯æ¯æä¸¤ç§æ¹å¼ï¼Servletæ¹å¼ + JETTYæ¹å¼ï¼ |
| | | - 4ãæ¯æâ任塿¥å¿âï¼ |
| | | - 5ãæ¯æâä¸²è¡æ§è¡âï¼å¹¶è¡æ§è¡ï¼ |
| | | |
| | | 说æï¼V1.2çæ¬å°ç³»ç»æ¶ææåè½æåä¸ºï¼ |
| | | |
| | | - è°åº¦æ¨¡åï¼è°åº¦ä¸å¿ï¼ï¼è´è´£ç®¡çè°åº¦ä¿¡æ¯ï¼æç
§è°åº¦é
ç½®ååºè°åº¦è¯·æ±ï¼ |
| | | - æ§è¡æ¨¡åï¼æ§è¡å¨ï¼ï¼è´è´£æ¥æ¶è°åº¦è¯·æ±å¹¶æ§è¡ä»»å¡é»è¾ï¼ |
| | | - é讯模åï¼è´è´£è°åº¦æ¨¡åå任塿¨¡åä¹é´çä¿¡æ¯éè®¯ï¼ |
| | | ä¼ç¹ï¼ |
| | | |
| | | - è§£è¦ï¼ä»»å¡æ¨¡åæä¾ä»»å¡æ¥å£ï¼è°åº¦æ¨¡åç»´æ¤è°åº¦ä¿¡æ¯ï¼ä¸å¡ç¸äºç¬ç«ï¼ |
| | | - 髿©å±æ§ï¼ |
| | | - ç¨³å®æ§ï¼ |
| | | |
| | | ### 6.3 çæ¬ V1.3.0ï¼æ°ç¹æ§[2016-05-19] |
| | | - 1ãéå¼âæ¬å°ä»»å¡â模å¼ï¼æ¨è使ç¨âè¿ç¨ä»»å¡âï¼æäºç³»ç»è§£è¦ï¼ä»»å¡å¯¹åºçJobHandlerç»ç§°ä¸ºâæ§è¡å¨âï¼ |
| | | - 2ãéå¼âservletâæ¹å¼åºå±ç³»ç»éè®¯ï¼æ¨è使ç¨JETTYæ¹å¼ï¼è°åº¦+åè°ååé讯ï¼éæé讯é»è¾ï¼ |
| | | - 3ãUI交äºä¼åï¼å·¦ä¾§èåå±å¼ç¶æä¼åï¼èå项éä¸ç¶æä¼åï¼ä»»å¡å表æå¼è¡¨æ ¼æå缩ä¼åï¼ |
| | | - 4ããéè¦ãâæ§è¡å¨âç»å为ï¼BEANãGLUE两ç§å¼å模å¼ï¼ç®ä»è§ä¸æï¼ |
| | | |
| | | âæ§è¡å¨â 模å¼ç®ä»ï¼ |
| | | - BEANæ¨¡å¼æ§è¡å¨ï¼æ¯ä¸ªæ§è¡å¨é½æ¯Springçä¸ä¸ªBeanå®ä¾ï¼XXL-JOBéè¿æ³¨è§£@JobHandlerè¯å«åè°åº¦æ§è¡å¨ï¼ |
| | | -GLUEæ¨¡å¼æ§è¡å¨ï¼æ¯ä¸ªæ§è¡å¨å¯¹åºä¸æ®µä»£ç ï¼å¨çº¿Webç¼è¾åç»´æ¤ï¼å¨æç¼è¯çæï¼æ§è¡å¨è´è´£å è½½GLUE代ç åæ§è¡ï¼ |
| | | |
| | | ### 6.4 çæ¬ V1.3.1ï¼æ°ç¹æ§[2016-05-23] |
| | | - 1ãæ´æ°é¡¹ç®ç®å½ç»æï¼ |
| | | - /xxl-job-admin -------------------- ãè°åº¦ä¸å¿ãï¼è´è´£ç®¡çè°åº¦ä¿¡æ¯ï¼æç
§è°åº¦é
ç½®ååºè°åº¦è¯·æ±ï¼ |
| | | - /xxl-job-core ----------------------- å
Œ
±ä¾èµ |
| | | - /xxl-job-executor-example ------ ãæ§è¡å¨ãï¼è´è´£æ¥æ¶è°åº¦è¯·æ±å¹¶æ§è¡ä»»å¡é»è¾ï¼ |
| | | - /db ---------------------------------- å»ºè¡¨èæ¬ |
| | | - /doc --------------------------------- ç¨æ·æå |
| | | - 2ã卿°çç®å½ç»æä¸ï¼å级äºç¨æ·æåï¼ |
| | | - 3ãä¼åäºä¸äºäº¤äºåUIï¼ |
| | | |
| | | ### 6.5 çæ¬ V1.3.2ï¼æ°ç¹æ§[2016-05-28] |
| | | - 1ãè°åº¦é»è¾è¿è¡äºå¡å
è£¹ï¼ |
| | | - 2ãæ§è¡å¨å¼æ¥åè°æ§è¡æ¥å¿ï¼ |
| | | - 3ããéè¦ãå¨ âè°åº¦ä¸å¿â æ¯æHAçåºç¡ä¸ï¼æ©å±æ§è¡å¨çFailoveræ¯æï¼æ¯æé
ç½®å¤æ§è¡æå°åï¼ |
| | | |
| | | ### 6.6 çæ¬ V1.4.0 æ°ç¹æ§[2016-07-24] |
| | | - 1ãä»»å¡ä¾èµ: éè¿äºä»¶è§¦åæ¹å¼å®ç°, 任塿§è¡æåå¹¶åè°æ¶ä¼ä¸»å¨è§¦å䏿¬¡åä»»å¡çè°åº¦, å¤ä¸ªåä»»å¡ç¨éå·åé; |
| | | - 2ãæ§è¡å¨åºå±å®ç°ä»£ç è¿è¡é度éæ, ä¼ååºå±å»ºè¡¨èæ¬; |
| | | - 3ãæ§è¡å¨ä¸ä»»å¡çº¿ç¨åç»é»è¾ä¼å: ä¹åæ ¹æ®æ§è¡å¨JobHandlerè¿è¡çº¿ç¨åç»,å½å¤ä¸ªä»»å¡å¤ç¨Jobhanlderä¼å¯¼è´ç¸äºé»å¡ãç°æ¹ä¸ºæ ¹æ®è°åº¦ä¸å¿ä»»å¡è¿è¡ä»»å¡çº¿ç¨åç»,ä»»å¡ä¸ä»»å¡æ§è¡ç¸äºé离; |
| | | - 4ãæ§è¡å¨è°åº¦éè®¯æ¹æ¡ä¼å, éè¿Hex + HCå®ç°å»ºè®®RPCé讯åè®®, ä¼åäºéè®¯åæ°çç»´æ¤åè§£ææµç¨; |
| | | - 5ãè°åº¦ä¸å¿, æ°å»º/ç¼è¾ä»»å¡, çé¢å±æ§è°æ´: |
| | | - 5.1ã任塿°å¢/ç¼è¾çé¢ä¸å»é¤ "ä»»å¡åJobName"屿§ ,è¯¥å±æ§æ¹ä¸ºç³»ç»èªå¨çæ: è¯¥åæ®µä¹å主è¦ç¨äºå¨ "è°åº¦ä¸å¿" å¯ä¸æ 示ä¸ä¸ªä»»å¡, ç°å®æä¹ä¸å¤§, å æ¤è®¡åæ·¡åæè¯¥å段,æ¹ä¸ºç³»ç»çæUUID,ä»èç®å任塿°å»ºçæä½; |
| | | - 5.2ã任塿°å¢/ç¼è¾çé¢ä¸å»é¤ "GLUE模å¼" å¤éæ¡ä½ç½®è°æ´, æ¹ä¸ºè´´è¿"JobHandler"è¾å
¥æ¡å³ä¾§; |
| | | - 5.3ã任塿°å¢/ç¼è¾çé¢ä¸å»é¤ "æ¥è¦éå¼" 屿§; |
| | | - 5.4ã任塿°å¢/ç¼è¾çé¢ä¸å»é¤ "åä»»å¡Key" 屿§, æ¯ä¸ªä»»å¡å
¨å±ä»»å¡Keyå¯ä»¥ä»ä»»å¡å表è·å, 彿¬ä»»å¡æ§è¡ç»æä¸æåå, å°ä¼æ ¹æ®åä»»å¡Keyå¹é
åä»»å¡å¹¶ä¸»å¨è§¦å䏿¬¡å任塿§è¡; |
| | | - 6ãé®é¢ä¿®å¤: |
| | | - 6.1ãæ§è¡å¨jettyå
³éä¼å,è§£å³ä¸å¤å¯è½å¯¼è´jettyæ æ³å
³éçé®é¢; |
| | | - 6.2ãæ§è¡å¨ä»»å¡ç»æ¢æ¶,æ§è¡éååè°ä¼å,è§£å³ä¸å¤å¯¼è´ä»»å¡æ æ³åè°çé®é¢ï¼ |
| | | - 6.3ãè°åº¦ä¸å¿ä¸å表å页忰ä¼å,è§£å³ä¸å¤å æå¡å¨éå¶posté¿åº¦èå¼èµ·çé®é¢; |
| | | - 6.4ãæ§è¡å¨Jobhandler注解ä¼å,è§£å³ä¸å¤å äºå¡ä»£ç导è´ç容卿 æ³å è½½JobHandlerçé®é¢; |
| | | - 6.5ãè¿ç¨è°åº¦ä¼å,ç¦ç¨retryçç¥,è§£å³ä¸å¤å¯è½å¯¼è´éå¤è°ç¨çé®é¢; |
| | | |
| | | Tips: åå²çæ¬(V1.3.x)ç®åå·²ç»Releaseè³ç¨³å®çæ¬, è¿å
¥ç»´æ¤é¶æ®µ, å°åè§åæ¯ [V1.3](https://github.com/xuxueli/xxl-job/tree/v1.3) ãæ°ç¹æ§å°ä¼å¨master忝æç»æ´æ°ã |
| | | |
| | | ### 6.7 çæ¬ V1.4.1 æ°ç¹æ§[2016-09-06] |
| | | - 1ãé¡¹ç®æåæ¨émavenä¸å¤®ä»åº, ä¸å¤®ä»åºå°å以åä¾èµå¦ä¸: |
| | | ``` |
| | | <!-- http://repo1.maven.org/maven2/com/xuxueli/xxl-job-core/ --> |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>${ææ°ç¨³å®ç}</version> |
| | | </dependency> |
| | | ``` |
| | | - 2ã为éé
ä¸å¤®ä»åºè§å, 项ç®groupIdä»com.xxlæ¹ä¸ºcom.xuxueliã |
| | | - 3ãç³»ç»çæ¬ä¸å¨ç»´æ¤å¨é¡¹ç®è·pomä¸,åä¸ªåæ¨¡ååç¬é
ç½®çæ¬é
ç½®,è§£å³åæ¨¡åæ æ³åç¬ç¼è¯çé®é¢; |
| | | - 4ãåºå±RPCé讯,ä¼ è¾æ°æ®çåèé¿åº¦ç»è®¡è§åä¼å,å¯èç50%æ°æ®ä¼ è¾é; |
| | | - 5ãIJobHandleråæ¶ä»»å¡è¿åå¼,åéè¿è¿åå¼å¤ææ§è¡ç¶æ,é»è¾æ¹ä¸º:é»è®¤ä»»å¡æ§è¡æå,ä»
卿è·å¼å¸¸æ¶è®¤å®ä»»å¡æ§è¡å¤±è´¥ã |
| | | - 6ãç³»ç»å
Œ
±å¼¹æ¡åè½,æä»¶å; |
| | | - 7ãåºå±è¡¨ç»æ,表æç»ä¸å¤§å; |
| | | - 8ãè°åº¦ä¸å¿,å¼å¸¸å¤çå¨JSONååºçContentTypeä¿®æ¹,ä¿®å¤æµè§å¨ä¸è¯å«çé®é¢; |
| | | |
| | | ### 6.8 çæ¬ V1.4.2 æ°ç¹æ§[2016-09-29] |
| | | - 1ãæ¨éæ°çæ¬ V1.4.2 è³ä¸å¤®ä»åº, å¤§çæ¬ V1.4 è¿å
¥ç»´æ¤é¶æ®µ; |
| | | - 2ã任塿°å¢æ¶,ä»»å¡å表åç§»é®é¢ä¿®å¤; |
| | | - 3ãä¿®å¤ä¸å¤å bootstrap䏿¯ææ¨¡ææ¡éå è导è´çæ ·å¼éä¹±çé®é¢, å¨ä»»å¡ç¼è¾æ¶ä¼åºç°è¯¥é®é¢; |
| | | - 4ãè°åº¦è¶
æ¶åHandlerå¹é
ä¸å°æ¶,è°åº¦ç¶æä¼å; |
| | | - 5ãå catchå¼å¸¸,导è´ä»»å¡ä¸å¯ç»æ¢çé®é¢,ç»åºè§£å³æ¹æ¡, è§ææ¡£; |
| | | |
| | | ### 6.9 çæ¬ V1.5.0 ç¹æ§[2016-11-13] |
| | | - 1ã任塿³¨å: æ§è¡å¨ä¼å¨ææ§èªå¨æ³¨åä»»å¡, è°åº¦ä¸å¿å°ä¼èªå¨åç°æ³¨åçä»»å¡å¹¶è§¦åæ§è¡ã |
| | | - 2ã"æ§è¡å¨" æ°å¢åæ° "AppName" : æ¯æ¯ä¸ªæ§è¡å¨é群çå¯ä¸æ 示AppName, 并卿æ§ä»¥AppName为对象è¿è¡èªå¨æ³¨åã |
| | | - 3ãè°åº¦ä¸å¿æ°å¢æ ç® "æ§è¡å¨ç®¡ç" : 管çå¨çº¿çæ§è¡å¨, éè¿å±æ§AppNameèªå¨åç°æ³¨åçæ§è¡å¨ãåªæè¢«ç®¡ççæ§è¡å¨æå
许被使ç¨; |
| | | - 4ã"ä»»å¡ç»"屿§æ¹ä¸º"æ§è¡å¨": æ¯ä¸ªä»»å¡éè¦ç»å®æå®çæ§è¡å¨, è°åº¦å°åéè¿ç»å®çæ§è¡å¨è·å; |
| | | - 5ãæå¼"任塿ºå¨"屿§: éè¿ä»»å¡ç»å®çæ§è¡å¨, èªå¨åç°æ³¨åçè¿ç¨æ§è¡å¨å°å并触åè°åº¦è¯·æ±ã |
| | | - 6ã"å
Œ
±ä¾èµ"䏿°å¢DBGlueLoader,åºäºåçjdbcå®ç°GLUEæºç çå è½½å¨,åå°ç¬¬ä¸æ¹ä¾èµ(mybatis,spring-ormç);ç²¾ç®åä¼åæ§è¡å¨æµé
ç½®(é对GLUEä»»å¡),éä½ä¸æé¾åº¦; |
| | | - 7ãè¡¨ç»æè°æ´,åºå±éæä¼å; |
| | | - 8ã"è°åº¦ä¸å¿"èªå¨æ³¨åååç°,failover: è°åº¦ä¸å¿å¨ææ§èªå¨æ³¨å, ä»»å¡åè°æ¶å¯ä»¥æç¥å¨çº¿çææè°åº¦ä¸å¿å°å, éè¿failoverçæ¹å¼è¿è¡ä»»å¡åè°,é¿å
åè°åç¹é£é©ã |
| | | |
| | | ### 6.10 çæ¬ V1.5.1 ç¹æ§[2016-11-13] |
| | | - 1ãåºå±ä»£ç éæåé»è¾ä¼åï¼POMæ¸
ç以åCleanCodeï¼ |
| | | - 2ãServlet/JSP Spec设å®ä¸º3.0/2.2 |
| | | - 3ãSpringå级è³3.2.17.RELEASEçæ¬ï¼ |
| | | - 4ãJettyåçº§çæ¬è³8.2.0.v20160908ï¼ |
| | | - 5ãå·²æ¨éV1.5.0åV1.5.1è³Mavenä¸å¤®ä»åºï¼ |
| | | |
| | | ### 6.10 çæ¬ V1.5.2 ç¹æ§[2017-02-28] |
| | | - 1ãIPå·¥å
·ç±»è·åIPé»è¾ä¼åï¼IPéæç¼åï¼ |
| | | - 2ãæ§è¡å¨ãè°åº¦ä¸å¿ï¼åæ¯æèªå®ä¹æ³¨åIPå°åï¼è§£å³æºå¨å¤ç½å¡æ¶é误ç½å¡æ³¨åçæ
åµï¼ |
| | | - 3ãä»»å¡è·¨å¤©æ§è¡æ¶çæå¤ä»½æ¥å¿æä»¶çé®é¢ä¿®å¤ï¼ |
| | | - 4ãåºå±æ¥å¿åºå±æ¥å¿è°æ´ï¼éæææ¥å¿levelè°æ´ä¸ºdebugï¼ |
| | | - 5ãåçº§æ°æ®åºè¿æ¥æ± c3p0çæ¬ï¼ |
| | | - 6ãæ§è¡å¨log4jé
ç½®ä¼åï¼å»é¤æ æå±æ§ï¼ |
| | | - 7ãåºå±ä»£ç éæåé»è¾ä¼å以åCleanCodeï¼ |
| | | - 8ãGLUEä¾èµæ³¨å
¥é»è¾ä¼åï¼æ¯æå«å注å
¥ï¼ |
| | | |
| | | ### 6.11 çæ¬ V1.6.0 ç¹æ§[2017-03-13] |
| | | - 1ãéè®¯æ¹æ¡å级ï¼ååºäºHEXçé讯模åè°æ´ä¸ºåºäºHTTPçB-RPCçé讯模åï¼ |
| | | - 2ãæ§è¡å¨æ¯ææå¨è®¾ç½®æ§è¡å°ååè¡¨ï¼æä¾å¼å
³åæ¢ä½¿ç¨æ³¨åå°åè¿æ¯æå¨è®¾ç½®çå°åï¼ |
| | | - 3ãæ§è¡å¨è·¯ç±è§åï¼ç¬¬ä¸ä¸ªãæåä¸ä¸ªã轮询ãéæºãä¸è´æ§HASHãæä¸ç»å¸¸ä½¿ç¨ãæè¿æä¹
æªä½¿ç¨ãæ
éè½¬ç§»ï¼ |
| | | - 4ãè§èçº¿ç¨æ¨¡åç»ä¸ï¼ç»ä¸çº¿ç¨éæ¯æ¹æ¡(éè¿listeneræstopæ¹æ³ï¼å®¹å¨éæ¯æ¶éæ¯çº¿ç¨ï¼Daemonæ¹å¼ææ¶ä¸å¤ªçæ³)ï¼ |
| | | - 5ãè§èç³»ç»é
ç½®æ°æ®ï¼éè¿é
ç½®æä»¶ç»ä¸ç®¡çï¼ |
| | | - 6ãCleanCodeï¼æ¸
çæ æçåå²åæ°ï¼ |
| | | - 7ãåºå±æ©å±æ°æ®ç»æä»¥åç¸å
³è¡¨ç»æè°æ´ï¼ |
| | | - 8ãæ°å»ºä»»å¡é»è®¤ä¸ºéè¿è¡ç¶æï¼ |
| | | - 9ãGLUE模å¼ä»»å¡å®ä¾æ´æ°é»è¾ä¼åï¼åæ ¹æ®è¶
æ¶æ¶é´æ´æ°æ¹ä¸ºæ ¹æ®çæ¬å·æ´æ°ï¼æºç åå¨çæ¬å·å ä¸ï¼ |
| | | |
| | | ### 6.12 çæ¬ V1.6.1 ç¹æ§[2017-03-25] |
| | | - 1ãRollingæ¥å¿ï¼ |
| | | - 2ãWebIDE交äºéæï¼ |
| | | - 3ãé讯å¢å¼ºæ ¡éªï¼ææè¿æ»¤éæ£å¸¸è¯·æ±ï¼ |
| | | - 4ãæéå¢å¼ºæ ¡éªï¼éç¨å¨æç»å½TOKENï¼æ¨èæ¥å
¥å
é¨SSOï¼ï¼ |
| | | - 5ãæ°æ®åºé
ç½®ä¼åï¼è§£å³ä¹±ç é®é¢ï¼ |
| | | |
| | | ### 6.13 çæ¬ V1.6.2 ç¹æ§[2017-04-25] |
| | | - 1ãè¿è¡æ¥è¡¨ï¼æ¯æå®æ¶æ¥çè¿è¡æ°æ®ï¼å¦ä»»å¡æ°éãè°åº¦æ¬¡æ°ãæ§è¡å¨æ°éçï¼ä»¥åè°åº¦æ¥è¡¨ï¼å¦è°åº¦æ¥æåå¸å¾ï¼è°åº¦æååå¸å¾çï¼ |
| | | - 2ãJobHandleræ¯æè®¾ç½®ä»»å¡è¿åå¼ï¼å¨ä»»å¡é»è¾ä¸å¯ä»¥æ¹ä¾¿çæ§å¶ä»»å¡æ§è¡ç»æï¼ |
| | | - 3ãèµæºè·¯å¾å
å«ç©ºæ ¼æä¸ææ¶èµæºæä»¶æ æ³å è½½æ¶ï¼æ æ³åç¡®æ¥çå¼å¸¸ä¿¡æ¯çé®é¢å¤çã |
| | | - 4ãè·¯ç±çè¶ä¼åï¼å¾ªç¯åLFUè·¯ç±çç¥è®¡æ°å¨èªå¢æ ä¸éé®é¢å馿¬¡è·¯ç±ååéä¸å¨é¦å°æºå¨çé®é¢ä¿®å¤ï¼ |
| | | |
| | | ### 6.14 çæ¬ V1.7.0 ç¹æ§[2017-05-02] |
| | | - 1ãèæ¬ä»»å¡ï¼æ¯æä»¥GLUE模å¼å¼ååè¿è¡èæ¬ä»»å¡ï¼å
æ¬ShellãPythonåGroovyçç±»åèæ¬; |
| | | - 2ãæ°å¢spring-bootç±»åæ§è¡å¨example项ç®ï¼ |
| | | - 3ãå级jettyçæ¬è³9.2ï¼ |
| | | - 4ãä»»å¡è¿è¡æ¥å¿ç§»é¤log4jç»ä»¶ä¾èµï¼æ¹ä¸ºåºå±èªä¸»å®ç°ï¼ä»èåæ¶äºå¯¹æ¥å¿ç»ä»¶çä¾èµéå¶ï¼ |
| | | - 5ãæ§è¡å¨ç§»é¤GlueLoaderä¾èµï¼æ¹ä¸ºæ¨éæ¹å¼å®ç°ï¼ä»èGLUEæºç å è½½ä¸åä¾èµJDBCï¼ |
| | | - 6ãç»å½æ¦æªRedirectæ¶è·å项ç®åï¼è§£å³éæ ¹æ®ç®å½å叿¶è·³è½¬404é®é¢ï¼ |
| | | |
| | | ### 6.15 çæ¬ V1.7.1 ç¹æ§[2017-05-08] |
| | | - 1ãè¿è¡æ¥å¿è¯»åç¼ç ç»ä¸ä¸ºUTF-8ï¼è§£å³windowsç¯å¢ä¸æ¥å¿ä¹±ç é®é¢ï¼ |
| | | - 2ãé讯è¶
æ¶æ¶é´éå®ä¸º10sï¼é¿å
å¼å¸¸æ
åµä¸è°åº¦çº¿ç¨å ç¨ï¼ |
| | | - 3ãæ§è¡å¨ï¼serverå¯å¨ã鿝忳¨åé»è¾è°æ´ï¼ |
| | | - 4ãJettyServerå
³éé»è¾ä¼åï¼ä¿®å¤æ§è¡å¨æ æ³æ£å¸¸å
³é导è´ç«¯å£å ç¨åé¢ç¹æå°c3p0æ¥å¿çé®é¢ï¼ |
| | | - 5ãJobHandlerä¸å¼å¯åçº¿ç¨æ¶ï¼æ¯æå线ç¨è¾åºæ§è¡æ¥å¿å¹¶éè¿Rollingæ¥çã |
| | | - 6ã任塿¥å¿æ¸
çåè½ï¼ |
| | | - 7ãå¼¹æ¡ç»ä»¶ç»ä¸æ¿æ¢ä¸ºlayerï¼ |
| | | - 8ãå级quartzçæ¬è³2.3.0ï¼ |
| | | |
| | | ### 6.16 çæ¬ V1.7.2 ç¹æ§[2017-05-17] |
| | | - 1ãé»å¡å¤ççç¥ï¼è°åº¦è¿äºå¯éæ§è¡å¨æ¥ä¸åå¤çæ¶çå¤ççç¥ï¼çç¥å
æ¬ï¼åæºä¸²è¡ï¼é»è®¤ï¼ã丢å¼åç»è°åº¦ãè¦çä¹åè°åº¦ï¼ |
| | | - 2ã失败å¤ççç¥ï¼è°åº¦å¤±è´¥æ¶çå¤ççç¥ï¼çç¥å
æ¬ï¼å¤±è´¥åè¦ï¼é»è®¤ï¼ã失败éè¯ï¼ |
| | | - 3ãé讯æ¶é´æ³è¶
æ¶æ¶é´è°æ´ä¸º180sï¼ |
| | | - 4ãæ§è¡å¨ä¸æ°æ®åºå½»åºè§£è¦ï¼ä½æ¯æ§è¡å¨éè¦é
ç½®è°åº¦ä¸å¿é群å°åãè°åº¦ä¸å¿æä¾API便§è¡å¨åè°åå¿è·³æ³¨åæå¡ï¼åæ¶è°åº¦ä¸å¿å
é¨jettyï¼å¿è·³å¨æè°æ´ä¸º30sï¼å¿è·³å¤±æä¸ºä¸åå¿è·³ï¼ |
| | | - 5ãæ§è¡åæ°ç¼è¾æ¶ä¸¢å¤±é®é¢ä¿®å¤ï¼ |
| | | - 6ãæ°å¢ä»»å¡æµè¯Demoï¼æ¹ä¾¿å¨å¼åæ¶è¿è¡ä»»å¡é»è¾æµè¯ï¼ |
| | | |
| | | ### 6.17 çæ¬ V1.8.0 ç¹æ§[2017-07-17] |
| | | - 1ãä»»å¡Cronæ´æ°é»è¾ä¼åï¼æ¹ä¸ºrescheduleJobï¼åæ¶é²æ¢cronéå¤è®¾ç½®ï¼ |
| | | - 2ãAPIåè°æå¡å¤±è´¥ç¶æç ä¼åï¼æ¹ä¾¿é®é¢ææ¥ï¼ |
| | | - 3ãXxlJobLoggerçæ¥å¿å¤åæ°æ¯æï¼ |
| | | - 4ãè·¯ç±çç¥æ°å¢ "å¿ç¢è½¬ç§»" 模å¼ï¼æç
§é¡ºåºä¾æ¬¡è¿è¡ç©ºé²æ£æµï¼ç¬¬ä¸ä¸ªç©ºé²æ£æµæåçæºå¨éå®ä¸ºç®æ æ§è¡å¨å¹¶åèµ·è°åº¦ï¼ |
| | | - 5ãè·¯ç±çç¥ä»£ç éæï¼ |
| | | - 6ãæ§è¡å¨é夿³¨åé®é¢ä¿®å¤ï¼ |
| | | - 7ãä»»å¡çº¿ç¨è½®ç©º30次åèªå¨éæ¯ï¼éä½ä½é¢ä»»å¡çæ æçº¿ç¨æ¶èã |
| | | - 8ãæ§è¡å¨ä»»å¡æ§è¡ç»ææ¹éåè°ï¼éä½åè°é¢çæåæ§è¡å¨æ§è½ï¼ |
| | | - 9ãspringbootçæ¬æ§è¡å¨ï¼åæ¶XMLé
ç½®ï¼æ¹ä¸ºç±»é
ç½®æ¹å¼ï¼ |
| | | - 10ãæ§è¡æ¥å¿ï¼æ¯ææ ¹æ®è¿è¡ "ç¶æ" ç鿥å¿ï¼ |
| | | - 11ãè°åº¦ä¸å¿ä»»å¡æ³¨åæ£æµé»è¾ä¼åï¼ |
| | | |
| | | ### 6.18 çæ¬ V1.8.1 ç¹æ§[2017-07-30] |
| | | - 1ãåç广æä»»å¡ï¼æ§è¡å¨é群é¨ç½²æ¶ï¼ä»»å¡è·¯ç±çç¥éæ©"åç广æ"æ
åµä¸ï¼ä¸æ¬¡ä»»å¡è°åº¦å°ä¼å¹¿æè§¦åéç¾¤ä¸æææ§è¡å¨æ§è¡ä¸æ¬¡ä»»å¡ï¼å¯æ ¹æ®åçåæ°å¤çåçä»»å¡ï¼ |
| | | - 2ã卿åçï¼åç广æä»»å¡ä»¥æ§è¡å¨ä¸ºç»´åº¦è¿è¡åçï¼æ¯æå¨ææ©å®¹æ§è¡å¨é群ä»è卿å¢å åçæ°éï¼ååè¿è¡ä¸å¡å¤çï¼å¨è¿è¡å¤§æ°æ®éä¸å¡æä½æ¶å¯æ¾èæåä»»å¡å¤çè½ååé度ã |
| | | - 3ãæ§è¡å¨JobHandlerç¦æ¢å½åå²çªï¼ |
| | | - 4ãæ§è¡å¨é群å°åå表è¿è¡èªç¶æåºï¼ |
| | | - 5ãè°åº¦ä¸å¿ï¼DAOå±ä»£ç ç²¾ç®ä¼å并䏿°å¢æµè¯ç¨ä¾è¦çï¼ |
| | | - 6ãè°åº¦ä¸å¿APIæå¡æ¹ä¸ºèªç RPCå½¢å¼ï¼ç»ä¸åºå±é讯模åï¼ |
| | | - 7ãæ°å¢è°åº¦ä¸å¿APIæå¡æµè¯Demoï¼æ¹ä¾¿å¨è°åº¦ä¸å¿APIæ©å±åæµè¯ï¼ |
| | | - 8ãä»»å¡å表页交äºä¼åï¼æ´æ¢æ§è¡å¨åç»æ¶èªå¨å·æ°ä»»å¡åè¡¨ï¼æ°å»ºä»»å¡æ¶é»è®¤å®ä½å¨å½åæ§è¡å¨ä½ç½®ï¼ |
| | | - 9ã访é®ä»¤çï¼accessTokenï¼ï¼ä¸ºæåç³»ç»å®å
¨æ§ï¼è°åº¦ä¸å¿åæ§è¡å¨è¿è¡å®å
¨æ§æ ¡éªï¼åæ¹AccessTokenå¹é
æå
许éè®¯ï¼ |
| | | - 10ãspringbootçæ¬æ§è¡å¨ï¼å级è³1.5.6.RELEASEçæ¬ï¼ |
| | | - 11ãç»ä¸mavenä¾èµçæ¬ç®¡çï¼ |
| | | |
| | | ### 6.19 çæ¬ V1.8.2 ç¹æ§[2017-09-04] |
| | | - 1ã项ç®ä¸»é¡µæå»ºï¼æä¾ä¸è±æææ¡£ï¼https://www.xuxueli.com/xxl-job |
| | | - 2ãJFinalæ§è¡å¨Sample示ä¾é¡¹ç®ï¼ |
| | | - 3ãäºä»¶è§¦åï¼é¤äº"Cronæ¹å¼"å"ä»»å¡ä¾èµæ¹å¼"触å任塿§è¡ä¹å¤ï¼æ¯æåºäºäºä»¶ç触å任塿¹å¼ãè°åº¦ä¸å¿æä¾è§¦åä»»å¡å次æ§è¡çAPIæå¡ï¼å¯æ ¹æ®ä¸å¡äºä»¶çµæ´»è§¦åã |
| | | - 4ãæ§è¡å¨æé¤ï¼æ§è¡å¨éæ¯æ¶ï¼ä¸»å¨éç¥è°åº¦ä¸å¿å¹¶æé¤å¯¹åºæ§è¡å¨èç¹ï¼æé«æ§è¡å¨ç¶ææç¥çæ¶ææ§ã |
| | | - 5ãæ§è¡å¨æå¨è®¾ç½®IPæ¶å°ä¼ç»å®Hostï¼ |
| | | - 6ãè§è项ç®ç®å½ï¼æ¹ä¾¿æ©å±å¤æ§è¡å¨ï¼ |
| | | - 7ãè§£å³æ§è¡å¨åè°URL䏿¯æé
ç½®HTTPSæ¶é®é¢ï¼ |
| | | - 8ãæ§è¡å¨åè°çº¿ç¨éæ¯å, æ¹éåè°éå䏿°æ®ï¼é²æ¢ä»»å¡ç»æä¸¢å¤±ï¼ |
| | | - 9ãè°åº¦ä¸å¿ä»»å¡çæ§çº¿ç¨éæ¯æ¶ï¼æ¹é对失败任å¡åè¦ï¼é²æ¢åè¦ä¿¡æ¯ä¸¢å¤±ï¼ |
| | | - 10ã任塿¥å¿æä»¶è·¯å¾æ¶é´æ³æ ¼å¼åæ¶SimpleDateFormatå¹¶åé®é¢è§£å³ï¼ |
| | | |
| | | ### 6.20 çæ¬ V1.9.0 ç¹æ§[2017-12-29] |
| | | - 1ãæ°å¢Nutzæ§è¡å¨Sample示ä¾é¡¹ç®ï¼ |
| | | - 2ãæ°å¢ä»»å¡è¿è¡æ¨¡å¼ "GLUE模å¼(NodeJS) "ï¼æ¯æNodeJSèæ¬ä»»å¡ï¼ |
| | | - 3ãèæ¬ä»»å¡ShellãPythonåNodejsçæ¯æè·ååçåæ°ï¼ |
| | | - 4ã失败éè¯ï¼å®æ´æ¯æï¼è°åº¦ä¸å¿è°åº¦å¤±è´¥ä¸å¯ç¨"失败éè¯"çç¥æ¶ï¼å°ä¼èªå¨éè¯ä¸æ¬¡ï¼æ§è¡å¨æ§è¡å¤±è´¥ä¸åè°å¤±è´¥éè¯ç¶æï¼æ°å¢å¤±è´¥éè¯ç¶æè¿åå¼ï¼æ¶ï¼ä¹å°ä¼èªå¨éè¯ä¸æ¬¡ï¼ |
| | | - 5ã失败åè¦çç¥æ©å±ï¼é»è®¤æä¾é®ä»¶å¤±è´¥åè¦ï¼å¯æ©å±çä¿¡çï¼æ©å±ä»£ç ä½ç½®ä¸º "JobFailMonitorHelper.failAlarm"ï¼ |
| | | - 6ãæ§è¡å¨ç«¯å£æ¯æèªå¨çæ(å°äºçäº0æ¶)ï¼é¿å
端å£å®ä¹å²çªï¼ |
| | | - 7ãè°åº¦æ¥è¡¨ä¼åï¼æ¯ææ¶é´åºé´çéï¼ |
| | | - 8ãLogç»ä»¶æ¯æè¾åºå¼å¸¸æ ä¿¡æ¯ï¼åºå±å®ç°ä¼åï¼ |
| | | - 9ãåè¦é®ä»¶æ ·å¼ä¼åï¼è°æ´ä¸ºè¡¨æ ¼å½¢å¼ï¼é®ä»¶ç»ä»¶è°æ´ä¸ºcommons-emailç®åé®ä»¶æä½ï¼ |
| | | - 10ã项ç®ä¾èµå
¨éå级è³è¾æ°ç¨³å®çæ¬ï¼å¦springãjacksonççï¼ |
| | | - 11ã任塿¥å¿ï¼è®°å½åèµ·è°åº¦çæºå¨ä¿¡æ¯ï¼ |
| | | - 12ã交äºä¼åï¼å¦ç»é注éï¼ |
| | | - 13ãä»»å¡Croné¿åº¦æ©å±æ¯æè³128ä½ï¼æ¯æè´è´£ç±»åCronè®¾ç½®ï¼ |
| | | - 14ãæ§è¡å¨å°åå½å
¥äº¤äºä¼åï¼å°åé¿åº¦æ©å±æ¯æè³512ä½ï¼æ¯æå¤§è§æ¨¡æ§è¡å¨é群é
ç½®ï¼ |
| | | - 15ãä»»å¡åæ°âIJobHandler.executeâå
¥åæ¹ä¸ºâString paramsâï¼å¢å¼ºå
¥åéç¨æ§ã |
| | | - 16ãIJobHandleræä¾init/destroyæ¹æ³ï¼æ¯æå¨ç¸åºä»»å¡çº¿ç¨åå§åå鿝æ¶è¿è¡éå æä½ï¼ |
| | | - 17ã任塿³¨è§£è°æ´ä¸º â@JobHandlerâï¼ä¸ä»»å¡æ½è±¡æ¥å£ç»ä¸ï¼ |
| | | - 18ãä¿®å¤ä»»å¡çæ§çº¿ç¨è¢«èæ¶ä»»å¡é»å¡çé®é¢ï¼ |
| | | - 19ãä¿®å¤ä»»å¡çæ§çº¿ç¨æ æ³çæ§ä»»å¡è§¦ååæ§è¡ç¶æåæª0çé®é¢ï¼ |
| | | - 20ãæ§è¡å¨å¨æä»£çå¯¹è±¡ï¼æ¦æªéä¸å¡æ¹æ³çæ§è¡ï¼ |
| | | - 21ãä¿®å¤JobThreadæè·Erroréè¯¯ä¸æ´æ°JobLogçé®é¢ï¼ |
| | | - 22ãä¿®å¤ä»»å¡å表çé¢å·¦ä¾§èååå¹¶æ¶æ ·å¼éä¹±é®é¢ï¼ |
| | | - 23ãè°åº¦ä¸å¿é¡¹ç®æ¥å¿é
ç½®æ¹ä¸ºxmlæä»¶æ ¼å¼ï¼ |
| | | - 24ãLogå°åæ ¼å¼å
¼å®¹ï¼æ¯æé"/"ç»å°¾è·¯å¾é
ç½®ï¼ |
| | | - 25ãåºå±ç³»ç»æ¥å¿çº§å«è§èè°æ´ï¼æ¸
çéç代ç ï¼ |
| | | - 26ã建表SQLä¼åï¼æ¯æåæ¥å建å¶å®ç¼ç çåºåè¡¨ï¼ |
| | | - 27ãç³»ç»å®å
¨æ§ä¼åï¼ç»éTokenåCookieæ¶è¿è¡MD5å å¯ï¼åæ¶Cookieå¯ç¨HttpOnlyï¼ |
| | | - 28ãæ°å¢"ä»»å¡ID"屿§ï¼ç§»é¤"JobKey"屿§ï¼åè
æ¿æ
ææåè½ï¼æ¹ä¾¿åç»å¢å¼ºä»»å¡ä¾èµåè½ã |
| | | - 29ãä»»å¡å¾ªç¯ä¾èµé®é¢ä¿®å¤ï¼é¿å
åä»»å¡ä¸ç¶ä»»å¡éå¤å¯¼è´çè°åº¦æ»å¾ªç¯ï¼ |
| | | - 30ãä»»å¡å表æ°å¢ç鿡件 "ä»»å¡æè¿°"ï¼å¿«éæ£ç´¢ä»»å¡ï¼ |
| | | - 31ãæ§è¡å¨Logæä»¶å®ææ¸
çåè½ï¼æ§è¡å¨æ°å¢é
置项ï¼"xxl.job.executor.logretentiondays"ï¼æ¥å¿ä¿å天æ°ï¼æ¥å¿æä»¶è¿æèªå¨å é¤ã |
| | | |
| | | ### 6.21 çæ¬ V1.9.1 ç¹æ§[2018-02-22] |
| | | - 1ãå½é
åï¼è°åº¦ä¸å¿å®ç°å½é
åï¼æ¯æä¸æãè±æä¸¤ç§è¯è¨ï¼é»è®¤ä¸ºä¸æã |
| | | - 2ãè°åº¦æ¥è¡¨æ°å¢"è¿è¡ä¸"ä¸ç¶æé¡¹ï¼ |
| | | - 3ãè°åº¦æ¥è¡¨ä¼åï¼æ¥è¡¨SQLè°ä¼å¹¶ä¸æ°å¢LocalCacheç¼åï¼ç¼åæ¶é´60sï¼ï¼æé«å¤§æ°æ®é䏿¥è¡¨å è½½éåº¦ï¼ |
| | | - 4ãä¿®å¤æå
é¨ç½²æ¶èµæºæä»¶ä¹±ç é®é¢ï¼ |
| | | - 5ãä¿®å¤æ°çæ¬chromeæ»å¨å°é¡¶é¨å¤±æé®é¢ï¼ |
| | | - 6ãè°åº¦ä¸å¿é
ç½®å è½½ä¼åï¼åæ¶å¯¹é
ç½®æä»¶åç强ä¾èµï¼æ¯æå è½½ç£çé
ç½®ï¼ |
| | | - 7ãä¿®å¤èæ¬ä»»å¡Logæä»¶æªæ£å¸¸closeçé®é¢ï¼ |
| | | - 8ã项ç®ä¾èµå
¨éå级è³è¾æ°ç¨³å®çæ¬ï¼å¦springãjacksonççï¼ |
| | | |
| | | ### 6.22 çæ¬ V1.9.2 ç¹æ§[2018-10-05] |
| | | - 1ãä»»å¡è¶
æ¶æ§å¶ï¼æ°å¢ä»»å¡å±æ§ "ä»»å¡è¶
æ¶æ¶é´"ï¼å¹¶æ¯æèªå®ä¹ï¼ä»»å¡è¿è¡è¶
æ¶å°ä¼ä¸»å¨ä¸æä»»å¡ï¼ |
| | | - 2ãä»»å¡å¤±è´¥éè¯æ¬¡æ°ï¼æ°å¢ä»»å¡å±æ§ "失败éè¯æ¬¡æ°"ï¼å¹¶æ¯æèªå®ä¹ï¼å½ä»»å¡å¤±è´¥æ¶å°ä¼æç
§é¢è®¾ç失败éè¯æ¬¡æ°ä¸»å¨è¿è¡éè¯ï¼åæ¶æ¶æåºå¼å
¶ä»å¤±è´¥éè¯çç¥ï¼å¦è°åº¦å¤±è´¥ãæ§è¡å¤±è´¥ãç¶æç 失败çï¼ |
| | | - 3ãæ°å¢ä»»å¡è¿è¡æ¨¡å¼ "GLUE模å¼(PHP) "ï¼æ¯æphpèæ¬ä»»å¡ï¼ |
| | | - 4ãæ°å¢ä»»å¡è¿è¡æ¨¡å¼ "GLUE模å¼(PowerShell) "ï¼æ¯æPowerShellèæ¬ä»»å¡ï¼ |
| | | - 5ãè°åº¦å
¨å¼æ¥å¤çï¼ä»»å¡è§¦åä¹åï¼æ¨éå°è°åº¦éåï¼å¤çº¿ç¨å¹¶åå¤çè°åº¦è¯·æ±ï¼æé«ä»»å¡è°åº¦éççåæ¶ï¼é¿å
å ç½ç»é®é¢å¯¼è´quartzè°åº¦çº¿ç¨é»å¡çé®é¢ï¼ |
| | | - 6ãæ§è¡å¨ä»»å¡ç»æè½çä¼åï¼æ§è¡å¨åè°å¤±è´¥æ¶å°ä»»å¡ç»æåç£çï¼å¾
é坿ç½ç»æ¢å¤æ¶éè¯åè°ä»»å¡ç»æï¼é²æ¢ä»»å¡æ§è¡ç»æä¸¢å¤±ï¼ |
| | | - 7ã任塿¥å¿æ¥è¯¢é度大å¹
æåï¼ç¾ä¸çº§å«æ°æ®éæç´¢é度æå1000åï¼ |
| | | - 8ãè°åº¦ä¸å¿æä¾APIæå¡ï¼æ¯æéè¿APIæå¡å¯¹ä»»å¡è¿è¡æ¥è¯¢ãæ°å¢ãæ´æ°ãå¯åçæä½ï¼ |
| | | - 9ãåºå±èªç Logç»ä»¶åæ°å ä½ç¬¦æ¹ä¸º"{}"ï¼å¹¶ä¿®å¤æå°æåæ¥å¿æ¶åæ°ä¸å¹é
å¯¼è´æ¥éçé®é¢ï¼ |
| | | - 10ãä»»å¡åè°ç»æä¼åï¼æ¯æå±ç¤ºå¨Rolling logä¸ï¼æ¹ä¾¿é®é¢ææ¥ï¼ |
| | | - 11ãåºå±LocalCacheç»ä»¶å
¼å®¹æ§ä¼åï¼æ¯æjdk9ãjdk10å以ä¸çæ¬ç¼è¯é¨ç½²ï¼ |
| | | - 12ãåè¦é®ä»¶åºå®ä½¿ç¨ UTF-8 ç¼ç æ ¼å¼ï¼ä¿®å¤ç±æºå¨ç¼ç 导è´çé®ä»¶ä¹±ç é®é¢ï¼ |
| | | - 13ãåè¦é®ä»¶ä¸å±ç¤ºå¤±è´¥åè¦ä¿¡æ¯ï¼ |
| | | - 14ãåè¦é®ç®±æ¯æSSLé
ç½®ï¼ |
| | | - 15ãWindowæºå¨ä¸File.separatorä¸å
¼å®¹é®é¢ä¿®å¤ï¼ |
| | | - 16ãèæ¬ä»»å¡å¼å¸¸Logè¾åºä¼åï¼ |
| | | - 17ãä»»å¡çº¿ç¨åæ¢åé修饰符ä¼åï¼ |
| | | - 18ãèæ¬ä»»å¡Logæä»¶æµå
³éä¼åï¼ |
| | | - 19ã任塿¥è¡¨æåã失败åè¿è¡ä¸ç»è®¡é®é¢ä¿®å¤ï¼ |
| | | - 20ãæ ¸å¿ä¾èµCoreå
é¨å½é
åå¤çï¼ |
| | | - 21ãé»è®¤Quartzçº¿ç¨æ°è°æ´ä¸º50ï¼ |
| | | - 22ãæ°å¢å·¦ä¾§èå"è¿è¡æ¥è¡¨"ï¼ |
| | | - 23ãæ§è¡å¨æå¨è®¾ç½®IPæ¶åæ¶ç»å®Hostçæä½ï¼è¯¥IPä»
便§è¡å¨æ³¨å使ç¨ï¼ä¿®å¤æå®å¤ç½IPæ¶æ æ³ç»å®æ§è¡å¨Hostçé®é¢ï¼ |
| | | - 24ãåæ¶ç¶åä»»å¡ä¸å¯éå¤çéå¶ï¼æ¯æå¾ªç¯ä»»å¡è§¦åçç¹æ®åºæ¯ï¼ |
| | | - 25ãä»»å¡è°åº¦å¤æ³¨ä¸æ 注任å¡è§¦åç±»åï¼å¦Cron触åãç¶ä»»å¡è§¦åãAPI触åççï¼æ¹ä¾¿ææ¥è°åº¦æ¥å¿ï¼ |
| | | - 26ãåºå±æ¥å¿ç»ä»¶SimpleDateFormat线ç¨å®å
¨é®é¢ä¿®å¤ï¼ |
| | | - 27ãæ§è¡å¨é讯线ç¨ä¼åï¼corePoolSizeä»256éä½è³32ï¼ |
| | | - 28ã任塿¥å¿è¡¨ç¶æå段类åä¼åï¼ |
| | | - 29ãGLUEèæ¬æä»¶èªå¨æ¸
çåè½ï¼åæ¶æ¸
çè¿æèæ¬æä»¶ï¼ |
| | | - 30ãæ§è¡å¨æ³¨åæ¹å¼åæ¢ä¼åï¼åæ¢èªå¨æ³¨åæ¶ä¸»å¨åæ¥å¨çº¿æºå¨ï¼é¿å
æ§è¡å¨ä¸ºç©ºçé®é¢ï¼ |
| | | - 31ã跨平å°ï¼é¤äºæä¾JavaãPythonãPHPç忥ç§ä»»å¡æ¨¡å¼ä¹å¤ï¼æ°å¢æä¾åºäºHTTPç任塿¨¡å¼ï¼ |
| | | - 32ãåºå±RPCåºåååè®®è°æ´ä¸ºhessian2ï¼ |
| | | - 33ãä¿®å¤è¡¨å段 ât.orderâ䏿°æ®åºå
³é®åå²çªæ¥è¯¢å¤±è´¥çé®é¢ï¼ |
| | | - 34ãä»»å¡å±æ§æä¸¾ "任塿¨¡å¼ãé»å¡çç¥" å½é
åä¼åï¼ |
| | | - 35ãåçä»»å¡å¤±è´¥éè¯ä¼åï¼ä»
éè¯å½å失败çåçï¼ |
| | | - 36ãä»»å¡è§¦åæ¶æ¯æå¨æä¼ åï¼è°åº¦ä¸å¿ä¸APIæå¡åæä¾æä¾å¨æåæ°åè½ï¼ |
| | | - 37ã任塿§è¡æ¥å¿ãè°åº¦æ¥å¿å段类åè°æ´ï¼æ¹ä¸ºtextç±»åå¹¶åæ¶åæ°éå¶ï¼ |
| | | - 38ãGLUEä»»å¡èæ¬å段类åè°æ´ï¼æ¹ä¸ºmediumtextç±»åï¼æé«GLUEé¿åº¦ä¸éï¼ |
| | | - 39ãä»»å¡çæ§çº¿ç¨Logè¾åºä¼åï¼è¿è¡ä¸ä»»å¡ççæ§Logæ¹ä¸ºdebug级å«ï¼åå°éæ ¸å¿æ¥å¿éï¼ |
| | | - 40ã项ç®ä¾èµå
¨éå级è³è¾æ°ç¨³å®çæ¬ï¼å¦springãJacksonãgroovyççï¼ |
| | | - 41ãdockeræ¯æï¼è°åº¦ä¸å¿æä¾ Dockerfile æ¹ä¾¿å¿«éæå»ºdockeréåï¼ |
| | | |
| | | ### 6.23 çæ¬ V2.0.0 Release Notes[2018-11-04] |
| | | - 1ãè°åº¦ä¸å¿è¿ç§»å° springbootï¼ |
| | | - 2ãåºå±é讯ç»ä»¶è¿ç§»è³ xxl-rpcï¼ |
| | | - 3ã容å¨åï¼æä¾å®æ¹dockeréåï¼å¹¶å®æ¶æ´æ°æ¨édockerhubï¼docker pull xuxueli/xxl-job-adminï¼ï¼è¿ä¸æ¥å®ç°äº§åå¼ç®±å³ç¨ï¼ |
| | | - 4ãæ°å¢æ æ¡æ¶æ§è¡å¨Sample示ä¾é¡¹ç® "xxl-job-executor-sample-frameless"ãä¸ä¾èµç¬¬ä¸æ¹æ¡æ¶ï¼åªémainæ¹æ³å³å¯å¯å¨è¿è¡æ§è¡å¨ï¼ |
| | | - 5ãå½ä»¤è¡ä»»å¡ï¼åçæä¾éç¨å½ä»¤è¡ä»»å¡Handlerï¼Beanä»»å¡ï¼"CommandJobHandler"ï¼ï¼ä¸å¡æ¹åªéè¦æä¾å½ä»¤è¡å³å¯ï¼ |
| | | - 6ãä»»å¡ç¶æä¼åï¼ä»
è¿è¡ç¶æ"NORMAL"ä»»å¡å
³èè³quartzï¼éä½quartzåºå±æ°æ®åå¨ä¸è°åº¦ååï¼ |
| | | - 7ãä»»å¡ç¶æè§èï¼æ°å¢ä»»å¡é»è®¤åæ¢ç¶æï¼ä»»å¡æ´æ°æ¶ä¿æä»»å¡ç¶æä¸åï¼ |
| | | - 8ãIPè·åé»è¾ä¼åï¼ä¼å
éåç½å¡æ¥è·åå¯ç¨IPï¼ |
| | | - 9ã任塿°å¢çAPIæå¡æ¥å£è¿åä»»å¡IDï¼æ¹ä¾¿è°ç¨æ¹å®ç¨ï¼ |
| | | - 10ãç»ä»¶åä¼åï¼ç§»é¤å¯¹ spring çä¾èµï¼éspringåºç¨éç¨ "XxlJobExecutor" ãspringåºç¨éç¨ "XxlJobSpringExecutor" ä½ä¸ºæ§è¡å¨ç»ä»¶ï¼ |
| | | - 11ãä»»å¡RollingLogå±ç¤ºé»è¾ä¼åï¼ä¿®å¤è¶
æ¶ä»»å¡æ æ³æ¥ççé®é¢ï¼ |
| | | - 12ãå¤é¡¹UIç»ä»¶åçº§å°ææ°çæ¬ï¼å¦ï¼CodeMirrorãEchartsãJquery çï¼ |
| | | - 13ã项ç®ä¾èµå级 groovy è³è¾æ°ç¨³å®çæ¬ï¼pomæ¸
çï¼ |
| | | - 14ãåä»»å¡å¤±è´¥éè¯éè¯é»è¾ä¼åï¼åä»»å¡å¤±è´¥æ¶å°ä¼æç
§å
¶é¢è®¾ç失败éè¯æ¬¡æ°ä¸»å¨è¿è¡éè¯ |
| | | |
| | | ### 6.23 çæ¬ v2.0.1 Release Notes[2018-11-09] |
| | | - 1ã左侧èåæå å¨ç»é®é¢ä¿®å¤ï¼ |
| | | - 2ãè°åº¦æ¥è¡¨æ¥æåå¸å¾é»è®¤å¼ç»ä¸ï¼ |
| | | - 3ãfreemarker对æ°åé»è®¤å ååä½é®é¢ä¿®å¤ï¼è§£å³æ¥å¿ID被åéå¯¼è´æ¥çæ¥å¿å¤±è´¥é®é¢ï¼ |
| | | - 4ãåºå±é讯ç»ä»¶å级ï¼ä¿®å¤é讯å¼å¸¸æ¶æ æçå¾
çé®é¢ï¼ |
| | | - 5ãæ§è¡å¨å¯å¨ä¹åjetty忢çé®é¢ä¿®å¤ï¼ |
| | | |
| | | ### 6.24 çæ¬ v2.0.2 Release Notes[2019-04-20] |
| | | - 1ãåºå±éè®¯æ¹æ¡ä¼åï¼åçº§è¾æ°çæ¬xxl-rpcï¼ç±"JETTY"æ¹æ¡è°æ´ä¸º"NETTY_HTTP"æ¹æ¡ï¼æ§è¡å¨å
åµnetty-http-serveræä¾æå¡ï¼è°åº¦ä¸å¿å¤ç¨å®¹å¨ç«¯å£æä¾æå¡ï¼ |
| | | - 2ãä»»å¡åè¦é»è¾è°æ´ï¼æ¹ä¸ºéè¿æ«æå¤±è´¥æ¥å¿æ¹å¼è§¦åã䏿¹é¢ç²¾ç¡®æ«æå¤±è´¥ä»»å¡ï¼é使«æèå´ï¼å¦ä¸æ¹é¢åæ¶å
åéåï¼éä½çº¿ç¨å
åæ¶èï¼ |
| | | - 3ãQuartz触åçº¿ç¨æ± åºå¼å¹¶æ¿æ¢ä¸º "XxlJobThreadPool"ï¼éä½çº¿ç¨åæ¢ãå
åå ç¨å¸¦æ¥çæ¶èï¼æé«è°åº¦æ§è½ï¼ |
| | | - 4ãè°åº¦çº¿ç¨æ± éç¦»ï¼æå为"Fast"å"Slow"ä¸¤ä¸ªçº¿ç¨æ± ï¼1åéçªå£æå
ä»»å¡èæ¶è¾¾500msè¶
è¿10次ï¼è¯¥çªå£æå
å¤å®ä¸ºæ
¢ä»»å¡ï¼æ
¢ä»»å¡èªå¨é级è¿å
¥"Slow"çº¿ç¨æ± ï¼é¿å
èå°½è°åº¦çº¿ç¨ï¼æé«ç³»ç»ç¨³å®æ§ï¼ |
| | | - 5ãæ§è¡å¨çé¨ç½²æ¶JobHandleréæ°åå§åï¼ä¿®å¤ç±æ¤å¯¼è´ç "jobhandler naming conflicts." é®é¢ï¼ |
| | | - 6ãæ°å¢Classçå è½½ç¼åï¼è§£å³é¢ç¹å è½½Classä¼ä½¿jvmçæ¹æ³åºç©ºé´ä¸è¶³å¯¼è´OOMçé®é¢ï¼ |
| | | - 7ã任塿¯ææ´æ¢ç»å®æ§è¡å¨ï¼æ¹ä¾¿ä»»å¡åç»è½¬ç§»å管çï¼ |
| | | - 8ãè°åº¦ä¸å¿åè¦é®ä»¶åéç»ä»¶æ¹ä¸º âspring-boot-starter-mailâï¼ |
| | | - 9ãè®°ä½å¯ç åè½ä¼åï¼é䏿¶æ°¸ä¹
è®°ä½ï¼éé䏿¶å
³éæµè§å¨å³ç»åºï¼ |
| | | - 10ã项ç®ä¾èµå级è³è¾æ°ç¨³å®çæ¬ï¼å¦quartzãspringãjacksonãgroovyãxxl-rpcççï¼ |
| | | - 11ãç²¾ç®é¡¹ç®ï¼åæ¶ç¬¬ä¸æ¹ä¾èµï¼å¦ commons-collections4ãcommons-lang3 ; |
| | | - 12ãæ§è¡å¨åè°æ¥å¿è½çæ¹æ¡å¤ç¨RPCåºååæ¹æ¡ï¼å¹¶ç§»é¤Jacksonä¾èµï¼ |
| | | - 13ãåºå±Logè°ä¼ï¼åºç¨æ£å¸¸ç»æ¢åæ¶å¼å¸¸æ ä¿¡æ¯æå°ï¼ |
| | | - 14ã交äºä¼åï¼å°½éé¿å
æ°å¼é¡µé¢çªå£ï¼ä»
WebIDEæ¯ææ°å¼é¡µï¼å¹¶æä¾çªå£å¿«éå
³éæé®ï¼ä»»å¡å¯ãåãå é¤ã触åçè½»æä½æç¤ºæ¹ä¸ºtoastæ¹å¼ï¼ |
| | | - 15ã任塿åãå é¤ä¼åï¼é¿å
quartz deleteä¸å®æ´å¯¼è´ä»»å¡èæ°æ®ï¼ |
| | | - 16ãä»»å¡åè°ãå¿è·³æ³¨åæåæ¥å¿ä¼åï¼éæ ¸å¿å¸¸è§æ¥å¿è°æ´ä¸ºdebug级å«ï¼éä½å使¥å¿è¾åºï¼ |
| | | - 17ãè°æ´é¦é¡µæ¥è¡¨é»è®¤åºé´ä¸ºæ¬å¨ï¼é¿å
æ¥å¿é太大æ¥è¯¢ç¼æ
¢ï¼ |
| | | - 18ãLRUè·¯ç±æ´æ°ä¸åæ¶é®é¢ä¿®å¤ï¼ |
| | | - 19ãä»»å¡å¤±è´¥åè¦é®ä»¶åéé»è¾ä¼åï¼ |
| | | - 20ãè°åº¦æ¥å¿æåºé»è¾è°æ´ä¸ºæç
§è°åº¦æ¶é´ååºï¼å
¼å®¹TIDBç主é®ä¸è¿ç»æ¥å¿åå¨ç»ä»¶ï¼ |
| | | - 21ãæ§è¡å¨ä¼é
åæºä¼åï¼ |
| | | - 22ãè¿æ¥æ± é
ç½®ä¼åï¼å¢å¼ºè¿æ¥æææ§éªè¯ï¼ |
| | | - 23ãJobHandler#msgé¿åº¦éå¶ï¼ä¿®å¤å¼å¸¸æ
åµä¸æ¥å¿è¶
é¿å¯¼è´å
åæº¢åºçé®é¢ï¼ |
| | | - 24ãå级xxl-rpcè³è¾æ°çæ¬ï¼ä¿®å¤springboot 2.xçæ¬å
¼å®¹æ§é®é¢ï¼ |
| | | |
| | | ### 6.25 çæ¬ v2.1.0 Release Notes[2019-07-07] |
| | | - 1ãèªç è°åº¦ç»ä»¶ï¼ç§»é¤quartzä¾èµï¼ä¸æ¹é¢æ¯ä¸ºäºç²¾ç®ç³»ç»éä½åä½ä¾èµï¼å¦ä¸æ¹é¢æ¯ä¸ºäºæä¾ç³»ç»ç坿§åº¦ä¸ç¨³å®æ§ï¼ |
| | | - 触åï¼åèç¹å¨ææ§è§¦åï¼è¿è¡äºä»¶å¦delayqueueï¼ |
| | | - è°åº¦ï¼é群ç«äºï¼è´è½½æ¹å¼ååå¤çï¼éç«äº-æ´æ°è§¦åä¿¡æ¯-æ¨éæ¶é´è½®-ééæ¾-éç«äºï¼ |
| | | - 2ãåºå±è¡¨ç»æéæï¼ç§»é¤11å¼ quartzç¸å
³è¡¨ï¼å¹¶å¯¹ç°æè¡¨ç»æä¼å梳çï¼ |
| | | - 3ã任塿¥å¿ä¸»é®è°æ´ä¸ºlongæ°æ®ç±»åï¼é²æ¢æµ·éæ¥å¿æ
åµä¸æ°æ®æº¢åºï¼ |
| | | - 4ãåºå±çº¿ç¨æ¨¡åéæï¼ç§»é¤Quartzçº¿ç¨æ± ï¼éä½ç³»ç»çº¿ç¨ä¸å
åå¼éï¼ |
| | | - 5ãç¨æ·ç®¡çï¼æ¯æå¨çº¿ç®¡çç³»ç»ç¨æ·ï¼åå¨ç®¡çåãæ®éç¨æ·ä¸¤ç§è§è²ï¼ |
| | | - 6ãæé管çï¼æ§è¡å¨ç»´åº¦è¿è¡æéæ§å¶ï¼ç®¡ç忥æå
¨éæéï¼æ®éç¨æ·éè¦åé
æ§è¡å¨æéåæå
许ç¸å
³æä½ï¼ |
| | | - 7ãè°åº¦çº¿ç¨æ± åæ°è°ä¼ï¼ |
| | | - 8ãæ³¨å表索å¼ä¼åï¼ç¼è§£é表é®é¢ï¼ |
| | | - 9ãæ°å¢Jbootæ§è¡å¨Sample示ä¾é¡¹ç®ï¼ |
| | | - 10ãä»»å¡å表ä¼åï¼æ¯ææ ¹æ® "ä»»å¡ç¶æ"ã"è´è´£äºº" 屿§çéä»»å¡ï¼ |
| | | - 11ã任塿¥å¿å表交äºä¼åï¼æä½æé®å并为å岿é®ï¼ |
| | | - 12ã项ç®ä¾èµå级è³è¾æ°ç¨³å®çæ¬ï¼å¦springãspringbootãgroovyãxxl-rpcççï¼å¹¶æ¸
çåä½POMï¼ |
| | | - 13ãå级xxl-rpcè³è¾æ°çæ¬ï¼ä¿®å¤ä»£çæå¡åå§åæ¶è¿ç¨æå¡ä¸å¯ç¨å¯¼è´é¿è¿åä½å建çé®é¢; |
| | | - 14ãé¦é¡µè°åº¦æ¥è¡¨çæ¥ææåºå¨TIDBä¸ä¹±åºé®é¢ä¿®å¤ï¼ |
| | | - 15ãè°åº¦ä¸å¿ä¸æ§è¡å¨ååé讯è¶
æ¶æ¶é´è°æ´ä¸º3sï¼ |
| | | - 16ãè°åº¦ç»ä»¶éæ¯æµç¨ä¼åï¼å
忢è°åº¦çº¿ç¨ï¼ç¶åçå¾
æ¶é´è½®å
åéä»»å¡å¤çå®æï¼æç»éæ¯æ¶é´è½®çº¿ç¨ï¼ |
| | | - 17ãæ§è¡å¨åè°çº¿ç¨ä¼åï¼åè°å°å为空æ¶éæ¯é®é¢ä¿®å¤ï¼ |
| | | - 18ãHttpJobHandlerä¼åï¼ååºæ°æ®æå®UTF-8æ ¼å¼ï¼é¿å
䏿乱ç ï¼ |
| | | - 19ã代ç ä¼åï¼ConcurrentHashMapåéç±»åæ¹ä¸ºConcurrentMapï¼é¿å
å ä¸åçæ¬å®ç°ä¸å导è´çå
¼å®¹æ§é®é¢ï¼ |
| | | |
| | | |
| | | ### 6.26 çæ¬ v2.1.1 Release Notes[2019-11-24] |
| | | - 1ã è°åº¦ä¸å¿æ¥å¿èªå¨æ¸
çåè½ï¼è³æ¤ï¼è°åº¦ä¸å¿/æ§è¡å¨åæ¯ææ¥å¿èªå¨æ¸
çï¼è¿æå¤©æ°åé»è®¤è®¾ç½®ä¸º30天ï¼ï¼è°åº¦ä¸å¿æ°å¢é
置项ï¼"xxl.job.logretentiondays"ï¼æ¥å¿ä¿å天æ°ï¼è¿ææ¥å¿èªå¨æ¸
çï¼è§£å³æµ·éæ¥å¿æ
åµä¸æ¥å¿è¡¨æ
¢SQLé®é¢ï¼éå¶å¤§äºçäº7æ¶çæï¼å¦åå
³éæ¸
çåè½ï¼é»è®¤ä¸º30ï¼ |
| | | - 2ã è°åº¦æ¥è¡¨ä¼åï¼æ°å¢æ¥å¿æ¥è¡¨çåå¨è¡¨ï¼ä¸å¤©å
ç任塿¥å¿ä¼ä»¥æ¯åé䏿¬¡çé¢ç弿¥åæ¥è³æ¥è¡¨ä¸ï¼ä»»å¡æ¥è¡¨ä»
è¯»åæ¥è¡¨æ°æ®ï¼æå¤§æåå è½½éåº¦ï¼ |
| | | - 3ã Cronå¨çº¿çæå·¥å
·ï¼ä»»å¡æ°å¢ãç¼è¾æ¡éè¿ç»ä»¶å¨çº¿çæCron表达å¼ï¼ |
| | | - 4ã Cron䏿¬¡æ§è¡æ¶é´æ¥è¯¢ï¼æ¯æéè¿çé¢å¨çº¿æ¥çåç»è¿ç»5次æ§è¡æ¶é´ï¼ |
| | | - 5ã è°åº¦ä¸å¿æ°å¢åºç¨å¥åº·æ£æ¥åè½ï¼åå©âspring-boot-starter-actuatorâï¼ç¸å¯¹å°å â/actuator/healthâï¼ |
| | | - 6ã DBèæ¬é»è®¤ç¼ç æ¹ä¸ºutf8mb4ï¼ä¿®å¤å符乱ç é®é¢(建议Mysqlçæ¬5.7+)ï¼ |
| | | - 7ã è°åº¦ä¸å¿ä»»å¡å¹³ååé
ï¼è§¦åç»ä»¶æ¯æ¬¡è·åä¸çº¿ç¨æ± æ°éç¸å
³æ°éçä»»å¡ï¼é¿å
大éä»»å¡éä¸å¨å个è°åº¦ä¸å¿é群èç¹ï¼ |
| | | - 8ã ä»»å¡è§¦åç»ä»¶ä¼åï¼é¢å è½½é¢çæ£å¸¸1s䏿¬¡ï¼å½é¢å 载轮空æ¶ä¸»å¨ä¼ç ä¸ä¸ªå è½½å¨æï¼å¨æéä½å è½½é¢çä»èéä½DBååï¼ |
| | | - 9ã è°åº¦ç»ä»¶ä¼åï¼é对永è¿ä¸ä¼è§¦åçCronç¦æ¢é
ç½®åå¯å¨ï¼ä»»å¡Cronæå䏿¬¡è§¦åååä¹ä¸ä¼è§¦åæ¶ï¼æ¯å¦ä¸æ¬¡æ§ä»»å¡ï¼ä¸»å¨åæ¢ç¸å
³ä»»å¡ï¼ |
| | | - 10ãDBéè¿ä¼åï¼ä¿®å¤DB宿ºéè¿åä»»å¡è°åº¦åæ¢çé®é¢ï¼éè¿åèªå¨å å
¥è°åº¦é群触åä»»å¡è°åº¦ï¼ |
| | | - 11ãæ³¨åçæ§çº¿ç¨ä¼åï¼é使»éå çï¼ |
| | | - 12ãè°åº¦ä¸å¿æ¥å¿å é¤ä¼åï¼æ¹ä¸ºå页è·åIDå¹¶æ ¹æ®IDå é¤çæ¹å¼ï¼é¿å
æ¹éå 餿µ·éæ¥å¿å¯¼è´æ»éé®é¢ï¼ |
| | | - 13ãä»»å¡éè¯æ¶åæ°ä¸¢å¤±çé®é¢ä¿®å¤ï¼ |
| | | - 14ãè°åº¦ä¸å¿ç§»é¤SQLä¸ç "now()" 彿°ï¼é群é¨ç½²æ¶ä¸åä¾èµDBæ¶éï¼ä»
éè¦ä¿è¯è°åº¦ä¸å¿åºç¨èç¹æ¶éä¸è´å³å¯ï¼ |
| | | - 15ãä»»å¡è§¦åç»ä»¶å 载顺åºè°æ´ï¼é¿å
å°æ¦çæ
åµä¸ç»ä»¶éæºå 载顺åºå¯¼è´çI18NçNPEé®é¢; |
| | | - 16ãJobThreadèªéæ¯ä¼åï¼é¿å
å¹¶å触å导è´triggerQueueä¸ä»»å¡ä¸¢å¤±é®é¢ï¼ |
| | | - 17ãè°åº¦ä¸å¿å¯ç éå¶18ä½ï¼ä¿®å¤ä¿®æ¹å¯ç è¶
è¿18使 æ³ç»éçé®é¢ï¼ |
| | | - 18ãä»»å¡åè¦ç»ä»¶åé¡µåæ°æ æé®é¢ä¿®å¤ï¼ |
| | | - 19ãå级xxl-rpcçæ¬ï¼æå¡ç«¯çº¿ç¨ä¼åï¼éä½çº¿ç¨å
åå¼éï¼IpUtilä¼åï¼å¢å è¿éæ§æ ¡ï¼è¿æ»¤æç¡®éæ³çç½å¡ï¼ |
| | | - 20ãè°åº¦ä¸å¿åè°APIæå¡æ¹ä¸ºrestfulæ¹å¼ï¼ |
| | | - 21ãUIä¼åï¼ä»»å¡åè¡¨åæ¥å¿åè¡¨æ°æ®è¡¨æ ¼å®½åº¦æ¯ä¾è°æ´ï¼é¿å
æ°æ®æ¢è¡æåä½éªï¼ |
| | | - 22ãç»å½çé¢åæ¶é»è®¤å¡«åçç»å½è´¦å·å¯ç ï¼ |
| | | - 23ãæ§è¡å¨è¡¨å±æ§è°æ´ï¼"顺åº" 屿§è°æ´ä¸ºæ´åï¼è§£å³æ§è¡å¨æ°æ®è¾å¤æ¶æ æ³æ£ç¡®æåºçé®é¢ï¼ |
| | | - 24ãä»»å¡å表交äºä¼åï¼æ¯ææ¥ç任塿屿§è¡å¨ç注åèç¹ï¼ |
| | | - 25ã项ç®ä¾èµå级è³è¾æ°ç¨³å®çæ¬ï¼å¦springãspring-bootãmybatisãslf4jãgroovyççï¼ |
| | | |
| | | ### 6.27 çæ¬ v2.1.2 Release Notes[2019-12-12] |
| | | - 1ãæ¹æ³ä»»å¡æ¯æï¼ç±åæ¥åºäºJobHandler类任å¡å¼åæ¹å¼ï¼ä¼åä¸ºæ¯æåºäºæ¹æ³çä»»å¡å¼åæ¹å¼ï¼å æ¤ï¼å¯ä»¥æ¯æå个类ä¸å¼åå¤ä¸ªä»»å¡æ¹æ³ï¼è¿è¡ç±»å¤ç¨ |
| | | ``` |
| | | @XxlJob("demoJobHandler") |
| | | public ReturnT<String> execute(String param) { |
| | | XxlJobLogger.log("hello world"); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | ``` |
| | | - 2ãç§»é¤commons-execï¼éç¨åçæ¹å¼å®ç°ï¼éä½ç¬¬ä¸æ¹ä¾èµï¼ |
| | | - 3ãæ§è¡å¨åè°ä¹±ç é®é¢ä¿®å¤ï¼ |
| | | - 4ãè°åº¦ä¸å¿dispatcher servletå 载顺åºä¼åï¼ |
| | | - 5ãæ§è¡å¨åè°å°åhttpså
¼å®¹æ¯æï¼ |
| | | - 6ãå¤ä¸ªé¡¹ç®ä¾èµå级è³è¾æ°ç¨³å®çæ¬ï¼ |
| | | - 注æï¼ææ°çæ¬ "XxlJobSpringExecutor" é»è¾æè°æ´ï¼åå²é¡¹ç®ä¸è¯¥ç»ä»¶çé
ç½®æ¹å¼è¯·åèSample示ä¾é¡¹ç®è¿è¡è°æ´ï¼å°¤å
¶æ³¨æéè¦ç§»é¤ç»ä»¶çinitådestroyæ¹æ³ï¼ |
| | | |
| | | |
| | | ### TODO LIST |
| | | - 1ãä»»å¡åçè·¯ç±ï¼åçéç¨ä¸è´æ§Hashç®æ³è®¡ç®åºå°½é稳å®çåç顺åºï¼å³ä½¿æ³¨åæºå¨å卿³¢å¨ä¹ä¸ä¼å¼èµ·åæ¹åç顺åºå¤§çæ³¢å¨ï¼ç®åéç¨IPèªç¶æåºï¼å¯ä»¥æ»¡è¶³éæ±ï¼å¾
å®ï¼ |
| | | - 2ãä»»å¡åæºå¤çº¿ç¨ï¼æåä»»å¡åæºå¹¶è¡å¤çè½åï¼ |
| | | - 3ãè°åº¦ä»»å¡ä¼å
çº§ï¼ |
| | | - 4ã夿°æ®åºæ¯æï¼å¨éåå¹¶ç§»é¤Quartzçåºç¡ä¸ï¼DAOå±éè¿JPAå®ç°ï¼ä¸éå¶æ°æ®åºç±»åï¼ |
| | | - 5ãæ§è¡å¨Logæ¸
çåè½ï¼è°åº¦ä¸å¿Logå 餿¶åæ¥å 餿§è¡å¨ä¸çLogæä»¶ï¼ |
| | | - 6ãä»»å¡èªå¨æ³¨åï¼Bean模å¼ä»»å¡ï¼JobHandlerèªå¨ä»æ§è¡å¨ä¸æ¥è¯¢å±ç¤ºä¸ºä¸ææ¡ï¼éæ©åèªå¨å¡«å
ä»»å¡åç§°ç屿§ï¼å¾
èèï¼å 为任å¡èªå¨æ³¨åå°ä¼å¯¼è´ä»»å¡é¾ä»¥ç®¡çæ§å¶ï¼ |
| | | - 7ãAPIäºä»¶è§¦åç±»åä»»å¡ï¼æ´ç±»ä¼¼MQæ¶æ¯ï¼æ¯æ"å¨æä¼ åãå»¶æ¶æ¶è´¹"ï¼è¯¥ç±»åä»»å¡ä¸èµ°è°åº¦ç»ä»¶ï¼åç¬å»ºç«MQæ¶æ¯è¡¨ï¼è°åº¦ä¸å¿ç«äºè§¦åï¼å¾
å®ï¼è¯¥åè½ä¸ XXL-MQ å²çªï¼è¯¥åºæ¯å»ºè®®ç¨åè
ï¼ |
| | | - 8ãè°åº¦çº¿ç¨æ± æ¹ä¸ºåç¨æ¹å¼å®ç°ï¼å¤§å¹
éä½ç³»ç»å
åæ¶èï¼ |
| | | - 9ãä»»å¡ãæ§è¡å¨æ°æ®å
¨éæ¬å°ç¼åï¼æ°å¢æ¶æ¯è¡¨å¹¿æéç¥ï¼ |
| | | - 10ãå¿ç¢è½¬ç§»ä¼åï¼å
¨é¨æºå¨å¿ç¢æ¶ä¸åç´æ¥å¤±è´¥ï¼ |
| | | - 11ã失败éè¯é´éï¼ |
| | | - 12ãSimpleTriggerï¼é¤Cronå¤ï¼æ¯æè®¾ç½®åºå®æ¶é´é´é触åï¼ |
| | | - 13ãè°åº¦æ¥å¿å表å 䏿§è¡æ¶é¿åï¼å¹¶æ¯ææåºï¼ |
| | | - 14ãDAGæµç¨ä»»å¡ï¼æ¿æ¢åä»»å¡ï¼æ¯æåæ°ä¼ éï¼é
置并åç"a-bãb-c"è·¯å¾åè¡¨ï¼ææä¸²è¡ãå¹¶è¡ãdag任塿µç¨ï¼"dagre-d3"ç»å¾ï¼ä»»å¡ä¾èµï¼æµç¨å¾ï¼åä»»å¡+ä¼ç¾ä»»å¡ï¼åèç¹æ¥å¿ï¼æ¯ææ ¹æ®æåãå¤±è´¥éæ©åæ¯ï¼ |
| | | - 15ãæ¥æè¿æ»¤ï¼æ¯æå¤ä¸ªæ¶é´æ®µæé¤ï¼ |
| | | - 16ãåè¦é®ä»¶å
å®¹ï¼æ¯æèªå®ä¹æ¨¡æ¿é
ç½®ï¼ |
| | | - 17ãæåç¶æï¼æ¯æCron ä¸ºç©ºï¼ |
| | | - 18ãæ°å¢ä»»å¡è¿è¡æ¨¡å¼ "GLUE模å¼(GO) "ï¼æ¯æGOä»»å¡ï¼ |
| | | - 19ãæ³¨åä¸å¿ä¼åï¼å®æ¶æ§æ³¨ååç°ï¼å¿è·³æ³¨åé´é10sï¼refresh失败å馿¬¡æ³¨åå¹¶ç«å³æ´æ°æ³¨åä¿¡æ¯ï¼å¿è·³ç±»ä¼¼ï¼30sè¿æéæ¯ï¼ |
| | | - 20ãæä¾æ§è¡å¨Dockeréåï¼ |
| | | - 21ãèæ¬ä»»å¡ï¼æ¯ææ°æ®åæ°ï¼æ°çæ¬ä»
æ¯æå忰䏿¯æéè¦å
¼å®¹ï¼ |
| | | - 22ãGLUE æ¨¡å¼ Web Ide çæ¬å¯¹æ¯åè½ï¼ |
| | | - 23ãæ¹éè°åº¦ï¼è°åº¦è¯·æ±å
¥queueï¼è°åº¦çº¿ç¨æ¹éè·åè°åº¦è¯·æ±å¹¶åèµ·è¿ç¨è°åº¦ï¼æé«çº¿ç¨æçï¼ |
| | | - 24ãå¤è¯è¨æ§è¡å¨ï¼çº¦å®è·¨è¯è¨éè®¯æ¹æ¡ï¼ä»¥åé讯æ¥å£ï¼ |
| | | - 25ãç§»é¤commons-execï¼éç¨åçå®ç°ï¼ |
| | | - 26ãè°åº¦ä¸å¿JDKçæ¬è°æ´ä¸ºJDK8ï¼ä»èåçº§è³ææ°çæ¬SpringBootï¼ |
| | | - 27ãæ§è¡å¨æå¡ç«¯å£ä¸æ³¨å端å£åç¦»ï¼æ¯ædockerå¨æéæºç«¯å£ï¼ |
| | | - 28ãæ§è¡å¨ç«¯å£å¤ç¨ï¼å¤ç¨å®¹å¨ç«¯å£æä¾é讯æå¡ï¼ |
| | | - 29ãèªå®ä¹å¤±è´¥éè¯æ¶é´é´éï¼ |
| | | - 30ãåçä»»å¡å
¨é¨æåå触ååä»»å¡ï¼ |
| | | - 31ãä»»å¡å¤å¶åè½ï¼ç¹å»å¤å¶æ¯å¼¹åºæ°å»ºä»»å¡å¼¹æ¡ï¼å¹¶åå§å被å¤å¶ä»»å¡ä¿¡æ¯ï¼ |
| | | - 32ãAccessTokenæç
§æ§è¡å¨ç»´åº¦è®¾ç½®ï¼æ§å¶è°åº¦ãåè°ï¼ |
| | | - 33ã任塿§è¡ä¸æ¬¡çæ¶åæå®IPï¼ |
| | | - 34ãéè®¯è°æ´ï¼ååHTTPï¼åè°åå
¶ä»APIèªå®ä¹AccessTokenï¼Restfulï¼æ§è¡å¨å¤ç¨å®¹å¨ç«¯å£ï¼ |
| | | - 35ãç¶åä»»å¡åæ°ä¼ éï¼æµç¨ä»»å¡çï¼éä¼ å¨æåæ°ï¼ |
| | | - 36ãæ°å¢æ§è¡å¨æè¿°ãä»»å¡æè¿°å±æ§ï¼ |
| | | |
| | | |
| | | ## ä¸ãå
¶ä» |
| | | |
| | | ### 7.1 项ç®è´¡ç® |
| | | 欢è¿åä¸é¡¹ç®è´¡ç®ï¼æ¯å¦æäº¤PRä¿®å¤ä¸ä¸ªbugï¼æè
æ°å»º [Issue](https://github.com/xuxueli/xxl-job/issues/) 讨论æ°ç¹æ§æè
åæ´ã |
| | | |
| | | ### 7.2 ç¨æ·æ¥å
¥ç»è®° |
| | | æ´å¤æ¥å
¥çå
¬å¸ï¼æ¬¢è¿å¨ [ç»è®°å°å](https://github.com/xuxueli/xxl-job/issues/1 ) ç»è®°ï¼ç»è®°ä»
ä»
为äºäº§åæ¨å¹¿ã |
| | | |
| | | ### 7.3 弿ºåè®®åçæ |
| | | 产å弿ºå
è´¹ï¼å¹¶ä¸å°æç»æä¾å
è´¹çç¤¾åºææ¯æ¯æã个人æä¼ä¸å
é¨å¯èªç±çæ¥å
¥å使ç¨ã |
| | | |
| | | - Licensed under the GNU General Public License (GPL) v3. |
| | | - Copyright (c) 2015-present, xuxueli. |
| | | |
| | | --- |
| | | ### æèµ |
| | | æ 论æèµ éé¢å¤å°é½è¶³å¤è¡¨è¾¾æ¨è¿ä»½å¿æï¼é常æè°¢ ï¼ï¼ [åå¾æèµ ](https://www.xuxueli.com/page/donate.html ) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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>ubcs-ops</artifactId> |
| | | <groupId>org.springblade</groupId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </parent> |
| | | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ubcs-xxljob-admin</artifactId> |
| | | <name>${project.artifactId}</name> |
| | | <version>${bladex.project.version}</version> |
| | | <packaging>jar</packaging> |
| | | |
| | | |
| | | <properties> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <maven.compiler.encoding>UTF-8</maven.compiler.encoding> |
| | | <maven.compiler.source>1.8</maven.compiler.source> |
| | | <maven.compiler.target>1.8</maven.compiler.target> |
| | | <maven.test.skip>true</maven.test.skip> |
| | | |
| | | <xxl-rpc.version>1.5.0</xxl-rpc.version> |
| | | |
| | | <spring.version>4.3.25.RELEASE</spring.version> |
| | | <spring-boot.version>1.5.22.RELEASE</spring-boot.version> |
| | | <mybatis-spring-boot-starter.version>1.3.5</mybatis-spring-boot-starter.version> |
| | | <mysql-connector-java.version>5.1.48</mysql-connector-java.version> |
| | | |
| | | <slf4j-api.version>1.7.29</slf4j-api.version> |
| | | <junit.version>4.12</junit.version> |
| | | |
| | | <groovy.version>2.5.8</groovy.version> |
| | | |
| | | <maven-source-plugin.version>3.2.0</maven-source-plugin.version> |
| | | <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version> |
| | | <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version> |
| | | <maven-war-plugin.version>3.2.3</maven-war-plugin.version> |
| | | </properties> |
| | | |
| | | |
| | | <dependencies> |
| | | <!--Blade--> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>ubcs-common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-cloud</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-core-launch</artifactId> |
| | | </dependency> |
| | | <!-- freemarker-starter --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-freemarker</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- mail-starter --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-mail</artifactId> |
| | | </dependency> |
| | | <!-- starter-actuator --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | <!-- mybatis-starterï¼mybatis + mybatis-spring + tomcat-jdbcï¼defaultï¼ --> |
| | | <dependency> |
| | | <groupId>org.mybatis.spring.boot</groupId> |
| | | <artifactId>mybatis-spring-boot-starter</artifactId> |
| | | <version>${mybatis-spring-boot-starter.version}</version> |
| | | </dependency> |
| | | <!-- mysql --> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | </dependency> |
| | | <!-- xxl-job-core --> |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.oracle.database.jdbc</groupId> |
| | | <artifactId>ojdbc8</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.easyproject</groupId> |
| | | <artifactId>orai18n</artifactId> |
| | | <version>${orai18n.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | <skip>false</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin; |
| | | |
| | | import com.vci.ubcs.common.constant.LauncherConstant; |
| | | import org.springblade.core.cloud.client.UbcsCloudApplication; |
| | | import org.springblade.core.launch.UbcsApplication; |
| | | |
| | | /** |
| | | * @author xuxueli 2018-10-28 00:38:13 |
| | | */ |
| | | @UbcsCloudApplication |
| | | public class JobAdminApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | UbcsApplication.run(LauncherConstant.APPLICATION_XXLJOB_ADMIN_NAME, JobAdminApplication.class, args); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.controller.annotation.PermissionLimit; |
| | | import com.vci.ubcs.xxl.job.admin.service.LoginService; |
| | | import com.vci.ubcs.xxl.job.admin.service.XxlJobService; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import org.springframework.beans.propertyeditors.CustomDateEditor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.WebDataBinder; |
| | | import org.springframework.web.bind.annotation.InitBinder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * index controller |
| | | * @author xuxueli 2015-12-19 16:13:16 |
| | | */ |
| | | @Controller |
| | | public class IndexController { |
| | | |
| | | @Resource |
| | | private XxlJobService xxlJobService; |
| | | @Resource |
| | | private LoginService loginService; |
| | | |
| | | |
| | | @RequestMapping("/") |
| | | public String index(Model model) { |
| | | |
| | | Map<String, Object> dashboardMap = xxlJobService.dashboardInfo(); |
| | | model.addAllAttributes(dashboardMap); |
| | | |
| | | return "index"; |
| | | } |
| | | |
| | | @RequestMapping("/chartInfo") |
| | | @ResponseBody |
| | | public ReturnT<Map<String, Object>> chartInfo(Date startDate, Date endDate) { |
| | | ReturnT<Map<String, Object>> chartInfo = xxlJobService.chartInfo(startDate, endDate); |
| | | return chartInfo; |
| | | } |
| | | |
| | | @RequestMapping("/toLogin") |
| | | @PermissionLimit(limit=false) |
| | | public String toLogin(HttpServletRequest request, HttpServletResponse response) { |
| | | if (loginService.ifLogin(request, response) != null) { |
| | | return "redirect:/"; |
| | | } |
| | | return "login"; |
| | | } |
| | | |
| | | @RequestMapping(value="login", method=RequestMethod.POST) |
| | | @ResponseBody |
| | | @PermissionLimit(limit=false) |
| | | public ReturnT<String> loginDo(HttpServletRequest request, HttpServletResponse response, String userName, String password, String ifRemember){ |
| | | boolean ifRem = (ifRemember!=null && ifRemember.trim().length()>0 && "on".equals(ifRemember))?true:false; |
| | | return loginService.login(request, response, userName, password, ifRem); |
| | | } |
| | | |
| | | @RequestMapping(value="logout", method=RequestMethod.POST) |
| | | @ResponseBody |
| | | @PermissionLimit(limit=false) |
| | | public ReturnT<String> logout(HttpServletRequest request, HttpServletResponse response){ |
| | | return loginService.logout(request, response); |
| | | } |
| | | |
| | | @RequestMapping("/help") |
| | | public String help() { |
| | | |
| | | /*if (!PermissionInterceptor.ifLogin(request)) { |
| | | return "redirect:/toLogin"; |
| | | }*/ |
| | | |
| | | return "help"; |
| | | } |
| | | |
| | | @InitBinder |
| | | public void initBinder(WebDataBinder binder) { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | dateFormat.setLenient(false); |
| | | binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.controller.annotation.PermissionLimit; |
| | | import com.vci.ubcs.xxl.job.admin.core.conf.XxlJobAdminConfig; |
| | | import com.vci.ubcs.xxl.job.admin.core.exception.XxlJobException; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.JacksonUtil; |
| | | import com.xxl.job.core.biz.AdminBiz; |
| | | import com.xxl.job.core.biz.model.HandleCallbackParam; |
| | | import com.xxl.job.core.biz.model.RegistryParam; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.util.XxlJobRemotingUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by xuxueli on 17/5/10. |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/api") |
| | | public class JobApiController { |
| | | |
| | | @Resource |
| | | private AdminBiz adminBiz; |
| | | |
| | | |
| | | // ---------------------- base ---------------------- |
| | | |
| | | /** |
| | | * valid access token |
| | | */ |
| | | private void validAccessToken(HttpServletRequest request){ |
| | | if (XxlJobAdminConfig.getAdminConfig().getAccessToken()!=null |
| | | && XxlJobAdminConfig.getAdminConfig().getAccessToken().trim().length()>0 |
| | | && !XxlJobAdminConfig.getAdminConfig().getAccessToken().equals(request.getHeader(XxlJobRemotingUtil.XXL_RPC_ACCESS_TOKEN))) { |
| | | throw new XxlJobException("The access token is wrong."); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * parse Param |
| | | */ |
| | | private Object parseParam(String data, Class<?> parametrized, Class<?>... parameterClasses){ |
| | | Object param = null; |
| | | try { |
| | | if (parameterClasses != null) { |
| | | param = JacksonUtil.readValue(data, parametrized, parameterClasses); |
| | | } else { |
| | | param = JacksonUtil.readValue(data, parametrized); |
| | | } |
| | | } catch (Exception e) { } |
| | | if (param==null) { |
| | | throw new XxlJobException("The request data invalid."); |
| | | } |
| | | return param; |
| | | } |
| | | |
| | | // ---------------------- admin biz ---------------------- |
| | | |
| | | /** |
| | | * callback |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/callback") |
| | | @ResponseBody |
| | | @PermissionLimit(limit=false) |
| | | public ReturnT<String> callback(HttpServletRequest request, @RequestBody(required = false) String data) { |
| | | // valid |
| | | validAccessToken(request); |
| | | |
| | | // param |
| | | List<HandleCallbackParam> callbackParamList = (List<HandleCallbackParam>) parseParam(data, List.class, HandleCallbackParam.class); |
| | | |
| | | // invoke |
| | | return adminBiz.callback(callbackParamList); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * registry |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/registry") |
| | | @ResponseBody |
| | | @PermissionLimit(limit=false) |
| | | public ReturnT<String> registry(HttpServletRequest request, @RequestBody(required = false) String data) { |
| | | // valid |
| | | validAccessToken(request); |
| | | |
| | | // param |
| | | RegistryParam registryParam = (RegistryParam) parseParam(data, RegistryParam.class); |
| | | |
| | | // invoke |
| | | return adminBiz.registry(registryParam); |
| | | } |
| | | |
| | | /** |
| | | * registry remove |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/registryRemove") |
| | | @ResponseBody |
| | | @PermissionLimit(limit=false) |
| | | public ReturnT<String> registryRemove(HttpServletRequest request, @RequestBody(required = false) String data) { |
| | | // valid |
| | | validAccessToken(request); |
| | | |
| | | // param |
| | | RegistryParam registryParam = (RegistryParam) parseParam(data, RegistryParam.class); |
| | | |
| | | // invoke |
| | | return adminBiz.registryRemove(registryParam); |
| | | } |
| | | |
| | | // ---------------------- job biz ---------------------- |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobInfo; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobLogGlue; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobInfoDao; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobLogGlueDao; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.glue.GlueTypeEnum; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * job code controller |
| | | * @author xuxueli 2015-12-19 16:13:16 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/jobcode") |
| | | public class JobCodeController { |
| | | |
| | | @Resource |
| | | private XxlJobInfoDao xxlJobInfoDao; |
| | | @Resource |
| | | private XxlJobLogGlueDao xxlJobLogGlueDao; |
| | | |
| | | @RequestMapping |
| | | public String index(HttpServletRequest request, Model model, int jobId) { |
| | | XxlJobInfo jobInfo = xxlJobInfoDao.loadById(jobId); |
| | | List<XxlJobLogGlue> jobLogGlues = xxlJobLogGlueDao.findByJobId(jobId); |
| | | |
| | | if (jobInfo == null) { |
| | | throw new RuntimeException(I18nUtil.getString("jobinfo_glue_jobid_unvalid")); |
| | | } |
| | | if (GlueTypeEnum.BEAN == GlueTypeEnum.match(jobInfo.getGlueType())) { |
| | | throw new RuntimeException(I18nUtil.getString("jobinfo_glue_gluetype_unvalid")); |
| | | } |
| | | |
| | | // valid permission |
| | | JobInfoController.validPermission(request, jobInfo.getJobGroup()); |
| | | |
| | | // Glueç±»å-åå
¸ |
| | | model.addAttribute("GlueTypeEnum", GlueTypeEnum.values()); |
| | | |
| | | model.addAttribute("jobInfo", jobInfo); |
| | | model.addAttribute("jobLogGlues", jobLogGlues); |
| | | return "jobcode/jobcode.index"; |
| | | } |
| | | |
| | | @RequestMapping("/save") |
| | | @ResponseBody |
| | | public ReturnT<String> save(Model model, int id, String glueSource, String glueRemark) { |
| | | // valid |
| | | if (glueRemark==null) { |
| | | return new ReturnT<String>(500, (I18nUtil.getString("system_please_input") + I18nUtil.getString("jobinfo_glue_remark")) ); |
| | | } |
| | | if (glueRemark.length()<4 || glueRemark.length()>100) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobinfo_glue_remark_limit")); |
| | | } |
| | | XxlJobInfo exists_jobInfo = xxlJobInfoDao.loadById(id); |
| | | if (exists_jobInfo == null) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobinfo_glue_jobid_unvalid")); |
| | | } |
| | | |
| | | // update new code |
| | | exists_jobInfo.setGlueSource(glueSource); |
| | | exists_jobInfo.setGlueRemark(glueRemark); |
| | | exists_jobInfo.setGlueUpdatetime(new Date()); |
| | | |
| | | exists_jobInfo.setUpdateTime(new Date()); |
| | | xxlJobInfoDao.update(exists_jobInfo); |
| | | |
| | | // log old code |
| | | XxlJobLogGlue xxlJobLogGlue = new XxlJobLogGlue(); |
| | | xxlJobLogGlue.setJobId(exists_jobInfo.getId()); |
| | | xxlJobLogGlue.setGlueType(exists_jobInfo.getGlueType()); |
| | | xxlJobLogGlue.setGlueSource(glueSource); |
| | | xxlJobLogGlue.setGlueRemark(glueRemark); |
| | | |
| | | xxlJobLogGlue.setAddTime(new Date()); |
| | | xxlJobLogGlue.setUpdateTime(new Date()); |
| | | xxlJobLogGlueDao.save(xxlJobLogGlue); |
| | | |
| | | // remove code backup more than 30 |
| | | xxlJobLogGlueDao.removeOld(exists_jobInfo.getId(), 30); |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobGroup; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobRegistry; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobGroupDao; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobInfoDao; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobRegistryDao; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.enums.RegistryConfig; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * job group controller |
| | | * @author xuxueli 2016-10-02 20:52:56 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/jobgroup") |
| | | public class JobGroupController { |
| | | |
| | | @Resource |
| | | public XxlJobInfoDao xxlJobInfoDao; |
| | | @Resource |
| | | public XxlJobGroupDao xxlJobGroupDao; |
| | | @Resource |
| | | private XxlJobRegistryDao xxlJobRegistryDao; |
| | | |
| | | @RequestMapping |
| | | public String index(Model model) { |
| | | |
| | | // job group (executor) |
| | | List<XxlJobGroup> list = xxlJobGroupDao.findAll(); |
| | | |
| | | model.addAttribute("list", list); |
| | | return "jobgroup/jobgroup.index"; |
| | | } |
| | | |
| | | @RequestMapping("/save") |
| | | @ResponseBody |
| | | public ReturnT<String> save(XxlJobGroup xxlJobGroup){ |
| | | |
| | | // valid |
| | | if (xxlJobGroup.getAppName()==null || xxlJobGroup.getAppName().trim().length()==0) { |
| | | return new ReturnT<String>(500, (I18nUtil.getString("system_please_input")+"AppName") ); |
| | | } |
| | | if (xxlJobGroup.getAppName().length()<4 || xxlJobGroup.getAppName().length()>64) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_appName_length") ); |
| | | } |
| | | if (xxlJobGroup.getTitle()==null || xxlJobGroup.getTitle().trim().length()==0) { |
| | | return new ReturnT<String>(500, (I18nUtil.getString("system_please_input") + I18nUtil.getString("jobgroup_field_title")) ); |
| | | } |
| | | if (xxlJobGroup.getAddressType()!=0) { |
| | | if (xxlJobGroup.getAddressList()==null || xxlJobGroup.getAddressList().trim().length()==0) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_addressType_limit") ); |
| | | } |
| | | String[] addresss = xxlJobGroup.getAddressList().split(","); |
| | | for (String item: addresss) { |
| | | if (item==null || item.trim().length()==0) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_registryList_unvalid") ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | int ret = xxlJobGroupDao.save(xxlJobGroup); |
| | | return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL; |
| | | } |
| | | |
| | | @RequestMapping("/update") |
| | | @ResponseBody |
| | | public ReturnT<String> update(XxlJobGroup xxlJobGroup){ |
| | | // valid |
| | | if (xxlJobGroup.getAppName()==null || xxlJobGroup.getAppName().trim().length()==0) { |
| | | return new ReturnT<String>(500, (I18nUtil.getString("system_please_input")+"AppName") ); |
| | | } |
| | | if (xxlJobGroup.getAppName().length()<4 || xxlJobGroup.getAppName().length()>64) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_appName_length") ); |
| | | } |
| | | if (xxlJobGroup.getTitle()==null || xxlJobGroup.getTitle().trim().length()==0) { |
| | | return new ReturnT<String>(500, (I18nUtil.getString("system_please_input") + I18nUtil.getString("jobgroup_field_title")) ); |
| | | } |
| | | if (xxlJobGroup.getAddressType() == 0) { |
| | | // 0=èªå¨æ³¨å |
| | | List<String> registryList = findRegistryByAppName(xxlJobGroup.getAppName()); |
| | | String addressListStr = null; |
| | | if (registryList!=null && !registryList.isEmpty()) { |
| | | Collections.sort(registryList); |
| | | addressListStr = ""; |
| | | for (String item:registryList) { |
| | | addressListStr += item + ","; |
| | | } |
| | | addressListStr = addressListStr.substring(0, addressListStr.length()-1); |
| | | } |
| | | xxlJobGroup.setAddressList(addressListStr); |
| | | } else { |
| | | // 1=æå¨å½å
¥ |
| | | if (xxlJobGroup.getAddressList()==null || xxlJobGroup.getAddressList().trim().length()==0) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_addressType_limit") ); |
| | | } |
| | | String[] addresss = xxlJobGroup.getAddressList().split(","); |
| | | for (String item: addresss) { |
| | | if (item==null || item.trim().length()==0) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_field_registryList_unvalid") ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | int ret = xxlJobGroupDao.update(xxlJobGroup); |
| | | return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL; |
| | | } |
| | | |
| | | private List<String> findRegistryByAppName(String appNameParam){ |
| | | HashMap<String, List<String>> appAddressMap = new HashMap<String, List<String>>(); |
| | | List<XxlJobRegistry> list = xxlJobRegistryDao.findAll(RegistryConfig.DEAD_TIMEOUT, new Date()); |
| | | if (list != null) { |
| | | for (XxlJobRegistry item: list) { |
| | | if (RegistryConfig.RegistType.EXECUTOR.name().equals(item.getRegistryGroup())) { |
| | | String appName = item.getRegistryKey(); |
| | | List<String> registryList = appAddressMap.get(appName); |
| | | if (registryList == null) { |
| | | registryList = new ArrayList<String>(); |
| | | } |
| | | |
| | | if (!registryList.contains(item.getRegistryValue())) { |
| | | registryList.add(item.getRegistryValue()); |
| | | } |
| | | appAddressMap.put(appName, registryList); |
| | | } |
| | | } |
| | | } |
| | | return appAddressMap.get(appNameParam); |
| | | } |
| | | |
| | | @RequestMapping("/remove") |
| | | @ResponseBody |
| | | public ReturnT<String> remove(int id){ |
| | | |
| | | // valid |
| | | int count = xxlJobInfoDao.pageListCount(0, 10, id, -1, null, null, null); |
| | | if (count > 0) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_del_limit_0") ); |
| | | } |
| | | |
| | | List<XxlJobGroup> allList = xxlJobGroupDao.findAll(); |
| | | if (allList.size() == 1) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobgroup_del_limit_1") ); |
| | | } |
| | | |
| | | int ret = xxlJobGroupDao.remove(id); |
| | | return (ret>0)?ReturnT.SUCCESS:ReturnT.FAIL; |
| | | } |
| | | |
| | | @RequestMapping("/loadById") |
| | | @ResponseBody |
| | | public ReturnT<XxlJobGroup> loadById(int id){ |
| | | XxlJobGroup jobGroup = xxlJobGroupDao.load(id); |
| | | return jobGroup!=null?new ReturnT<XxlJobGroup>(jobGroup):new ReturnT<XxlJobGroup>(ReturnT.FAIL_CODE, null); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.cron.CronExpression; |
| | | import com.vci.ubcs.xxl.job.admin.core.exception.XxlJobException; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobGroup; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobInfo; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobUser; |
| | | import com.vci.ubcs.xxl.job.admin.core.route.ExecutorRouteStrategyEnum; |
| | | import com.vci.ubcs.xxl.job.admin.core.thread.JobTriggerPoolHelper; |
| | | import com.vci.ubcs.xxl.job.admin.core.trigger.TriggerTypeEnum; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobGroupDao; |
| | | import com.vci.ubcs.xxl.job.admin.service.LoginService; |
| | | import com.vci.ubcs.xxl.job.admin.service.XxlJobService; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.enums.ExecutorBlockStrategyEnum; |
| | | import com.xxl.job.core.glue.GlueTypeEnum; |
| | | import com.xxl.job.core.util.DateUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * index controller |
| | | * @author xuxueli 2015-12-19 16:13:16 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/jobinfo") |
| | | public class JobInfoController { |
| | | |
| | | @Resource |
| | | private XxlJobGroupDao xxlJobGroupDao; |
| | | @Resource |
| | | private XxlJobService xxlJobService; |
| | | |
| | | @RequestMapping |
| | | public String index(HttpServletRequest request, Model model, @RequestParam(required = false, defaultValue = "-1") int jobGroup) { |
| | | |
| | | // æä¸¾-åå
¸ |
| | | model.addAttribute("ExecutorRouteStrategyEnum", ExecutorRouteStrategyEnum.values()); // è·¯ç±çç¥-å表 |
| | | model.addAttribute("GlueTypeEnum", GlueTypeEnum.values()); // Glueç±»å-åå
¸ |
| | | model.addAttribute("ExecutorBlockStrategyEnum", ExecutorBlockStrategyEnum.values()); // é»å¡å¤ççç¥-åå
¸ |
| | | |
| | | // æ§è¡å¨å表 |
| | | List<XxlJobGroup> jobGroupList_all = xxlJobGroupDao.findAll(); |
| | | |
| | | // filter group |
| | | List<XxlJobGroup> jobGroupList = filterJobGroupByRole(request, jobGroupList_all); |
| | | if (jobGroupList==null || jobGroupList.size()==0) { |
| | | throw new XxlJobException(I18nUtil.getString("jobgroup_empty")); |
| | | } |
| | | |
| | | model.addAttribute("JobGroupList", jobGroupList); |
| | | model.addAttribute("jobGroup", jobGroup); |
| | | |
| | | return "jobinfo/jobinfo.index"; |
| | | } |
| | | |
| | | public static List<XxlJobGroup> filterJobGroupByRole(HttpServletRequest request, List<XxlJobGroup> jobGroupList_all){ |
| | | List<XxlJobGroup> jobGroupList = new ArrayList<>(); |
| | | if (jobGroupList_all!=null && jobGroupList_all.size()>0) { |
| | | XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); |
| | | if (loginUser.getRole() == 1) { |
| | | jobGroupList = jobGroupList_all; |
| | | } else { |
| | | List<String> groupIdStrs = new ArrayList<>(); |
| | | if (loginUser.getPermission()!=null && loginUser.getPermission().trim().length()>0) { |
| | | groupIdStrs = Arrays.asList(loginUser.getPermission().trim().split(",")); |
| | | } |
| | | for (XxlJobGroup groupItem:jobGroupList_all) { |
| | | if (groupIdStrs.contains(String.valueOf(groupItem.getId()))) { |
| | | jobGroupList.add(groupItem); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return jobGroupList; |
| | | } |
| | | public static void validPermission(HttpServletRequest request, int jobGroup) { |
| | | XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); |
| | | if (!loginUser.validPermission(jobGroup)) { |
| | | throw new RuntimeException(I18nUtil.getString("system_permission_limit") + "[username="+ loginUser.getUsername() +"]"); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/pageList") |
| | | @ResponseBody |
| | | public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start, |
| | | @RequestParam(required = false, defaultValue = "10") int length, |
| | | int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String author) { |
| | | |
| | | return xxlJobService.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler, author); |
| | | } |
| | | |
| | | @RequestMapping("/add") |
| | | @ResponseBody |
| | | public ReturnT<String> add(XxlJobInfo jobInfo) { |
| | | return xxlJobService.add(jobInfo); |
| | | } |
| | | |
| | | @RequestMapping("/update") |
| | | @ResponseBody |
| | | public ReturnT<String> update(XxlJobInfo jobInfo) { |
| | | return xxlJobService.update(jobInfo); |
| | | } |
| | | |
| | | @RequestMapping("/remove") |
| | | @ResponseBody |
| | | public ReturnT<String> remove(int id) { |
| | | return xxlJobService.remove(id); |
| | | } |
| | | |
| | | @RequestMapping("/stop") |
| | | @ResponseBody |
| | | public ReturnT<String> pause(int id) { |
| | | return xxlJobService.stop(id); |
| | | } |
| | | |
| | | @RequestMapping("/start") |
| | | @ResponseBody |
| | | public ReturnT<String> start(int id) { |
| | | return xxlJobService.start(id); |
| | | } |
| | | |
| | | @RequestMapping("/trigger") |
| | | @ResponseBody |
| | | //@PermissionLimit(limit = false) |
| | | public ReturnT<String> triggerJob(int id, String executorParam) { |
| | | // force cover job param |
| | | if (executorParam == null) { |
| | | executorParam = ""; |
| | | } |
| | | |
| | | JobTriggerPoolHelper.trigger(id, TriggerTypeEnum.MANUAL, -1, null, executorParam); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | @RequestMapping("/nextTriggerTime") |
| | | @ResponseBody |
| | | public ReturnT<List<String>> nextTriggerTime(String cron) { |
| | | List<String> result = new ArrayList<>(); |
| | | try { |
| | | CronExpression cronExpression = new CronExpression(cron); |
| | | Date lastTime = new Date(); |
| | | for (int i = 0; i < 5; i++) { |
| | | lastTime = cronExpression.getNextValidTimeAfter(lastTime); |
| | | if (lastTime != null) { |
| | | result.add(DateUtil.formatDateTime(lastTime)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } catch (ParseException e) { |
| | | return new ReturnT<List<String>>(ReturnT.FAIL_CODE, I18nUtil.getString("jobinfo_field_cron_unvalid")); |
| | | } |
| | | return new ReturnT<List<String>>(result); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.exception.XxlJobException; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobGroup; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobInfo; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobLog; |
| | | import com.vci.ubcs.xxl.job.admin.core.scheduler.XxlJobScheduler; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobGroupDao; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobInfoDao; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobLogDao; |
| | | import com.xxl.job.core.biz.ExecutorBiz; |
| | | import com.xxl.job.core.biz.model.LogResult; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.util.DateUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * index controller |
| | | * @author xuxueli 2015-12-19 16:13:16 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/joblog") |
| | | public class JobLogController { |
| | | private static Logger logger = LoggerFactory.getLogger(JobLogController.class); |
| | | |
| | | @Resource |
| | | private XxlJobGroupDao xxlJobGroupDao; |
| | | @Resource |
| | | public XxlJobInfoDao xxlJobInfoDao; |
| | | @Resource |
| | | public XxlJobLogDao xxlJobLogDao; |
| | | |
| | | @RequestMapping |
| | | public String index(HttpServletRequest request, Model model, @RequestParam(required = false, defaultValue = "0") Integer jobId) { |
| | | |
| | | // æ§è¡å¨å表 |
| | | List<XxlJobGroup> jobGroupList_all = xxlJobGroupDao.findAll(); |
| | | |
| | | // filter group |
| | | List<XxlJobGroup> jobGroupList = JobInfoController.filterJobGroupByRole(request, jobGroupList_all); |
| | | if (jobGroupList==null || jobGroupList.size()==0) { |
| | | throw new XxlJobException(I18nUtil.getString("jobgroup_empty")); |
| | | } |
| | | |
| | | model.addAttribute("JobGroupList", jobGroupList); |
| | | |
| | | // ä»»å¡ |
| | | if (jobId > 0) { |
| | | XxlJobInfo jobInfo = xxlJobInfoDao.loadById(jobId); |
| | | if (jobInfo == null) { |
| | | throw new RuntimeException(I18nUtil.getString("jobinfo_field_id") + I18nUtil.getString("system_unvalid")); |
| | | } |
| | | |
| | | model.addAttribute("jobInfo", jobInfo); |
| | | |
| | | // valid permission |
| | | JobInfoController.validPermission(request, jobInfo.getJobGroup()); |
| | | } |
| | | |
| | | return "joblog/joblog.index"; |
| | | } |
| | | |
| | | @RequestMapping("/getJobsByGroup") |
| | | @ResponseBody |
| | | public ReturnT<List<XxlJobInfo>> getJobsByGroup(int jobGroup){ |
| | | List<XxlJobInfo> list = xxlJobInfoDao.getJobsByGroup(jobGroup); |
| | | return new ReturnT<List<XxlJobInfo>>(list); |
| | | } |
| | | |
| | | @RequestMapping("/pageList") |
| | | @ResponseBody |
| | | public Map<String, Object> pageList(HttpServletRequest request, |
| | | @RequestParam(required = false, defaultValue = "0") int start, |
| | | @RequestParam(required = false, defaultValue = "10") int length, |
| | | int jobGroup, int jobId, int logStatus, String filterTime) { |
| | | |
| | | // valid permission |
| | | JobInfoController.validPermission(request, jobGroup); // ä»
管çåæ¯ææ¥è¯¢å
¨é¨ï¼æ®éç¨æ·ä»
æ¯ææ¥è¯¢ææéç jobGroup |
| | | |
| | | // parse param |
| | | Date triggerTimeStart = null; |
| | | Date triggerTimeEnd = null; |
| | | if (filterTime!=null && filterTime.trim().length()>0) { |
| | | String[] temp = filterTime.split(" - "); |
| | | if (temp.length == 2) { |
| | | triggerTimeStart = DateUtil.parseDateTime(temp[0]); |
| | | triggerTimeEnd = DateUtil.parseDateTime(temp[1]); |
| | | } |
| | | } |
| | | |
| | | // page query |
| | | List<XxlJobLog> list = xxlJobLogDao.pageList(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); |
| | | int list_count = xxlJobLogDao.pageListCount(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); |
| | | |
| | | // package result |
| | | Map<String, Object> maps = new HashMap<String, Object>(); |
| | | maps.put("recordsTotal", list_count); // æ»è®°å½æ° |
| | | maps.put("recordsFiltered", list_count); // è¿æ»¤åçæ»è®°å½æ° |
| | | maps.put("data", list); // å页å表 |
| | | return maps; |
| | | } |
| | | |
| | | @RequestMapping("/logDetailPage") |
| | | public String logDetailPage(int id, Model model){ |
| | | |
| | | // base check |
| | | ReturnT<String> logStatue = ReturnT.SUCCESS; |
| | | XxlJobLog jobLog = xxlJobLogDao.load(id); |
| | | if (jobLog == null) { |
| | | throw new RuntimeException(I18nUtil.getString("joblog_logid_unvalid")); |
| | | } |
| | | |
| | | model.addAttribute("triggerCode", jobLog.getTriggerCode()); |
| | | model.addAttribute("handleCode", jobLog.getHandleCode()); |
| | | model.addAttribute("executorAddress", jobLog.getExecutorAddress()); |
| | | model.addAttribute("triggerTime", jobLog.getTriggerTime().getTime()); |
| | | model.addAttribute("logId", jobLog.getId()); |
| | | return "joblog/joblog.detail"; |
| | | } |
| | | |
| | | @RequestMapping("/logDetailCat") |
| | | @ResponseBody |
| | | public ReturnT<LogResult> logDetailCat(String executorAddress, long triggerTime, long logId, int fromLineNum){ |
| | | try { |
| | | ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(executorAddress); |
| | | ReturnT<LogResult> logResult = executorBiz.log(triggerTime, logId, fromLineNum); |
| | | |
| | | // is end |
| | | if (logResult.getContent()!=null && logResult.getContent().getFromLineNum() > logResult.getContent().getToLineNum()) { |
| | | XxlJobLog jobLog = xxlJobLogDao.load(logId); |
| | | if (jobLog.getHandleCode() > 0) { |
| | | logResult.getContent().setEnd(true); |
| | | } |
| | | } |
| | | |
| | | return logResult; |
| | | } catch (Exception e) { |
| | | logger.error(e.getMessage(), e); |
| | | return new ReturnT<LogResult>(ReturnT.FAIL_CODE, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/logKill") |
| | | @ResponseBody |
| | | public ReturnT<String> logKill(int id){ |
| | | // base check |
| | | XxlJobLog log = xxlJobLogDao.load(id); |
| | | XxlJobInfo jobInfo = xxlJobInfoDao.loadById(log.getJobId()); |
| | | if (jobInfo==null) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("jobinfo_glue_jobid_unvalid")); |
| | | } |
| | | if (ReturnT.SUCCESS_CODE != log.getTriggerCode()) { |
| | | return new ReturnT<String>(500, I18nUtil.getString("joblog_kill_log_limit")); |
| | | } |
| | | |
| | | // request of kill |
| | | ReturnT<String> runResult = null; |
| | | try { |
| | | ExecutorBiz executorBiz = XxlJobScheduler.getExecutorBiz(log.getExecutorAddress()); |
| | | runResult = executorBiz.kill(jobInfo.getId()); |
| | | } catch (Exception e) { |
| | | logger.error(e.getMessage(), e); |
| | | runResult = new ReturnT<String>(500, e.getMessage()); |
| | | } |
| | | |
| | | if (ReturnT.SUCCESS_CODE == runResult.getCode()) { |
| | | log.setHandleCode(ReturnT.FAIL_CODE); |
| | | log.setHandleMsg( I18nUtil.getString("joblog_kill_log_byman")+":" + (runResult.getMsg()!=null?runResult.getMsg():"")); |
| | | log.setHandleTime(new Date()); |
| | | xxlJobLogDao.updateHandleInfo(log); |
| | | return new ReturnT<String>(runResult.getMsg()); |
| | | } else { |
| | | return new ReturnT<String>(500, runResult.getMsg()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/clearLog") |
| | | @ResponseBody |
| | | public ReturnT<String> clearLog(int jobGroup, int jobId, int type){ |
| | | |
| | | Date clearBeforeTime = null; |
| | | int clearBeforeNum = 0; |
| | | if (type == 1) { |
| | | clearBeforeTime = DateUtil.addMonths(new Date(), -1); // æ¸
çä¸ä¸ªæä¹åæ¥å¿æ°æ® |
| | | } else if (type == 2) { |
| | | clearBeforeTime = DateUtil.addMonths(new Date(), -3); // æ¸
çä¸ä¸ªæä¹åæ¥å¿æ°æ® |
| | | } else if (type == 3) { |
| | | clearBeforeTime = DateUtil.addMonths(new Date(), -6); // æ¸
çå
个æä¹åæ¥å¿æ°æ® |
| | | } else if (type == 4) { |
| | | clearBeforeTime = DateUtil.addYears(new Date(), -1); // æ¸
çä¸å¹´ä¹åæ¥å¿æ°æ® |
| | | } else if (type == 5) { |
| | | clearBeforeNum = 1000; // æ¸
çä¸åæ¡ä»¥åæ¥å¿æ°æ® |
| | | } else if (type == 6) { |
| | | clearBeforeNum = 10000; // æ¸
çä¸ä¸æ¡ä»¥åæ¥å¿æ°æ® |
| | | } else if (type == 7) { |
| | | clearBeforeNum = 30000; // æ¸
çä¸ä¸æ¡ä»¥åæ¥å¿æ°æ® |
| | | } else if (type == 8) { |
| | | clearBeforeNum = 100000; // æ¸
çå䏿¡ä»¥åæ¥å¿æ°æ® |
| | | } else if (type == 9) { |
| | | clearBeforeNum = 0; // æ¸
çæææ¥å¿æ°æ® |
| | | } else { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("joblog_clean_type_unvalid")); |
| | | } |
| | | |
| | | List<Long> logIds = null; |
| | | do { |
| | | logIds = xxlJobLogDao.findClearLogIds(jobGroup, jobId, clearBeforeTime, clearBeforeNum, 1000); |
| | | if (logIds!=null && logIds.size()>0) { |
| | | xxlJobLogDao.clearLog(logIds); |
| | | } |
| | | } while (logIds!=null && logIds.size()>0); |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.controller.annotation.PermissionLimit; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobGroup; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobUser; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobGroupDao; |
| | | import com.vci.ubcs.xxl.job.admin.dao.XxlJobUserDao; |
| | | import com.vci.ubcs.xxl.job.admin.service.LoginService; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.DigestUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author xuxueli 2019-05-04 16:39:50 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/user") |
| | | public class UserController { |
| | | |
| | | @Resource |
| | | private XxlJobUserDao xxlJobUserDao; |
| | | @Resource |
| | | private XxlJobGroupDao xxlJobGroupDao; |
| | | |
| | | @RequestMapping |
| | | @PermissionLimit(adminuser = true) |
| | | public String index(Model model) { |
| | | |
| | | // æ§è¡å¨å表 |
| | | List<XxlJobGroup> groupList = xxlJobGroupDao.findAll(); |
| | | model.addAttribute("groupList", groupList); |
| | | |
| | | return "user/user.index"; |
| | | } |
| | | |
| | | @RequestMapping("/pageList") |
| | | @ResponseBody |
| | | @PermissionLimit(adminuser = true) |
| | | public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start, |
| | | @RequestParam(required = false, defaultValue = "10") int length, |
| | | String username, int role) { |
| | | |
| | | // page list |
| | | List<XxlJobUser> list = xxlJobUserDao.pageList(start, length, username, role); |
| | | int list_count = xxlJobUserDao.pageListCount(start, length, username, role); |
| | | |
| | | // package result |
| | | Map<String, Object> maps = new HashMap<String, Object>(); |
| | | maps.put("recordsTotal", list_count); // æ»è®°å½æ° |
| | | maps.put("recordsFiltered", list_count); // è¿æ»¤åçæ»è®°å½æ° |
| | | maps.put("data", list); // å页å表 |
| | | return maps; |
| | | } |
| | | |
| | | @RequestMapping("/add") |
| | | @ResponseBody |
| | | @PermissionLimit(adminuser = true) |
| | | public ReturnT<String> add(XxlJobUser xxlJobUser) { |
| | | |
| | | // valid username |
| | | if (!StringUtils.hasText(xxlJobUser.getUsername())) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("system_please_input")+I18nUtil.getString("user_username") ); |
| | | } |
| | | xxlJobUser.setUsername(xxlJobUser.getUsername().trim()); |
| | | if (!(xxlJobUser.getUsername().length()>=4 && xxlJobUser.getUsername().length()<=20)) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("system_lengh_limit")+"[4-20]" ); |
| | | } |
| | | // valid password |
| | | if (!StringUtils.hasText(xxlJobUser.getPassword())) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("system_please_input")+I18nUtil.getString("user_password") ); |
| | | } |
| | | xxlJobUser.setPassword(xxlJobUser.getPassword().trim()); |
| | | if (!(xxlJobUser.getPassword().length()>=4 && xxlJobUser.getPassword().length()<=20)) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("system_lengh_limit")+"[4-20]" ); |
| | | } |
| | | // md5 password |
| | | xxlJobUser.setPassword(DigestUtils.md5DigestAsHex(xxlJobUser.getPassword().getBytes())); |
| | | |
| | | // check repeat |
| | | XxlJobUser existUser = xxlJobUserDao.loadByUserName(xxlJobUser.getUsername()); |
| | | if (existUser != null) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("user_username_repeat") ); |
| | | } |
| | | |
| | | // write |
| | | xxlJobUserDao.save(xxlJobUser); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | @RequestMapping("/update") |
| | | @ResponseBody |
| | | @PermissionLimit(adminuser = true) |
| | | public ReturnT<String> update(HttpServletRequest request, XxlJobUser xxlJobUser) { |
| | | |
| | | // avoid opt login seft |
| | | XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); |
| | | if (loginUser.getUsername().equals(xxlJobUser.getUsername())) { |
| | | return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("user_update_loginuser_limit")); |
| | | } |
| | | |
| | | // valid password |
| | | if (StringUtils.hasText(xxlJobUser.getPassword())) { |
| | | xxlJobUser.setPassword(xxlJobUser.getPassword().trim()); |
| | | if (!(xxlJobUser.getPassword().length()>=4 && xxlJobUser.getPassword().length()<=20)) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("system_lengh_limit")+"[4-20]" ); |
| | | } |
| | | // md5 password |
| | | xxlJobUser.setPassword(DigestUtils.md5DigestAsHex(xxlJobUser.getPassword().getBytes())); |
| | | } else { |
| | | xxlJobUser.setPassword(null); |
| | | } |
| | | |
| | | // write |
| | | xxlJobUserDao.update(xxlJobUser); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | @RequestMapping("/remove") |
| | | @ResponseBody |
| | | @PermissionLimit(adminuser = true) |
| | | public ReturnT<String> remove(HttpServletRequest request, int id) { |
| | | |
| | | // avoid opt login seft |
| | | XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); |
| | | if (loginUser.getId() == id) { |
| | | return new ReturnT<String>(ReturnT.FAIL.getCode(), I18nUtil.getString("user_update_loginuser_limit")); |
| | | } |
| | | |
| | | xxlJobUserDao.delete(id); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | @RequestMapping("/updatePwd") |
| | | @ResponseBody |
| | | public ReturnT<String> updatePwd(HttpServletRequest request, String password){ |
| | | |
| | | // valid password |
| | | if (password==null || password.trim().length()==0){ |
| | | return new ReturnT<String>(ReturnT.FAIL.getCode(), "å¯ç ä¸å¯ä¸ºç©º"); |
| | | } |
| | | password = password.trim(); |
| | | if (!(password.length()>=4 && password.length()<=20)) { |
| | | return new ReturnT<String>(ReturnT.FAIL_CODE, I18nUtil.getString("system_lengh_limit")+"[4-20]" ); |
| | | } |
| | | |
| | | // md5 password |
| | | String md5Password = DigestUtils.md5DigestAsHex(password.getBytes()); |
| | | |
| | | // update pwd |
| | | XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); |
| | | |
| | | // do write |
| | | XxlJobUser existUser = xxlJobUserDao.loadByUserName(loginUser.getUsername()); |
| | | existUser.setPassword(md5Password); |
| | | xxlJobUserDao.update(existUser); |
| | | |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller.annotation; |
| | | |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * æééå¶ |
| | | * @author xuxueli 2015-12-12 18:29:02 |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface PermissionLimit { |
| | | |
| | | /** |
| | | * ç»å½æ¦æª (é»è®¤æ¦æª) |
| | | */ |
| | | boolean limit() default true; |
| | | |
| | | /** |
| | | * è¦æ±ç®¡çåæé |
| | | * |
| | | * @return |
| | | */ |
| | | boolean adminuser() default false; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller.interceptor; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.util.FtlUtil; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * push cookies to model as cookieMap |
| | | * |
| | | * @author xuxueli 2015-12-12 18:09:04 |
| | | */ |
| | | @Component |
| | | public class CookieInterceptor extends HandlerInterceptorAdapter { |
| | | |
| | | @Override |
| | | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, |
| | | ModelAndView modelAndView) throws Exception { |
| | | |
| | | // cookie |
| | | if (modelAndView!=null && request.getCookies()!=null && request.getCookies().length>0) { |
| | | HashMap<String, Cookie> cookieMap = new HashMap<String, Cookie>(); |
| | | for (Cookie ck : request.getCookies()) { |
| | | cookieMap.put(ck.getName(), ck); |
| | | } |
| | | modelAndView.addObject("cookieMap", cookieMap); |
| | | } |
| | | |
| | | // static method |
| | | if (modelAndView != null) { |
| | | modelAndView.addObject("I18nUtil", FtlUtil.generateStaticModel(I18nUtil.class.getName())); |
| | | } |
| | | |
| | | super.postHandle(request, response, handler, modelAndView); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller.interceptor; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.controller.annotation.PermissionLimit; |
| | | import com.vci.ubcs.xxl.job.admin.core.model.XxlJobUser; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.I18nUtil; |
| | | import com.vci.ubcs.xxl.job.admin.service.LoginService; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * æéæ¦æª |
| | | * |
| | | * @author xuxueli 2015-12-12 18:09:04 |
| | | */ |
| | | @Component |
| | | public class PermissionInterceptor extends HandlerInterceptorAdapter { |
| | | |
| | | @Resource |
| | | private LoginService loginService; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | |
| | | if (!(handler instanceof HandlerMethod)) { |
| | | return super.preHandle(request, response, handler); |
| | | } |
| | | |
| | | // if need login |
| | | boolean needLogin = true; |
| | | boolean needAdminuser = false; |
| | | HandlerMethod method = (HandlerMethod)handler; |
| | | PermissionLimit permission = method.getMethodAnnotation(PermissionLimit.class); |
| | | if (permission!=null) { |
| | | needLogin = permission.limit(); |
| | | needAdminuser = permission.adminuser(); |
| | | } |
| | | |
| | | if (needLogin) { |
| | | XxlJobUser loginUser = loginService.ifLogin(request, response); |
| | | if (loginUser == null) { |
| | | response.sendRedirect(request.getContextPath() + "/toLogin"); |
| | | //request.getRequestDispatcher("/toLogin").forward(request, response); |
| | | return false; |
| | | } |
| | | if (needAdminuser && loginUser.getRole()!=1) { |
| | | throw new RuntimeException(I18nUtil.getString("system_permission_limit")); |
| | | } |
| | | request.setAttribute(LoginService.LOGIN_IDENTITY_KEY, loginUser); |
| | | } |
| | | |
| | | return super.preHandle(request, response, handler); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller.interceptor; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | | |
| | | /** |
| | | * web mvc config |
| | | * |
| | | * @author xuxueli 2018-04-02 20:48:20 |
| | | */ |
| | | @Configuration(proxyBeanMethods = false) |
| | | public class WebMvcConfig extends WebMvcConfigurerAdapter { |
| | | |
| | | @Autowired |
| | | private PermissionInterceptor permissionInterceptor; |
| | | @Autowired |
| | | private CookieInterceptor cookieInterceptor; |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(permissionInterceptor).addPathPatterns("/**"); |
| | | registry.addInterceptor(cookieInterceptor).addPathPatterns("/**"); |
| | | super.addInterceptors(registry); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.controller.resolver; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.exception.XxlJobException; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.vci.ubcs.xxl.job.admin.core.util.JacksonUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.HandlerExceptionResolver; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * common exception resolver |
| | | * |
| | | * @author xuxueli 2016-1-6 19:22:18 |
| | | */ |
| | | @Component |
| | | public class WebExceptionResolver implements HandlerExceptionResolver { |
| | | private static transient Logger logger = LoggerFactory.getLogger(WebExceptionResolver.class); |
| | | |
| | | @Override |
| | | public ModelAndView resolveException(HttpServletRequest request, |
| | | HttpServletResponse response, Object handler, Exception ex) { |
| | | |
| | | if (!(ex instanceof XxlJobException)) { |
| | | logger.error("WebExceptionResolver:{}", ex); |
| | | } |
| | | |
| | | // if json |
| | | boolean isJson = false; |
| | | HandlerMethod method = (HandlerMethod)handler; |
| | | ResponseBody responseBody = method.getMethodAnnotation(ResponseBody.class); |
| | | if (responseBody != null) { |
| | | isJson = true; |
| | | } |
| | | |
| | | // error result |
| | | ReturnT<String> errorResult = new ReturnT<String>(ReturnT.FAIL_CODE, ex.toString().replaceAll("\n", "<br/>")); |
| | | |
| | | // response |
| | | ModelAndView mv = new ModelAndView(); |
| | | if (isJson) { |
| | | try { |
| | | response.setContentType("application/json;charset=utf-8"); |
| | | response.getWriter().print(JacksonUtil.writeValueAsString(errorResult)); |
| | | } catch (IOException e) { |
| | | logger.error(e.getMessage(), e); |
| | | } |
| | | return mv; |
| | | } else { |
| | | |
| | | mv.addObject("exceptionMsg", errorResult.getMsg()); |
| | | mv.setViewName("/common/common.exception"); |
| | | return mv; |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.core.conf; |
| | | |
| | | import com.vci.ubcs.xxl.job.admin.core.scheduler.XxlJobScheduler; |
| | | import com.vci.ubcs.xxl.job.admin.dao.*; |
| | | import org.springframework.beans.factory.DisposableBean; |
| | | import org.springframework.beans.factory.InitializingBean; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.mail.javamail.JavaMailSender; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.sql.DataSource; |
| | | |
| | | /** |
| | | * xxl-job config |
| | | * |
| | | * @author xuxueli 2017-04-28 |
| | | */ |
| | | |
| | | @Component |
| | | public class XxlJobAdminConfig implements InitializingBean, DisposableBean { |
| | | |
| | | private static XxlJobAdminConfig adminConfig = null; |
| | | public static XxlJobAdminConfig getAdminConfig() { |
| | | return adminConfig; |
| | | } |
| | | |
| | | |
| | | // ---------------------- XxlJobScheduler ---------------------- |
| | | |
| | | private XxlJobScheduler xxlJobScheduler; |
| | | |
| | | @Override |
| | | public void afterPropertiesSet() throws Exception { |
| | | adminConfig = this; |
| | | |
| | | xxlJobScheduler = new XxlJobScheduler(); |
| | | xxlJobScheduler.init(); |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() throws Exception { |
| | | xxlJobScheduler.destroy(); |
| | | } |
| | | |
| | | |
| | | // ---------------------- XxlJobScheduler ---------------------- |
| | | |
| | | // conf |
| | | @Value("${xxl.job.i18n}") |
| | | private String i18n; |
| | | |
| | | @Value("${xxl.job.accessToken}") |
| | | private String accessToken; |
| | | |
| | | @Value("${spring.mail.username}") |
| | | private String emailUserName; |
| | | |
| | | @Value("${xxl.job.triggerpool.fast.max}") |
| | | private int triggerPoolFastMax; |
| | | |
| | | @Value("${xxl.job.triggerpool.slow.max}") |
| | | private int triggerPoolSlowMax; |
| | | |
| | | @Value("${xxl.job.logretentiondays}") |
| | | private int logretentiondays; |
| | | |
| | | // dao, service |
| | | |
| | | @Resource |
| | | private XxlJobLogDao xxlJobLogDao; |
| | | @Resource |
| | | private XxlJobInfoDao xxlJobInfoDao; |
| | | @Resource |
| | | private XxlJobRegistryDao xxlJobRegistryDao; |
| | | @Resource |
| | | private XxlJobGroupDao xxlJobGroupDao; |
| | | @Resource |
| | | private XxlJobLogReportDao xxlJobLogReportDao; |
| | | @Resource |
| | | private JavaMailSender mailSender; |
| | | @Resource |
| | | private DataSource dataSource; |
| | | |
| | | |
| | | public String getI18n() { |
| | | return i18n; |
| | | } |
| | | |
| | | public String getAccessToken() { |
| | | return accessToken; |
| | | } |
| | | |
| | | public String getEmailUserName() { |
| | | return emailUserName; |
| | | } |
| | | |
| | | public int getTriggerPoolFastMax() { |
| | | if (triggerPoolFastMax < 200) { |
| | | return 200; |
| | | } |
| | | return triggerPoolFastMax; |
| | | } |
| | | |
| | | public int getTriggerPoolSlowMax() { |
| | | if (triggerPoolSlowMax < 100) { |
| | | return 100; |
| | | } |
| | | return triggerPoolSlowMax; |
| | | } |
| | | |
| | | public int getLogretentiondays() { |
| | | if (logretentiondays < 7) { |
| | | return -1; // Limit greater than or equal to 7, otherwise close |
| | | } |
| | | return logretentiondays; |
| | | } |
| | | |
| | | public XxlJobLogDao getXxlJobLogDao() { |
| | | return xxlJobLogDao; |
| | | } |
| | | |
| | | public XxlJobInfoDao getXxlJobInfoDao() { |
| | | return xxlJobInfoDao; |
| | | } |
| | | |
| | | public XxlJobRegistryDao getXxlJobRegistryDao() { |
| | | return xxlJobRegistryDao; |
| | | } |
| | | |
| | | public XxlJobGroupDao getXxlJobGroupDao() { |
| | | return xxlJobGroupDao; |
| | | } |
| | | |
| | | public XxlJobLogReportDao getXxlJobLogReportDao() { |
| | | return xxlJobLogReportDao; |
| | | } |
| | | |
| | | public JavaMailSender getMailSender() { |
| | | return mailSender; |
| | | } |
| | | |
| | | public DataSource getDataSource() { |
| | | return dataSource; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. |
| | | * |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| | | * use this file except in compliance with the License. You may obtain a copy |
| | | * of the License at |
| | | * |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| | | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| | | * License for the specific language governing permissions and limitations |
| | | * under the License. |
| | | * |
| | | */ |
| | | |
| | | package com.vci.ubcs.xxl.job.admin.core.cron; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.ParseException; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.SortedSet; |
| | | import java.util.StringTokenizer; |
| | | import java.util.TimeZone; |
| | | import java.util.TreeSet; |
| | | |
| | | /** |
| | | * Provides a parser and evaluator for unix-like cron expressions. Cron |
| | | * expressions provide the ability to specify complex time combinations such as |
| | | * "At 8:00am every Monday through Friday" or "At 1:30am every |
| | | * last Friday of the month". |
| | | * <P> |
| | | * Cron expressions are comprised of 6 required fields and one optional field |
| | | * separated by white space. The fields respectively are described as follows: |
| | | * |
| | | * <table cellspacing="8"> |
| | | * <tr> |
| | | * <th align="left">Field Name</th> |
| | | * <th align="left"> </th> |
| | | * <th align="left">Allowed Values</th> |
| | | * <th align="left"> </th> |
| | | * <th align="left">Allowed Special Characters</th> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Seconds</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>0-59</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * /</code></td> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Minutes</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>0-59</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * /</code></td> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Hours</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>0-23</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * /</code></td> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Day-of-month</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>1-31</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * ? / L W</code></td> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Month</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>0-11 or JAN-DEC</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * /</code></td> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Day-of-Week</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>1-7 or SUN-SAT</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * ? / L #</code></td> |
| | | * </tr> |
| | | * <tr> |
| | | * <td align="left"><code>Year (Optional)</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>empty, 1970-2199</code></td> |
| | | * <td align="left"> </th> |
| | | * <td align="left"><code>, - * /</code></td> |
| | | * </tr> |
| | | * </table> |
| | | * <P> |
| | | * The '*' character is used to specify all values. For example, "*" |
| | | * in the minute field means "every minute". |
| | | * <P> |
| | | * The '?' character is allowed for the day-of-month and day-of-week fields. It |
| | | * is used to specify 'no specific value'. This is useful when you need to |
| | | * specify something in one of the two fields, but not the other. |
| | | * <P> |
| | | * The '-' character is used to specify ranges For example "10-12" in |
| | | * the hour field means "the hours 10, 11 and 12". |
| | | * <P> |
| | | * The ',' character is used to specify additional values. For example |
| | | * "MON,WED,FRI" in the day-of-week field means "the days Monday, |
| | | * Wednesday, and Friday". |
| | | * <P> |
| | | * The '/' character is used to specify increments. For example "0/15" |
| | | * in the seconds field means "the seconds 0, 15, 30, and 45". And |
| | | * "5/15" in the seconds field means "the seconds 5, 20, 35, and |
| | | * 50". Specifying '*' before the '/' is equivalent to specifying 0 is |
| | | * the value to start with. Essentially, for each field in the expression, there |
| | | * is a set of numbers that can be turned on or off. For seconds and minutes, |
| | | * the numbers range from 0 to 59. For hours 0 to 23, for days of the month 0 to |
| | | * 31, and for months 0 to 11 (JAN to DEC). The "/" character simply helps you turn |
| | | * on every "nth" value in the given set. Thus "7/6" in the |
| | | * month field only turns on month "7", it does NOT mean every 6th |
| | | * month, please note that subtlety. |
| | | * <P> |
| | | * The 'L' character is allowed for the day-of-month and day-of-week fields. |
| | | * This character is short-hand for "last", but it has different |
| | | * meaning in each of the two fields. For example, the value "L" in |
| | | * the day-of-month field means "the last day of the month" - day 31 |
| | | * for January, day 28 for February on non-leap years. If used in the |
| | | * day-of-week field by itself, it simply means "7" or |
| | | * "SAT". But if used in the day-of-week field after another value, it |
| | | * means "the last xxx day of the month" - for example "6L" |
| | | * means "the last friday of the month". You can also specify an offset |
| | | * from the last day of the month, such as "L-3" which would mean the third-to-last |
| | | * day of the calendar month. <i>When using the 'L' option, it is important not to |
| | | * specify lists, or ranges of values, as you'll get confusing/unexpected results.</i> |
| | | * <P> |
| | | * The 'W' character is allowed for the day-of-month field. This character |
| | | * is used to specify the weekday (Monday-Friday) nearest the given day. As an |
| | | * example, if you were to specify "15W" as the value for the |
| | | * day-of-month field, the meaning is: "the nearest weekday to the 15th of |
| | | * the month". So if the 15th is a Saturday, the trigger will fire on |
| | | * Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the |
| | | * 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th. |
| | | * However if you specify "1W" as the value for day-of-month, and the |
| | | * 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not |
| | | * 'jump' over the boundary of a month's days. The 'W' character can only be |
| | | * specified when the day-of-month is a single day, not a range or list of days. |
| | | * <P> |
| | | * The 'L' and 'W' characters can also be combined for the day-of-month |
| | | * expression to yield 'LW', which translates to "last weekday of the |
| | | * month". |
| | | * <P> |
| | | * The '#' character is allowed for the day-of-week field. This character is |
| | | * used to specify "the nth" XXX day of the month. For example, the |
| | | * value of "6#3" in the day-of-week field means the third Friday of |
| | | * the month (day 6 = Friday and "#3" = the 3rd one in the month). |
| | | * Other examples: "2#1" = the first Monday of the month and |
| | | * "4#5" = the fifth Wednesday of the month. Note that if you specify |
| | | * "#5" and there is not 5 of the given day-of-week in the month, then |
| | | * no firing will occur that month. If the '#' character is used, there can |
| | | * only be one expression in the day-of-week field ("3#1,6#3" is |
| | | * not valid, since there are two expressions). |
| | | * <P> |
| | | * <!--The 'C' character is allowed for the day-of-month and day-of-week fields. |
| | | * This character is short-hand for "calendar". This means values are |
| | | * calculated against the associated calendar, if any. If no calendar is |
| | | * associated, then it is equivalent to having an all-inclusive calendar. A |
| | | * value of "5C" in the day-of-month field means "the first day included by the |
| | | * calendar on or after the 5th". A value of "1C" in the day-of-week field |
| | | * means "the first day included by the calendar on or after Sunday".--> |
| | | * <P> |
| | | * The legal characters and the names of months and days of the week are not |
| | | * case sensitive. |
| | | * |
| | | * <p> |
| | | * <b>NOTES:</b> |
| | | * <ul> |
| | | * <li>Support for specifying both a day-of-week and a day-of-month value is |
| | | * not complete (you'll need to use the '?' character in one of these fields). |
| | | * </li> |
| | | * <li>Overflowing ranges is supported - that is, having a larger number on |
| | | * the left hand side than the right. You might do 22-2 to catch 10 o'clock |
| | | * at night until 2 o'clock in the morning, or you might have NOV-FEB. It is |
| | | * very important to note that overuse of overflowing ranges creates ranges |
| | | * that don't make sense and no effort has been made to determine which |
| | | * interpretation CronExpression chooses. An example would be |
| | | * "0 0 14-6 ? * FRI-MON". </li> |
| | | * </ul> |
| | | * </p> |
| | | * |
| | | * |
| | | * @author Sharada Jambula, James House |
| | | * @author Contributions from Mads Henderson |
| | | * @author Refactoring from CronTrigger to CronExpression by Aaron Craven |
| | | * |
| | | * Borrowed from quartz v2.3.1 |
| | | * |
| | | */ |
| | | public final class CronExpression implements Serializable, Cloneable { |
| | | |
| | | private static final long serialVersionUID = 12423409423L; |
| | | |
| | | protected static final int SECOND = 0; |
| | | protected static final int MINUTE = 1; |
| | | protected static final int HOUR = 2; |
| | | protected static final int DAY_OF_MONTH = 3; |
| | | protected static final int MONTH = 4; |
| | | protected static final int DAY_OF_WEEK = 5; |
| | | protected static final int YEAR = 6; |
| | | protected static final int ALL_SPEC_INT = 99; // '*' |
| | | protected static final int NO_SPEC_INT = 98; // '?' |
| | | protected static final Integer ALL_SPEC = ALL_SPEC_INT; |
| | | protected static final Integer NO_SPEC = NO_SPEC_INT; |
| | | |
| | | protected static final Map<String, Integer> monthMap = new HashMap<String, Integer>(20); |
| | | protected static final Map<String, Integer> dayMap = new HashMap<String, Integer>(60); |
| | | static { |
| | | monthMap.put("JAN", 0); |
| | | monthMap.put("FEB", 1); |
| | | monthMap.put("MAR", 2); |
| | | monthMap.put("APR", 3); |
| | | monthMap.put("MAY", 4); |
| | | monthMap.put("JUN", 5); |
| | | monthMap.put("JUL", 6); |
| | | monthMap.put("AUG", 7); |
| | | monthMap.put("SEP", 8); |
| | | monthMap.put("OCT", 9); |
| | | monthMap.put("NOV", 10); |
| | | monthMap.put("DEC", 11); |
| | | |
| | | dayMap.put("SUN", 1); |
| | | dayMap.put("MON", 2); |
| | | dayMap.put("TUE", 3); |
| | | dayMap.put("WED", 4); |
| | | dayMap.put("THU", 5); |
| | | dayMap.put("FRI", 6); |
| | | dayMap.put("SAT", 7); |
| | | } |
| | | |
| | | private final String cronExpression; |
| | | private TimeZone timeZone = null; |
| | | protected transient TreeSet<Integer> seconds; |
| | | protected transient TreeSet<Integer> minutes; |
| | | protected transient TreeSet<Integer> hours; |
| | | protected transient TreeSet<Integer> daysOfMonth; |
| | | protected transient TreeSet<Integer> months; |
| | | protected transient TreeSet<Integer> daysOfWeek; |
| | | protected transient TreeSet<Integer> years; |
| | | |
| | | protected transient boolean lastdayOfWeek = false; |
| | | protected transient int nthdayOfWeek = 0; |
| | | protected transient boolean lastdayOfMonth = false; |
| | | protected transient boolean nearestWeekday = false; |
| | | protected transient int lastdayOffset = 0; |
| | | protected transient boolean expressionParsed = false; |
| | | |
| | | public static final int MAX_YEAR = Calendar.getInstance().get(Calendar.YEAR) + 100; |
| | | |
| | | /** |
| | | * Constructs a new <CODE>CronExpression</CODE> based on the specified |
| | | * parameter. |
| | | * |
| | | * @param cronExpression String representation of the cron expression the |
| | | * new object should represent |
| | | * @throws java.text.ParseException |
| | | * if the string expression cannot be parsed into a valid |
| | | * <CODE>CronExpression</CODE> |
| | | */ |
| | | public CronExpression(String cronExpression) throws ParseException { |
| | | if (cronExpression == null) { |
| | | throw new IllegalArgumentException("cronExpression cannot be null"); |
| | | } |
| | | |
| | | this.cronExpression = cronExpression.toUpperCase(Locale.US); |
| | | |
| | | buildExpression(this.cronExpression); |
| | | } |
| | | |
| | | /** |
| | | * Constructs a new {@code CronExpression} as a copy of an existing |
| | | * instance. |
| | | * |
| | | * @param expression |
| | | * The existing cron expression to be copied |
| | | */ |
| | | public CronExpression(CronExpression expression) { |
| | | /* |
| | | * We don't call the other constructor here since we need to swallow the |
| | | * ParseException. We also elide some of the sanity checking as it is |
| | | * not logically trippable. |
| | | */ |
| | | this.cronExpression = expression.getCronExpression(); |
| | | try { |
| | | buildExpression(cronExpression); |
| | | } catch (ParseException ex) { |
| | | throw new AssertionError(); |
| | | } |
| | | if (expression.getTimeZone() != null) { |
| | | setTimeZone((TimeZone) expression.getTimeZone().clone()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Indicates whether the given date satisfies the cron expression. Note that |
| | | * milliseconds are ignored, so two Dates falling on different milliseconds |
| | | * of the same second will always have the same result here. |
| | | * |
| | | * @param date the date to evaluate |
| | | * @return a boolean indicating whether the given date satisfies the cron |
| | | * expression |
| | | */ |
| | | public boolean isSatisfiedBy(Date date) { |
| | | Calendar testDateCal = Calendar.getInstance(getTimeZone()); |
| | | testDateCal.setTime(date); |
| | | testDateCal.set(Calendar.MILLISECOND, 0); |
| | | Date originalDate = testDateCal.getTime(); |
| | | |
| | | testDateCal.add(Calendar.SECOND, -1); |
| | | |
| | | Date timeAfter = getTimeAfter(testDateCal.getTime()); |
| | | |
| | | return ((timeAfter != null) && (timeAfter.equals(originalDate))); |
| | | } |
| | | |
| | | /** |
| | | * Returns the next date/time <I>after</I> the given date/time which |
| | | * satisfies the cron expression. |
| | | * |
| | | * @param date the date/time at which to begin the search for the next valid |
| | | * date/time |
| | | * @return the next valid date/time |
| | | */ |
| | | public Date getNextValidTimeAfter(Date date) { |
| | | return getTimeAfter(date); |
| | | } |
| | | |
| | | /** |
| | | * Returns the next date/time <I>after</I> the given date/time which does |
| | | * <I>not</I> satisfy the expression |
| | | * |
| | | * @param date the date/time at which to begin the search for the next |
| | | * invalid date/time |
| | | * @return the next valid date/time |
| | | */ |
| | | public Date getNextInvalidTimeAfter(Date date) { |
| | | long difference = 1000; |
| | | |
| | | //move back to the nearest second so differences will be accurate |
| | | Calendar adjustCal = Calendar.getInstance(getTimeZone()); |
| | | adjustCal.setTime(date); |
| | | adjustCal.set(Calendar.MILLISECOND, 0); |
| | | Date lastDate = adjustCal.getTime(); |
| | | |
| | | Date newDate; |
| | | |
| | | //FUTURE_TODO: (QUARTZ-481) IMPROVE THIS! The following is a BAD solution to this problem. Performance will be very bad here, depending on the cron expression. It is, however A solution. |
| | | |
| | | //keep getting the next included time until it's farther than one second |
| | | // apart. At that point, lastDate is the last valid fire time. We return |
| | | // the second immediately following it. |
| | | while (difference == 1000) { |
| | | newDate = getTimeAfter(lastDate); |
| | | if(newDate == null) |
| | | break; |
| | | |
| | | difference = newDate.getTime() - lastDate.getTime(); |
| | | |
| | | if (difference == 1000) { |
| | | lastDate = newDate; |
| | | } |
| | | } |
| | | |
| | | return new Date(lastDate.getTime() + 1000); |
| | | } |
| | | |
| | | /** |
| | | * Returns the time zone for which this <code>CronExpression</code> |
| | | * will be resolved. |
| | | */ |
| | | public TimeZone getTimeZone() { |
| | | if (timeZone == null) { |
| | | timeZone = TimeZone.getDefault(); |
| | | } |
| | | |
| | | return timeZone; |
| | | } |
| | | |
| | | /** |
| | | * Sets the time zone for which this <code>CronExpression</code> |
| | | * will be resolved. |
| | | */ |
| | | public void setTimeZone(TimeZone timeZone) { |
| | | this.timeZone = timeZone; |
| | | } |
| | | |
| | | /** |
| | | * Returns the string representation of the <CODE>CronExpression</CODE> |
| | | * |
| | | * @return a string representation of the <CODE>CronExpression</CODE> |
| | | */ |
| | | @Override |
| | | public String toString() { |
| | | return cronExpression; |
| | | } |
| | | |
| | | /** |
| | | * Indicates whether the specified cron expression can be parsed into a |
| | | * valid cron expression |
| | | * |
| | | * @param cronExpression the expression to evaluate |
| | | * @return a boolean indicating whether the given expression is a valid cron |
| | | * expression |
| | | */ |
| | | public static boolean isValidExpression(String cronExpression) { |
| | | |
| | | try { |
| | | new CronExpression(cronExpression); |
| | | } catch (ParseException pe) { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | public static void validateExpression(String cronExpression) throws ParseException { |
| | | |
| | | new CronExpression(cronExpression); |
| | | } |
| | | |
| | | |
| | | //////////////////////////////////////////////////////////////////////////// |
| | | // |
| | | // Expression Parsing Functions |
| | | // |
| | | //////////////////////////////////////////////////////////////////////////// |
| | | |
| | | protected void buildExpression(String expression) throws ParseException { |
| | | expressionParsed = true; |
| | | |
| | | try { |
| | | |
| | | if (seconds == null) { |
| | | seconds = new TreeSet<Integer>(); |
| | | } |
| | | if (minutes == null) { |
| | | minutes = new TreeSet<Integer>(); |
| | | } |
| | | if (hours == null) { |
| | | hours = new TreeSet<Integer>(); |
| | | } |
| | | if (daysOfMonth == null) { |
| | | daysOfMonth = new TreeSet<Integer>(); |
| | | } |
| | | if (months == null) { |
| | | months = new TreeSet<Integer>(); |
| | | } |
| | | if (daysOfWeek == null) { |
| | | daysOfWeek = new TreeSet<Integer>(); |
| | | } |
| | | if (years == null) { |
| | | years = new TreeSet<Integer>(); |
| | | } |
| | | |
| | | int exprOn = SECOND; |
| | | |
| | | StringTokenizer exprsTok = new StringTokenizer(expression, " \t", |
| | | false); |
| | | |
| | | while (exprsTok.hasMoreTokens() && exprOn <= YEAR) { |
| | | String expr = exprsTok.nextToken().trim(); |
| | | |
| | | // throw an exception if L is used with other days of the month |
| | | if(exprOn == DAY_OF_MONTH && expr.indexOf('L') != -1 && expr.length() > 1 && expr.contains(",")) { |
| | | throw new ParseException("Support for specifying 'L' and 'LW' with other days of the month is not implemented", -1); |
| | | } |
| | | // throw an exception if L is used with other days of the week |
| | | if(exprOn == DAY_OF_WEEK && expr.indexOf('L') != -1 && expr.length() > 1 && expr.contains(",")) { |
| | | throw new ParseException("Support for specifying 'L' with other days of the week is not implemented", -1); |
| | | } |
| | | if(exprOn == DAY_OF_WEEK && expr.indexOf('#') != -1 && expr.indexOf('#', expr.indexOf('#') +1) != -1) { |
| | | throw new ParseException("Support for specifying multiple \"nth\" days is not implemented.", -1); |
| | | } |
| | | |
| | | StringTokenizer vTok = new StringTokenizer(expr, ","); |
| | | while (vTok.hasMoreTokens()) { |
| | | String v = vTok.nextToken(); |
| | | storeExpressionVals(0, v, exprOn); |
| | | } |
| | | |
| | | exprOn++; |
| | | } |
| | | |
| | | if (exprOn <= DAY_OF_WEEK) { |
| | | throw new ParseException("Unexpected end of expression.", |
| | | expression.length()); |
| | | } |
| | | |
| | | if (exprOn <= YEAR) { |
| | | storeExpressionVals(0, "*", YEAR); |
| | | } |
| | | |
| | | TreeSet<Integer> dow = getSet(DAY_OF_WEEK); |
| | | TreeSet<Integer> dom = getSet(DAY_OF_MONTH); |
| | | |
| | | // Copying the logic from the UnsupportedOperationException below |
| | | boolean dayOfMSpec = !dom.contains(NO_SPEC); |
| | | boolean dayOfWSpec = !dow.contains(NO_SPEC); |
| | | |
| | | if (!dayOfMSpec || dayOfWSpec) { |
| | | if (!dayOfWSpec || dayOfMSpec) { |
| | | throw new ParseException( |
| | | "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.", 0); |
| | | } |
| | | } |
| | | } catch (ParseException pe) { |
| | | throw pe; |
| | | } catch (Exception e) { |
| | | throw new ParseException("Illegal cron expression format (" |
| | | + e.toString() + ")", 0); |
| | | } |
| | | } |
| | | |
| | | protected int storeExpressionVals(int pos, String s, int type) |
| | | throws ParseException { |
| | | |
| | | int incr = 0; |
| | | int i = skipWhiteSpace(pos, s); |
| | | if (i >= s.length()) { |
| | | return i; |
| | | } |
| | | char c = s.charAt(i); |
| | | if ((c >= 'A') && (c <= 'Z') && (!s.equals("L")) && (!s.equals("LW")) && (!s.matches("^L-[0-9]*[W]?"))) { |
| | | String sub = s.substring(i, i + 3); |
| | | int sval = -1; |
| | | int eval = -1; |
| | | if (type == MONTH) { |
| | | sval = getMonthNumber(sub) + 1; |
| | | if (sval <= 0) { |
| | | throw new ParseException("Invalid Month value: '" + sub + "'", i); |
| | | } |
| | | if (s.length() > i + 3) { |
| | | c = s.charAt(i + 3); |
| | | if (c == '-') { |
| | | i += 4; |
| | | sub = s.substring(i, i + 3); |
| | | eval = getMonthNumber(sub) + 1; |
| | | if (eval <= 0) { |
| | | throw new ParseException("Invalid Month value: '" + sub + "'", i); |
| | | } |
| | | } |
| | | } |
| | | } else if (type == DAY_OF_WEEK) { |
| | | sval = getDayOfWeekNumber(sub); |
| | | if (sval < 0) { |
| | | throw new ParseException("Invalid Day-of-Week value: '" |
| | | + sub + "'", i); |
| | | } |
| | | if (s.length() > i + 3) { |
| | | c = s.charAt(i + 3); |
| | | if (c == '-') { |
| | | i += 4; |
| | | sub = s.substring(i, i + 3); |
| | | eval = getDayOfWeekNumber(sub); |
| | | if (eval < 0) { |
| | | throw new ParseException( |
| | | "Invalid Day-of-Week value: '" + sub |
| | | + "'", i); |
| | | } |
| | | } else if (c == '#') { |
| | | try { |
| | | i += 4; |
| | | nthdayOfWeek = Integer.parseInt(s.substring(i)); |
| | | if (nthdayOfWeek < 1 || nthdayOfWeek > 5) { |
| | | throw new Exception(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new ParseException( |
| | | "A numeric value between 1 and 5 must follow the '#' option", |
| | | i); |
| | | } |
| | | } else if (c == 'L') { |
| | | lastdayOfWeek = true; |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | throw new ParseException( |
| | | "Illegal characters for this position: '" + sub + "'", |
| | | i); |
| | | } |
| | | if (eval != -1) { |
| | | incr = 1; |
| | | } |
| | | addToSet(sval, eval, incr, type); |
| | | return (i + 3); |
| | | } |
| | | |
| | | if (c == '?') { |
| | | i++; |
| | | if ((i + 1) < s.length() |
| | | && (s.charAt(i) != ' ' && s.charAt(i + 1) != '\t')) { |
| | | throw new ParseException("Illegal character after '?': " |
| | | + s.charAt(i), i); |
| | | } |
| | | if (type != DAY_OF_WEEK && type != DAY_OF_MONTH) { |
| | | throw new ParseException( |
| | | "'?' can only be specified for Day-of-Month or Day-of-Week.", |
| | | i); |
| | | } |
| | | if (type == DAY_OF_WEEK && !lastdayOfMonth) { |
| | | int val = daysOfMonth.last(); |
| | | if (val == NO_SPEC_INT) { |
| | | throw new ParseException( |
| | | "'?' can only be specified for Day-of-Month -OR- Day-of-Week.", |
| | | i); |
| | | } |
| | | } |
| | | |
| | | addToSet(NO_SPEC_INT, -1, 0, type); |
| | | return i; |
| | | } |
| | | |
| | | if (c == '*' || c == '/') { |
| | | if (c == '*' && (i + 1) >= s.length()) { |
| | | addToSet(ALL_SPEC_INT, -1, incr, type); |
| | | return i + 1; |
| | | } else if (c == '/' |
| | | && ((i + 1) >= s.length() || s.charAt(i + 1) == ' ' || s |
| | | .charAt(i + 1) == '\t')) { |
| | | throw new ParseException("'/' must be followed by an integer.", i); |
| | | } else if (c == '*') { |
| | | i++; |
| | | } |
| | | c = s.charAt(i); |
| | | if (c == '/') { // is an increment specified? |
| | | i++; |
| | | if (i >= s.length()) { |
| | | throw new ParseException("Unexpected end of string.", i); |
| | | } |
| | | |
| | | incr = getNumericValue(s, i); |
| | | |
| | | i++; |
| | | if (incr > 10) { |
| | | i++; |
| | | } |
| | | checkIncrementRange(incr, type, i); |
| | | } else { |
| | | incr = 1; |
| | | } |
| | | |
| | | addToSet(ALL_SPEC_INT, -1, incr, type); |
| | | return i; |
| | | } else if (c == 'L') { |
| | | i++; |
| | | if (type == DAY_OF_MONTH) { |
| | | lastdayOfMonth = true; |
| | | } |
| | | if (type == DAY_OF_WEEK) { |
| | | addToSet(7, 7, 0, type); |
| | | } |
| | | if(type == DAY_OF_MONTH && s.length() > i) { |
| | | c = s.charAt(i); |
| | | if(c == '-') { |
| | | ValueSet vs = getValue(0, s, i+1); |
| | | lastdayOffset = vs.value; |
| | | if(lastdayOffset > 30) |
| | | throw new ParseException("Offset from last day must be <= 30", i+1); |
| | | i = vs.pos; |
| | | } |
| | | if(s.length() > i) { |
| | | c = s.charAt(i); |
| | | if(c == 'W') { |
| | | nearestWeekday = true; |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | | return i; |
| | | } else if (c >= '0' && c <= '9') { |
| | | int val = Integer.parseInt(String.valueOf(c)); |
| | | i++; |
| | | if (i >= s.length()) { |
| | | addToSet(val, -1, -1, type); |
| | | } else { |
| | | c = s.charAt(i); |
| | | if (c >= '0' && c <= '9') { |
| | | ValueSet vs = getValue(val, s, i); |
| | | val = vs.value; |
| | | i = vs.pos; |
| | | } |
| | | i = checkNext(i, s, val, type); |
| | | return i; |
| | | } |
| | | } else { |
| | | throw new ParseException("Unexpected character: " + c, i); |
| | | } |
| | | |
| | | return i; |
| | | } |
| | | |
| | | private void checkIncrementRange(int incr, int type, int idxPos) throws ParseException { |
| | | if (incr > 59 && (type == SECOND || type == MINUTE)) { |
| | | throw new ParseException("Increment > 60 : " + incr, idxPos); |
| | | } else if (incr > 23 && (type == HOUR)) { |
| | | throw new ParseException("Increment > 24 : " + incr, idxPos); |
| | | } else if (incr > 31 && (type == DAY_OF_MONTH)) { |
| | | throw new ParseException("Increment > 31 : " + incr, idxPos); |
| | | } else if (incr > 7 && (type == DAY_OF_WEEK)) { |
| | | throw new ParseException("Increment > 7 : " + incr, idxPos); |
| | | } else if (incr > 12 && (type == MONTH)) { |
| | | throw new ParseException("Increment > 12 : " + incr, idxPos); |
| | | } |
| | | } |
| | | |
| | | protected int checkNext(int pos, String s, int val, int type) |
| | | throws ParseException { |
| | | |
| | | int end = -1; |
| | | int i = pos; |
| | | |
| | | if (i >= s.length()) { |
| | | addToSet(val, end, -1, type); |
| | | return i; |
| | | } |
| | | |
| | | char c = s.charAt(pos); |
| | | |
| | | if (c == 'L') { |
| | | if (type == DAY_OF_WEEK) { |
| | | if(val < 1 || val > 7) |
| | | throw new ParseException("Day-of-Week values must be between 1 and 7", -1); |
| | | lastdayOfWeek = true; |
| | | } else { |
| | | throw new ParseException("'L' option is not valid here. (pos=" + i + ")", i); |
| | | } |
| | | TreeSet<Integer> set = getSet(type); |
| | | set.add(val); |
| | | i++; |
| | | return i; |
| | | } |
| | | |
| | | if (c == 'W') { |
| | | if (type == DAY_OF_MONTH) { |
| | | nearestWeekday = true; |
| | | } else { |
| | | throw new ParseException("'W' option is not valid here. (pos=" + i + ")", i); |
| | | } |
| | | if(val > 31) |
| | | throw new ParseException("The 'W' option does not make sense with values larger than 31 (max number of days in a month)", i); |
| | | TreeSet<Integer> set = getSet(type); |
| | | set.add(val); |
| | | i++; |
| | | return i; |
| | | } |
| | | |
| | | if (c == '#') { |
| | | if (type != DAY_OF_WEEK) { |
| | | throw new ParseException("'#' option is not valid here. (pos=" + i + ")", i); |
| | | } |
| | | i++; |
| | | try { |
| | | nthdayOfWeek = Integer.parseInt(s.substring(i)); |
| | | if (nthdayOfWeek < 1 || nthdayOfWeek > 5) { |
| | | throw new Exception(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new ParseException( |
| | | "A numeric value between 1 and 5 must follow the '#' option", |
| | | i); |
| | | } |
| | | |
| | | TreeSet<Integer> set = getSet(type); |
| | | set.add(val); |
| | | i++; |
| | | return i; |
| | | } |
| | | |
| | | if (c == '-') { |
| | | i++; |
| | | c = s.charAt(i); |
| | | int v = Integer.parseInt(String.valueOf(c)); |
| | | end = v; |
| | | i++; |
| | | if (i >= s.length()) { |
| | | addToSet(val, end, 1, type); |
| | | return i; |
| | | } |
| | | c = s.charAt(i); |
| | | if (c >= '0' && c <= '9') { |
| | | ValueSet vs = getValue(v, s, i); |
| | | end = vs.value; |
| | | i = vs.pos; |
| | | } |
| | | if (i < s.length() && ((c = s.charAt(i)) == '/')) { |
| | | i++; |
| | | c = s.charAt(i); |
| | | int v2 = Integer.parseInt(String.valueOf(c)); |
| | | i++; |
| | | if (i >= s.length()) { |
| | | addToSet(val, end, v2, type); |
| | | return i; |
| | | } |
| | | c = s.charAt(i); |
| | | if (c >= '0' && c <= '9') { |
| | | ValueSet vs = getValue(v2, s, i); |
| | | int v3 = vs.value; |
| | | addToSet(val, end, v3, type); |
| | | i = vs.pos; |
| | | return i; |
| | | } else { |
| | | addToSet(val, end, v2, type); |
| | | return i; |
| | | } |
| | | } else { |
| | | addToSet(val, end, 1, type); |
| | | return i; |
| | | } |
| | | } |
| | | |
| | | if (c == '/') { |
| | | if ((i + 1) >= s.length() || s.charAt(i + 1) == ' ' || s.charAt(i + 1) == '\t') { |
| | | throw new ParseException("'/' must be followed by an integer.", i); |
| | | } |
| | | |
| | | i++; |
| | | c = s.charAt(i); |
| | | int v2 = Integer.parseInt(String.valueOf(c)); |
| | | i++; |
| | | if (i >= s.length()) { |
| | | checkIncrementRange(v2, type, i); |
| | | addToSet(val, end, v2, type); |
| | | return i; |
| | | } |
| | | c = s.charAt(i); |
| | | if (c >= '0' && c <= '9') { |
| | | ValueSet vs = getValue(v2, s, i); |
| | | int v3 = vs.value; |
| | | checkIncrementRange(v3, type, i); |
| | | addToSet(val, end, v3, type); |
| | | i = vs.pos; |
| | | return i; |
| | | } else { |
| | | throw new ParseException("Unexpected character '" + c + "' after '/'", i); |
| | | } |
| | | } |
| | | |
| | | addToSet(val, end, 0, type); |
| | | i++; |
| | | return i; |
| | | } |
| | | |
| | | public String getCronExpression() { |
| | | return cronExpression; |
| | | } |
| | | |
| | | public String getExpressionSummary() { |
| | | StringBuilder buf = new StringBuilder(); |
| | | |
| | | buf.append("seconds: "); |
| | | buf.append(getExpressionSetSummary(seconds)); |
| | | buf.append("\n"); |
| | | buf.append("minutes: "); |
| | | buf.append(getExpressionSetSummary(minutes)); |
| | | buf.append("\n"); |
| | | buf.append("hours: "); |
| | | buf.append(getExpressionSetSummary(hours)); |
| | | buf.append("\n"); |
| | | buf.append("daysOfMonth: "); |
| | | buf.append(getExpressionSetSummary(daysOfMonth)); |
| | | buf.append("\n"); |
| | | buf.append("months: "); |
| | | buf.append(getExpressionSetSummary(months)); |
| | | buf.append("\n"); |
| | | buf.append("daysOfWeek: "); |
| | | buf.append(getExpressionSetSummary(daysOfWeek)); |
| | | buf.append("\n"); |
| | | buf.append("lastdayOfWeek: "); |
| | | buf.append(lastdayOfWeek); |
| | | buf.append("\n"); |
| | | buf.append("nearestWeekday: "); |
| | | buf.append(nearestWeekday); |
| | | buf.append("\n"); |
| | | buf.append("NthDayOfWeek: "); |
| | | buf.append(nthdayOfWeek); |
| | | buf.append("\n"); |
| | | buf.append("lastdayOfMonth: "); |
| | | buf.append(lastdayOfMonth); |
| | | buf.append("\n"); |
| | | buf.append("years: "); |
| | | buf.append(getExpressionSetSummary(years)); |
| | | buf.append("\n"); |
| | | |
| | | return buf.toString(); |
| | | } |
| | | |
| | | protected String getExpressionSetSummary(java.util.Set<Integer> set) { |
| | | |
| | | if (set.contains(NO_SPEC)) { |
| | | return "?"; |
| | | } |
| | | if (set.contains(ALL_SPEC)) { |
| | | return "*"; |
| | | } |
| | | |
| | | StringBuilder buf = new StringBuilder(); |
| | | |
| | | Iterator<Integer> itr = set.iterator(); |
| | | boolean first = true; |
| | | while (itr.hasNext()) { |
| | | Integer iVal = itr.next(); |
| | | String val = iVal.toString(); |
| | | if (!first) { |
| | | buf.append(","); |
| | | } |
| | | buf.append(val); |
| | | first = false; |
| | | } |
| | | |
| | | return buf.toString(); |
| | | } |
| | | |
| | | protected String getExpressionSetSummary(java.util.ArrayList<Integer> list) { |
| | | |
| | | if (list.contains(NO_SPEC)) { |
| | | return "?"; |
| | | } |
| | | if (list.contains(ALL_SPEC)) { |
| | | return "*"; |
| | | } |
| | | |
| | | StringBuilder buf = new StringBuilder(); |
| | | |
| | | Iterator<Integer> itr = list.iterator(); |
| | | boolean first = true; |
| | | while (itr.hasNext()) { |
| | | Integer iVal = itr.next(); |
| | | String val = iVal.toString(); |
| | | if (!first) { |
| | | buf.append(","); |
| | | } |
| | | buf.append(val); |
| | | first = false; |
| | | } |
| | | |
| | | return buf.toString(); |
| | | } |
| | | |
| | | protected int skipWhiteSpace(int i, String s) { |
| | | for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) { |
| | | } |
| | | |
| | | return i; |
| | | } |
| | | |
| | | protected int findNextWhiteSpace(int i, String s) { |
| | | for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) { |
| | | } |
| | | |
| | | return i; |
| | | } |
| | | |
| | | protected void addToSet(int val, int end, int incr, int type) |
| | | throws ParseException { |
| | | |
| | | TreeSet<Integer> set = getSet(type); |
| | | |
| | | if (type == SECOND || type == MINUTE) { |
| | | if ((val < 0 || val > 59 || end > 59) && (val != ALL_SPEC_INT)) { |
| | | throw new ParseException( |
| | | "Minute and Second values must be between 0 and 59", |
| | | -1); |
| | | } |
| | | } else if (type == HOUR) { |
| | | if ((val < 0 || val > 23 || end > 23) && (val != ALL_SPEC_INT)) { |
| | | throw new ParseException( |
| | | "Hour values must be between 0 and 23", -1); |
| | | } |
| | | } else if (type == DAY_OF_MONTH) { |
| | | if ((val < 1 || val > 31 || end > 31) && (val != ALL_SPEC_INT) |
| | | && (val != NO_SPEC_INT)) { |
| | | throw new ParseException( |
| | | "Day of month values must be between 1 and 31", -1); |
| | | } |
| | | } else if (type == MONTH) { |
| | | if ((val < 1 || val > 12 || end > 12) && (val != ALL_SPEC_INT)) { |
| | | throw new ParseException( |
| | | "Month values must be between 1 and 12", -1); |
| | | } |
| | | } else if (type == DAY_OF_WEEK) { |
| | | if ((val == 0 || val > 7 || end > 7) && (val != ALL_SPEC_INT) |
| | | && (val != NO_SPEC_INT)) { |
| | | throw new ParseException( |
| | | "Day-of-Week values must be between 1 and 7", -1); |
| | | } |
| | | } |
| | | |
| | | if ((incr == 0 || incr == -1) && val != ALL_SPEC_INT) { |
| | | if (val != -1) { |
| | | set.add(val); |
| | | } else { |
| | | set.add(NO_SPEC); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | |
| | | int startAt = val; |
| | | int stopAt = end; |
| | | |
| | | if (val == ALL_SPEC_INT && incr <= 0) { |
| | | incr = 1; |
| | | set.add(ALL_SPEC); // put in a marker, but also fill values |
| | | } |
| | | |
| | | if (type == SECOND || type == MINUTE) { |
| | | if (stopAt == -1) { |
| | | stopAt = 59; |
| | | } |
| | | if (startAt == -1 || startAt == ALL_SPEC_INT) { |
| | | startAt = 0; |
| | | } |
| | | } else if (type == HOUR) { |
| | | if (stopAt == -1) { |
| | | stopAt = 23; |
| | | } |
| | | if (startAt == -1 || startAt == ALL_SPEC_INT) { |
| | | startAt = 0; |
| | | } |
| | | } else if (type == DAY_OF_MONTH) { |
| | | if (stopAt == -1) { |
| | | stopAt = 31; |
| | | } |
| | | if (startAt == -1 || startAt == ALL_SPEC_INT) { |
| | | startAt = 1; |
| | | } |
| | | } else if (type == MONTH) { |
| | | if (stopAt == -1) { |
| | | stopAt = 12; |
| | | } |
| | | if (startAt == -1 || startAt == ALL_SPEC_INT) { |
| | | startAt = 1; |
| | | } |
| | | } else if (type == DAY_OF_WEEK) { |
| | | if (stopAt == -1) { |
| | | stopAt = 7; |
| | | } |
| | | if (startAt == -1 || startAt == ALL_SPEC_INT) { |
| | | startAt = 1; |
| | | } |
| | | } else if (type == YEAR) { |
| | | if (stopAt == -1) { |
| | | stopAt = MAX_YEAR; |
| | | } |
| | | if (startAt == -1 || startAt == ALL_SPEC_INT) { |
| | | startAt = 1970; |
| | | } |
| | | } |
| | | |
| | | // if the end of the range is before the start, then we need to overflow into |
| | | // the next day, month etc. This is done by adding the maximum amount for that |
| | | // type, and using modulus max to determine the value being added. |
| | | int max = -1; |
| | | if (stopAt < startAt) { |
| | | switch (type) { |
| | | case SECOND : max = 60; break; |
| | | case MINUTE : max = 60; break; |
| | | case HOUR : max = 24; break; |
| | | case MONTH : max = 12; break; |
| | | case DAY_OF_WEEK : max = 7; break; |
| | | case DAY_OF_MONTH : max = 31; break; |
| | | case YEAR : throw new IllegalArgumentException("Start year must be less than stop year"); |
| | | default : throw new IllegalArgumentException("Unexpected type encountered"); |
| | | } |
| | | stopAt += max; |
| | | } |
| | | |
| | | for (int i = startAt; i <= stopAt; i += incr) { |
| | | if (max == -1) { |
| | | // ie: there's no max to overflow over |
| | | set.add(i); |
| | | } else { |
| | | // take the modulus to get the real value |
| | | int i2 = i % max; |
| | | |
| | | // 1-indexed ranges should not include 0, and should include their max |
| | | if (i2 == 0 && (type == MONTH || type == DAY_OF_WEEK || type == DAY_OF_MONTH) ) { |
| | | i2 = max; |
| | | } |
| | | |
| | | set.add(i2); |
| | | } |
| | | } |
| | | } |
| | | |
| | | TreeSet<Integer> getSet(int type) { |
| | | switch (type) { |
| | | case SECOND: |
| | | return seconds; |
| | | case MINUTE: |
| | | return minutes; |
| | | case HOUR: |
| | | return hours; |
| | | case DAY_OF_MONTH: |
| | | return daysOfMonth; |
| | | case MONTH: |
| | | return months; |
| | | case DAY_OF_WEEK: |
| | | return daysOfWeek; |
| | | case YEAR: |
| | | return years; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | protected ValueSet getValue(int v, String s, int i) { |
| | | char c = s.charAt(i); |
| | | StringBuilder s1 = new StringBuilder(String.valueOf(v)); |
| | | while (c >= '0' && c <= '9') { |
| | | s1.append(c); |
| | | i++; |
| | | if (i >= s.length()) { |
| | | break; |
| | | } |
| | | c = s.charAt(i); |
| | | } |
| | | ValueSet val = new ValueSet(); |
| | | |
| | | val.pos = (i < s.length()) ? i : i + 1; |
| | | val.value = Integer.parseInt(s1.toString()); |
| | | return val; |
| | | } |
| | | |
| | | protected int getNumericValue(String s, int i) { |
| | | int endOfVal = findNextWhiteSpace(i, s); |
| | | String val = s.substring(i, endOfVal); |
| | | return Integer.parseInt(val); |
| | | } |
| | | |
| | | protected int getMonthNumber(String s) { |
| | | Integer integer = monthMap.get(s); |
| | | |
| | | if (integer == null) { |
| | | return -1; |
| | | } |
| | | |
| | | return integer; |
| | | } |
| | | |
| | | protected int getDayOfWeekNumber(String s) { |
| | | Integer integer = dayMap.get(s); |
| | | |
| | | if (integer == null) { |
| | | return -1; |
| | | } |
| | | |
| | | return integer; |
| | | } |
| | | |
| | | //////////////////////////////////////////////////////////////////////////// |
| | | // |
| | | // Computation Functions |
| | | // |
| | | //////////////////////////////////////////////////////////////////////////// |
| | | |
| | | public Date getTimeAfter(Date afterTime) { |
| | | |
| | | // Computation is based on Gregorian year only. |
| | | Calendar cl = new java.util.GregorianCalendar(getTimeZone()); |
| | | |
| | | // move ahead one second, since we're computing the time *after* the |
| | | // given time |
| | | afterTime = new Date(afterTime.getTime() + 1000); |
| | | // CronTrigger does not deal with milliseconds |
| | | cl.setTime(afterTime); |
| | | cl.set(Calendar.MILLISECOND, 0); |
| | | |
| | | boolean gotOne = false; |
| | | // loop until we've computed the next time, or we've past the endTime |
| | | while (!gotOne) { |
| | | |
| | | //if (endTime != null && cl.getTime().after(endTime)) return null; |
| | | if(cl.get(Calendar.YEAR) > 2999) { // prevent endless loop... |
| | | return null; |
| | | } |
| | | |
| | | SortedSet<Integer> st = null; |
| | | int t = 0; |
| | | |
| | | int sec = cl.get(Calendar.SECOND); |
| | | int min = cl.get(Calendar.MINUTE); |
| | | |
| | | // get second................................................. |
| | | st = seconds.tailSet(sec); |
| | | if (st != null && st.size() != 0) { |
| | | sec = st.first(); |
| | | } else { |
| | | sec = seconds.first(); |
| | | min++; |
| | | cl.set(Calendar.MINUTE, min); |
| | | } |
| | | cl.set(Calendar.SECOND, sec); |
| | | |
| | | min = cl.get(Calendar.MINUTE); |
| | | int hr = cl.get(Calendar.HOUR_OF_DAY); |
| | | t = -1; |
| | | |
| | | // get minute................................................. |
| | | st = minutes.tailSet(min); |
| | | if (st != null && st.size() != 0) { |
| | | t = min; |
| | | min = st.first(); |
| | | } else { |
| | | min = minutes.first(); |
| | | hr++; |
| | | } |
| | | if (min != t) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, min); |
| | | setCalendarHour(cl, hr); |
| | | continue; |
| | | } |
| | | cl.set(Calendar.MINUTE, min); |
| | | |
| | | hr = cl.get(Calendar.HOUR_OF_DAY); |
| | | int day = cl.get(Calendar.DAY_OF_MONTH); |
| | | t = -1; |
| | | |
| | | // get hour................................................... |
| | | st = hours.tailSet(hr); |
| | | if (st != null && st.size() != 0) { |
| | | t = hr; |
| | | hr = st.first(); |
| | | } else { |
| | | hr = hours.first(); |
| | | day++; |
| | | } |
| | | if (hr != t) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, day); |
| | | setCalendarHour(cl, hr); |
| | | continue; |
| | | } |
| | | cl.set(Calendar.HOUR_OF_DAY, hr); |
| | | |
| | | day = cl.get(Calendar.DAY_OF_MONTH); |
| | | int mon = cl.get(Calendar.MONTH) + 1; |
| | | // '+ 1' because calendar is 0-based for this field, and we are |
| | | // 1-based |
| | | t = -1; |
| | | int tmon = mon; |
| | | |
| | | // get day................................................... |
| | | boolean dayOfMSpec = !daysOfMonth.contains(NO_SPEC); |
| | | boolean dayOfWSpec = !daysOfWeek.contains(NO_SPEC); |
| | | if (dayOfMSpec && !dayOfWSpec) { // get day by day of month rule |
| | | st = daysOfMonth.tailSet(day); |
| | | if (lastdayOfMonth) { |
| | | if(!nearestWeekday) { |
| | | t = day; |
| | | day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | day -= lastdayOffset; |
| | | if(t > day) { |
| | | mon++; |
| | | if(mon > 12) { |
| | | mon = 1; |
| | | tmon = 3333; // ensure test of mon != tmon further below fails |
| | | cl.add(Calendar.YEAR, 1); |
| | | } |
| | | day = 1; |
| | | } |
| | | } else { |
| | | t = day; |
| | | day = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | day -= lastdayOffset; |
| | | |
| | | java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone()); |
| | | tcal.set(Calendar.SECOND, 0); |
| | | tcal.set(Calendar.MINUTE, 0); |
| | | tcal.set(Calendar.HOUR_OF_DAY, 0); |
| | | tcal.set(Calendar.DAY_OF_MONTH, day); |
| | | tcal.set(Calendar.MONTH, mon - 1); |
| | | tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR)); |
| | | |
| | | int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | int dow = tcal.get(Calendar.DAY_OF_WEEK); |
| | | |
| | | if(dow == Calendar.SATURDAY && day == 1) { |
| | | day += 2; |
| | | } else if(dow == Calendar.SATURDAY) { |
| | | day -= 1; |
| | | } else if(dow == Calendar.SUNDAY && day == ldom) { |
| | | day -= 2; |
| | | } else if(dow == Calendar.SUNDAY) { |
| | | day += 1; |
| | | } |
| | | |
| | | tcal.set(Calendar.SECOND, sec); |
| | | tcal.set(Calendar.MINUTE, min); |
| | | tcal.set(Calendar.HOUR_OF_DAY, hr); |
| | | tcal.set(Calendar.DAY_OF_MONTH, day); |
| | | tcal.set(Calendar.MONTH, mon - 1); |
| | | Date nTime = tcal.getTime(); |
| | | if(nTime.before(afterTime)) { |
| | | day = 1; |
| | | mon++; |
| | | } |
| | | } |
| | | } else if(nearestWeekday) { |
| | | t = day; |
| | | day = daysOfMonth.first(); |
| | | |
| | | java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone()); |
| | | tcal.set(Calendar.SECOND, 0); |
| | | tcal.set(Calendar.MINUTE, 0); |
| | | tcal.set(Calendar.HOUR_OF_DAY, 0); |
| | | tcal.set(Calendar.DAY_OF_MONTH, day); |
| | | tcal.set(Calendar.MONTH, mon - 1); |
| | | tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR)); |
| | | |
| | | int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | int dow = tcal.get(Calendar.DAY_OF_WEEK); |
| | | |
| | | if(dow == Calendar.SATURDAY && day == 1) { |
| | | day += 2; |
| | | } else if(dow == Calendar.SATURDAY) { |
| | | day -= 1; |
| | | } else if(dow == Calendar.SUNDAY && day == ldom) { |
| | | day -= 2; |
| | | } else if(dow == Calendar.SUNDAY) { |
| | | day += 1; |
| | | } |
| | | |
| | | |
| | | tcal.set(Calendar.SECOND, sec); |
| | | tcal.set(Calendar.MINUTE, min); |
| | | tcal.set(Calendar.HOUR_OF_DAY, hr); |
| | | tcal.set(Calendar.DAY_OF_MONTH, day); |
| | | tcal.set(Calendar.MONTH, mon - 1); |
| | | Date nTime = tcal.getTime(); |
| | | if(nTime.before(afterTime)) { |
| | | day = daysOfMonth.first(); |
| | | mon++; |
| | | } |
| | | } else if (st != null && st.size() != 0) { |
| | | t = day; |
| | | day = st.first(); |
| | | // make sure we don't over-run a short month, such as february |
| | | int lastDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | if (day > lastDay) { |
| | | day = daysOfMonth.first(); |
| | | mon++; |
| | | } |
| | | } else { |
| | | day = daysOfMonth.first(); |
| | | mon++; |
| | | } |
| | | |
| | | if (day != t || mon != tmon) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, day); |
| | | cl.set(Calendar.MONTH, mon - 1); |
| | | // '- 1' because calendar is 0-based for this field, and we |
| | | // are 1-based |
| | | continue; |
| | | } |
| | | } else if (dayOfWSpec && !dayOfMSpec) { // get day by day of week rule |
| | | if (lastdayOfWeek) { // are we looking for the last XXX day of |
| | | // the month? |
| | | int dow = daysOfWeek.first(); // desired |
| | | // d-o-w |
| | | int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w |
| | | int daysToAdd = 0; |
| | | if (cDow < dow) { |
| | | daysToAdd = dow - cDow; |
| | | } |
| | | if (cDow > dow) { |
| | | daysToAdd = dow + (7 - cDow); |
| | | } |
| | | |
| | | int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | |
| | | if (day + daysToAdd > lDay) { // did we already miss the |
| | | // last one? |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, 1); |
| | | cl.set(Calendar.MONTH, mon); |
| | | // no '- 1' here because we are promoting the month |
| | | continue; |
| | | } |
| | | |
| | | // find date of last occurrence of this day in this month... |
| | | while ((day + daysToAdd + 7) <= lDay) { |
| | | daysToAdd += 7; |
| | | } |
| | | |
| | | day += daysToAdd; |
| | | |
| | | if (daysToAdd > 0) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, day); |
| | | cl.set(Calendar.MONTH, mon - 1); |
| | | // '- 1' here because we are not promoting the month |
| | | continue; |
| | | } |
| | | |
| | | } else if (nthdayOfWeek != 0) { |
| | | // are we looking for the Nth XXX day in the month? |
| | | int dow = daysOfWeek.first(); // desired |
| | | // d-o-w |
| | | int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w |
| | | int daysToAdd = 0; |
| | | if (cDow < dow) { |
| | | daysToAdd = dow - cDow; |
| | | } else if (cDow > dow) { |
| | | daysToAdd = dow + (7 - cDow); |
| | | } |
| | | |
| | | boolean dayShifted = false; |
| | | if (daysToAdd > 0) { |
| | | dayShifted = true; |
| | | } |
| | | |
| | | day += daysToAdd; |
| | | int weekOfMonth = day / 7; |
| | | if (day % 7 > 0) { |
| | | weekOfMonth++; |
| | | } |
| | | |
| | | daysToAdd = (nthdayOfWeek - weekOfMonth) * 7; |
| | | day += daysToAdd; |
| | | if (daysToAdd < 0 |
| | | || day > getLastDayOfMonth(mon, cl |
| | | .get(Calendar.YEAR))) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, 1); |
| | | cl.set(Calendar.MONTH, mon); |
| | | // no '- 1' here because we are promoting the month |
| | | continue; |
| | | } else if (daysToAdd > 0 || dayShifted) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, day); |
| | | cl.set(Calendar.MONTH, mon - 1); |
| | | // '- 1' here because we are NOT promoting the month |
| | | continue; |
| | | } |
| | | } else { |
| | | int cDow = cl.get(Calendar.DAY_OF_WEEK); // current d-o-w |
| | | int dow = daysOfWeek.first(); // desired |
| | | // d-o-w |
| | | st = daysOfWeek.tailSet(cDow); |
| | | if (st != null && st.size() > 0) { |
| | | dow = st.first(); |
| | | } |
| | | |
| | | int daysToAdd = 0; |
| | | if (cDow < dow) { |
| | | daysToAdd = dow - cDow; |
| | | } |
| | | if (cDow > dow) { |
| | | daysToAdd = dow + (7 - cDow); |
| | | } |
| | | |
| | | int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR)); |
| | | |
| | | if (day + daysToAdd > lDay) { // will we pass the end of |
| | | // the month? |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, 1); |
| | | cl.set(Calendar.MONTH, mon); |
| | | // no '- 1' here because we are promoting the month |
| | | continue; |
| | | } else if (daysToAdd > 0) { // are we swithing days? |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, day + daysToAdd); |
| | | cl.set(Calendar.MONTH, mon - 1); |
| | | // '- 1' because calendar is 0-based for this field, |
| | | // and we are 1-based |
| | | continue; |
| | | } |
| | | } |
| | | } else { // dayOfWSpec && !dayOfMSpec |
| | | throw new UnsupportedOperationException( |
| | | "Support for specifying both a day-of-week AND a day-of-month parameter is not implemented."); |
| | | } |
| | | cl.set(Calendar.DAY_OF_MONTH, day); |
| | | |
| | | mon = cl.get(Calendar.MONTH) + 1; |
| | | // '+ 1' because calendar is 0-based for this field, and we are |
| | | // 1-based |
| | | int year = cl.get(Calendar.YEAR); |
| | | t = -1; |
| | | |
| | | // test for expressions that never generate a valid fire date, |
| | | // but keep looping... |
| | | if (year > MAX_YEAR) { |
| | | return null; |
| | | } |
| | | |
| | | // get month................................................... |
| | | st = months.tailSet(mon); |
| | | if (st != null && st.size() != 0) { |
| | | t = mon; |
| | | mon = st.first(); |
| | | } else { |
| | | mon = months.first(); |
| | | year++; |
| | | } |
| | | if (mon != t) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, 1); |
| | | cl.set(Calendar.MONTH, mon - 1); |
| | | // '- 1' because calendar is 0-based for this field, and we are |
| | | // 1-based |
| | | cl.set(Calendar.YEAR, year); |
| | | continue; |
| | | } |
| | | cl.set(Calendar.MONTH, mon - 1); |
| | | // '- 1' because calendar is 0-based for this field, and we are |
| | | // 1-based |
| | | |
| | | year = cl.get(Calendar.YEAR); |
| | | t = -1; |
| | | |
| | | // get year................................................... |
| | | st = years.tailSet(year); |
| | | if (st != null && st.size() != 0) { |
| | | t = year; |
| | | year = st.first(); |
| | | } else { |
| | | return null; // ran out of years... |
| | | } |
| | | |
| | | if (year != t) { |
| | | cl.set(Calendar.SECOND, 0); |
| | | cl.set(Calendar.MINUTE, 0); |
| | | cl.set(Calendar.HOUR_OF_DAY, 0); |
| | | cl.set(Calendar.DAY_OF_MONTH, 1); |
| | | cl.set(Calendar.MONTH, 0); |
| | | // '- 1' because calendar is 0-based for this field, and we are |
| | | // 1-based |
| | | cl.set(Calendar.YEAR, year); |
| | | continue; |
| | | } |
| | | cl.set(Calendar.YEAR, year); |
| | | |
| | | gotOne = true; |
| | | } // while( !done ) |
| | | |
| | | return cl.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * Advance the calendar to the particular hour paying particular attention |
| | | * to daylight saving problems. |
| | | * |
| | | * @param cal the calendar to operate on |
| | | * @param hour the hour to set |
| | | */ |
| | | protected void setCalendarHour(Calendar cal, int hour) { |
| | | cal.set(java.util.Calendar.HOUR_OF_DAY, hour); |
| | | if (cal.get(java.util.Calendar.HOUR_OF_DAY) != hour && hour != 24) { |
| | | cal.set(java.util.Calendar.HOUR_OF_DAY, hour + 1); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * NOT YET IMPLEMENTED: Returns the time before the given time |
| | | * that the <code>CronExpression</code> matches. |
| | | */ |
| | | public Date getTimeBefore(Date endTime) { |
| | | // FUTURE_TODO: implement QUARTZ-423 |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * NOT YET IMPLEMENTED: Returns the final time that the |
| | | * <code>CronExpression</code> will match. |
| | | */ |
| | | public Date getFinalFireTime() { |
| | | // FUTURE_TODO: implement QUARTZ-423 |
| | | return null; |
| | | } |
| | | |
| | | protected boolean isLeapYear(int year) { |
| | | return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)); |
| | | } |
| | | |
| | | protected int getLastDayOfMonth(int monthNum, int year) { |
| | | |
| | | switch (monthNum) { |
| | | case 1: |
| | | return 31; |
| | | case 2: |
| | | return (isLeapYear(year)) ? 29 : 28; |
| | | case 3: |
| | | return 31; |
| | | case 4: |
| | | return 30; |
| | | case 5: |
| | | return 31; |
| | | case 6: |
| | | return 30; |
| | | case 7: |
| | | return 31; |
| | | case 8: |
| | | return 31; |
| | | case 9: |
| | | return 30; |
| | | case 10: |
| | | return 31; |
| | | case 11: |
| | | return 30; |
| | | case 12: |
| | | return 31; |
| | | default: |
| | | throw new IllegalArgumentException("Illegal month number: " |
| | | + monthNum); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void readObject(java.io.ObjectInputStream stream) |
| | | throws java.io.IOException, ClassNotFoundException { |
| | | |
| | | stream.defaultReadObject(); |
| | | try { |
| | | buildExpression(cronExpression); |
| | | } catch (Exception ignore) { |
| | | } // never happens |
| | | } |
| | | |
| | | @Override |
| | | @Deprecated |
| | | public Object clone() { |
| | | return new CronExpression(this); |
| | | } |
| | | } |
| | | |
| | | class ValueSet { |
| | | public int value; |
| | | |
| | | public int pos; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.core.exception; |
| | | |
| | | /** |
| | | * @author xuxueli 2019-05-04 23:19:29 |
| | | */ |
| | | public class XxlJobException extends RuntimeException { |
| | | |
| | | public XxlJobException() { |
| | | } |
| | | public XxlJobException(String message) { |
| | | super(message); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.core.model; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by xuxueli on 16/9/30. |
| | | */ |
| | | public class XxlJobGroup { |
| | | |
| | | private int id; |
| | | private String appName; |
| | | private String title; |
| | | private int order; |
| | | private int addressType; // æ§è¡å¨å°åç±»åï¼0=èªå¨æ³¨åã1=æå¨å½å
¥ |
| | | private String addressList; // æ§è¡å¨å°åå表ï¼å¤å°åéå·åé(æå¨å½å
¥) |
| | | |
| | | // registry list |
| | | private List<String> registryList; // æ§è¡å¨å°åå表(ç³»ç»æ³¨å) |
| | | public List<String> getRegistryList() { |
| | | if (addressList!=null && addressList.trim().length()>0) { |
| | | registryList = new ArrayList<String>(Arrays.asList(addressList.split(","))); |
| | | } |
| | | return registryList; |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getAppName() { |
| | | return appName; |
| | | } |
| | | |
| | | public void setAppName(String appName) { |
| | | this.appName = appName; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public int getOrder() { |
| | | return order; |
| | | } |
| | | |
| | | public void setOrder(int order) { |
| | | this.order = order; |
| | | } |
| | | |
| | | public int getAddressType() { |
| | | return addressType; |
| | | } |
| | | |
| | | public void setAddressType(int addressType) { |
| | | this.addressType = addressType; |
| | | } |
| | | |
| | | public String getAddressList() { |
| | | return addressList; |
| | | } |
| | | |
| | | public void setAddressList(String addressList) { |
| | | this.addressList = addressList; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.xxl.job.admin.core.model; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * xxl-job info |
| | | * |
| | | * @author xuxueli 2016-1-12 18:25:49 |
| | | */ |
| | | public class XxlJobInfo { |
| | | |
| | | private int id; // 主é®ID |
| | | |
| | | private int jobGroup; // æ§è¡å¨ä¸»é®ID |
| | | private String jobCron; // 任塿§è¡CRONè¡¨è¾¾å¼ |
| | | private String jobDesc; |
| | | |
| | | private Date addTime; |
| | | private Date updateTime; |
| | | |
| | | private String author; // è´è´£äºº |
| | | private String alarmEmail; // æ¥è¦é®ä»¶ |
| | | |
| | | private String executorRouteStrategy; // æ§è¡å¨è·¯ç±çç¥ |
| | | private String executorHandler; // æ§è¡å¨ï¼ä»»å¡Handleråç§° |
| | | private String executorParam; // æ§è¡å¨ï¼ä»»å¡åæ° |
| | | private String executorBlockStrategy; // é»å¡å¤ççç¥ |
| | | private int executorTimeout; // 任塿§è¡è¶
æ¶æ¶é´ï¼åä½ç§ |
| | | private int executorFailRetryCount; // 失败éè¯æ¬¡æ° |
| | | |
| | | private String glueType; // GLUEç±»å #com.xxl.job.core.glue.GlueTypeEnum |
| | | private String glueSource; // GLUEæºä»£ç |
| | | private String glueRemark; // GLUE夿³¨ |
| | | private Date glueUpdatetime; // GLUEæ´æ°æ¶é´ |
| | | |
| | | private String childJobId; // åä»»å¡IDï¼å¤ä¸ªéå·åé |
| | | |
| | | private int triggerStatus; // è°åº¦ç¶æï¼0-忢ï¼1-è¿è¡ |
| | | private long triggerLastTime; // 䏿¬¡è°åº¦æ¶é´ |
| | | private long triggerNextTime; // 䏿¬¡è°åº¦æ¶é´ |
| | | |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getJobGroup() { |
| | | return jobGroup; |
| | | } |
| | | |
| | | public void setJobGroup(int jobGroup) { |
| | | this.jobGroup = jobGroup; |
| | | } |
| | | |
| | | public String getJobCron() { |
| | | return jobCron; |
| | | } |
| | | |
| | | public void setJobCron(String jobCron) { |
| | | this.jobCron = jobCron; |
| | | } |
| | | |
| | | public String getJobDesc() { |
| | | return jobDesc; |
| | | } |
| | | |
| | | public void setJobDesc(String jobDesc) { |
| | | this.jobDesc = jobDesc; |
| | | } |
| | | |
| | | public Date getAddTime() { |
| | | return addTime; |
| | | } |
| | | |
| | | public void setAddTime(Date addTime) { |
| | | this.addTime = addTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getAuthor() { |
| | | return author; |
| | | } |
| | | |
| | | public void setAuthor(String author) { |
| | | this.author = author; |
| | | } |
| | | |
| | | public String getAlarmEmail() { |
| | | return alarmEmail; |
| | | } |
| | | |
| | | public void setAlarmEmail(String alarmEmail) { |
| | | this.alarmEmail = alarmEmail; |
| | | } |
| | | |
| | | public String getExecutorRouteStrategy() { |
| | | return executorRouteStrategy; |
| | | } |
| | | |
| | | public void setExecutorRouteStrategy(String executorRouteStrategy) { |
| | | this.executorRouteStrategy = executorRouteStrategy; |
| | | } |
| | | |
| | | public String getExecutorHandler() { |
| | | return executorHandler; |
| | | } |
| | | |
| | | public void setExecutorHandler(String executorHandler) { |
| | | this.executorHandler = executorHandler; |
| | | } |
| | | |
| | | public String getExecutorParam() { |
| | | return executorParam; |
| | | } |
| | | |
| | | public void setExecutorParam(String executorParam) { |
| | | this.executorParam = executorParam; |
| | | } |
| | | |
| | | public String getExecutorBlockStrategy() { |
| | | return executorBlockStrategy; |
| | | } |
| | | |
| | | public void setExecutorBlockStrategy(String executorBlockStrategy) { |
| | | this.executorBlockStrategy = executorBlockStrategy; |
| | | } |
| | | |
| | | public int getExecutorTimeout() { |
| | | return executorTimeout; |
| | | } |
| | | |
| | | public void setExecutorTimeout(int executorTimeout) { |
| | | this.executorTimeout = executorTimeout; |
| | | } |
| | | |
| | | public int getExecutorFailRetryCount() { |
| | | return executorFailRetryCount; |
| | | } |
| | | |
| | | public void setExecutorFailRetryCount(int executorFailRetryCount) { |
| | | this.executorFailRetryCount = executorFailRetryCount; |
| | | } |
| | | |
| | | public String getGlueType() { |
| | | return glueType; |
| | | } |
| | | |
| | | public void setGlueType(String glueType) { |
| | | this.glueType = glueType; |
| | | } |
| | | |
| | | public String getGlueSource() { |
| | | return glueSource; |
| | | } |
| | | |
| | | public void setGlueSource(String glueSource) { |
| | | this.glueSource = glueSource; |
| | | } |
| | | |
| | | public String getGlueRemark() { |
| | | return glueRemark; |
| | | } |
| | | |
| | | public void setGlueRemark(String glueRemark) { |
| | | this.glueRemark = glueRemark; |
| | | } |
| | | |
| | | public Date getGlueUpdatetime() { |
| | | return glueUpdatetime; |
| | | } |
| | | |
| | | public void setGlueUpdatetime(Date glueUpdatetime) { |
| | | this.glueUpdatetime = glueUpdatetime; |
| | | } |
| | | |
| | | public String getChildJobId() { |
| | | return childJobId; |
| | | } |
| | | |
| | | public void setChildJobId(String childJobId) { |
| | | this.childJobId = childJobId; |
| | | } |
| | | |
| | | public int getTriggerStatus() { |
| | | return triggerStatus; |
| | | } |
| | | |
| | | public void setTriggerStatus(int triggerStatus) { |
| | | this.triggerStatus = triggerStatus; |
| | | } |
| | | |
| | | public long getTriggerLastTime() { |
| | | return triggerLastTime; |
| | | } |
| | | |
| | | public void setTriggerLastTime(long triggerLastTime) { |
| | | this.triggerLastTime = triggerLastTime; |
| | | } |
| | | |
| | | public long getTriggerNextTime() { |
| | | return triggerNextTime; |
| | | } |
| | | |
| | | public void setTriggerNextTime(long triggerNextTime) { |
| | | this.triggerNextTime = triggerNextTime; |
| | | } |
| | | } |
| Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/model/XxlJobLog.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/model/XxlJobLogGlue.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/model/XxlJobLogReport.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/model/XxlJobRegistry.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/model/XxlJobUser.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/old/RemoteHttpJobBean.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/old/XxlJobDynamicScheduler.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/old/XxlJobThreadPool.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/ExecutorRouteStrategyEnum.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/ExecutorRouter.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteConsistentHash.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteFirst.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteLast.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteRandom.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/route/strategy/ExecutorRouteRound.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/scheduler/XxlJobScheduler.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/thread/JobFailMonitorHelper.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/thread/JobLogReportHelper.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/thread/JobScheduleHelper.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/thread/JobTriggerPoolHelper.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/trigger/TriggerTypeEnum.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/trigger/XxlJobTrigger.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/util/CookieUtil.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/util/FtlUtil.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/util/I18nUtil.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/util/JacksonUtil.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/core/util/LocalCacheUtil.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobGroupDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobInfoDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobLogDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobLogGlueDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobLogReportDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobRegistryDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/dao/XxlJobUserDao.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/service/LoginService.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/service/XxlJobService.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/service/impl/AdminBizImpl.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/java/com/vci/ubcs/xxl/job/admin/service/impl/XxlJobServiceImpl.java
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/application-dev.yml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/application-prod.yml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/application-test.yml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/application.yml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/i18n/message.properties
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/i18n/message_en.properties
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/logback.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobGroupMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobLogGlueMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobLogReportMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobRegistryMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/Ionicons/css/ionicons.min.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/Ionicons/fonts/ionicons.eot
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/Ionicons/fonts/ionicons.svg
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/Ionicons/fonts/ionicons.ttf
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/Ionicons/fonts/ionicons.woff
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/PACE/pace.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/PACE/themes/blue/pace-theme-flash.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap-daterangepicker/daterangepicker.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap-daterangepicker/daterangepicker.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/css/bootstrap.css.map
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/css/bootstrap.min.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/fonts/glyphicons-halflings-regular.eot
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/fonts/glyphicons-halflings-regular.svg
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/fonts/glyphicons-halflings-regular.ttf
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/fonts/glyphicons-halflings-regular.woff2
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/bootstrap/js/bootstrap.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/datatables.net/js/jquery.dataTables.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/fastclick/fastclick.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/css/font-awesome.css.map
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/css/font-awesome.min.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/fonts/FontAwesome.otf
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/fonts/fontawesome-webfont.eot
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/fonts/fontawesome-webfont.svg
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/fonts/fontawesome-webfont.ttf
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/fonts/fontawesome-webfont.woff
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/font-awesome/fonts/fontawesome-webfont.woff2
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/jquery/jquery.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/bower_components/moment/moment.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/dist/css/AdminLTE.min.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/dist/css/skins/_all-skins.min.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/dist/js/adminlte.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/plugins/iCheck/icheck.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/plugins/iCheck/square/blue.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/plugins/iCheck/square/blue.png
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/adminlte/plugins/iCheck/square/blue@2x.png
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/favicon.ico
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/common.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/index.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/jobcode.index.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/jobgroup.index.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/jobinfo.index.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/joblog.detail.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/joblog.index.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/login.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/js/user.index.1.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/addon/hint/anyword-hint.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/addon/hint/show-hint.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/addon/hint/show-hint.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/lib/codemirror.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/lib/codemirror.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/mode/clike/clike.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/mode/javascript/javascript.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/mode/php/php.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/mode/powershell/powershell.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/mode/python/python.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/codemirror/mode/shell/shell.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/cronGen/cronGen.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/cronGen/cronGen_en.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/echarts/echarts.common.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/jquery/jquery.cookie.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/jquery/jquery.validate.min.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/layer.js
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/theme/default/icon-ext.png
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/theme/default/icon.png
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/theme/default/layer.css
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/theme/default/loading-0.gif
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/theme/default/loading-1.gif
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/static/plugins/layer/theme/default/loading-2.gif
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/common/common.exception.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/common/common.macro.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/help.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/index.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/jobcode/jobcode.index.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/jobgroup/jobgroup.index.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/joblog/joblog.detail.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/joblog/joblog.index.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/login.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob-admin/src/main/resources/templates/user/user.index.ftl
Source/UBCS/ubcs-ops/ubcs-xxljob/Dockerfile
Source/UBCS/ubcs-ops/ubcs-xxljob/pom.xml
Source/UBCS/ubcs-ops/ubcs-xxljob/src/main/java/com/vci/ubcs/job/executor/JobApplication.java
Source/UBCS/ubcs-ops/ubcs-xxljob/src/main/java/com/vci/ubcs/job/executor/config/XxlJobConfig.java
Source/UBCS/ubcs-ops/ubcs-xxljob/src/main/java/com/vci/ubcs/job/executor/controller/TestController.java
Source/UBCS/ubcs-ops/ubcs-xxljob/src/main/java/com/vci/ubcs/job/executor/jobhandler/SampleXxlJob.java
Source/UBCS/ubcs-ops/ubcs-xxljob/src/main/resources/application.yml
Source/UBCS/ubcs-ops/ubcs-xxljob/src/main/resources/logback.xml
Source/UBCS/ubcs-plugin-api/README.md
Source/UBCS/ubcs-plugin-api/pom.xml
Source/UBCS/ubcs-plugin/README.md
Source/UBCS/ubcs-plugin/pom.xml
Source/UBCS/ubcs-service-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/bo/CodeClassifyFullInfoBO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/bo/CodeTemplateAttrSqlBO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeBasicSecDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeButtonDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyProcessTempDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyTempMapItemDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyTemplateAttrDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyTemplateButtonDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyTemplateDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyTemplateMapDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyValueDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeCompPreviewDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeDeleteBatchDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeExportAttrDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeFixedValueDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeImprotDataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeKeyAttrRepeatRuleDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeOrderDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeOrderSecDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodePhaseAttrDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeResembleRuleDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeRuleDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeSynonymDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeTemplatePhaseDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingDataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingLogeDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingPreApplyDataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingPreApplyDataInfoDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingPreAttrMappingDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingPreAttrRangeDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/DockingTaskDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/PreApplyCodeOrderDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/SysIntAuthorityDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/SysIntBaseDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/SysIntHeaderDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/SysIntInfoBseDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/SysIntInfoDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/SysIntParamDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/UpdateSysInfoStatusDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/classify/JsonRootDataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/classify/NodeClassifyDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/classify/NodeDataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/classify/NodeLibraryDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/classify/classfy.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/classify/data.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/data/NodeJosnDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/data/NodeObjectDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/data/NodeProDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/data/NodedataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/data/data.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/data/result.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/result/ResultJsonDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/result/ResultNodeDataDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/datapush/result/ResultNodeObjectDTO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/po/CodeClassifyPO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeBasicSecVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeButtonVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyAttributeVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyProcessTempVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyTempMapItemVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyTemplateAttrVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyTemplateButtonVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyTemplateMapVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyTemplateVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyValueVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeFixedValueVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImProtRusultVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImportResultVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImportTemplateVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImprotDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImprotParmaDatVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImprotResembleVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeImprotSaveDatVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeKeyAttrRepeatRuleVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodePhaseAttrVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeResembleRuleVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeRuleVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeSerialAlgorithmVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeSynonymVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeTemplatePhaseVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/ColumnVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/ConfigAttrMappingVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DataResembleVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingLogeVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingPreApplyDataInfoVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingPreApplyDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingPreAttrMappingVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingPreAttrRangeVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/DockingTaskVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/MdmUIInfoVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/SysIntAuthorityVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/SysIntBaseVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/SysIntHeaderVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/SysIntInfoVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/SysIntParamVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/ApplyDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/ApplyDatasVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/ClassfyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/ClassfysVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/InterParameterVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/ProppertyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/RootDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/SectionVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/SectionsVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/apply/UserVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/ClsfAttrMappingDO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/DataAttributeVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/DataObjectVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/GeneralMappingUtil.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/LibraryClsfDO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/LibraryDO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/RowDatas.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/appcode.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/clsfAttrMap.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/tt.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/xxx.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/attrmap/xxxxxxxxx.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/ClassifyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/LibraryVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/QueryClassifyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/QueryData.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/QueryLibraryVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/ResultClassifyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/ResultData.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/classify.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/classify/xxx.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/CondtionVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/CondtionsVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/DataCondtionsVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/DataObjectVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/PropertyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/ResultDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/ResultVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/result.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/data/xx.xml
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/JSONResultClassfyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/JSONResultClassfysVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/JSONResultDataObjectDO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/JSONResultDataObjectDetailDO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/JSONResultDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/JSONResultSystemVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/json/tt.json
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/xml/XMLResultClassfyVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/xml/XMLResultDataObjectDetailDO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/xml/XMLResultDataVO.java
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/universalInter/result/xml/XMLResultSystemVO.java
Source/UBCS/ubcs-service-api/ubcs-desk-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-desk-api/src/main/java/com/vci/ubcs/desk/entity/Notice.java
Source/UBCS/ubcs-service-api/ubcs-desk-api/src/main/java/com/vci/ubcs/desk/feign/INoticeClient.java
Source/UBCS/ubcs-service-api/ubcs-desk-api/src/main/java/com/vci/ubcs/desk/vo/NoticeVO.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/cache/DictBizCache.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/cache/DictCache.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/constant/DictConstant.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/dto/DictDTO.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/entity/Dict.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/entity/DictBiz.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/enums/DictBizEnum.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/enums/DictEnum.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/feign/IDictBizClient.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/feign/IDictBizClientFallback.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/feign/IDictClient.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/feign/IDictClientFallback.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/vo/DictBizVO.java
Source/UBCS/ubcs-service-api/ubcs-dict-api/src/main/java/com/vci/ubcs/system/vo/DictVO.java
Source/UBCS/ubcs-service-api/ubcs-omd-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/cache/DictBizCache.java
Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/entity/DictBizM.java
Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/enums/DictBizEnum.java
Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/feign/IDictBizClient.java
Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/feign/IDictBizClientFallback.java
Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/DictBizMVO.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/cache/ApiScopeCache.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/cache/DataScopeCache.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/config/ScopeConfiguration.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/feign/IApiScopeClient.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/feign/IApiScopeClientFallback.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/feign/IDataScopeClient.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/feign/IDataScopeClientFallback.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/handler/ApiScopePermissionHandler.java
Source/UBCS/ubcs-service-api/ubcs-scope-api/src/main/java/com/vci/ubcs/system/handler/DataScopeModelHandler.java
Source/UBCS/ubcs-service-api/ubcs-system-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/cache/ParamCache.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/cache/RegionCache.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/cache/SysCache.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/DeptDTO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/MenuDTO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/ParamDTO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/PostDTO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/RoleDTO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/dto/RoleMenuDTO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/ApiScope.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/AuthClient.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Combination.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/DataScope.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Dept.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Menu.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Param.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Post.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Region.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Role.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/RoleMenu.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/RoleScope.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Strategy.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/Tenant.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/TenantPackage.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/TopMenu.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/TopMenuSetting.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/UserPwdstrategy.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/entity/ValueRange.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/ApiScopeVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/CheckedTreeVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/DataScopeVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/DeptVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/GrantTreeVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/GrantVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/MenuVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/ParamVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/PostVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/RegionVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/RoleMenuVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/RoleVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/TenantVO.java
Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/vo/UserPwdstrategyVO.java
Source/UBCS/ubcs-service-api/ubcs-user-api/pom.xml
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/cache/UserCache.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/User.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/UserApp.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/UserDept.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/UserInfo.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/UserOauth.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/UserOther.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/entity/UserWeb.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/enums/UserEnum.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/feign/IUserClient.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/feign/IUserSearchClient.java
Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/vo/UserVO.java
Source/UBCS/ubcs-service/pom.xml
Source/UBCS/ubcs-service/ubcs-code/pom.xml
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/CodeApplication.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/DockingClassSyncScheduling.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/DockingDataSyncScheduling.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/Scheduling/DockingScheduling.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/algorithm/CustomSerialAlgorithmExample.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/annotation/MdmIntegrationMap.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/annotation/MdmIntegrationMapMethod.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/annotation/MdmSerialAlgorithm.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/annotation/MdmSerialAlgorithmMethod.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/constant/MdmBtmTypeConstant.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/constant/MdmDuckingConstant.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/constant/MdmEngineConstant.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/constant/MdmEnumIdConstant.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/constant/MdmLifeCycleConstant.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/constant/MdmLinkTypeConstant.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeApplySyncController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeButtonController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyProcessTempController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyTempMapItemController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyTemplateAttrController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyTemplateButtonController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyTemplateController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyTemplateMapController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyValueController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeDuckingController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeFixedValueController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeKeyAttrRepeatRuleController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodePhaseAttrController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeResembleRuleController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeRuleController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSerialAlgorithmController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeSynonymController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeTemplatePhaseController.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeAllCodeDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeBasicSecDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeButtonDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyProcessTempDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyTempMapItemDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyTemplateAttrDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyTemplateButtonDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyTemplateDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyTemplateMapDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeClassifyValueDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeFixedValueDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeKeyAttrRepeatRuleDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodePhaseAttrDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeResembleRuleDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeRuleDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeSerialValueDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeSynonymDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/CodeTemplatePhaseDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingDataDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingLogeDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingPreApplyDataDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingPreApplyDataInfoDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingPreAttrMappingDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingPreAttrRangeDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/DockingTaskDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/SysIntAuthorityDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/SysIntBaseDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/SysIntHeaderDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/SysIntInfoDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/SysIntParamDaoI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeAllCodeDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeBasicSecDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeButtonDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyProcessTempDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyTempMapItemDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyTemplateAttrDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyTemplateButtonDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyTemplateDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyTemplateMapDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeClassifyValueDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeFixedValueDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeKeyAttrRepeatRuleDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodePhaseAttrDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeResembleRuleDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeRuleDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeSerialValueDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeSynonymDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/CodeTemplatePhaseDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingDataDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingLogeDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingPreApplyDataDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingPreApplyDataInfoDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingPreAttrMappingDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingPreAttrRangeDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/DockingTaskDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/SysIntAuthorityDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/SysIntBaseDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/SysIntHeaderDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/SysIntInfoDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/dao/impl/SysIntParamDaoImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeButtonUseEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeClassifyProcessUseEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeCutTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeGetValueTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeLevelTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeMapRuleTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecLengthTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeUseButtonPositionTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/SysIntegrationAuthorityTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/SysIntegrationDataFlowTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/SysIntegrationParamAndReturnTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/SysIntegrationRequestMethodEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/SysIntegrationRequestTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/sysIntegrationPushTypeEnum.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/lifecycle/CodeAllCodeLC.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/lifecycle/CodeClassifyTemplateLC.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/lifecycle/CodeDefaultLC.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/lifecycle/CodeRuleLC.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeALlCodeMapper.xml
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeAllCodeMapper.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeAllCodeDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeBasicSecDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeButtonDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyProcessPhaseDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyProcessTempDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyTempMapItemDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyTemplateAttrDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyTemplateButtonDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyTemplateDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyTemplateMapDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeClassifyValueDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeFixedValueDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeImprotDataGridVO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeKeyAttrRepeatRuleDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodePhaseAttrDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeResembleRuleDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeRuleDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeSerialValueDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeSynonymDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/CodeTemplatePhaseDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingDataDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingLogeDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingPreApplyDataDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingPreApplyDataInfoDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingPreAttrMappingDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingPreAttrRangeDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/DockingTaskDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/SysIntAuthorityDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/SysIntBaseDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/SysIntHeaderDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/SysIntInfoDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/SysIntParamDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/model/TaskDuckingDO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeBasicSecServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeButtonServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyProcessTempServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyTempMapItemServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyTemplateAttrServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyTemplateButtonServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyTemplateMapServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyTemplateServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeClassifyValueServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeDuckingServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeDuckingSyncServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeFixedValueServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeKeyAttrRepeatRuleServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodePhaseAttrServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeResembleRuleServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeRuleServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeSerialAlgorithmServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeSynonymServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/CodeTemplatePhaseServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/DockingPreApplyDataInfoServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/DockingPreApplyDataServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/DockingPreAttrMappingSeviceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmIOServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmProductCodeServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/SysIntAuthorityServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/SysIntBaseServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/SysIntInfoServiceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/UniversalInterfaceI.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeButtonServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyProcessTempServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyTempMapItemServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyTemplateAttrServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyTemplateButtonServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyTemplateMapServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyTemplateServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyValueServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeDuckingSyncServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeFixedValueServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeKeyAttrRepeatRuleServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodePhaseAttrServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeResembleRuleServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeSerialAlgorithmServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeSynonymServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeTemplatePhaseServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/DockingPreApplyDataInfoServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/DockingPreApplyDataServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/DockingPreAttrMappingSeviceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/SysIntAuthorityServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/SysIntBaseServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/SysIntInfoServiceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/tt.xml
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/update.json
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/AttributeMapConfig.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/BackXml.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/DateUtils.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/EnumVO.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/HttpUtils.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/Json2XmlUtil.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/PatternUtil.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/Pro.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/WsAxis2ClientUtil.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/WsErpClientUtil.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/XmlData.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/XmlUtil.java
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/utils/gennerAttrMapUtil.java
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/application-dev.yml
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/application-prod.yml
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/application-test.yml
Source/UBCS/ubcs-service/ubcs-code/src/main/resources/application.yml
Source/UBCS/ubcs-service/ubcs-desk/Dockerfile
Source/UBCS/ubcs-service/ubcs-desk/pom.xml
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/DeskApplication.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/controller/DashBoardController.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/controller/LeaveController.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/controller/NoticeController.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/entity/ProcessLeave.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/feign/NoticeClient.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/mapper/LeaveMapper.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/mapper/NoticeMapper.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/service/ILeaveService.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/service/INoticeService.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/service/impl/LeaveServiceImpl.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/service/impl/NoticeServiceImpl.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/java/com/vci/ubcs/desk/wrapper/NoticeWrapper.java
Source/UBCS/ubcs-service/ubcs-desk/src/main/resources/application-dev.yml
Source/UBCS/ubcs-service/ubcs-desk/src/main/resources/application-prod.yml
Source/UBCS/ubcs-service/ubcs-desk/src/main/resources/application-test.yml
Source/UBCS/ubcs-service/ubcs-desk/src/main/resources/mapper/LeaveMapper.xml
Source/UBCS/ubcs-service/ubcs-desk/src/main/resources/mapper/NoticeMapper.xml
Source/UBCS/ubcs-service/ubcs-omd/pom.xml
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/OmdApplication.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/DictBizOmdController.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/feign/DictBizClient.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/mapper/DictBizMapper.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/IDictBizService.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/DictBizServiceImpl.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/wrapper/DictBizWrapper.java
Source/UBCS/ubcs-service/ubcs-omd/src/main/resources/application-dev.yml
Source/UBCS/ubcs-service/ubcs-omd/src/main/resources/application-prod.yml
Source/UBCS/ubcs-service/ubcs-omd/src/main/resources/application-test.yml
Source/UBCS/ubcs-service/ubcs-omd/src/main/resources/mapper/DictBizMapper.xml
Source/UBCS/ubcs-service/ubcs-system/Dockerfile
Source/UBCS/ubcs-service/ubcs-system/pom.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/SystemApplication.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ApiScopeController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/AuthClientController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/CombinationController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/DataScopeController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/DeptController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/DictBizController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/DictController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/MenuController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ParamController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/PostController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RegionController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/SearchController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/StrategyController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantPackageController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TopMenuController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/UserPwdstrategyController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/ValueRangeController.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/excel/RegionExcel.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/excel/RegionImporter.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/ApiScopeClient.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/DataScopeClient.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/DictBizClient.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/DictClient.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ApiScopeMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/AuthClientMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/CombinationMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/DataScopeMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/DeptMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/DictBizMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/DictMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/MenuMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ParamMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/PostMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/RegionMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/RoleMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/RoleMenuMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/RoleScopeMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/StrategyMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/TenantMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/TenantPackageMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/TopMenuMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/TopMenuSettingMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/UserPwdstrategyMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/ValueRangeMapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IApiScopeService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IAuthClientService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/ICombinationService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IDataScopeService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IDeptService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IDictBizService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IDictService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IMenuService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IParamService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IPostService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRegionService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRoleMenuService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRoleScopeService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRoleService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IStrategyService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/ITenantPackageService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/ITenantService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/ITopMenuService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/ITopMenuSettingService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IUserPwdstrategyService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IValueRangeService.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ApiScopeServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/AuthClientServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/CombinationServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DataScopeServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DictBizServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DictServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/MenuServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ParamServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/PostServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RegionServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleMenuServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleScopeServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/StrategyServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/TenantPackageServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/TenantServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/TopMenuServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/TopMenuSettingServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/UserPwdstrategyServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/ValueRangeServiceImpl.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/ApiScopeWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/DataScopeWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/DeptWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/DictBizWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/DictWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/MenuWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/PostWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/RegionWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/wrapper/RoleWrapper.java
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/application-dev.yml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/application-prod.yml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/application-test.yml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ApiScopeMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/AuthClientMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/CombinationMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/DataScopeMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/DeptMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/DictBizMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/DictMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/MenuMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ParamMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/PostMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/RegionMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/RoleMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/RoleMenuMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/RoleScopeMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/StrategyMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/TenantMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/TenantPackageMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/TopMenuMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/TopMenuSettingMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/UserPwdstrategyMapper.xml
Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/ValueRangeMapper.xml
Source/UBCS/ubcs-service/ubcs-user/Dockerfile
Source/UBCS/ubcs-service/ubcs-user/pom.xml
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/UserApplication.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/controller/UserController.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/excel/UserExcel.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/excel/UserImporter.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/feign/UserClient.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/feign/UserSearchClient.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserAppMapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserDeptMapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserMapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserOauthMapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserOtherMapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/mapper/UserWebMapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserDeptService.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserOauthService.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserSearchService.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserService.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserDeptServiceImpl.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserOauthServiceImpl.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserSearchServiceImpl.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/wrapper/UserWrapper.java
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/application-dev.yml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/application-prod.yml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/application-test.yml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserAppMapper.xml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserDeptMapper.xml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserMapper.xml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserOauthMapper.xml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserOtherMapper.xml
Source/UBCS/ubcs-service/ubcs-user/src/main/resources/mapper/UserWebMapper.xml
Source/更改过的jar包/blade-core-cloud/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-core-cloud/3.0.1.RELEASE/blade-core-cloud-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-core-cloud/3.0.1.RELEASE/blade-core-cloud-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-core-cloud/3.0.1.RELEASE/blade-core-cloud-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-core-cloud/3.0.1.RELEASE/blade-core-cloud-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-core-cloud/3.0.1.RELEASE/blade-core-cloud-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-core-launch/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-core-launch/3.0.1.RELEASE/blade-core-launch-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-core-launch/3.0.1.RELEASE/blade-core-launch-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-core-launch/3.0.1.RELEASE/blade-core-launch-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-core-launch/3.0.1.RELEASE/blade-core-launch-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-core-launch/3.0.1.RELEASE/blade-core-launch-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-auth/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-auth/3.0.1.RELEASE/blade-starter-auth-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-auth/3.0.1.RELEASE/blade-starter-auth-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-auth/3.0.1.RELEASE/blade-starter-auth-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-auth/3.0.1.RELEASE/blade-starter-auth-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-auth/3.0.1.RELEASE/blade-starter-auth-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-datascope/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-datascope/3.0.1.RELEASE/blade-starter-datascope-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-datascope/3.0.1.RELEASE/blade-starter-datascope-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-datascope/3.0.1.RELEASE/blade-starter-datascope-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-datascope/3.0.1.RELEASE/blade-starter-datascope-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-datascope/3.0.1.RELEASE/blade-starter-datascope-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-develop/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-develop/3.0.1.RELEASE/blade-starter-develop-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-develop/3.0.1.RELEASE/blade-starter-develop-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-develop/3.0.1.RELEASE/blade-starter-develop-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-develop/3.0.1.RELEASE/blade-starter-develop-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-develop/3.0.1.RELEASE/blade-starter-develop-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-log/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-log/3.0.1.RELEASE/blade-starter-log-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-log/3.0.1.RELEASE/blade-starter-log-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-log/3.0.1.RELEASE/blade-starter-log-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-log/3.0.1.RELEASE/blade-starter-log-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-log/3.0.1.RELEASE/blade-starter-log-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-mybatis/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-mybatis/3.0.1.RELEASE/blade-starter-mybatis-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-mybatis/3.0.1.RELEASE/blade-starter-mybatis-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-mybatis/3.0.1.RELEASE/blade-starter-mybatis-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-mybatis/3.0.1.RELEASE/blade-starter-mybatis-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-mybatis/3.0.1.RELEASE/blade-starter-mybatis-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-report/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-report/3.0.1.RELEASE/blade-starter-report-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-report/3.0.1.RELEASE/blade-starter-report-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-report/3.0.1.RELEASE/blade-starter-report-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-report/3.0.1.RELEASE/blade-starter-report-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-report/3.0.1.RELEASE/blade-starter-report-3.0.1.RELEASE.pom.sha1
Source/更改过的jar包/blade-starter-tenant/3.0.1.RELEASE/_remote.repositories
Source/更改过的jar包/blade-starter-tenant/3.0.1.RELEASE/blade-starter-tenant-3.0.1.RELEASE.jar.lastUpdated
Source/更改过的jar包/blade-starter-tenant/3.0.1.RELEASE/blade-starter-tenant-3.0.1.RELEASE.jar.sha1
Source/更改过的jar包/blade-starter-tenant/3.0.1.RELEASE/blade-starter-tenant-3.0.1.RELEASE.pom
Source/更改过的jar包/blade-starter-tenant/3.0.1.RELEASE/blade-starter-tenant-3.0.1.RELEASE.pom.lastUpdated
Source/更改过的jar包/blade-starter-tenant/3.0.1.RELEASE/blade-starter-tenant-3.0.1.RELEASE.pom.sha1 |