fix:新增租户同步spdm data服务数据

This commit is contained in:
2025-12-29 10:29:57 +08:00
parent a5b10d1b35
commit 3b133c19dd
4 changed files with 35 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.honeycombis.honeycom.common.core.util.R;
import com.honeycombis.honeycom.spdm.dto.TenantPageQueryDto;
import com.honeycombis.honeycom.spdm.feign.RemoteTenantServiceFeign;
import com.honeycombis.honeycom.spdm.feign.SpdmServiceFeignClient;
import com.honeycombis.honeycom.spdm.util.PageResult;
import com.honeycombis.honeycom.spdm.util.ResponseR;
import com.honeycombis.honeycom.tenant.vo.tenant.SysTenantVO;
@@ -32,6 +33,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@@ -42,11 +44,14 @@ import java.util.List;
@AllArgsConstructor
@RequestMapping("/spdm-tenant")
@Tag(description = "spdm", name = "提供给SPDM的租户模块")
@Slf4j
public class SpdmTenantController {
@Resource
private RemoteTenantServiceFeign remoteTenantServiceFeign;
@Resource
private SpdmServiceFeignClient spdmServiceFeignClient;
@Resource
private ObjectMapper objectMapper;
@@ -68,7 +73,7 @@ public class SpdmTenantController {
if (listTenantForPage.getData() != null && CollectionUtils.isNotEmpty(listTenantForPage.getData().getRecords())) {
return ResponseR.ok(listTenantForPage.getData().getRecords().get(0));
}
return ResponseR.ok();
return ResponseR.ok();
}
@Operation(summary = "查询所有租户" , description = "查询所有租户" )
@@ -77,4 +82,10 @@ public class SpdmTenantController {
return ResponseR.ok(remoteTenantServiceFeign.getAll().getData());
}
@PostMapping("/initNewTenant")
public void initNewTenant(@RequestParam Long tenantId) {
ResponseR responseR = spdmServiceFeignClient.initNewTenant(tenantId);
log.info("[initNewTenant] tenantId:{}, responseR:{}", tenantId, responseR);
}
}

View File

@@ -3,6 +3,7 @@ package com.honeycombis.honeycom.spdm.feign;
import com.honeycombis.honeycom.common.core.util.R;
import com.honeycombis.honeycom.spdm.dto.ApproveResultDto;
import com.honeycombis.honeycom.spdm.dto.SysLogDto;
import com.honeycombis.honeycom.spdm.util.ResponseR;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@@ -18,4 +19,7 @@ public interface SpdmServiceFeignClient {
@PostMapping("/systemLog/saveLog")
R saveLog(@RequestBody SysLogDto sysLogDto);
@PostMapping("/tenant/initNewTenant")
ResponseR initNewTenant(@RequestParam Long tenantId);
}