Fix license service activation visibility
这个提交包含在:
父节点
7ce4d728cc
当前提交
d5b8f03996
@ -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<String, Object> data = Map.of(
|
||||
"exists", true,
|
||||
"active", companyService.isCompanyValid(company),
|
||||
"maxDevices", company.getMaxDevices(),
|
||||
"registeredDevices", company.getRegisteredDevices(),
|
||||
"expiresAt", company.getExpiresAt()
|
||||
);
|
||||
Map<String, Object> 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)));
|
||||
|
||||
@ -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,
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户