Changing a few things

This commit is contained in:
Sekwah 2020-06-29 00:59:47 +01:00 committed by Rezel
parent ab6c78101d
commit dee750b936
3 changed files with 10 additions and 7 deletions

View File

@ -1,4 +1,4 @@
package com.sekwah.advancedportals.repository;
public interface DestinationRepository<T> extends JsonRepository<T> {
public interface DestinationRepository<T> extends JsonRepository<T> {
}

View File

@ -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) {

View File

@ -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,
}
}