build: continew-starter 2.9.0 => 2.10.0

1.适配限流模块、链路追踪模块、访问日志等配置调整
2.适配Crud模块 API 命名变化(add => create、detail => get)
3.适配 sa-token、snail-job 升级变化
This commit is contained in:
2025-03-26 22:58:21 +08:00
parent 754ef0639b
commit cae6da298c
62 changed files with 469 additions and 433 deletions

View File

@@ -19,13 +19,13 @@ package top.continew.admin.schedule.api;
import com.aizuda.snailjob.common.core.model.Result;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.*;
import top.continew.admin.schedule.model.JobPageResult;
import top.continew.admin.schedule.model.req.JobReq;
import top.continew.admin.schedule.model.req.JobStatusReq;
import top.continew.admin.schedule.model.req.JobTriggerReq;
import top.continew.admin.schedule.model.resp.JobResp;
import java.util.List;
@@ -65,7 +65,7 @@ public interface JobApi {
* @return 响应信息
*/
@PostExchange("/job")
ResponseEntity<Result<Boolean>> add(@RequestBody JobReq req);
ResponseEntity<Result<Boolean>> create(@RequestBody JobReq req);
/**
* 修改
@@ -97,11 +97,11 @@ public interface JobApi {
/**
* 执行
*
* @param id ID
* @param req 参数
* @return 响应信息
*/
@PostExchange("/job/trigger/{id}")
ResponseEntity<Result<Boolean>> trigger(@PathVariable("id") Long id);
@PostExchange("/job/trigger")
ResponseEntity<Result<Boolean>> trigger(@RequestBody JobTriggerReq req);
/**
* 查询分组列表

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2022-present Charles7c Authors. 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 top.continew.admin.schedule.model.req;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 执行任务参数
*
* @author Charles7c
* @since 2025/3/26 21:50
*/
@Data
@Schema(description = "执行任务参数")
public class JobTriggerReq implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@Schema(description = "ID", example = "1")
@NotNull(message = "ID不能为空")
private Long jobId;
/**
* 方法参数
*/
@Schema(description = "方法参数")
private String tmpArgsStr;
}

View File

@@ -19,6 +19,7 @@ package top.continew.admin.schedule.service;
import top.continew.admin.schedule.model.query.JobQuery;
import top.continew.admin.schedule.model.req.JobReq;
import top.continew.admin.schedule.model.req.JobStatusReq;
import top.continew.admin.schedule.model.req.JobTriggerReq;
import top.continew.admin.schedule.model.resp.JobResp;
import top.continew.starter.extension.crud.model.resp.PageResp;
@@ -47,7 +48,7 @@ public interface JobService {
* @param req 创建信息
* @return 新增结果
*/
boolean add(JobReq req);
boolean create(JobReq req);
/**
* 修改
@@ -78,10 +79,10 @@ public interface JobService {
/**
* 执行
*
* @param id ID
* @param req 参数
* @return 执行结果
*/
boolean trigger(Long id);
boolean trigger(JobTriggerReq req);
/**
* 查询分组列表

View File

@@ -23,6 +23,7 @@ import top.continew.admin.schedule.api.JobClient;
import top.continew.admin.schedule.model.query.JobQuery;
import top.continew.admin.schedule.model.req.JobReq;
import top.continew.admin.schedule.model.req.JobStatusReq;
import top.continew.admin.schedule.model.req.JobTriggerReq;
import top.continew.admin.schedule.model.resp.JobResp;
import top.continew.admin.schedule.service.JobService;
import top.continew.starter.extension.crud.model.resp.PageResp;
@@ -51,8 +52,8 @@ public class JobServiceImpl implements JobService {
}
@Override
public boolean add(JobReq req) {
return Boolean.TRUE.equals(jobClient.request(() -> jobApi.add(req)));
public boolean create(JobReq req) {
return Boolean.TRUE.equals(jobClient.request(() -> jobApi.create(req)));
}
@Override
@@ -73,8 +74,8 @@ public class JobServiceImpl implements JobService {
}
@Override
public boolean trigger(Long id) {
return Boolean.TRUE.equals(jobClient.request(() -> jobApi.trigger(id)));
public boolean trigger(JobTriggerReq req) {
return Boolean.TRUE.equals(jobClient.request(() -> jobApi.trigger(req)));
}
@Override