liuxiaolong
2019-05-06 71af9c46c24b562acc00a71ec6c97c04eb048d9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.cloud.device.controller;
 
import com.cloud.device.model.AreaLayer;
import com.cloud.device.service.AreaLayerService;
import com.cloud.model.common.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
 
import java.awt.*;
 
@Slf4j
@Api(value="AreaLayerController", description = "地图图层管理")
@RequestMapping("/data/api-d/areaLayer")
@RestController
public class AreaLayerController {
 
    @Autowired
    private AreaLayerService areaLayerService;
 
    @PostMapping("/save")
    @ApiOperation(value = "添加地图图层", notes="添加地图图层", httpMethod = "POST", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name="areaName", value ="地图图层名称,必填",required = true, dataType = "String", paramType = "query")
    })
    public Result save(@RequestBody AreaLayer arealayer) {
        try {
            return Result.ok("保存成功",areaLayerService.save(arealayer));
        }catch (Exception e){
            log.error(e.getLocalizedMessage());
            return Result.error(e);
        }
    }
}