5 小时以前 55d694aaae4e421b5e55cd941500e08f85cb5d4d
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
40
41
42
43
44
package com.ruoyi.device.controller;
 
import com.ruoyi.device.dto.DeviceAreaDto;
import com.ruoyi.device.service.IDeviceAreaService;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@Tag(name = "设备区域管理")
@RequestMapping("/device/area")
@RestController
@AllArgsConstructor
public class DeviceAreaController {
 
    private final IDeviceAreaService deviceAreaService;
 
    @Operation(summary = "查询设备区域树(含递归设备数量)")
    @GetMapping("/tree")
    public AjaxResult tree() {
        return AjaxResult.success(deviceAreaService.selectAreaTree());
    }
 
    @Operation(summary = "新增设备区域")
    @PostMapping()
    public AjaxResult add(@RequestBody DeviceAreaDto dto) {
        return deviceAreaService.addArea(dto);
    }
 
    @Operation(summary = "修改设备区域")
    @PutMapping()
    public AjaxResult update(@RequestBody DeviceAreaDto dto) {
        return deviceAreaService.updateArea(dto);
    }
 
    @Operation(summary = "删除设备区域")
    @DeleteMapping("/{ids}")
    public AjaxResult delete(@PathVariable("ids") List<Long> ids) {
        return deviceAreaService.deleteArea(ids);
    }
}