package de.gernd.simplemon.endpoints;

import de.gernd.simplemon.endpoints.model.AddSiteToMonitorRequest;
import de.gernd.simplemon.endpoints.model.GetMonitoredSitesResponse;
import de.gernd.simplemon.service.SimpleMonitoringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import java.util.List;

@Component
@Path("/monitored-sites")
@Produces("application/json")
@Consumes("application/json")
public class SimpleMonitoringEndpoint {

    @Autowired
    private SimpleMonitoringService monitoringService;


    /**
     * Method for retrieving all currently monitored sites
     *
     * @return All currently monitored sites
     */
    @Path("/")
    @GET
    public Response monitor() {
        GetMonitoredSitesResponse response = new GetMonitoredSitesResponse();
        List<String> monitoredSites = monitoringService.getMonitoredSites();
        response.monitoredSites = monitoredSites;
        return Response.ok(monitoredSites).build();
    }

    /**
     * Method for retrieving all currently monitored sites
     */
    @Path("/")
    @POST
    public Response addSite(AddSiteToMonitorRequest addSiteToMonitorRequest){
        monitoringService.startMonitoring(addSiteToMonitorRequest.url);
        return Response.ok().build();
    }
}

@@ -801,23 +801,33 @@
 esponse 
-m
+getM
 onitor
+edSites
 () %7B%0A   
@@ -1381,10 +1381,12 @@
 ;%0A    %7D%0A
+%0A%0A
 %7D%0A

Fix method name for getting the monitored sites