xiangpei
2024-08-21 e9dd07a6eec753511aec755e1d1ee5344f06a194
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.ycl.platform.controller;
 
import com.ycl.platform.domain.form.PlatformForm;
import com.ycl.platform.domain.query.PlatformQuery;
import com.ycl.platform.service.PlatformService;
import com.ycl.system.Result;
import com.ycl.system.domain.group.Add;
import com.ycl.system.domain.group.Update;
import jakarta.validation.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import lombok.RequiredArgsConstructor;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
/**
 * 平台运行监控 前端控制器
 *
 * @author xp
 * @since 2024-08-15
 */
@Validated
@RequiredArgsConstructor
@Api(value = "平台运行监控", tags = "平台运行监控管理")
@RestController
@RequestMapping("/platform")
public class PlatformController {
 
    private final PlatformService platformService;
 
    @PostMapping
    @ApiOperation(value = "添加", notes = "添加")
    @PreAuthorize("@ss.hasPermi('platform:add')")
    public Result add(@RequestBody @Validated(Add.class) PlatformForm form) {
        return platformService.add(form);
    }
 
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
    @PreAuthorize("@ss.hasPermi('platform:edit')")
    public Result update(@RequestBody @Validated(Update.class) PlatformForm form) {
        return platformService.update(form);
    }
 
    @DeleteMapping("/{id}")
    @ApiOperation(value = "ID删除", notes = "ID删除")
    @PreAuthorize("@ss.hasPermi('platform:del')")
    public Result removeById(@PathVariable("id") String id) {
        return platformService.removeById(id);
    }
 
    @DeleteMapping("/batch")
    @ApiOperation(value = "批量删除", notes = "批量删除")
    @PreAuthorize("@ss.hasPermi('platform:del:batch')")
    public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) {
        return platformService.remove(ids);
    }
 
    @GetMapping("/page")
    @ApiOperation(value = "分页", notes = "分页")
    @PreAuthorize("@ss.hasPermi('platform:page')")
    public Result page(PlatformQuery query) {
        return platformService.page(query);
    }
 
    @GetMapping("/{id}")
    @ApiOperation(value = "详情", notes = "详情")
    @PreAuthorize("@ss.hasPermi('platform:detail')")
    public Result detail(@PathVariable("id") Integer id) {
        return platformService.detail(id);
    }
 
    @GetMapping("/list")
    @PreAuthorize("@ss.hasPermi('platform:list')")
    @ApiOperation(value = "列表", notes = "列表")
    public Result list() {
        return platformService.all();
    }
}