summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
21e5030)
Issue-ID: PORTAL-865
Change-Id: Id64f7eee433892b7fa241ea26424efff742f7229
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modification Copyright © 2020 IBM.
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
import org.slf4j.MDC;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.slf4j.MDC;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.onap.music.main.MusicUtil;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.onap.music.main.MusicUtil;
private final String statusDown = "DOWN";
private final String statusOk = "OK";
private final String statusDown = "DOWN";
private final String statusOk = "OK";
- @RequestMapping(value = { "/portalApi/healthCheck" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/healthCheck" }, produces = "application/json")
public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "");
public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "");
- @RequestMapping(value = {
- "/portalApi/healthCheckSuspend" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/healthCheckSuspend" }, produces = "application/json")
public HealthStatus healthCheckSuspend(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "Suspended for manual failover mechanism");
public HealthStatus healthCheckSuspend(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "Suspended for manual failover mechanism");
- @RequestMapping(value = {
- "/portalApi/healthCheckResume" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/healthCheckResume" }, produces = "application/json")
public HealthStatus healthCheckResume(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "Resumed from manual failover mechanism");
public HealthStatus healthCheckResume(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "Resumed from manual failover mechanism");
- @RequestMapping(value = { "/portalApi/ping" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/ping" }, produces = "application/json")
public HealthStatus ping(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(200, "OK");
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/ping", "GET result =", response.getStatus());
public HealthStatus ping(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(200, "OK");
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/ping", "GET result =", response.getStatus());
/**
* Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
*
/**
* Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
*
+ * Modification Copyright © 2020 IBM.
+ * ===================================================================
* 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
* 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
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
@Autowired
private LanguageService languageService;
@Autowired
private LanguageService languageService;
- @RequestMapping(value = "/language",method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+ @GetMapping(value = "/language", produces = "application/json;charset=UTF-8")
public JSONObject getLanguageList() {
return languageService.getLanguages();
}
public JSONObject getLanguageList() {
return languageService.getLanguages();
}
- @RequestMapping(value = "/languageSetting/user/{loginId}",method = RequestMethod.POST)
+ @PostMapping(value = "/languageSetting/user/{loginId}")
public void setUpUserLanguage(@RequestBody JSONObject jsonLanguageId,
@PathVariable("loginId") String loginId) throws Exception {
Integer languageId = jsonLanguageId.getInteger("languageId");
languageService.setUpUserLanguage(languageId,loginId);
}
public void setUpUserLanguage(@RequestBody JSONObject jsonLanguageId,
@PathVariable("loginId") String loginId) throws Exception {
Integer languageId = jsonLanguageId.getInteger("languageId");
languageService.setUpUserLanguage(languageId,loginId);
}
- @RequestMapping(value = "/languageSetting/user/{loginId}",method = RequestMethod.GET)
+ @GetMapping(value = "/languageSetting/user/{loginId}")
public JSONObject getUserLanguage(HttpServletRequest request, HttpServletResponse response,
@PathVariable("loginId") String loginId) {
return languageService.getUserLanguage(loginId);
public JSONObject getUserLanguage(HttpServletRequest request, HttpServletResponse response,
@PathVariable("loginId") String loginId) {
return languageService.getUserLanguage(loginId);
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modification Copyright © 2020 IBM.
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@Autowired
private MicroserviceService microserviceService;
@Autowired
private MicroserviceService microserviceService;
- @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/microservices" })
public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
@Valid @RequestBody MicroserviceData newServiceData) throws Exception {
if (newServiceData == null) {
public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
@Valid @RequestBody MicroserviceData newServiceData) throws Exception {
if (newServiceData == null) {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
- @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/microservices" })
public List<MicroserviceData> getMicroservice(HttpServletRequest request, HttpServletResponse response)
throws Exception {
return microserviceService.getMicroserviceData();
}
public List<MicroserviceData> getMicroservice(HttpServletRequest request, HttpServletResponse response)
throws Exception {
return microserviceService.getMicroserviceData();
}
- @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.PUT)
+ @PutMapping(value = { "/portalApi/microservices/{serviceId}" })
public PortalRestResponse<String> updateMicroservice(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") long serviceId, @Valid @RequestBody MicroserviceData newServiceData) {
public PortalRestResponse<String> updateMicroservice(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") long serviceId, @Valid @RequestBody MicroserviceData newServiceData) {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
- @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.DELETE)
+ @DeleteMapping(value = { "/portalApi/microservices/{serviceId}" })
public PortalRestResponse<String> deleteMicroservice(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") long serviceId) {
try {
public PortalRestResponse<String> deleteMicroservice(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") long serviceId) {
try {
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modification Copyright © 2020 IBM.
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
@Autowired
private MicroserviceProxyService microserviceProxyService;
@Autowired
private MicroserviceProxyService microserviceProxyService;
- @RequestMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, produces = "application/json")
public String getMicroserviceProxy(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") long serviceId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
public String getMicroserviceProxy(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") long serviceId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
}
return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
}
- @RequestMapping(value = { "/portalApi/microservice/proxy/parameter/{widgetId}" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/microservice/proxy/parameter/{widgetId}" }, produces = "application/json")
public String getMicroserviceProxyByWidgetId(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
public String getMicroserviceProxyByWidgetId(HttpServletRequest request, HttpServletResponse response,
@PathVariable("widgetId") long widgetId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modification Copyright © 2020 IBM.
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
this.auditService = auditService;
}
this.auditService = auditService;
}
- @RequestMapping(value = { "/portalApi/portalAdmins" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/portalAdmins" }, produces = "application/json")
public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<PortalAdmin> portalAdmins = null;
public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<PortalAdmin> portalAdmins = null;
* @param response
* @return FieldsValidator
*/
* @param response
* @return FieldsValidator
*/
- @RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/portalAdmin" })
public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userId,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userId,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
return fieldsValidator;
}
return fieldsValidator;
}
- @RequestMapping(value = { "/portalApi/portalAdmin/{userInfo}" }, method = RequestMethod.DELETE)
+ @DeleteMapping(value = { "/portalApi/portalAdmin/{userInfo}" })
public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("userInfo") String userInfo,
HttpServletResponse response) {
public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("userInfo") String userInfo,
HttpServletResponse response) {
return fieldsValidator;
}
return fieldsValidator;
}
- @RequestMapping(value = {
- "/portalApi/adminAppsRoles/{appId}" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/adminAppsRoles/{appId}" }, produces = "application/json")
public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);