gtsoft-snail-job-demo/src/main/java/com/example/snailjob/controller/ManualRetryExecutorController.java

34 lines
1.6 KiB
Java
Raw Normal View History

2024-04-16 15:03:52 +08:00
package com.example.snailjob.controller;
2023-09-02 17:24:47 +08:00
2023-09-03 23:49:11 +08:00
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
2023-09-02 17:24:47 +08:00
import org.springframework.beans.factory.annotation.Autowired;
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;
2024-04-16 15:03:52 +08:00
import com.example.snailjob.service.ManualRetryExecutorMethodService;
2023-09-02 17:24:47 +08:00
@RestController
@RequestMapping("/manual")
2023-09-03 23:49:11 +08:00
@Tag(name = "模拟手动执行重试案例", description = "手动执行重试上报")
2023-09-02 17:24:47 +08:00
public class ManualRetryExecutorController {
@Autowired
2023-09-03 23:49:11 +08:00
private ManualRetryExecutorMethodService manualRetryExecutorMethodService;
@Operation(
summary = "手动重试",
description = "❤️如果不知道这个手动重试的使用场景可以参考: https://www.easyretry.com/pages/406a68/#%E5%8F%91%E9%80%81mq%E5%9C%BA%E6%99%AF \n"
+ "📢查看任务列表: http://preview.easyretry.com/#/retry-task/list"
2023-09-02 17:24:47 +08:00
)
@GetMapping("/retry")
public void remoteRetryWithCallback(@Parameter(name = "params", description = "测试参数", schema = @Schema(type = "string", description = "测试参数", defaultValue = "test"))
2023-09-03 23:49:11 +08:00
@RequestParam("params") String params) {
manualRetryExecutorMethodService.myExecutorMethod(params);
2023-09-02 17:24:47 +08:00
}
}