mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 02:25:49 +01:00
Changing a few things
This commit is contained in:
parent
cdde81dbb7
commit
5e2d4a4dba
@ -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
Block a user