Changing a few things
This commit is contained in:
parent
ab6c78101d
commit
dee750b936
|
@ -1,4 +1,4 @@
|
|||
package com.sekwah.advancedportals.repository;
|
||||
|
||||
public interface DestinationRepository<T> extends JsonRepository<T> {
|
||||
public interface DestinationRepository<T> extends JsonRepository<T> {
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ public class DestinationServices {
|
|||
this.destinationRepository = destinationRepository;
|
||||
}
|
||||
|
||||
public Response create(String name, Destination destination) {
|
||||
public Response.Creation create(String name, Destination destination) {
|
||||
if (!destinationRepository.containsKey(name)) {
|
||||
destinationRepository.save(name, destination);
|
||||
return Response.SUCCESS;
|
||||
return Response.Creation.SUCCESS;
|
||||
}
|
||||
return Response.NAME_IN_USE;
|
||||
return Response.Creation.NAME_IN_USE;
|
||||
}
|
||||
|
||||
public Boolean delete(String name) {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.sekwah.advancedportals.services;
|
||||
|
||||
public enum Response {
|
||||
SUCCESS,
|
||||
NAME_IN_USE,
|
||||
public class Response {
|
||||
|
||||
public enum Creation {
|
||||
SUCCESS,
|
||||
NAME_IN_USE,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue