Commit 6d4e4c1a authored by Noel Alonso's avatar Noel Alonso
Browse files

Elimina componentes de ObjectCollectingSeries

parent 0c097c85
Loading
Loading
Loading
Loading
+0 −95
Original line number Diff line number Diff line
package es.redmic.api.series.objectcollecting.controller;

/*-
 * #%L
 * API
 * %%
 * Copyright (C) 2019 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 javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import es.redmic.api.series.common.controller.RSeriesController;
import es.redmic.es.series.objectcollecting.service.ObjectCollectingSeriesESService;
import es.redmic.models.es.common.dto.SuperDTO;
import es.redmic.models.es.common.query.dto.AggsPropertiesDTO;
import es.redmic.models.es.common.query.dto.GeoDataQueryDTO;
import es.redmic.models.es.series.objectcollecting.dto.ObjectCollectingSeriesDTO;
import es.redmic.models.es.series.objectcollecting.model.ObjectCollectingSeries;

@RestController
@RequestMapping(value = "${controller.mapping.OBJECTCOLLECTING}")
public class RObjectCollectingSeriesController extends RSeriesController<ObjectCollectingSeries, ObjectCollectingSeriesDTO, GeoDataQueryDTO> {

	private ObjectCollectingSeriesESService service;

	@Autowired
	public RObjectCollectingSeriesController(ObjectCollectingSeriesESService service) {
		super(service);
		this.service = service;
	}

	@PostMapping(value = "${controller.mapping.OBJECT_CLASSIFICATION_LIST}/_search")
	@ResponseBody
	public SuperDTO findClassificationList(@Valid @RequestBody GeoDataQueryDTO queryDTO, BindingResult bindingResult) {

		AggsPropertiesDTO agg = new AggsPropertiesDTO();
		agg.setField("classificationList");
		queryDTO.addAgg(agg);
		queryDTO.setSize(0);

		processQuery(queryDTO, bindingResult);

		return service.findClassificationList(queryDTO);
	}

	@PostMapping(value = "${controller.mapping.OBJECT_CLASSIFICATION}/_search")
	@ResponseBody
	public SuperDTO findClassification(@Valid @RequestBody GeoDataQueryDTO queryDTO, BindingResult bindingResult) {

		AggsPropertiesDTO agg = new AggsPropertiesDTO();
		agg.setField("classification");
		queryDTO.addAgg(agg);
		queryDTO.setSize(0);

		processQuery(queryDTO, bindingResult);

		return service.findClassificationStatistics(queryDTO);
	}

	@PostMapping(value = "${controller.mapping.SERIES_TEMPORALDATA}/_search")
	@ResponseBody
	public SuperDTO findTemporalData(@Valid @RequestBody GeoDataQueryDTO queryDTO, BindingResult bindingResult) {

		AggsPropertiesDTO agg = new AggsPropertiesDTO();
		agg.setField("temporaldata");
		queryDTO.addAgg(agg);

		queryDTO.setSize(0);

		processQuery(queryDTO, bindingResult);

		return service.findTemporalDataStatistics(queryDTO);
	}
}
+0 −40
Original line number Diff line number Diff line
package es.redmic.api.series.objectcollecting.controller;

/*-
 * #%L
 * API
 * %%
 * Copyright (C) 2019 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.series.common.controller.RWSeriesController;
import es.redmic.db.series.objectcollecting.model.ObjectCollecting;
import es.redmic.db.series.objectcollecting.service.ObjectCollectingSeriesService;
import es.redmic.models.es.series.objectcollecting.dto.ObjectCollectingSeriesDTO;

@RestController
@RequestMapping(value = "${controller.mapping.OBJECTCOLLECTING_BY_DATA_DEFINITION}")
public class RWObjectCollectingSeriesController extends RWSeriesController<ObjectCollecting, ObjectCollectingSeriesDTO> {

	@Autowired
	public RWObjectCollectingSeriesController(ObjectCollectingSeriesService service) {
		super(service);
	}
}
+0 −14
Original line number Diff line number Diff line
@@ -147,8 +147,6 @@ controller.mapping.SURVEYSTATIONS_BY_ACTIVITY=/activities/{activityId}/timeserie
controller.mapping.TIMESERIES_BY_DATA_DEFINITION=/datadefinitions/{dataDefinitionId}/timeseries
controller.mapping.TIMESERIES=/timeseries
controller.mapping.OBJECTCOLLECTING_BY_ACTIVITY=/activities/{activityId}/objectcollectingseriesstations
controller.mapping.OBJECTCOLLECTING_BY_DATA_DEFINITION=/datadefinitions/{dataDefinitionId}/objectcollectingseries
controller.mapping.OBJECTCOLLECTING=/objectcollectingseries
controller.mapping.ACTIVITY_OBJECTCOLLECTINGSERIES=/objectcollectingseries/activities
controller.mapping.ACTIVITY_TIMESERIES=/timeseries/activities
#Distribution
@@ -294,18 +292,6 @@ contoller.mapping.ANCESTORS_SCHEMA=${contoller.mapping.ANCESTORS}${controller.ma
controller.mapping.TRACK_CLUSTER=/cluster
controller.mapping.TRACK_CLUSTER_SCHEMA=${controller.mapping.TRACK_CLUSTER}${controller.mapping.FILTER_SCHEMA}

controller.mapping.OBJECT_CLASSIFICATION_LIST=/classificationlist
controller.mapping.OBJECT_CLASSIFICATION_LIST_SCHEMA=${controller.mapping.OBJECT_CLASSIFICATION_LIST}${controller.mapping.FILTER_SCHEMA}

controller.mapping.OBJECT_CLASSIFICATION=/classification
controller.mapping.OBJECT_CLASSIFICATION_SCHEMA=${controller.mapping.OBJECT_CLASSIFICATION}${controller.mapping.FILTER_SCHEMA}

controller.mapping.SERIES_TEMPORALDATA=/temporaldata
controller.mapping.SERIES_TEMPORALDATA_SCHEMA=${controller.mapping.SERIES_TEMPORALDATA}${controller.mapping.FILTER_SCHEMA}

controller.mapping.SERIES_WINDROSE=/windrose
controller.mapping.SERIES_WINDROSE_SCHEMA=${controller.mapping.SERIES_TEMPORALDATA}${controller.mapping.FILTER_SCHEMA}

controller.mapping.GRID100=/grid100
controller.mapping.GRID100_SCHEMA=${controller.mapping.GRID100}${controller.mapping.FILTER_SCHEMA}