GeoDataController.java 2.27 KB
package com.bsth.controller.geo_data;

import com.bsth.entity.geo_data.GeoRoad;
import com.bsth.entity.geo_data.GeoStation;
import com.bsth.service.geo_data.GeoDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by panzhao on 2017/12/7.
 */
@RestController
@RequestMapping("/_geo_data")
public class GeoDataController {

    @Autowired
    GeoDataService geoDataService;

    @RequestMapping("findGeoStations")
    public Map<String, Object> findGeoStations(@RequestParam String lineCode){
        return geoDataService.findGeoStations(lineCode);
    }


    @RequestMapping("findGeoRoad")
    public Map<String, Object> findGeoRoad(@RequestParam String lineCode){
        return geoDataService.findGeoRoad(lineCode);
    }

    @RequestMapping(value = "updateBufferInfo",method = RequestMethod.POST)
    public Map<String, Object> updateBufferInfo(GeoStation station){
        return geoDataService.updateBufferInfo(station);
    }

    @RequestMapping(value = "updateStationName",method = RequestMethod.POST)
    public Map<String, Object> updateStationName(@RequestParam Map<String, Object> map){
        return geoDataService.updateStationName(map);
    }

    @RequestMapping(value = "addNewStationRoute",method = RequestMethod.POST)
    public Map<String, Object> addNewStationRoute(@RequestParam String lineCode,@RequestParam int versions,@RequestParam int upDown
            ,@RequestParam String stationName,@RequestParam Float lat,@RequestParam Float lng,@RequestParam int prevRouteId){
        return geoDataService.addNewStationRoute(lineCode, upDown, versions, stationName, lat, lng, prevRouteId);
    }

    @RequestMapping(value = "destroyStation",method = RequestMethod.POST)
    public Map<String, Object> destroyStation(GeoStation station){
        return geoDataService.destroyStation(station);
    }

    @RequestMapping(value = "updateRoadInfo",method = RequestMethod.POST)
    public Map<String, Object> updateRoadInfo(GeoRoad road){
        return geoDataService.updateRoadInfo(road);
    }
}