use of com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO in project apollo by ctripcorp.
the class NamespaceController method getNamespaceLock.
@RequestMapping(value = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/lock", method = RequestMethod.GET)
public OpenNamespaceLockDTO getNamespaceLock(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName) {
NamespaceDTO namespace = namespaceService.loadNamespaceBaseInfo(appId, Env.fromString(env), clusterName, namespaceName);
NamespaceLockDTO lockDTO = namespaceLockService.getNamespaceLock(appId, Env.fromString(env), clusterName, namespaceName);
return OpenApiBeanUtils.transformFromNamespaceLockDTO(namespace.getNamespaceName(), lockDTO);
}
use of com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO in project apollo by ctripcorp.
the class ServerNamespaceOpenApiService method getNamespaceLock.
@Override
public OpenNamespaceLockDTO getNamespaceLock(String appId, String env, String clusterName, String namespaceName) {
NamespaceDTO namespace = namespaceService.loadNamespaceBaseInfo(appId, Env.valueOf(env), clusterName, namespaceName);
NamespaceLockDTO lockDTO = namespaceLockService.getNamespaceLock(appId, Env.valueOf(env), clusterName, namespaceName);
return OpenApiBeanUtils.transformFromNamespaceLockDTO(namespace.getNamespaceName(), lockDTO);
}
use of com.ctrip.framework.apollo.openapi.dto.OpenNamespaceLockDTO in project apollo by ctripcorp.
the class OpenApiBeanUtils method transformFromNamespaceLockDTO.
public static OpenNamespaceLockDTO transformFromNamespaceLockDTO(String namespaceName, NamespaceLockDTO namespaceLock) {
OpenNamespaceLockDTO lock = new OpenNamespaceLockDTO();
lock.setNamespaceName(namespaceName);
if (namespaceLock == null) {
lock.setLocked(false);
} else {
lock.setLocked(true);
lock.setLockedBy(namespaceLock.getDataChangeCreatedBy());
}
return lock;
}
Aggregations