From 7696c934b12ce6f5b0a69eb5a44d7c86398ccfb5 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sun, 7 Sep 2025 14:43:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(pc):=20=E9=87=8D=E6=9E=84=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=B7=A5=E4=BD=9C=E5=99=A8=E7=AE=A1=E7=90=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=B9=B6=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD-=20=E9=87=8D=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E4=BA=86=E6=B8=B2=E6=9F=93=E5=B7=A5=E4=BD=9C=E5=99=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3=EF=BC=8C=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E4=BA=86=E6=93=8D=E4=BD=9C=E6=B5=81=E7=A8=8B-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E6=B8=B2=E6=9F=93=E5=B7=A5=E4=BD=9C=E5=99=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=8C=85=E6=8B=AC=E5=88=9B=E5=BB=BA=E3=80=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=80=81=E5=88=A0=E9=99=A4=E7=AD=89=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=20-=20=E4=BC=98=E5=8C=96=E4=BA=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=8C=E6=8F=90=E9=AB=98=E4=BA=86=E5=8F=AF?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=80=A7=E5=92=8C=E5=8F=AF=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pc/RenderWorkerConfigV2Controller.java | 196 +++++++++++ .../pc/RenderWorkerV2Controller.java | 320 +++++------------- .../repository/RenderWorkerRepository.java | 4 +- 3 files changed, 277 insertions(+), 243 deletions(-) create mode 100644 src/main/java/com/ycwl/basic/controller/pc/RenderWorkerConfigV2Controller.java diff --git a/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerConfigV2Controller.java b/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerConfigV2Controller.java new file mode 100644 index 0000000..334eda1 --- /dev/null +++ b/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerConfigV2Controller.java @@ -0,0 +1,196 @@ +package com.ycwl.basic.controller.pc; + +import com.ycwl.basic.integration.render.dto.config.BatchRenderWorkerConfigRequest; +import com.ycwl.basic.integration.render.dto.config.RenderWorkerConfigV2DTO; +import com.ycwl.basic.integration.render.service.RenderWorkerConfigIntegrationService; +import com.ycwl.basic.utils.ApiResponse; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 渲染工作器配置管理 V2 版本控制器 + * 基于 zt-render-worker 微服务标准接口实现 + * + * @author Claude Code + * @date 2025-09-06 + */ +@Slf4j +@RestController +@RequestMapping("/api/render/worker/config/v2") +@RequiredArgsConstructor +public class RenderWorkerConfigV2Controller { + + private final RenderWorkerConfigIntegrationService configIntegrationService; + + /** + * 获取工作器所有配置 + * + * @param workerId 工作器ID + * @return 工作器配置列表 + */ + @GetMapping("/{workerId}") + public ApiResponse> getWorkerConfigs(@PathVariable Long workerId) { + log.info("获取渲染工作器配置列表, workerId: {}", workerId); + + try { + List configs = configIntegrationService.getWorkerConfigs(workerId); + return ApiResponse.success(configs); + } catch (Exception e) { + log.error("获取渲染工作器配置列表失败, workerId: {}", workerId, e); + return ApiResponse.fail("获取渲染工作器配置列表失败: " + e.getMessage()); + } + } + + /** + * 获取工作器平铺配置 + * + * @param workerId 工作器ID + * @return 平铺配置Map + */ + @GetMapping("/{workerId}/flat") + public ApiResponse> getWorkerFlatConfig(@PathVariable Long workerId) { + log.info("获取渲染工作器平铺配置, workerId: {}", workerId); + + try { + Map flatConfig = configIntegrationService.getWorkerFlatConfig(workerId); + return ApiResponse.success(flatConfig); + } catch (Exception e) { + log.error("获取渲染工作器平铺配置失败, workerId: {}", workerId, e); + return ApiResponse.fail("获取渲染工作器平铺配置失败: " + e.getMessage()); + } + } + + /** + * 根据配置键获取特定配置 + * + * @param workerId 工作器ID + * @param configKey 配置键 + * @return 配置信息 + */ + @GetMapping("/{workerId}/key/{configKey}") + public ApiResponse getWorkerConfigByKey(@PathVariable Long workerId, + @PathVariable String configKey) { + log.info("根据配置键获取渲染工作器配置, workerId: {}, configKey: {}", workerId, configKey); + + try { + RenderWorkerConfigV2DTO config = configIntegrationService.getWorkerConfigByKey(workerId, configKey); + return ApiResponse.success(config); + } catch (Exception e) { + log.error("根据配置键获取渲染工作器配置失败, workerId: {}, configKey: {}", workerId, configKey, e); + return ApiResponse.fail("根据配置键获取渲染工作器配置失败: " + e.getMessage()); + } + } + + /** + * 创建工作器配置 + * + * @param workerId 工作器ID + * @param config 配置信息 + * @return 创建的配置信息 + */ + @PostMapping("/{workerId}") + public ApiResponse createWorkerConfig(@PathVariable Long workerId, + @Valid @RequestBody RenderWorkerConfigV2DTO config) { + log.info("创建渲染工作器配置, workerId: {}, configKey: {}", workerId, config.getConfigKey()); + + try { + RenderWorkerConfigV2DTO result = configIntegrationService.createWorkerConfig(workerId, config); + return ApiResponse.success(result); + } catch (Exception e) { + log.error("创建渲染工作器配置失败, workerId: {}", workerId, e); + return ApiResponse.fail("创建渲染工作器配置失败: " + e.getMessage()); + } + } + + /** + * 更新工作器配置 + * + * @param workerId 工作器ID + * @param configId 配置ID + * @param updates 更新内容 + * @return 操作结果 + */ + @PutMapping("/{workerId}/{configId}") + public ApiResponse updateWorkerConfig(@PathVariable Long workerId, + @PathVariable Long configId, + @Valid @RequestBody Map updates) { + log.info("更新渲染工作器配置, workerId: {}, configId: {}", workerId, configId); + + try { + configIntegrationService.updateWorkerConfig(workerId, configId, updates); + return ApiResponse.success(null); + } catch (Exception e) { + log.error("更新渲染工作器配置失败, workerId: {}, configId: {}", workerId, configId, e); + return ApiResponse.fail("更新渲染工作器配置失败: " + e.getMessage()); + } + } + + /** + * 删除工作器配置 + * + * @param workerId 工作器ID + * @param configId 配置ID + * @return 操作结果 + */ + @DeleteMapping("/{workerId}/{configId}") + public ApiResponse deleteWorkerConfig(@PathVariable Long workerId, + @PathVariable Long configId) { + log.info("删除渲染工作器配置, workerId: {}, configId: {}", workerId, configId); + + try { + configIntegrationService.deleteWorkerConfig(workerId, configId); + return ApiResponse.success(null); + } catch (Exception e) { + log.error("删除渲染工作器配置失败, workerId: {}, configId: {}", workerId, configId, e); + return ApiResponse.fail("删除渲染工作器配置失败: " + e.getMessage()); + } + } + + /** + * 批量更新工作器配置 + * + * @param workerId 工作器ID + * @param request 批量配置请求 + * @return 操作结果 + */ + @PostMapping("/{workerId}/batch") + public ApiResponse batchUpdateWorkerConfigs(@PathVariable Long workerId, + @Valid @RequestBody BatchRenderWorkerConfigRequest request) { + log.info("批量更新渲染工作器配置, workerId: {}, configCount: {}", + workerId, request.getConfigs() != null ? request.getConfigs().size() : 0); + + try { + configIntegrationService.batchUpdateWorkerConfigs(workerId, request); + return ApiResponse.success(null); + } catch (Exception e) { + log.error("批量更新渲染工作器配置失败, workerId: {}", workerId, e); + return ApiResponse.fail("批量更新渲染工作器配置失败: " + e.getMessage()); + } + } + + /** + * 批量平铺更新工作器配置 + * + * @param workerId 工作器ID + * @param flatConfigs 平铺配置Map + * @return 操作结果 + */ + @PostMapping("/{workerId}/flat-batch") + public ApiResponse batchFlatUpdateWorkerConfigs(@PathVariable Long workerId, + @Valid @RequestBody Map flatConfigs) { + log.info("批量平铺更新渲染工作器配置, workerId: {}, configCount: {}", workerId, flatConfigs.size()); + + try { + configIntegrationService.batchFlatUpdateWorkerConfigs(workerId, flatConfigs); + return ApiResponse.success(null); + } catch (Exception e) { + log.error("批量平铺更新渲染工作器配置失败, workerId: {}", workerId, e); + return ApiResponse.fail("批量平铺更新渲染工作器配置失败: " + e.getMessage()); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerV2Controller.java b/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerV2Controller.java index 808b0b4..910478b 100644 --- a/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerV2Controller.java +++ b/src/main/java/com/ycwl/basic/controller/pc/RenderWorkerV2Controller.java @@ -1,49 +1,49 @@ package com.ycwl.basic.controller.pc; -import com.github.pagehelper.PageInfo; -import com.ycwl.basic.model.pc.renderWorker.entity.RenderWorkerEntity; -import com.ycwl.basic.model.pc.renderWorker.req.RenderWorkerReqQuery; -import com.ycwl.basic.model.pc.renderWorker.resp.RenderWorkerRespVO; -import com.ycwl.basic.service.pc.RenderWorkerService; +import com.ycwl.basic.integration.common.response.PageResponse; +import com.ycwl.basic.integration.render.dto.worker.CreateRenderWorkerRequest; +import com.ycwl.basic.integration.render.dto.worker.RenderWorkerV2DTO; +import com.ycwl.basic.integration.render.dto.worker.UpdateRenderWorkerRequest; +import com.ycwl.basic.integration.render.service.RenderWorkerIntegrationService; import com.ycwl.basic.utils.ApiResponse; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; -import java.util.List; -import java.util.Map; - /** - * 渲染机管理 V2 版本控制器 + * 渲染工作器管理 V2 版本控制器 + * 基于 zt-render-worker 微服务标准接口实现 * * @author Claude Code - * @date 2025-09-05 + * @date 2025-09-06 */ @Slf4j @RestController -@RequestMapping("/api/renderWorker/v2") +@RequestMapping("/api/render/worker/v2") @RequiredArgsConstructor public class RenderWorkerV2Controller { - private final RenderWorkerService renderWorkerService; - - // ========== 渲染机基础 CRUD 操作 ========== + private final RenderWorkerIntegrationService renderWorkerIntegrationService; /** - * 渲染机分页列表查询 + * 分页查询渲染工作器列表 + * + * @param page 页码,从1开始 + * @param pageSize 每页大小,默认10,最大100 + * @param isEnabled 是否启用(0-禁用,1-启用) + * @param name 工作器名称(模糊搜索) + * @return 分页查询结果 */ - @GetMapping("/") - public ApiResponse> listRenderWorkers(@RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer pageSize, - @RequestParam(required = false) String name, - @RequestParam(required = false) String platform, - @RequestParam(required = false) Long scenicOnly, - @RequestParam(required = false) Integer testOnly, - @RequestParam(required = false) Integer online, - @RequestParam(required = false) Integer status) { - log.info("分页查询渲染机列表, page: {}, pageSize: {}, name: {}, platform: {}, scenicOnly: {}, testOnly: {}, online: {}, status: {}", - page, pageSize, name, platform, scenicOnly, testOnly, online, status); + @GetMapping + public ApiResponse> listWorkers( + @RequestParam(defaultValue = "1") Integer page, + @RequestParam(defaultValue = "10") Integer pageSize, + @RequestParam(required = false) Integer isEnabled, + @RequestParam(required = false) String name) { + + log.info("分页查询渲染工作器列表, page: {}, pageSize: {}, isEnabled: {}, name: {}", + page, pageSize, isEnabled, name); // 参数验证:限制pageSize最大值为100 if (pageSize > 100) { @@ -51,252 +51,92 @@ public class RenderWorkerV2Controller { } try { - RenderWorkerReqQuery queryReq = new RenderWorkerReqQuery(); - queryReq.setPageNum(page); - queryReq.setPageSize(pageSize); - queryReq.setName(name); - queryReq.setPlatform(platform); - queryReq.setScenicOnly(scenicOnly); - queryReq.setTestOnly(testOnly); - queryReq.setOnline(online); - queryReq.setStatus(status); - - return renderWorkerService.pageQuery(queryReq); + PageResponse result = renderWorkerIntegrationService.listWorkers( + page, pageSize, isEnabled, name); + return ApiResponse.success(result); } catch (Exception e) { - log.error("分页查询渲染机列表失败", e); - return ApiResponse.fail("分页查询渲染机列表失败: " + e.getMessage()); + log.error("分页查询渲染工作器列表失败", e); + return ApiResponse.fail("分页查询渲染工作器列表失败: " + e.getMessage()); } } /** - * 根据ID获取渲染机详情 + * 根据ID获取渲染工作器详情 + * + * @param id 工作器ID + * @return 工作器详情 */ @GetMapping("/{id}") - public ApiResponse getRenderWorker(@PathVariable Long id) { + public ApiResponse getWorker(@PathVariable Long id) { + log.info("获取渲染工作器详情, id: {}", id); + try { - return renderWorkerService.detail(id); + RenderWorkerV2DTO worker = renderWorkerIntegrationService.getWorker(id); + return ApiResponse.success(worker); } catch (Exception e) { - log.error("获取渲染机详情失败, id: {}", id, e); - return ApiResponse.fail("获取渲染机详情失败: " + e.getMessage()); + log.error("获取渲染工作器详情失败, id: {}", id, e); + return ApiResponse.fail("获取渲染工作器详情失败: " + e.getMessage()); } } /** - * 创建渲染机 + * 创建渲染工作器 + * + * @param request 创建请求 + * @return 创建的工作器信息 */ - @PostMapping("/") - public ApiResponse createRenderWorker(@Valid @RequestBody RenderWorkerEntity renderWorker) { - log.info("创建渲染机, name: {}, accessKey: {}, scenicOnly: {}, testOnly: {}", - renderWorker.getName(), renderWorker.getAccessKey(), renderWorker.getScenicOnly(), renderWorker.getTestOnly()); + @PostMapping + public ApiResponse createWorker(@Valid @RequestBody CreateRenderWorkerRequest request) { + log.info("创建渲染工作器, name: {}, key: {}, isActive: {}", + request.getName(), request.getKey(), request.getIsActive()); + try { - return renderWorkerService.add(renderWorker); + RenderWorkerV2DTO worker = renderWorkerIntegrationService.createWorker(request); + return ApiResponse.success(worker); } catch (Exception e) { - log.error("创建渲染机失败", e); - return ApiResponse.fail("创建渲染机失败: " + e.getMessage()); + log.error("创建渲染工作器失败", e); + return ApiResponse.fail("创建渲染工作器失败: " + e.getMessage()); } } /** - * 更新渲染机信息 + * 更新渲染工作器 + * + * @param id 工作器ID + * @param request 更新请求 + * @return 操作结果 */ @PutMapping("/{id}") - public ApiResponse updateRenderWorker(@PathVariable Long id, @Valid @RequestBody RenderWorkerEntity renderWorker) { - log.info("更新渲染机信息, id: {}", id); + public ApiResponse updateWorker(@PathVariable Long id, + @Valid @RequestBody UpdateRenderWorkerRequest request) { + log.info("更新渲染工作器, id: {}, name: {}, isActive: {}", + id, request.getName(), request.getIsActive()); + try { - renderWorker.setId(id); - return renderWorkerService.update(renderWorker); + renderWorkerIntegrationService.updateWorker(id, request); + return ApiResponse.success(null); } catch (Exception e) { - log.error("更新渲染机信息失败, id: {}", id, e); - return ApiResponse.fail("更新渲染机信息失败: " + e.getMessage()); + log.error("更新渲染工作器失败, id: {}", id, e); + return ApiResponse.fail("更新渲染工作器失败: " + e.getMessage()); } } /** - * 删除渲染机 + * 删除渲染工作器 + * + * @param id 工作器ID + * @return 操作结果 */ @DeleteMapping("/{id}") - public ApiResponse deleteRenderWorker(@PathVariable Long id) { - log.info("删除渲染机, id: {}", id); + public ApiResponse deleteWorker(@PathVariable Long id) { + log.info("删除渲染工作器, id: {}", id); + try { - return renderWorkerService.deleteById(id); + renderWorkerIntegrationService.deleteWorker(id); + return ApiResponse.success(null); } catch (Exception e) { - log.error("删除渲染机失败, id: {}", id, e); - return ApiResponse.fail("删除渲染机失败: " + e.getMessage()); - } - } - - // ========== 状态管理操作 ========== - - /** - * 启用渲染机 - */ - @PutMapping("/{id}/enable") - public ApiResponse enableRenderWorker(@PathVariable Long id) { - log.info("启用渲染机, id: {}", id); - try { - // 获取渲染机信息 - ApiResponse detailResponse = renderWorkerService.detail(id); - if (!detailResponse.isSuccess()) { - return ApiResponse.fail("渲染机不存在"); - } - - // 更新状态 - RenderWorkerEntity entity = new RenderWorkerEntity(); - entity.setId(id); - entity.setStatus(1); // 1表示启用 - - ApiResponse updateResponse = renderWorkerService.update(entity); - if (updateResponse.isSuccess()) { - return ApiResponse.success("渲染机启用成功"); - } else { - return ApiResponse.fail("渲染机启用失败"); - } - } catch (Exception e) { - log.error("启用渲染机失败, id: {}", id, e); - return ApiResponse.fail("启用渲染机失败: " + e.getMessage()); - } - } - - /** - * 禁用渲染机 - */ - @PutMapping("/{id}/disable") - public ApiResponse disableRenderWorker(@PathVariable Long id) { - log.info("禁用渲染机, id: {}", id); - try { - // 获取渲染机信息 - ApiResponse detailResponse = renderWorkerService.detail(id); - if (!detailResponse.isSuccess()) { - return ApiResponse.fail("渲染机不存在"); - } - - // 更新状态 - RenderWorkerEntity entity = new RenderWorkerEntity(); - entity.setId(id); - entity.setStatus(0); // 0表示禁用 - - ApiResponse updateResponse = renderWorkerService.update(entity); - if (updateResponse.isSuccess()) { - return ApiResponse.success("渲染机禁用成功"); - } else { - return ApiResponse.fail("渲染机禁用失败"); - } - } catch (Exception e) { - log.error("禁用渲染机失败, id: {}", id, e); - return ApiResponse.fail("禁用渲染机失败: " + e.getMessage()); - } - } - - // ========== 配置管理操作 ========== - // 注意:以下配置管理方法需要根据实际的RenderWorker配置服务进行调整 - // 目前暂时保留接口结构,等待配置相关服务的具体实现 - - /** - * 获取渲染机配置列表 - */ - @GetMapping("/{id}/config") - public ApiResponse>> getRenderWorkerConfigs(@PathVariable Long id) { - log.info("获取渲染机配置列表, renderWorkerId: {}", id); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("获取渲染机配置列表失败, renderWorkerId: {}", id, e); - return ApiResponse.fail("获取渲染机配置列表失败: " + e.getMessage()); - } - } - - /** - * 获取渲染机扁平化配置 - */ - @GetMapping("/{id}/flat-config") - public ApiResponse> getRenderWorkerFlatConfig(@PathVariable Long id) { - log.info("获取渲染机扁平化配置, renderWorkerId: {}", id); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("获取渲染机扁平化配置失败, renderWorkerId: {}", id, e); - return ApiResponse.fail("获取渲染机扁平化配置失败: " + e.getMessage()); - } - } - - /** - * 根据配置键获取配置 - */ - @GetMapping("/{id}/config/{configKey}") - public ApiResponse> getRenderWorkerConfigByKey(@PathVariable Long id, - @PathVariable String configKey) { - log.info("根据键获取渲染机配置, renderWorkerId: {}, configKey: {}", id, configKey); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("根据键获取渲染机配置失败, renderWorkerId: {}, configKey: {}", id, configKey, e); - return ApiResponse.fail("根据键获取渲染机配置失败: " + e.getMessage()); - } - } - - /** - * 创建渲染机配置 - */ - @PostMapping("/{id}/config") - public ApiResponse> createRenderWorkerConfig(@PathVariable Long id, - @Valid @RequestBody Map request) { - log.info("创建渲染机配置, renderWorkerId: {}", id); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("创建渲染机配置失败, renderWorkerId: {}", id, e); - return ApiResponse.fail("创建渲染机配置失败: " + e.getMessage()); - } - } - - /** - * 批量创建/更新渲染机配置 - */ - @PostMapping("/{id}/config/batch") - public ApiResponse> batchUpdateRenderWorkerConfig(@PathVariable Long id, - @Valid @RequestBody Map request) { - log.info("批量更新渲染机配置, renderWorkerId: {}", id); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("批量更新渲染机配置失败, renderWorkerId: {}", id, e); - return ApiResponse.fail("批量更新渲染机配置失败: " + e.getMessage()); - } - } - - /** - * 更新渲染机配置 - */ - @PutMapping("/{id}/config/{configId}") - public ApiResponse updateRenderWorkerConfig(@PathVariable Long id, @PathVariable Long configId, - @Valid @RequestBody Map request) { - log.info("更新渲染机配置, renderWorkerId: {}, configId: {}", id, configId); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("更新渲染机配置失败, renderWorkerId: {}, configId: {}", id, configId, e); - return ApiResponse.fail("更新渲染机配置失败: " + e.getMessage()); - } - } - - /** - * 删除渲染机配置 - */ - @DeleteMapping("/{id}/config/{configId}") - public ApiResponse deleteRenderWorkerConfig(@PathVariable Long id, @PathVariable Long configId) { - log.info("删除渲染机配置, renderWorkerId: {}, configId: {}", id, configId); - try { - // TODO: 需要实现RenderWorker配置服务 - return ApiResponse.fail("配置管理功能待实现"); - } catch (Exception e) { - log.error("删除渲染机配置失败, renderWorkerId: {}, configId: {}", id, configId, e); - return ApiResponse.fail("删除渲染机配置失败: " + e.getMessage()); + log.error("删除渲染工作器失败, id: {}", id, e); + return ApiResponse.fail("删除渲染工作器失败: " + e.getMessage()); } } } \ No newline at end of file diff --git a/src/main/java/com/ycwl/basic/repository/RenderWorkerRepository.java b/src/main/java/com/ycwl/basic/repository/RenderWorkerRepository.java index 5f6661c..d5ffe88 100644 --- a/src/main/java/com/ycwl/basic/repository/RenderWorkerRepository.java +++ b/src/main/java/com/ycwl/basic/repository/RenderWorkerRepository.java @@ -13,8 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; -import java.math.BigDecimal; -import java.math.RoundingMode; import java.util.Date; import java.util.List; import java.util.concurrent.TimeUnit; @@ -25,7 +23,7 @@ public class RenderWorkerRepository { @Autowired private RedisTemplate redisTemplate; public static final String RENDER_WORKER_STATUS_CACHE_KEY = "render_worker:host_status:%s"; - + @Autowired private RenderWorkerIntegrationService renderWorkerIntegrationService;