From 4a56debaac0d6d7a073ae24f1d8099879f121ba1 Mon Sep 17 00:00:00 2001 From: Bruno Sakoto Date: Wed, 17 Feb 2021 17:26:33 -0500 Subject: Create application skeleton This skeleton is used to start validating cps temporal jenkins jobs. Issue-ID: CPS-190 Change-Id: Iccbd4f58eaf2bd3ffaf668f4471b94581425c484 Signed-off-by: Bruno Sakoto --- .../java/org/onap/cps/temporal/Application.java | 34 +++++++++++++++++++++ .../cps/temporal/controller/QueryController.java | 35 ++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src/main/java/org/onap/cps/temporal/Application.java create mode 100644 src/main/java/org/onap/cps/temporal/controller/QueryController.java (limited to 'src/main') diff --git a/src/main/java/org/onap/cps/temporal/Application.java b/src/main/java/org/onap/cps/temporal/Application.java new file mode 100644 index 0000000..57dabb3 --- /dev/null +++ b/src/main/java/org/onap/cps/temporal/Application.java @@ -0,0 +1,34 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (c) 2021 Bell Canada. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.cps.temporal; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Main application class for CPS Temporal. + */ +@SpringBootApplication +public class Application { + + public static void main(final String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/src/main/java/org/onap/cps/temporal/controller/QueryController.java b/src/main/java/org/onap/cps/temporal/controller/QueryController.java new file mode 100644 index 0000000..b12b451 --- /dev/null +++ b/src/main/java/org/onap/cps/temporal/controller/QueryController.java @@ -0,0 +1,35 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (c) 2021 Bell Canada. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.cps.temporal.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Controller for query requests. + */ +@RestController +public class QueryController { + + @RequestMapping("/") + public String home() { + return "Welcome to CPS Temporal Service!"; + } + +} -- cgit 1.2.3-korg