| | |
| | | package com.yssh.controller; |
| | | |
| | | import com.yssh.utils.CacheUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author wMeng |
| | | * @ClassName YsshLocationController |
| | | * @Description YsshLocationController |
| | | * @date 2022/10/30 13:21 |
| | | * @Version 1.0 |
| | | */ |
| | | @Api(tags="厂区热点点位") |
| | | @RestController |
| | | @RequestMapping("/location") |
| | |
| | | @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); |
| | | } |
| | |
| | | @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 |