Commit 3b46e109 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade endpoint para consultar estaciones de elasmo

parent ffe02c5e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ public class Oauth2SecurityConfiguration {

			http.cors();

			http.authorizeRequests().antMatchers("/private/**").access(
				"hasAnyRole('ROLE_ADMINISTRATOR', 'ROLE_MANAGER')");

			http.authorizeRequests().antMatchers(HttpMethod.POST, "/**/_search").permitAll();

			http.authorizeRequests().antMatchers(HttpMethod.POST, "/**/_categories").permitAll();
+42 −0
Original line number Diff line number Diff line
package es.redmic.api.privatedata.controller;

/*-
 * #%L
 * API
 * %%
 * Copyright (C) 2024 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import es.redmic.api.geodata.common.controller.RGeoDataController;
import es.redmic.api.privatedata.service.GeoFixedObservationSeriesESService;
import es.redmic.models.es.common.query.dto.GeoDataQueryDTO;
import es.redmic.models.es.geojson.common.model.GeoPointData;
import es.redmic.models.es.geojson.geofixedstation.dto.GeoFixedTimeSeriesDTO;

@RestController
@RequestMapping("${controller.mapping.PRIVATE_SURVEYSTATIONS_BY_ACTIVITY}")
public class GeoFixedObservationSeriesController
	extends RGeoDataController<GeoPointData, GeoFixedTimeSeriesDTO, GeoDataQueryDTO> {

	@Autowired
	public GeoFixedObservationSeriesController(GeoFixedObservationSeriesESService ESService) {
		super(ESService);
	}
}
+54 −0
Original line number Diff line number Diff line
package es.redmic.api.privatedata.repository;

/*-
 * #%L
 * API
 * %%
 * Copyright (C) 2024 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.stereotype.Repository;

import es.redmic.es.common.queryFactory.geodata.GeoFixedTimeSeriesQueryUtils;
import es.redmic.es.geodata.geofixedstation.repository.GeoFixedBaseESRepository;
import es.redmic.models.es.geojson.common.model.GeoPointData;

@Repository
public class GeoFixedObservationSeriesESRepository extends GeoFixedBaseESRepository<GeoPointData> {

	protected static String[] INDEX = { "private_geodata" };
	protected static String TYPE = "_doc";

	public GeoFixedObservationSeriesESRepository() {
		super();
		setInternalQuery(GeoFixedTimeSeriesQueryUtils.INTERNAL_QUERY);
	}

	@Override
	public String[] getIndex() {
		return INDEX;
	}

	@Override
	public String getType() {
		return TYPE;
	}

	@Override
	protected String getMappingFilePath(String index, String type) {
		return MAPPING_BASE_PATH + "private/geodata" + MAPPING_FILE_EXTENSION;
	}
}
+38 −0
Original line number Diff line number Diff line
package es.redmic.api.privatedata.service;

/*-
 * #%L
 * API
 * %%
 * Copyright (C) 2024 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import es.redmic.es.geodata.common.service.RGeoDataESService;
import es.redmic.es.geodata.geofixedstation.repository.GeoFixedTimeSeriesESRepository;
import es.redmic.models.es.geojson.common.model.GeoPointData;
import es.redmic.models.es.geojson.geofixedstation.dto.GeoFixedTimeSeriesDTO;

@Service
public class GeoFixedObservationSeriesESService extends RGeoDataESService<GeoFixedTimeSeriesDTO, GeoPointData> {

	@Autowired
	public GeoFixedObservationSeriesESService(GeoFixedTimeSeriesESRepository repository) {
		super(repository);
	}
}
+6 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ controller.mapping.ACTIVITY_TRACKING=/tracking/activities

controller.mapping.TRACKING_BY_ACTIVITY=/activities/{activityId}/tracking

controller.mapping.PRIVATE_ANIMAL_TRACKING_BY_ACTIVITY=/activities/{activityId}/privateanimaltracking

controller.mapping.TRACKING_ELEMENTS_BY_ACTIVITY=${controller.mapping.TRACKING_BY_ACTIVITY}/elements

controller.mapping.TRACKING_BY_ACTIVITY_AND_ELEMENT=${controller.mapping.TRACKING_ELEMENTS_BY_ACTIVITY}/{uuid}/track
@@ -309,6 +311,10 @@ controller.mapping.GRID5000_SCHEMA=${controller.mapping.GRID5000}${controller.ma
controller.mapping.GRID5000_BY_ID=/grid5000/{id}
controller.mapping.GRID5000_BY_ID_SCHEMA=${controller.mapping.GRID5000_BY_ID}${controller.mapping.FILTER_SCHEMA}

#Private
controller.mapping.PRIVATE_SURVEYSTATIONS_BY_ACTIVITY=/private/activities/{activityId}/timeseriesstations


#Paths

#Worms
Loading