燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2024-11-13 2f55cebbad3dea187a5f91d16ec80a9677dab699
src/main/java/com/yssh/controller/LocationController.java
@@ -1,5 +1,6 @@
package com.yssh.controller;
import com.yssh.utils.CacheUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -20,13 +21,6 @@
import javax.annotation.Resource;
/**
 * @author wMeng
 * @ClassName YsshLocationController
 * @Description YsshLocationController
 * @date 2022/10/30 13:21
 * @Version 1.0
 */
@Api(tags="厂区热点点位")
@RestController
@RequestMapping("/location")
@@ -39,7 +33,7 @@
    @GetMapping("/query")
    public Result query(
            @RequestParam(value = "name", required = false) String name,
            @RequestParam(value = "type", required = true) String type) {
            @RequestParam(value = "type", required = false) String type) {
        List<Location> data = locationService.query(name, type);
        return Result.OK(data);
    }
@@ -48,10 +42,16 @@
    @GetMapping("/list")
    @ApiOperation(value = "查询所有点位数据", notes = "查询所有厂区热点点位数据")
    public Result list() {
        List<Location> list = locationService.getAll();
        //List<Location> list = locationService.getAll();
        String key = "locationService.getAll";
        List<Location> list = CacheUtils.getListByKey(key);
        if (null == list) {
            list = locationService.getAll();
            CacheUtils.putListByKey(key, list);
        }
        return Result.OK(list);
    }
    @ApiOperation(value = "新增点位数据", notes = "新增点位详情数据")
    @PostMapping