修改获取动态线程池运行状态接口.

pull/28/head
chen.ma 3 years ago
parent 7e708d2f67
commit f3f2c9378d

@ -4,6 +4,7 @@ import cn.hippo4j.common.model.PoolRunStateInfo;
import cn.hippo4j.common.web.base.Result;
import cn.hippo4j.common.web.base.Results;
import cn.hippo4j.starter.handler.ThreadPoolRunStateHandler;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -17,11 +18,14 @@ import org.springframework.web.bind.annotation.RestController;
*/
@CrossOrigin
@RestController
@AllArgsConstructor
public class PoolRunStateController {
private final ThreadPoolRunStateHandler threadPoolRunStateHandler;
@GetMapping("/run/state/{tpId}")
public Result<PoolRunStateInfo> getPoolRunState(@PathVariable("tpId") String tpId) {
PoolRunStateInfo poolRunState = ThreadPoolRunStateHandler.getPoolRunState(tpId);
PoolRunStateInfo poolRunState = threadPoolRunStateHandler.getPoolRunState(tpId);
return Results.success(poolRunState);
}

Loading…
Cancel
Save