2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
21 * Created by robertlo on 11/18/2016.
26 class AuditLogService {
27 constructor($q, $log, $http, conf, uuid) {
35 storeAudit(affectedAppId) {
36 // this.$log.error('ecomp::storeAudit storeAudit',affectedAppId);
37 let deferred = this.$q.defer();
40 url: this.conf.api.storeAuditLog+'?affectedAppId=' + affectedAppId +"&type=''&comment=''",
43 'X-ECOMP-RequestID':this.uuid.generate()
46 return deferred.promise;
49 storeAudit(affectedAppId,type) {
50 // this.$log.error('ecomp::storeAudit storeAudit',affectedAppId + " " +type);
51 let deferred = this.$q.defer();
54 url: this.conf.api.storeAuditLog+'?affectedAppId=' + affectedAppId + '&type='+type+"&comment=''",
57 'X-ECOMP-RequestID':this.uuid.generate()
60 return deferred.promise;
62 storeAudit(affectedAppId,type,comment) {
63 comment = filterDummyValue(comment);
64 let deferred = this.$q.defer();
65 var url =this.conf.api.storeAuditLog+'?affectedAppId=' + affectedAppId;
67 url= url+'&type='+type;
70 url= url+'&comment='+comment;
77 'X-ECOMP-RequestID':this.uuid.generate()
80 return deferred.promise;
83 AuditLogService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4'];
84 angular.module('ecompApp').service('auditLogService', AuditLogService)
87 function filterDummyValue(comment){
88 var n = comment.indexOf("?dummyVar");
90 comment = comment.substring(0, n);