package com.ycwl.basic.integration.render.client;

import com.ycwl.basic.integration.common.response.CommonResponse;
import com.ycwl.basic.integration.common.response.PageResponse;
import com.ycwl.basic.integration.render.dto.worker.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 渲染工作器V2客户端
 */
@FeignClient(name = "zt-render-worker", contextId = "render-worker-v2", path = "/api/render/worker/v2")
public interface RenderWorkerV2Client {
    
    /**
     * 获取工作器核心信息
     */
    @GetMapping("/{id}")
    CommonResponse<RenderWorkerV2DTO> getWorker(@PathVariable("id") Long id);

    /**
     * 创建工作器
     */
    @PostMapping
    CommonResponse<RenderWorkerV2DTO> createWorker(@RequestBody CreateRenderWorkerRequest request);
    
    /**
     * 更新工作器
     */
    @PutMapping("/{id}")
    CommonResponse<Void> updateWorker(@PathVariable("id") Long id, 
                                      @RequestBody UpdateRenderWorkerRequest request);
    
    /**
     * 删除工作器
     */
    @DeleteMapping("/{id}")
    CommonResponse<Void> deleteWorker(@PathVariable("id") Long id);
    
    /**
     * 分页查询工作器列表（核心信息）
     */
    @GetMapping
    CommonResponse<PageResponse<RenderWorkerV2DTO>> listWorkers(@RequestParam(defaultValue = "1") Integer page,
                                                         @RequestParam(defaultValue = "10") Integer pageSize,
                                                         @RequestParam(required = false) Integer isEnabled,
                                                         @RequestParam(required = false) String name);

    /**
     * 根据key获取工作器核心信息
     */
    @GetMapping("/key/{key}")
    CommonResponse<RenderWorkerV2DTO> getWorkerByKey(@PathVariable("key") String key);
}