You've already forked FrameTour-BE
refactor(device): 整合设备相关Feign客户端接口
- 将DefaultConfigClient、DeviceConfigV2Client、DeviceStatusClient的功能整合到DeviceV2Client - 更新DeviceConfigIntegrationService、DeviceDefaultConfigIntegrationService和DeviceStatusIntegrationService依赖为DeviceV2Client - 移除独立的设备配置与状态客户端接口文件 - 保留原有API路径结构并调整为统一前缀管理 refactor(render): 整合渲染工作器相关Feign客户端接口 - 将RenderWorkerConfigV2Client功能整合到RenderWorkerV2Client - 更新RenderWorkerConfigIntegrationService依赖为RenderWorkerV2Client - 移除独立的渲染工作器配置客户端接口文件 - 保留原有API路径结构并调整为统一前缀管理 refactor(scenic): 整合景区相关Feign客户端接口 - 将ScenicConfigV2Client和DefaultConfigClient的功能整合到ScenicV2Client - 更新ScenicConfigIntegrationService和ScenicDefaultConfigIntegrationService依赖为ScenicV2Client - 移除独立的景区配置与默认配置客户端接口文件 - 保留原有API路径结构并调整为统一前缀管理
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
package com.ycwl.basic.integration.device.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.response.PageResponse;
|
||||
import com.ycwl.basic.integration.device.dto.defaults.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 默认配置管理 Feign 客户端
|
||||
*/
|
||||
@FeignClient(name = "zt-device", contextId = "device-default-config", path = "/api/device/config/v2/defaults")
|
||||
public interface DefaultConfigClient {
|
||||
|
||||
/**
|
||||
* 获取默认配置列表
|
||||
*/
|
||||
@GetMapping
|
||||
CommonResponse<PageResponse<DefaultConfigResponse>> listDefaultConfigs(@RequestParam(value = "page", defaultValue = "1") int page,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize);
|
||||
|
||||
/**
|
||||
* 根据配置键获取默认配置
|
||||
*/
|
||||
@GetMapping("/{configKey}")
|
||||
CommonResponse<DefaultConfigResponse> getDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 创建默认配置
|
||||
*/
|
||||
@PostMapping
|
||||
CommonResponse<String> createDefaultConfig(@RequestBody DefaultConfigRequest request);
|
||||
|
||||
/**
|
||||
* 更新默认配置
|
||||
*/
|
||||
@PutMapping("/{configKey}")
|
||||
CommonResponse<Map<String, Object>> updateDefaultConfig(@PathVariable("configKey") String configKey,
|
||||
@RequestBody Map<String, Object> updates);
|
||||
|
||||
/**
|
||||
* 删除默认配置
|
||||
*/
|
||||
@DeleteMapping("/{configKey}")
|
||||
CommonResponse<String> deleteDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 批量更新默认配置
|
||||
*/
|
||||
@PostMapping("/batch")
|
||||
CommonResponse<BatchDefaultConfigResponse> batchUpdateDefaultConfigs(@RequestBody BatchDefaultConfigRequest request);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.ycwl.basic.integration.device.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.device.dto.config.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = "zt-device", contextId = "device-config-v2", path = "/api/device/config/v2")
|
||||
public interface DeviceConfigV2Client {
|
||||
|
||||
/**
|
||||
* 获取设备所有配置
|
||||
*/
|
||||
@GetMapping("/{deviceId}")
|
||||
CommonResponse<List<DeviceConfigV2DTO>> getDeviceConfigs(@PathVariable("deviceId") Long deviceId);
|
||||
|
||||
/**
|
||||
* 根据设备编号获取设备所有配置
|
||||
*/
|
||||
@GetMapping("/no/{no}")
|
||||
CommonResponse<List<DeviceConfigV2DTO>> getDeviceConfigsByNo(@PathVariable("no") String no);
|
||||
|
||||
/**
|
||||
* 获取设备特定配置
|
||||
*/
|
||||
@GetMapping("/{deviceId}/key/{configKey}")
|
||||
CommonResponse<DeviceConfigV2DTO> getDeviceConfigByKey(@PathVariable("deviceId") Long deviceId,
|
||||
@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 创建设备配置
|
||||
*/
|
||||
@PostMapping("/{deviceId}")
|
||||
CommonResponse<DeviceConfigV2DTO> createDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@RequestBody CreateDeviceConfigRequest request);
|
||||
|
||||
/**
|
||||
* 更新设备配置
|
||||
*/
|
||||
@PutMapping("/{deviceId}/{id}")
|
||||
CommonResponse<String> updateDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@PathVariable("id") Long id,
|
||||
@RequestBody UpdateDeviceConfigRequest request);
|
||||
|
||||
/**
|
||||
* 删除设备配置
|
||||
*/
|
||||
@DeleteMapping("/{deviceId}/{id}")
|
||||
CommonResponse<String> deleteDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量更新设备配置
|
||||
*/
|
||||
@PostMapping("/{deviceId}/batch")
|
||||
CommonResponse<BatchUpdateResponse> batchUpdateDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@RequestBody BatchDeviceConfigRequest request);
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.ycwl.basic.integration.device.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.device.dto.status.DeviceStatusDTO;
|
||||
import com.ycwl.basic.integration.device.dto.status.OnlineStatusResponseDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "zt-device", contextId = "deviceStatusClient", path = "/api/device/status")
|
||||
public interface DeviceStatusClient {
|
||||
|
||||
/**
|
||||
* 获取设备状态
|
||||
*/
|
||||
@GetMapping("/{deviceNo}")
|
||||
CommonResponse<DeviceStatusDTO> getDeviceStatus(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 检查设备是否在线
|
||||
*/
|
||||
@GetMapping("/{deviceNo}/online")
|
||||
CommonResponse<OnlineStatusResponseDTO> isDeviceOnline(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 获取所有在线设备
|
||||
*/
|
||||
@GetMapping("/online")
|
||||
CommonResponse<List<DeviceStatusDTO>> getAllOnlineDevices();
|
||||
|
||||
/**
|
||||
* 设置设备离线
|
||||
*/
|
||||
@PostMapping("/{deviceNo}/offline")
|
||||
CommonResponse<String> setDeviceOffline(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 设置设备在线
|
||||
*/
|
||||
@PostMapping("/{deviceNo}/online")
|
||||
CommonResponse<String> setDeviceOnline(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 清理过期设备状态
|
||||
*/
|
||||
@PostMapping("/clean")
|
||||
CommonResponse<String> cleanExpiredDevices();
|
||||
}
|
||||
@@ -2,48 +2,57 @@ package com.ycwl.basic.integration.device.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.response.PageResponse;
|
||||
import com.ycwl.basic.integration.device.dto.config.*;
|
||||
import com.ycwl.basic.integration.device.dto.defaults.*;
|
||||
import com.ycwl.basic.integration.device.dto.device.*;
|
||||
import com.ycwl.basic.integration.device.dto.status.DeviceStatusDTO;
|
||||
import com.ycwl.basic.integration.device.dto.status.OnlineStatusResponseDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@FeignClient(name = "zt-device", contextId = "device-v2", path = "/api/device/v2")
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = "zt-device", contextId = "device-v2", path = "/api/device")
|
||||
public interface DeviceV2Client {
|
||||
|
||||
// ==================== Device V2 Operations ====================
|
||||
|
||||
/**
|
||||
* 获取设备核心信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping("v2/{id}")
|
||||
CommonResponse<DeviceV2DTO> getDevice(@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 根据设备编号获取设备核心信息
|
||||
*/
|
||||
@GetMapping("/no/{no}")
|
||||
@GetMapping("v2/no/{no}")
|
||||
CommonResponse<DeviceV2DTO> getDeviceByNo(@PathVariable("no") String no);
|
||||
|
||||
/**
|
||||
* 创建设备
|
||||
*/
|
||||
@PostMapping("/")
|
||||
@PostMapping("v2/")
|
||||
CommonResponse<DeviceV2DTO> createDevice(@RequestBody CreateDeviceRequest request);
|
||||
|
||||
/**
|
||||
* 更新设备
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping("v2/{id}")
|
||||
CommonResponse<String> updateDevice(@PathVariable("id") Long id,
|
||||
@RequestBody UpdateDeviceRequest request);
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@DeleteMapping("v2/{id}")
|
||||
CommonResponse<String> deleteDevice(@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 分页获取设备列表(核心信息)
|
||||
*/
|
||||
@GetMapping("/")
|
||||
@GetMapping("v2/")
|
||||
CommonResponse<PageResponse<DeviceV2DTO>> listDevices(
|
||||
@RequestParam(value = "page", defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
@@ -56,7 +65,135 @@ public interface DeviceV2Client {
|
||||
/**
|
||||
* 根据配置条件筛选设备
|
||||
*/
|
||||
@PostMapping("/filter-by-configs")
|
||||
@PostMapping("v2/filter-by-configs")
|
||||
CommonResponse<FilterDevicesByConfigsResponse> filterDevicesByConfigs(
|
||||
@RequestBody FilterDevicesByConfigsRequest request);
|
||||
|
||||
// ==================== Device Config V2 Operations ====================
|
||||
|
||||
/**
|
||||
* 获取设备所有配置
|
||||
*/
|
||||
@GetMapping("config/v2/{deviceId}")
|
||||
CommonResponse<List<DeviceConfigV2DTO>> getDeviceConfigs(@PathVariable("deviceId") Long deviceId);
|
||||
|
||||
/**
|
||||
* 根据设备编号获取设备所有配置
|
||||
*/
|
||||
@GetMapping("config/v2/no/{no}")
|
||||
CommonResponse<List<DeviceConfigV2DTO>> getDeviceConfigsByNo(@PathVariable("no") String no);
|
||||
|
||||
/**
|
||||
* 获取设备特定配置
|
||||
*/
|
||||
@GetMapping("config/v2/{deviceId}/key/{configKey}")
|
||||
CommonResponse<DeviceConfigV2DTO> getDeviceConfigByKey(@PathVariable("deviceId") Long deviceId,
|
||||
@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 创建设备配置
|
||||
*/
|
||||
@PostMapping("config/v2/{deviceId}")
|
||||
CommonResponse<DeviceConfigV2DTO> createDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@RequestBody CreateDeviceConfigRequest request);
|
||||
|
||||
/**
|
||||
* 更新设备配置
|
||||
*/
|
||||
@PutMapping("config/v2/{deviceId}/{id}")
|
||||
CommonResponse<String> updateDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@PathVariable("id") Long id,
|
||||
@RequestBody UpdateDeviceConfigRequest request);
|
||||
|
||||
/**
|
||||
* 删除设备配置
|
||||
*/
|
||||
@DeleteMapping("config/v2/{deviceId}/{id}")
|
||||
CommonResponse<String> deleteDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量更新设备配置
|
||||
*/
|
||||
@PostMapping("config/v2/{deviceId}/batch")
|
||||
CommonResponse<BatchUpdateResponse> batchUpdateDeviceConfig(@PathVariable("deviceId") Long deviceId,
|
||||
@RequestBody BatchDeviceConfigRequest request);
|
||||
|
||||
// ==================== Default Config Operations ====================
|
||||
|
||||
/**
|
||||
* 获取默认配置列表
|
||||
*/
|
||||
@GetMapping("config/v2/defaults")
|
||||
CommonResponse<PageResponse<DefaultConfigResponse>> listDefaultConfigs(@RequestParam(value = "page", defaultValue = "1") int page,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize);
|
||||
|
||||
/**
|
||||
* 根据配置键获取默认配置
|
||||
*/
|
||||
@GetMapping("config/v2/defaults/{configKey}")
|
||||
CommonResponse<DefaultConfigResponse> getDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 创建默认配置
|
||||
*/
|
||||
@PostMapping("config/v2/defaults")
|
||||
CommonResponse<String> createDefaultConfig(@RequestBody DefaultConfigRequest request);
|
||||
|
||||
/**
|
||||
* 更新默认配置
|
||||
*/
|
||||
@PutMapping("config/v2/defaults/{configKey}")
|
||||
CommonResponse<Map<String, Object>> updateDefaultConfig(@PathVariable("configKey") String configKey,
|
||||
@RequestBody Map<String, Object> updates);
|
||||
|
||||
/**
|
||||
* 删除默认配置
|
||||
*/
|
||||
@DeleteMapping("config/v2/defaults/{configKey}")
|
||||
CommonResponse<String> deleteDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 批量更新默认配置
|
||||
*/
|
||||
@PostMapping("config/v2/defaults/batch")
|
||||
CommonResponse<BatchDefaultConfigResponse> batchUpdateDefaultConfigs(@RequestBody BatchDefaultConfigRequest request);
|
||||
|
||||
// ==================== Device Status Operations ====================
|
||||
|
||||
/**
|
||||
* 获取设备状态
|
||||
*/
|
||||
@GetMapping("status/{deviceNo}")
|
||||
CommonResponse<DeviceStatusDTO> getDeviceStatus(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 检查设备是否在线
|
||||
*/
|
||||
@GetMapping("status/{deviceNo}/online")
|
||||
CommonResponse<OnlineStatusResponseDTO> isDeviceOnline(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 获取所有在线设备
|
||||
*/
|
||||
@GetMapping("status/online")
|
||||
CommonResponse<List<DeviceStatusDTO>> getAllOnlineDevices();
|
||||
|
||||
/**
|
||||
* 设置设备离线
|
||||
*/
|
||||
@PostMapping("status/{deviceNo}/offline")
|
||||
CommonResponse<String> setDeviceOffline(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 设置设备在线
|
||||
*/
|
||||
@PostMapping("status/{deviceNo}/online")
|
||||
CommonResponse<String> setDeviceOnline(@PathVariable("deviceNo") String deviceNo);
|
||||
|
||||
/**
|
||||
* 清理过期设备状态
|
||||
*/
|
||||
@PostMapping("status/clean")
|
||||
CommonResponse<String> cleanExpiredDevices();
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.ycwl.basic.integration.device.service;
|
||||
import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.service.IntegrationFallbackService;
|
||||
import com.ycwl.basic.integration.device.client.DeviceConfigV2Client;
|
||||
import com.ycwl.basic.integration.device.client.DeviceV2Client;
|
||||
import com.ycwl.basic.integration.device.dto.config.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -18,7 +18,7 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceConfigIntegrationService {
|
||||
|
||||
private final DeviceConfigV2Client deviceConfigV2Client;
|
||||
private final DeviceV2Client deviceConfigV2Client;
|
||||
private final IntegrationFallbackService fallbackService;
|
||||
|
||||
private static final String SERVICE_NAME = "zt-device";
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.response.PageResponse;
|
||||
import com.ycwl.basic.integration.common.service.IntegrationFallbackService;
|
||||
import com.ycwl.basic.integration.device.client.DefaultConfigClient;
|
||||
import com.ycwl.basic.integration.device.client.DeviceV2Client;
|
||||
import com.ycwl.basic.integration.device.dto.defaults.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceDefaultConfigIntegrationService {
|
||||
|
||||
private final DefaultConfigClient defaultConfigClient;
|
||||
private final DeviceV2Client defaultConfigClient;
|
||||
private final IntegrationFallbackService fallbackService;
|
||||
|
||||
private static final String SERVICE_NAME = "zt-device";
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.ycwl.basic.integration.device.service;
|
||||
import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.service.IntegrationFallbackService;
|
||||
import com.ycwl.basic.integration.device.client.DeviceStatusClient;
|
||||
import com.ycwl.basic.integration.device.client.DeviceV2Client;
|
||||
import com.ycwl.basic.integration.device.dto.status.DeviceStatusDTO;
|
||||
import com.ycwl.basic.integration.device.dto.status.OnlineStatusResponseDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -18,7 +18,7 @@ import java.util.Optional;
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceStatusIntegrationService {
|
||||
|
||||
private final DeviceStatusClient deviceStatusClient;
|
||||
private final DeviceV2Client deviceStatusClient;
|
||||
private final IntegrationFallbackService fallbackService;
|
||||
|
||||
private static final String SERVICE_NAME = "zt-device";
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.ycwl.basic.integration.render.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.render.dto.config.BatchRenderWorkerConfigRequest;
|
||||
import com.ycwl.basic.integration.render.dto.config.RenderWorkerConfigV2DTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 渲染工作器配置V2客户端
|
||||
*/
|
||||
@FeignClient(name = "zt-render-worker", contextId = "render-worker-config-v2", path = "/api/render/worker/config/v2")
|
||||
public interface RenderWorkerConfigV2Client {
|
||||
|
||||
/**
|
||||
* 获取工作器所有配置
|
||||
*/
|
||||
@GetMapping("/{workerId}")
|
||||
CommonResponse<List<RenderWorkerConfigV2DTO>> getWorkerConfigs(@PathVariable("workerId") Long workerId);
|
||||
|
||||
/**
|
||||
* 根据配置键获取特定配置
|
||||
*/
|
||||
@GetMapping("/{workerId}/key/{configKey}")
|
||||
CommonResponse<RenderWorkerConfigV2DTO> getWorkerConfigByKey(@PathVariable("workerId") Long workerId,
|
||||
@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 创建配置
|
||||
*/
|
||||
@PostMapping("/{workerId}")
|
||||
CommonResponse<RenderWorkerConfigV2DTO> createWorkerConfig(@PathVariable("workerId") Long workerId,
|
||||
@RequestBody RenderWorkerConfigV2DTO config);
|
||||
|
||||
/**
|
||||
* 更新配置
|
||||
*/
|
||||
@PutMapping("/{workerId}/{id}")
|
||||
CommonResponse<Void> updateWorkerConfig(@PathVariable("workerId") Long workerId,
|
||||
@PathVariable("id") Long id,
|
||||
@RequestBody Map<String, Object> updates);
|
||||
|
||||
/**
|
||||
* 删除配置
|
||||
*/
|
||||
@DeleteMapping("/{workerId}/{id}")
|
||||
CommonResponse<Void> deleteWorkerConfig(@PathVariable("workerId") Long workerId,
|
||||
@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量更新配置
|
||||
*/
|
||||
@PostMapping("/{workerId}/batch")
|
||||
CommonResponse<Void> batchUpdateWorkerConfigs(@PathVariable("workerId") Long workerId,
|
||||
@RequestBody BatchRenderWorkerConfigRequest request);
|
||||
}
|
||||
@@ -2,45 +2,52 @@ 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.config.BatchRenderWorkerConfigRequest;
|
||||
import com.ycwl.basic.integration.render.dto.config.RenderWorkerConfigV2DTO;
|
||||
import com.ycwl.basic.integration.render.dto.worker.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 渲染工作器V2客户端
|
||||
*/
|
||||
@FeignClient(name = "zt-render-worker", contextId = "render-worker-v2", path = "/api/render/worker/v2")
|
||||
@FeignClient(name = "zt-render-worker", contextId = "render-worker-v2", path = "/api/render/worker")
|
||||
public interface RenderWorkerV2Client {
|
||||
|
||||
// ==================== Worker V2 Operations ====================
|
||||
|
||||
/**
|
||||
* 获取工作器核心信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@GetMapping("v2/{id}")
|
||||
CommonResponse<RenderWorkerV2DTO> getWorker(@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 创建工作器
|
||||
*/
|
||||
@PostMapping
|
||||
@PostMapping("v2")
|
||||
CommonResponse<RenderWorkerV2DTO> createWorker(@RequestBody CreateRenderWorkerRequest request);
|
||||
|
||||
/**
|
||||
* 更新工作器
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping("v2/{id}")
|
||||
CommonResponse<Void> updateWorker(@PathVariable("id") Long id,
|
||||
@RequestBody UpdateRenderWorkerRequest request);
|
||||
|
||||
/**
|
||||
* 删除工作器
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@DeleteMapping("v2/{id}")
|
||||
CommonResponse<Void> deleteWorker(@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 分页查询工作器列表(核心信息)
|
||||
*/
|
||||
@GetMapping
|
||||
@GetMapping("v2")
|
||||
CommonResponse<PageResponse<RenderWorkerV2DTO>> listWorkers(@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) Integer isEnabled,
|
||||
@@ -49,6 +56,50 @@ public interface RenderWorkerV2Client {
|
||||
/**
|
||||
* 根据key获取工作器核心信息
|
||||
*/
|
||||
@GetMapping("/key/{key}")
|
||||
@GetMapping("v2/key/{key}")
|
||||
CommonResponse<RenderWorkerV2DTO> getWorkerByKey(@PathVariable("key") String key);
|
||||
|
||||
// ==================== Worker Config V2 Operations ====================
|
||||
|
||||
/**
|
||||
* 获取工作器所有配置
|
||||
*/
|
||||
@GetMapping("config/v2/{workerId}")
|
||||
CommonResponse<List<RenderWorkerConfigV2DTO>> getWorkerConfigs(@PathVariable("workerId") Long workerId);
|
||||
|
||||
/**
|
||||
* 根据配置键获取特定配置
|
||||
*/
|
||||
@GetMapping("config/v2/{workerId}/key/{configKey}")
|
||||
CommonResponse<RenderWorkerConfigV2DTO> getWorkerConfigByKey(@PathVariable("workerId") Long workerId,
|
||||
@PathVariable("configKey") String configKey);
|
||||
|
||||
/**
|
||||
* 创建配置
|
||||
*/
|
||||
@PostMapping("config/v2/{workerId}")
|
||||
CommonResponse<RenderWorkerConfigV2DTO> createWorkerConfig(@PathVariable("workerId") Long workerId,
|
||||
@RequestBody RenderWorkerConfigV2DTO config);
|
||||
|
||||
/**
|
||||
* 更新配置
|
||||
*/
|
||||
@PutMapping("config/v2/{workerId}/{id}")
|
||||
CommonResponse<Void> updateWorkerConfig(@PathVariable("workerId") Long workerId,
|
||||
@PathVariable("id") Long id,
|
||||
@RequestBody Map<String, Object> updates);
|
||||
|
||||
/**
|
||||
* 删除配置
|
||||
*/
|
||||
@DeleteMapping("config/v2/{workerId}/{id}")
|
||||
CommonResponse<Void> deleteWorkerConfig(@PathVariable("workerId") Long workerId,
|
||||
@PathVariable("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量更新配置
|
||||
*/
|
||||
@PostMapping("config/v2/{workerId}/batch")
|
||||
CommonResponse<Void> batchUpdateWorkerConfigs(@PathVariable("workerId") Long workerId,
|
||||
@RequestBody BatchRenderWorkerConfigRequest request);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.ycwl.basic.integration.render.service;
|
||||
import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.service.IntegrationFallbackService;
|
||||
import com.ycwl.basic.integration.render.client.RenderWorkerConfigV2Client;
|
||||
import com.ycwl.basic.integration.render.client.RenderWorkerV2Client;
|
||||
import com.ycwl.basic.integration.render.dto.config.BatchRenderWorkerConfigRequest;
|
||||
import com.ycwl.basic.integration.render.dto.config.RenderWorkerConfigV2DTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -23,7 +23,7 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class RenderWorkerConfigIntegrationService {
|
||||
|
||||
private final RenderWorkerConfigV2Client renderWorkerConfigV2Client;
|
||||
private final RenderWorkerV2Client renderWorkerConfigV2Client;
|
||||
private final IntegrationFallbackService fallbackService;
|
||||
|
||||
private static final String SERVICE_NAME = "zt-render-worker";
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.ycwl.basic.integration.scenic.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.scenic.dto.config.DefaultConfigDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = "zt-scenic", contextId = "scenic-default-config", path = "/api/scenic/default-config")
|
||||
public interface DefaultConfigClient {
|
||||
|
||||
@GetMapping("/")
|
||||
CommonResponse<List<DefaultConfigDTO>> listDefaultConfigs();
|
||||
|
||||
@GetMapping("/{configKey}")
|
||||
CommonResponse<DefaultConfigDTO> getDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
|
||||
@PostMapping("/")
|
||||
CommonResponse<DefaultConfigDTO> createDefaultConfig(@RequestBody DefaultConfigDTO request);
|
||||
|
||||
@PutMapping("/{configKey}")
|
||||
CommonResponse<DefaultConfigDTO> updateDefaultConfig(@PathVariable("configKey") String configKey,
|
||||
@RequestBody DefaultConfigDTO request);
|
||||
|
||||
@DeleteMapping("/{configKey}")
|
||||
CommonResponse<Void> deleteDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.ycwl.basic.integration.scenic.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.scenic.dto.config.*;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = "zt-scenic", contextId = "scenic-config-v2", path = "/api/scenic/config/v2")
|
||||
public interface ScenicConfigV2Client {
|
||||
|
||||
@GetMapping("/{scenicId}")
|
||||
CommonResponse<List<ScenicConfigV2DTO>> listConfigs(@PathVariable("scenicId") Long scenicId);
|
||||
|
||||
@GetMapping("/{scenicId}/key/{configKey}")
|
||||
CommonResponse<ScenicConfigV2DTO> getConfigByKey(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("configKey") String configKey);
|
||||
|
||||
@PostMapping("/{scenicId}")
|
||||
CommonResponse<ScenicConfigV2DTO> createConfig(@PathVariable("scenicId") Long scenicId,
|
||||
@RequestBody CreateConfigRequest request);
|
||||
|
||||
@PutMapping("/{scenicId}/{id}")
|
||||
CommonResponse<ScenicConfigV2DTO> updateConfig(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("id") String id,
|
||||
@RequestBody UpdateConfigRequest request);
|
||||
|
||||
@DeleteMapping("/{scenicId}/{id}")
|
||||
CommonResponse<Void> deleteConfig(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("id") String id);
|
||||
|
||||
@PostMapping("/{scenicId}/batch")
|
||||
CommonResponse<BatchUpdateResponse> batchUpdateConfigs(@PathVariable("scenicId") Long scenicId,
|
||||
@RequestBody BatchConfigRequest request);
|
||||
}
|
||||
@@ -1,39 +1,87 @@
|
||||
package com.ycwl.basic.integration.scenic.client;
|
||||
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.response.PageResponse;
|
||||
import com.ycwl.basic.integration.scenic.dto.config.*;
|
||||
import com.ycwl.basic.integration.scenic.dto.filter.ScenicFilterPageResponse;
|
||||
import com.ycwl.basic.integration.scenic.dto.filter.ScenicFilterRequest;
|
||||
import com.ycwl.basic.integration.scenic.dto.scenic.CreateScenicRequest;
|
||||
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2DTO;
|
||||
import com.ycwl.basic.integration.common.response.PageResponse;
|
||||
import com.ycwl.basic.integration.scenic.dto.scenic.UpdateScenicRequest;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@FeignClient(name = "zt-scenic", contextId = "scenic-v2", path = "/api/scenic/v2")
|
||||
@FeignClient(name = "zt-scenic", contextId = "scenic-v2", path = "/api/scenic")
|
||||
public interface ScenicV2Client {
|
||||
|
||||
@GetMapping("/{scenicId}")
|
||||
// ==================== Scenic V2 Operations ====================
|
||||
|
||||
@GetMapping("v2/{scenicId}")
|
||||
CommonResponse<ScenicV2DTO> getScenic(@PathVariable("scenicId") Long scenicId);
|
||||
|
||||
@PostMapping("/")
|
||||
@PostMapping("v2/")
|
||||
CommonResponse<ScenicV2DTO> createScenic(@RequestBody CreateScenicRequest request);
|
||||
|
||||
@PutMapping("/{scenicId}")
|
||||
@PutMapping("v2/{scenicId}")
|
||||
CommonResponse<ScenicV2DTO> updateScenic(@PathVariable("scenicId") Long scenicId,
|
||||
@RequestBody UpdateScenicRequest request);
|
||||
|
||||
@DeleteMapping("/{scenicId}")
|
||||
@DeleteMapping("v2/{scenicId}")
|
||||
CommonResponse<Void> deleteScenic(@PathVariable("scenicId") Long scenicId);
|
||||
|
||||
@PostMapping("/filter")
|
||||
@PostMapping("v2/filter")
|
||||
CommonResponse<ScenicFilterPageResponse> filterScenics(@RequestBody ScenicFilterRequest request);
|
||||
|
||||
@GetMapping("/")
|
||||
@GetMapping("v2/")
|
||||
CommonResponse<PageResponse<ScenicV2DTO>> listScenics(@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false) String name);
|
||||
|
||||
// ==================== Scenic Config V2 Operations ====================
|
||||
|
||||
@GetMapping("config/v2/{scenicId}")
|
||||
CommonResponse<List<ScenicConfigV2DTO>> listConfigs(@PathVariable("scenicId") Long scenicId);
|
||||
|
||||
@GetMapping("config/v2/{scenicId}/key/{configKey}")
|
||||
CommonResponse<ScenicConfigV2DTO> getConfigByKey(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("configKey") String configKey);
|
||||
|
||||
@PostMapping("config/v2/{scenicId}")
|
||||
CommonResponse<ScenicConfigV2DTO> createConfig(@PathVariable("scenicId") Long scenicId,
|
||||
@RequestBody CreateConfigRequest request);
|
||||
|
||||
@PutMapping("config/v2/{scenicId}/{id}")
|
||||
CommonResponse<ScenicConfigV2DTO> updateConfig(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("id") String id,
|
||||
@RequestBody UpdateConfigRequest request);
|
||||
|
||||
@DeleteMapping("config/v2/{scenicId}/{id}")
|
||||
CommonResponse<Void> deleteConfig(@PathVariable("scenicId") Long scenicId,
|
||||
@PathVariable("id") String id);
|
||||
|
||||
@PostMapping("config/v2/{scenicId}/batch")
|
||||
CommonResponse<BatchUpdateResponse> batchUpdateConfigs(@PathVariable("scenicId") Long scenicId,
|
||||
@RequestBody BatchConfigRequest request);
|
||||
|
||||
// ==================== Default Config Operations ====================
|
||||
|
||||
@GetMapping("default-config/")
|
||||
CommonResponse<List<DefaultConfigDTO>> listDefaultConfigs();
|
||||
|
||||
@GetMapping("default-config/{configKey}")
|
||||
CommonResponse<DefaultConfigDTO> getDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
|
||||
@PostMapping("default-config/")
|
||||
CommonResponse<DefaultConfigDTO> createDefaultConfig(@RequestBody DefaultConfigDTO request);
|
||||
|
||||
@PutMapping("default-config/{configKey}")
|
||||
CommonResponse<DefaultConfigDTO> updateDefaultConfig(@PathVariable("configKey") String configKey,
|
||||
@RequestBody DefaultConfigDTO request);
|
||||
|
||||
@DeleteMapping("default-config/{configKey}")
|
||||
CommonResponse<Void> deleteDefaultConfig(@PathVariable("configKey") String configKey);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.ycwl.basic.integration.scenic.service;
|
||||
import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.service.IntegrationFallbackService;
|
||||
import com.ycwl.basic.integration.scenic.client.ScenicConfigV2Client;
|
||||
import com.ycwl.basic.integration.scenic.client.ScenicV2Client;
|
||||
import com.ycwl.basic.integration.scenic.dto.config.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class ScenicConfigIntegrationService {
|
||||
|
||||
private final ScenicConfigV2Client scenicConfigV2Client;
|
||||
private final ScenicV2Client scenicConfigV2Client;
|
||||
private final IntegrationFallbackService fallbackService;
|
||||
|
||||
private static final String SERVICE_NAME = "zt-scenic";
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ycwl.basic.integration.scenic.service;
|
||||
|
||||
import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.scenic.client.DefaultConfigClient;
|
||||
import com.ycwl.basic.integration.scenic.client.ScenicV2Client;
|
||||
import com.ycwl.basic.integration.scenic.dto.config.DefaultConfigDTO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
public class ScenicDefaultConfigIntegrationService {
|
||||
|
||||
private final DefaultConfigClient defaultConfigClient;
|
||||
private final ScenicV2Client defaultConfigClient;
|
||||
|
||||
public List<DefaultConfigDTO> listDefaultConfigs() {
|
||||
log.debug("获取默认配置列表");
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.ycwl.basic.integration.scenic.service;
|
||||
import com.ycwl.basic.integration.common.exception.IntegrationException;
|
||||
import com.ycwl.basic.integration.common.response.CommonResponse;
|
||||
import com.ycwl.basic.integration.common.service.IntegrationFallbackService;
|
||||
import com.ycwl.basic.integration.scenic.client.ScenicConfigV2Client;
|
||||
import com.ycwl.basic.integration.scenic.client.ScenicV2Client;
|
||||
import com.ycwl.basic.integration.scenic.dto.filter.ScenicFilterPageResponse;
|
||||
import com.ycwl.basic.integration.scenic.dto.filter.ScenicFilterRequest;
|
||||
@@ -23,7 +22,6 @@ import java.util.Map;
|
||||
public class ScenicIntegrationService {
|
||||
|
||||
private final ScenicV2Client scenicV2Client;
|
||||
private final ScenicConfigV2Client scenicConfigV2Client;
|
||||
private final IntegrationFallbackService fallbackService;
|
||||
|
||||
private static final String SERVICE_NAME = "zt-scenic";
|
||||
|
||||
Reference in New Issue
Block a user