diff --git a/license-service/src/main/java/com/xuqm/license/controller/LicenseInternalController.java b/license-service/src/main/java/com/xuqm/license/controller/LicenseInternalController.java index f7bf969..6253ac7 100644 --- a/license-service/src/main/java/com/xuqm/license/controller/LicenseInternalController.java +++ b/license-service/src/main/java/com/xuqm/license/controller/LicenseInternalController.java @@ -10,6 +10,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -37,13 +38,12 @@ public class LicenseInternalController { } try { CompanyEntity company = companyService.getById(appKey); - Map data = Map.of( - "exists", true, - "active", companyService.isCompanyValid(company), - "maxDevices", company.getMaxDevices(), - "registeredDevices", company.getRegisteredDevices(), - "expiresAt", company.getExpiresAt() - ); + Map data = new HashMap<>(); + data.put("exists", true); + data.put("active", companyService.isCompanyValid(company)); + data.put("maxDevices", company.getMaxDevices()); + data.put("registeredDevices", company.getRegisteredDevices()); + data.put("expiresAt", company.getExpiresAt()); return ResponseEntity.ok(ApiResponse.success(data)); } catch (Exception e) { return ResponseEntity.ok(ApiResponse.success(Map.of("exists", false))); diff --git a/tenant-service/src/main/java/com/xuqm/tenant/service/FeatureServiceManager.java b/tenant-service/src/main/java/com/xuqm/tenant/service/FeatureServiceManager.java index 03ef522..8c3b976 100644 --- a/tenant-service/src/main/java/com/xuqm/tenant/service/FeatureServiceManager.java +++ b/tenant-service/src/main/java/com/xuqm/tenant/service/FeatureServiceManager.java @@ -51,7 +51,8 @@ public class FeatureServiceManager { FeatureServiceEntity.ServiceType.IM, FeatureServiceEntity.ServiceType.PUSH, FeatureServiceEntity.ServiceType.UPDATE, - FeatureServiceEntity.ServiceType.FILE)) { + FeatureServiceEntity.ServiceType.FILE, + FeatureServiceEntity.ServiceType.LICENSE)) { services.stream() .filter(service -> service.getServiceType() == serviceType) .findFirst() @@ -62,7 +63,7 @@ public class FeatureServiceManager { /** * Submit an activation request. Disabling is immediate; enabling requires ops approval. - * IM / PUSH / UPDATE are app-wide, so duplicate checks ignore platform. + * IM / PUSH / UPDATE / FILE / LICENSE are app-wide, so duplicate checks ignore platform. */ @Transactional public ServiceActivationRequestEntity submitActivationRequest( @@ -559,7 +560,8 @@ public class FeatureServiceManager { return serviceType == FeatureServiceEntity.ServiceType.IM || serviceType == FeatureServiceEntity.ServiceType.PUSH || serviceType == FeatureServiceEntity.ServiceType.UPDATE - || serviceType == FeatureServiceEntity.ServiceType.FILE; + || serviceType == FeatureServiceEntity.ServiceType.FILE + || serviceType == FeatureServiceEntity.ServiceType.LICENSE; } private JsonNode readConfigNode(String appKey,