Code clean up
This commit is contained in:
parent
e8c90e66a5
commit
ecd7898237
|
@ -1,8 +1,6 @@
|
||||||
package eu.eudat.controllers;
|
package eu.eudat.controllers;
|
||||||
|
|
||||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
||||||
import eu.eudat.logic.managers.LockManager;
|
import eu.eudat.logic.managers.LockManager;
|
||||||
import eu.eudat.models.data.dmp.DataManagementPlan;
|
|
||||||
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
import eu.eudat.models.data.helpers.responses.ResponseItem;
|
||||||
import eu.eudat.models.data.lock.Lock;
|
import eu.eudat.models.data.lock.Lock;
|
||||||
import eu.eudat.models.data.security.Principal;
|
import eu.eudat.models.data.security.Principal;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import eu.eudat.exceptions.security.UnauthorisedException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
@ -20,11 +19,9 @@ import javax.annotation.Priority;
|
||||||
@Priority(4)
|
@Priority(4)
|
||||||
public class ControllerUnauthorisedHandler {
|
public class ControllerUnauthorisedHandler {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ControllerUnauthorisedHandler.class);
|
private static final Logger logger = LoggerFactory.getLogger(ControllerUnauthorisedHandler.class);
|
||||||
// private Logger logger;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ControllerUnauthorisedHandler(/*Logger logger*/) {
|
public ControllerUnauthorisedHandler() {
|
||||||
// this.logger = logger;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(UnauthorisedException.class)
|
@ExceptionHandler(UnauthorisedException.class)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package eu.eudat.controllers.interceptors;
|
package eu.eudat.controllers.interceptors;
|
||||||
|
|
||||||
import eu.eudat.logic.services.helpers.LoggerService;
|
|
||||||
import eu.eudat.types.WarningLevel;
|
import eu.eudat.types.WarningLevel;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -18,11 +17,9 @@ import java.util.Date;
|
||||||
@Component
|
@Component
|
||||||
public class RequestInterceptor extends HandlerInterceptorAdapter {
|
public class RequestInterceptor extends HandlerInterceptorAdapter {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(RequestInterceptor.class);
|
private static final Logger logger = LoggerFactory.getLogger(RequestInterceptor.class);
|
||||||
// private LoggerService loggerService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public RequestInterceptor(/*LoggerService loggerService*/) {
|
public RequestInterceptor() {
|
||||||
// this.loggerService = loggerService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { BaseHttpParams } from '@common/http/base-http-params';
|
import { BaseHttpParams } from '@common/http/base-http-params';
|
||||||
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
||||||
import { BaseHttpService } from '@common/base/base-http.service';
|
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { catchError, takeUntil } from 'rxjs/operators';
|
import { catchError, takeUntil } from 'rxjs/operators';
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class BaseHttpService {
|
|
||||||
constructor(
|
|
||||||
protected http: HttpClient
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
get<T>(url: string, options?: Object): Observable<T> {
|
|
||||||
return this.http.get<T>(url, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
post<T>(url: string, body: any, options?: Object): Observable<T> {
|
|
||||||
return this.http.post<T>(url, body, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
put<T>(url: string, body: any, options?: Object): Observable<T> {
|
|
||||||
return this.http.put<T>(url, body, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete<T>(url: string, options?: Object): Observable<T> {
|
|
||||||
return this.http.delete<T>(url, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
patch<T>(url: string, body: any, options?: Object): Observable<T> {
|
|
||||||
return this.http.patch<T>(url, body, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
head<T>(url: string, options?: Object): Observable<T> {
|
|
||||||
return this.http.head<T>(url, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
options<T>(url: string, options?: Object): Observable<T> {
|
|
||||||
return this.http.options<T>(url, options);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue