diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/biz/client/ExecutorBizClient.java b/xxl-job-core/src/main/java/com/xxl/job/core/biz/client/ExecutorBizClient.java index 9f594309..94ea480a 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/biz/client/ExecutorBizClient.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/biz/client/ExecutorBizClient.java @@ -30,27 +30,27 @@ public ExecutorBizClient(String addressUrl, String accessToken) { @Override public ReturnT beat() { - return XxlJobRemotingUtil.postBody(addressUrl+"beat", accessToken, timeout, "", String.class); + return XxlJobRemotingUtil.postBody(addressUrl+"xxl-job/beat", accessToken, timeout, "", String.class); } @Override public ReturnT idleBeat(IdleBeatParam idleBeatParam){ - return XxlJobRemotingUtil.postBody(addressUrl+"idleBeat", accessToken, timeout, idleBeatParam, String.class); + return XxlJobRemotingUtil.postBody(addressUrl+"xxl-job/idleBeat", accessToken, timeout, idleBeatParam, String.class); } @Override public ReturnT run(TriggerParam triggerParam) { - return XxlJobRemotingUtil.postBody(addressUrl + "run", accessToken, timeout, triggerParam, String.class); + return XxlJobRemotingUtil.postBody(addressUrl + "xxl-job/run", accessToken, timeout, triggerParam, String.class); } @Override public ReturnT kill(KillParam killParam) { - return XxlJobRemotingUtil.postBody(addressUrl + "kill", accessToken, timeout, killParam, String.class); + return XxlJobRemotingUtil.postBody(addressUrl + "xxl-job/kill", accessToken, timeout, killParam, String.class); } @Override public ReturnT log(LogParam logParam) { - return XxlJobRemotingUtil.postBody(addressUrl + "log", accessToken, timeout, logParam, LogResult.class); + return XxlJobRemotingUtil.postBody(addressUrl + "xxl-job/log", accessToken, timeout, logParam, LogResult.class); } } diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/controller/XxlJobController.java b/xxl-job-core/src/main/java/com/xxl/job/core/controller/XxlJobController.java index 62ad25b5..08fec29b 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/controller/XxlJobController.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/controller/XxlJobController.java @@ -1,9 +1,14 @@ package com.xxl.job.core.controller; +import com.google.gson.Gson; import com.xxl.job.core.biz.impl.ExecutorBizImpl; import com.xxl.job.core.biz.model.*; +import groovy.util.logging.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** @@ -11,25 +16,32 @@ * @date 2021/5/7 */ @RestController +@RequestMapping("/xxl-job") public class XxlJobController { + private static final Logger log = LoggerFactory.getLogger(XxlJobController.class); + @PostMapping("/beat") public ReturnT beat() { + log.debug("接收到beat请求"); return new ExecutorBizImpl().beat(); } @PostMapping("/idleBeat") public ReturnT idleBeat(@RequestBody IdleBeatParam param) { + log.debug("接收到idleBeat请求,{}",new Gson().toJson(param)); return new ExecutorBizImpl().idleBeat(param); } @PostMapping("/run") public ReturnT run(@RequestBody TriggerParam param) { + log.debug("接收到run请求,{}",new Gson().toJson(param)); return new ExecutorBizImpl().run(param); } @PostMapping("/kill") public ReturnT kill(@RequestBody KillParam param) { + log.debug("接收到kill请求,{}",new Gson().toJson(param)); return new ExecutorBizImpl().kill(param); }