Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
simbabdytech committed Dec 18, 2024
1 parent 499ecc1 commit b696d31
Show file tree
Hide file tree
Showing 78 changed files with 3,749 additions and 66 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM amazoncorretto:17
FROM amazoncorretto:21
MAINTAINER xiaowoniu

ADD ./target/snail-job-example.jar snail-job-example.jar
ADD ./target/example.jar example.jar

#对外暴漏的端口号
EXPOSE 8018

WORKDIR /

#开机启动
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /snail-job-example.jar $PARAMS"]
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /example.jar $PARAMS"]

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

# JDK 支持

| JDK版本 | 对应分支 |
|-------|-----------------------------------------------------------------------------|
| ≥ 17 | [master](https://gitee.com/opensnail/snail-job-demo/tree/master/) |
| 8 | [master-jdk8](https://gitee.com/opensnail/snail-job-demo/tree/master-jdk8/) |
```shell
$ java -version ⏎
java version "21.0.2" 2024-01-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30, mixed mode, sharing)
```

# 🌸 简介

Expand Down
9 changes: 9 additions & 0 deletions build-exclude-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

CurrentDir=$(dirname $0)

find ${CurrentDir} -name "target" | xargs rm -rf $(xargs)
mvn clean package -DskipTests=true



9 changes: 9 additions & 0 deletions build-include-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

CurrentDir=$(dirname $0)

find ${CurrentDir} -name "target" | xargs rm -rf $(xargs)
mvn clean package



84 changes: 48 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,127 +5,139 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.5</version>
<version>3.4.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.example</groupId>
<artifactId>example1</artifactId>
<artifactId>example</artifactId>
<version>1.0.0</version>
<name>example</name>
<description>Demo project for Spring Boot</description>
<description>Example project for Spring Boot</description>

<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<snailjob.version>1.2.0</snailjob.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>mybatis-spring</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>1.18.36</version>
</dependency>


<dependency>
<groupId>com.aizuda</groupId>
<artifactId>snail-job-client-starter</artifactId>
<version>${snailjob.version}</version>
</dependency>

<dependency>
<groupId>com.aizuda</groupId>
<artifactId>snail-job-client-retry-core</artifactId>
<version>${snailjob.version}</version>
</dependency>

<dependency>
<groupId>com.aizuda</groupId>
<artifactId>snail-job-client-job-core</artifactId>
<version>${snailjob.version}</version>
</dependency>

<dependency>
<groupId>com.googlecode.aviator</groupId>
<artifactId>aviator</artifactId>
<version>5.3.3</version>
<version>5.4.3</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>QLExpress</artifactId>
<version>3.3.1</version>
<version>3.3.4</version>
</dependency>

<dependency>
<groupId>com.baomidou</groupId>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.7</version>
<version>3.5.9</version>
</dependency>

<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.5.1</version>
<version>3.5.9</version>
</dependency>

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.28</version>
<version>2.3.33</version>
</dependency>

<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.19</version>
<version>5.8.34</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>9.1.0</version>
</dependency>

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.2.0</version>
<version>2.7.0</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>transmittable-thread-local</artifactId>
<version>2.12.0</version>
<version>2.14.5</version>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.1.1</version>
<version>4.2.2</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.2.0</version>
<version>4.12.0</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.3</version>
<version>4.0.3</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.53</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>snail-job-example</finalName>
<finalName>example</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand All @@ -141,5 +153,5 @@
</plugin>
</plugins>
</build>

</project>

18 changes: 18 additions & 0 deletions src/main/java/com/example/ExampleApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.example;

import com.aizuda.snailjob.client.starter.EnableSnailJob;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.TimeZone;

@SpringBootApplication
@EnableSnailJob
@MapperScan("com.example.dao")
public class ExampleApplication {
public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
SpringApplication.run(ExampleApplication.class, args);
}
}
18 changes: 18 additions & 0 deletions src/main/java/com/example/bo/PhoneNumberBo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.example.bo;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

/**
* excel表格手机号BO
*
* @author JiChenWang
* @since 2024/6/27 20:28
*/
@Data
public class PhoneNumberBo {

@ExcelProperty(value = "手机号码", index = 0)
private String phoneNumber;

}
39 changes: 39 additions & 0 deletions src/main/java/com/example/bo/PhoneNumberCheckBo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
* 手机号检测BO
*
* @author JiChenWang
* @since 2024/6/27 20:50
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PhoneNumberCheckBo {

@Schema(description = "检测总条数", accessMode = Schema.AccessMode.READ_WRITE)
private Long total = 0L;

@Schema(description = "检测失败条数", accessMode = Schema.AccessMode.READ_WRITE)
private Long error = 0L;

@Schema(description = "检测成功条数", accessMode = Schema.AccessMode.READ_WRITE)
private Long success = 0L;

@Schema(description = "检测失败临时的数据", accessMode = Schema.AccessMode.READ_WRITE)
private List<String> checkErrors = new ArrayList<>();

// @Schema(description = "检测成功临时的数据", accessMode = Schema.AccessMode.READ_WRITE)
// private List<PhoneNumberPo> checkSuccessPhoneNumberList = new ArrayList<>();

}
55 changes: 55 additions & 0 deletions src/main/java/com/example/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.example.config;

import com.aizuda.snailjob.common.core.util.SnailJobVersion;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
* @author: www.byteblogs.com
* @date : 2023-07-17 18:19
* @since 2.1.0
*/
@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI springShopOpenAPI() {
return new OpenAPI()
.info(new Info()
.title("Snail Job Example")
.description("<h1>SnailJob是一个灵活,可靠和快速的分布式任务重试和分布式任务调度平台</h1> \n" +
"<h3>官网地址: https://snailjob.opensnail.com/</h3>" +
"<h3>在线体验地址: https://preview.snailjob.opensnail.com/</h3> " +
"<h3>源码地址: https://gitee.com/opensnail/snail-job-demo</h3>" +
"<h3>特别提醒: 🌻在您使用测试案例之前请认真的阅读官网.</h3>")
.version(SnailJobVersion.getVersion())
.license(new License().name("Apache 2.0").url("https://snailjob.opensnail.com/")))
.externalDocs(new ExternalDocumentation()
.description("视频教程:以小白视角的SnailJob入门级视频教程")
.url("https://www.bilibili.com/video/BV1pvtBerEmV/?vd_source=ec323e2347232ea82321f54aba036b63"))
;
}

@Bean
public GroupedOpenApi adminApi() {
return GroupedOpenApi.builder()
//分组名
.group("user")
.pathsToMatch("/**")
//扫描路径,将路径下有swagger注解的接口解析到文档中
.packagesToScan("com.example.controller")
.build();
}
}






Loading

0 comments on commit b696d31

Please sign in to comment.