|
|
@ -2,17 +2,19 @@ package com.github.dynamic.threadpool.console.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.github.dynamic.threadpool.common.constant.Constants;
|
|
|
|
import com.github.dynamic.threadpool.common.constant.Constants;
|
|
|
|
|
|
|
|
import com.github.dynamic.threadpool.common.model.InstanceInfo;
|
|
|
|
import com.github.dynamic.threadpool.common.web.base.Result;
|
|
|
|
import com.github.dynamic.threadpool.common.web.base.Result;
|
|
|
|
import com.github.dynamic.threadpool.common.web.base.Results;
|
|
|
|
import com.github.dynamic.threadpool.common.web.base.Results;
|
|
|
|
import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolQueryReqDTO;
|
|
|
|
import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolQueryReqDTO;
|
|
|
|
import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolRespDTO;
|
|
|
|
import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolRespDTO;
|
|
|
|
import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO;
|
|
|
|
import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolSaveOrUpdateReqDTO;
|
|
|
|
import com.github.dynamic.threadpool.config.service.biz.ThreadPoolService;
|
|
|
|
import com.github.dynamic.threadpool.config.service.biz.ThreadPoolService;
|
|
|
|
|
|
|
|
import com.github.dynamic.threadpool.discovery.core.BaseInstanceRegistry;
|
|
|
|
|
|
|
|
import com.github.dynamic.threadpool.discovery.core.Lease;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import java.util.List;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Thread pool controller.
|
|
|
|
* Thread pool controller.
|
|
|
@ -27,6 +29,8 @@ public class ThreadPoolController {
|
|
|
|
|
|
|
|
|
|
|
|
private final ThreadPoolService threadPoolService;
|
|
|
|
private final ThreadPoolService threadPoolService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final BaseInstanceRegistry baseInstanceRegistry;
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/pool/query/page")
|
|
|
|
@PostMapping("/pool/query/page")
|
|
|
|
public Result<IPage<ThreadPoolRespDTO>> queryNameSpacePage(@RequestBody ThreadPoolQueryReqDTO reqDTO) {
|
|
|
|
public Result<IPage<ThreadPoolRespDTO>> queryNameSpacePage(@RequestBody ThreadPoolQueryReqDTO reqDTO) {
|
|
|
|
return Results.success(threadPoolService.queryThreadPoolPage(reqDTO));
|
|
|
|
return Results.success(threadPoolService.queryThreadPoolPage(reqDTO));
|
|
|
@ -43,4 +47,10 @@ public class ThreadPoolController {
|
|
|
|
return Results.success();
|
|
|
|
return Results.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/pool/list/instance/{itemId}")
|
|
|
|
|
|
|
|
public Result<List<Lease<InstanceInfo>>> listInstance(@PathVariable("itemId") String itemId) {
|
|
|
|
|
|
|
|
List<Lease<InstanceInfo>> leases = baseInstanceRegistry.listInstance(itemId);
|
|
|
|
|
|
|
|
return Results.success(leases);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|