From e45119b36079dec9025368133bdab92bcd53b2e3 Mon Sep 17 00:00:00 2001 From: shsahahyland Date: Wed, 11 Dec 2024 19:10:08 +0530 Subject: [PATCH] AAE-29293 Add ServerTime controller --- .../web/EnableIdentityManagementRestAPI.java | 2 ++ .../web/controller/ServerTimeController.java | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/controller/ServerTimeController.java diff --git a/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/EnableIdentityManagementRestAPI.java b/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/EnableIdentityManagementRestAPI.java index cebc043ae9a..cca18b06b77 100644 --- a/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/EnableIdentityManagementRestAPI.java +++ b/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/EnableIdentityManagementRestAPI.java @@ -23,6 +23,7 @@ import org.activiti.cloud.identity.config.IdentitySearchCacheConfiguration; import org.activiti.cloud.identity.web.controller.IdentityManagementController; import org.activiti.cloud.identity.web.controller.IdentityManagementRestExceptionHandler; +import org.activiti.cloud.identity.web.controller.ServerTimeController; import org.springframework.context.annotation.Import; /** @@ -37,6 +38,7 @@ IdentityManagementController.class, IdentityManagementRestExceptionHandler.class, IdentitySearchCacheConfiguration.class, + ServerTimeController.class, } ) public @interface EnableIdentityManagementRestAPI { diff --git a/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/controller/ServerTimeController.java b/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/controller/ServerTimeController.java new file mode 100644 index 00000000000..bdc13922478 --- /dev/null +++ b/activiti-cloud-service-common/activiti-cloud-services-common-security/src/main/java/org/activiti/cloud/identity/web/controller/ServerTimeController.java @@ -0,0 +1,31 @@ +/* + * Copyright 2017-2020 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.activiti.cloud.identity.web.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping(value = "${activiti.cloud.services.identity.url:/v1}") +public class ServerTimeController { + + @GetMapping(value = "/server/time") + public String getServerTime() { + return String.valueOf(System.currentTimeMillis()); + } +}