Skip to content

Commit

Permalink
refactor: 代码去easy-retry化
Browse files Browse the repository at this point in the history
  • Loading branch information
dhb52 committed Apr 16, 2024
1 parent 44f6bf8 commit bbf8924
Show file tree
Hide file tree
Showing 64 changed files with 339 additions and 345 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ HELP.md
.vscode/

.flattened-pom.xml

/data/
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
</dependencies>

<build>
<finalName>easy-retry-example</finalName>
<finalName>snail-job-example</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down
55 changes: 0 additions & 55 deletions src/main/java/com/example/easy/retry/config/SwaggerConfig.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package com.example.easy.retry;
package com.example.snailjob;

import com.aizuda.easy.retry.client.starter.EnableEasyRetry;
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
@EnableEasyRetry(group = "easy_retry_demo_group")
@MapperScan("com.example.easy.retry.dao")
public class EasyRetrySpringbootApplication {
@EnableSnailJob(group = "snail_job_demo_group")
@MapperScan("com.example.snailjob.dao")
public class SnailJobSpringbootApplication {

public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
SpringApplication.run(EasyRetrySpringbootApplication.class, args);
SpringApplication.run(SnailJobSpringbootApplication.class, args);
}

}
55 changes: 55 additions & 0 deletions src/main/java/com/example/snailjob/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.example.snailjob.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://www.easyretry.com/</h3>" +
"<h3>在线体验地址: http://preview.easyretry.com/</h3> " +
"<h3>源码地址: https://gitee.com/byteblogs168/easy-retry-demo</h3>" +
"<h3>特别提醒: 🌻在您使用测试案例之前请认真的阅读官网.</h3>")
.version(SnailJobVersion.getVersion())
.license(new License().name("Apache 2.0").url("https://www.easyretry.com/")))
.externalDocs(new ExternalDocumentation()
.description("视频教程:从0到1快速了解分布式重试组件EasyRetry")
.url("https://www.ixigua.com/pseries/7272009348824433213/"))
;
}

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






Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.easy.retry.controller;
package com.example.snailjob.controller;

import com.example.easy.retry.service.LocalRemoteService;
import com.example.snailjob.service.LocalRemoteService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.easy.retry.controller;
package com.example.snailjob.controller;

import com.example.easy.retry.vo.OrderVo;
import com.example.snailjob.vo.OrderVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
Expand All @@ -16,7 +16,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.example.easy.retry.service.LocalRetryService;
import com.example.snailjob.service.LocalRetryService;

@RestController
@RequestMapping("/local")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.easy.retry.controller;
package com.example.snailjob.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand All @@ -10,7 +10,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.example.easy.retry.service.ManualRetryExecutorMethodService;
import com.example.snailjob.service.ManualRetryExecutorMethodService;

@RestController
@RequestMapping("/manual")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.easy.retry.controller;
package com.example.snailjob.controller;

import java.util.Random;
import java.util.UUID;
Expand All @@ -16,8 +16,8 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.example.easy.retry.vo.OrderVo;
import com.example.easy.retry.service.RemoteRetryService;
import com.example.snailjob.vo.OrderVo;
import com.example.snailjob.service.RemoteRetryService;

@RestController
@RequestMapping("/remote")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.easy.retry.controller;
package com.example.snailjob.controller;

import com.aizuda.easy.retry.server.model.dto.CallbackParamsDTO;
import com.aizuda.snailjob.server.model.dto.CallbackParamsDTO;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.easy.retry.customized;
package com.example.snailjob.customized;

import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
import com.example.easy.retry.vo.OrderVo;
import com.aizuda.snailjob.client.core.IdempotentIdGenerate;
import com.aizuda.snailjob.common.core.model.IdempotentIdContext;
import com.example.snailjob.vo.OrderVo;

import cn.hutool.crypto.SecureUtil;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.example.easy.retry.customized;
package com.example.snailjob.customized;

import cn.hutool.json.JSONUtil;
import com.aizuda.easy.retry.client.core.callback.RetryCompleteCallback;
import com.aizuda.easy.retry.common.core.util.JsonUtil;
import com.aizuda.snailjob.client.core.callback.RetryCompleteCallback;
import com.aizuda.snailjob.common.core.util.JsonUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.example.easy.retry.dao.FailOrderBaseMapper;
import com.example.easy.retry.po.FailOrderPo;
import com.example.easy.retry.vo.OrderVo;
import com.example.snailjob.dao.FailOrderBaseMapper;
import com.example.snailjob.po.FailOrderPo;
import com.example.snailjob.vo.OrderVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.example.easy.retry.customized;
package com.example.snailjob.customized;

import org.apache.catalina.security.SecurityUtil;

import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
import com.example.easy.retry.vo.OrderVo;
import com.aizuda.snailjob.client.core.IdempotentIdGenerate;
import com.aizuda.snailjob.common.core.model.IdempotentIdContext;
import com.example.snailjob.vo.OrderVo;

import cn.hutool.crypto.SecureUtil;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.example.easy.retry.customized;

import java.lang.reflect.Array;
package com.example.snailjob.customized;

import org.springframework.stereotype.Component;

import com.aizuda.easy.retry.client.core.strategy.ExecutorMethod;
import com.example.easy.retry.vo.OrderVo;
import com.aizuda.snailjob.client.core.strategy.ExecutorMethod;
import com.example.snailjob.vo.OrderVo;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.example.easy.retry.customized;
package com.example.snailjob.customized;

import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
import com.example.easy.retry.vo.OrderVo;
import com.aizuda.snailjob.client.core.IdempotentIdGenerate;
import com.aizuda.snailjob.common.core.model.IdempotentIdContext;

import cn.hutool.crypto.SecureUtil;

Expand Down
Loading

0 comments on commit bbf8924

Please sign in to comment.