初始化

master
LQS 2024-07-24 20:49:05 +08:00
commit d4df7efb9b
19 changed files with 260 additions and 0 deletions

8
.idea/.gitignore vendored 100644
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

13
.idea/compiler.xml 100644
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="cloud-common-xxl" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://101.132.33.172:8081/repository/maven-public/" />
</remote-repository>
<remote-repository>
<option name="id" value="public" />
<option name="name" value="aliyun nexus" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="public" />
<option name="name" value="aliyun nexus" />
<option name="url" value="http://101.132.33.172:8081/repository/maven-public/" />
</remote-repository>
</component>
</project>

18
.idea/misc.xml 100644
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="MavenRunner">
<option name="delegateBuildToMaven" value="true" />
<option name="jreName" value="1.8" />
<option name="skipTests" value="true" />
<option name="vmOptions" value="-DarchetypeCatalog=internal" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

6
.idea/vcs.xml 100644
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

37
pom.xml 100644
View File

@ -0,0 +1,37 @@
<?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>
<groupId>com.muyu</groupId>
<artifactId>cloud-common</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>cloud-common-xxl</artifactId>
<description>XllJob定时任务</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- MuYu Common Core-->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-core</artifactId>
</dependency>
<!-- xxl-job-core -->
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,28 @@
package com.muyu.common.xxl;
import com.muyu.common.core.utils.StringUtils;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@Log4j2
@Component
public class XXLJobConfig {
@Bean
public XxlJobSpringExecutor xxlJobExecutor(XxlJobProperties xxlJobProperties) {
if (StringUtils.isEmpty(xxlJobProperties.getAdminAddresses())){
throw new RuntimeException("请在bootstrap.yml当中配置shared-configs项xxl-job共享配置[application-xxl-config]");
}
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(xxlJobProperties.getAdminAddresses());
xxlJobSpringExecutor.setAppname(xxlJobProperties.getAppName());
xxlJobSpringExecutor.setIp(xxlJobProperties.getIp());
xxlJobSpringExecutor.setPort(xxlJobProperties.getPort());
xxlJobSpringExecutor.setAccessToken(xxlJobProperties.getAccessToken());
xxlJobSpringExecutor.setLogPath(xxlJobProperties.getLogPath());
xxlJobSpringExecutor.setLogRetentionDays(xxlJobProperties.getLogRetentionDays());
log.info(">>>>>>>>>>> xxl-job config init success.");
return xxlJobSpringExecutor;
}
}

View File

@ -0,0 +1,63 @@
package com.muyu.common.xxl;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "xxl-job")
public class XxlJobProperties {
/**
* []
* 使"执行器心跳注册""任务结果回调"
*
*/
private String adminAddresses;
/**
* TOKEN []
*
*/
private String accessToken;
/**
* AppName []
*
*/
private String appName;
/**
* []
* 使使 IP:PORT
* IP
*/
private String address;
/**
* IP []
* IPIPIPHost
* "执行器注册" "调度中心请求并触发任务"
*/
private String ip;
/**
* []
* 09999
*
*/
private int port;
/**
* []
* 使
*/
private String logPath;
/**
* []
* , 3; , -1,
*/
private int logRetentionDays;
}

View File

@ -0,0 +1,28 @@
package com.muyu.common.xxl.demo;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;
@Log4j2
@Component
public class XxlJobDemoService {
/**
*
*/
@XxlJob("xxl-job-demo-no-param")
public void xxlJobDemoNoParam(){
log.info("调度名称:[{}] - 无参", "xxl-job-demo-no-param");
}
/**
*
*/
@XxlJob("xxl-job-demo-one-param")
public void xxlJobDemoOneParam(){
String param = XxlJobHelper.getJobParam();
log.info("调度名称:[{}] - 参数:[{}]", "xxl-job-demo-one-param", param);
}
}

View File

@ -0,0 +1,3 @@
com.muyu.common.xxl.XXLJobConfig
com.muyu.common.xxl.XxlJobProperties
com.muyu.common.xxl.demo.XxlJobDemoService

View File

@ -0,0 +1,3 @@
com.muyu.common.xxl.XXLJobConfig
com.muyu.common.xxl.XxlJobProperties
com.muyu.common.xxl.demo.XxlJobDemoService

Binary file not shown.

View File

@ -0,0 +1,5 @@
#Generated by Maven
#Wed Jul 24 20:47:47 CST 2024
groupId=com.muyu
artifactId=cloud-common-xxl
version=3.6.3

View File

@ -0,0 +1,3 @@
com\muyu\common\xxl\demo\XxlJobDemoService.class
com\muyu\common\xxl\XXLJobConfig.class
com\muyu\common\xxl\XxlJobProperties.class

View File

@ -0,0 +1,3 @@
D:\workspace-IceCeram-Cloud-master\zglchaifen\cloud-common-xxl\src\main\java\com\muyu\common\xxl\demo\XxlJobDemoService.java
D:\workspace-IceCeram-Cloud-master\zglchaifen\cloud-common-xxl\src\main\java\com\muyu\common\xxl\XxlJobProperties.java
D:\workspace-IceCeram-Cloud-master\zglchaifen\cloud-common-xxl\src\main\java\com\muyu\common\xxl\XXLJobConfig.java