diff --git a/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java b/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java index 4ac994bd..337cb799 100644 --- a/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java +++ b/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ItemController.java @@ -9,7 +9,7 @@ import com.github.dynamic.threadpool.config.model.biz.item.ItemRespDTO; import com.github.dynamic.threadpool.config.model.biz.item.ItemSaveReqDTO; import com.github.dynamic.threadpool.config.model.biz.item.ItemUpdateReqDTO; import com.github.dynamic.threadpool.config.service.biz.ItemService; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; /** @@ -19,11 +19,11 @@ import org.springframework.web.bind.annotation.*; * @date 2021/6/29 21:42 */ @RestController +@AllArgsConstructor @RequestMapping(Constants.BASE_PATH + "/item") public class ItemController { - @Autowired - private ItemService itemService; + private final ItemService itemService; @PostMapping("/query/page") public Result> queryItemPage(@RequestBody ItemQueryReqDTO reqDTO) { @@ -52,4 +52,5 @@ public class ItemController { itemService.deleteItem(tenantId, itemId); return Results.success(); } + } diff --git a/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java b/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java index 7d174ab1..122e7509 100644 --- a/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java +++ b/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/TenantController.java @@ -9,21 +9,21 @@ import com.github.dynamic.threadpool.config.model.biz.tenant.TenantRespDTO; import com.github.dynamic.threadpool.config.model.biz.tenant.TenantSaveReqDTO; import com.github.dynamic.threadpool.config.model.biz.tenant.TenantUpdateReqDTO; import com.github.dynamic.threadpool.config.service.biz.TenantService; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.AllArgsConstructor; import org.springframework.web.bind.annotation.*; /** - * Tenant Controller. + * Tenant controller. * * @author chen.ma * @date 2021/6/25 18:31 */ @RestController +@AllArgsConstructor @RequestMapping(Constants.BASE_PATH + "/tenant") public class TenantController { - @Autowired - private TenantService tenantService; + private final TenantService tenantService; @PostMapping("/query/page") public Result> queryNameSpacePage(@RequestBody TenantQueryReqDTO reqDTO) { @@ -52,4 +52,5 @@ public class TenantController { tenantService.deleteTenantById(tenantId); return Results.success(); } + } diff --git a/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java b/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java index c7d9a55d..004d6209 100644 --- a/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java +++ b/dynamic-threadpool-console/src/main/java/com/github/dynamic/threadpool/console/controller/ThreadPoolController.java @@ -8,21 +8,24 @@ import com.github.dynamic.threadpool.config.model.biz.threadpool.ThreadPoolQuery 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.service.biz.ThreadPoolService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import lombok.AllArgsConstructor; +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; /** - * Thread Pool Controller. + * Thread pool controller. * * @author chen.ma * @date 2021/6/30 20:54 */ @RestController +@AllArgsConstructor @RequestMapping(Constants.BASE_PATH + "/thread") public class ThreadPoolController { - @Autowired - private ThreadPoolService threadPoolService; + private final ThreadPoolService threadPoolService; @PostMapping("/pool/query/page") public Result> queryNameSpacePage(@RequestBody ThreadPoolQueryReqDTO reqDTO) {