Domain model change
[portal.git] / portal-BE / src / main / java / org / onap / portal / service / ep / EpMicroserviceParameterService.java
index 2544ae6..ea0e69b 100644 (file)
@@ -51,11 +51,13 @@ import org.onap.portal.domain.dto.ecomp.MicroserviceParameter;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 @Service
+@Transactional
 public class EpMicroserviceParameterService {
 
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EpWidgetCatalogParameterService.class);
+       final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EpWidgetCatalogParameterService.class);
 
        private final EpMicroserviceParameterDao epMicroserviceParameterDao;
 
@@ -84,4 +86,19 @@ public class EpMicroserviceParameterService {
        private List<MicroserviceParameter> mapToMicroserviceParameterList(final List<EpMicroserviceParameter> list){
               return list.stream().map(this::epWidgetCatalogParameterToMicroserviceParameter).collect(Collectors.toList());
        }
+
+       public EpMicroserviceParameter save(EpMicroserviceParameter epMicroserviceParameter){
+              return epMicroserviceParameterDao.save(epMicroserviceParameter);
+       }
+
+       @Transactional
+       public boolean deleteMicroserviceParameterById(final Long paramid){
+              try {
+                     epMicroserviceParameterDao.deleteById(paramid);
+                     return true;
+              }catch (Exception e){
+                     logger.error(EELFLoggerDelegate.errorLogger, e.getMessage());
+                     return false;
+              }
+       }
 }