whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
82
83
84
85
package com.fgkj.controller.ram;
 
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.ram.Server_state;
import com.fgkj.services.ram.Server_stateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RequestMapping("serverState")
@RestController
@Api(tags = "serverState接口")
public class Server_stateController{
 
    @Resource
    private Server_stateService service;
 
    @PostMapping("/")
    @ApiOperation(notes = "{\n" +
            "  \"server_version\": 0.0,\n" +
            "  \"server_datetime\": \"2021-02-22 08:15:59\",\n" +
            "  \"max_mem\": 0,\n" +
            "  \"total_mem\": 0,\n" +
            "  \"free_men\": 0,\n" +
            "  \"total_disc_space\": 0,\n" +
            "  \"free_disc_space\": 0,\n" +
            "  \"db_conn_max\": 0,\n" +
            "  \"db_conn_count\": 0\n" +
            "}",value="新增")
    public ServiceModel add(@RequestBody Server_state state) {
        ServiceModel model = service.add(state);
        return model;
        
    }
 
    @PutMapping("/")
    @ApiOperation(notes = "{\n" +
            "  \"server_version\": 0.0,\n" +
            "  \"server_datetime\": \"2021-02-22 08:15:59\",\n" +
            "  \"max_mem\": 0,\n" +
            "  \"total_mem\": 0,\n" +
            "  \"free_men\": 0,\n" +
            "  \"total_disc_space\": 0,\n" +
            "  \"free_disc_space\": 0,\n" +
            "  \"db_conn_max\": 0,\n" +
            "  \"db_conn_count\": 0,\n" +
            "  \"num\": 0\n" +
            "}",value="修改")
    public ServiceModel update(@RequestBody Server_state state) {
        ServiceModel model = service.update(state);
 
        return model;
    }
 
    @DeleteMapping("/")
    @ApiOperation(notes = "", value = "删除")
    public ServiceModel delete(@RequestParam Integer num) {
        Server_state state = new Server_state();
        state.setNum(num);
        ServiceModel model = service.delete(state);
 
        return model;
    }
 
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="byCondition")
     public ServiceModel serchByCondition(@RequestParam Integer num) {
        Server_state state = new Server_state();
        state.setNum(num);
         ServiceModel model = service.serchByCondition(state);
 
         return model;
    } 
 
    @GetMapping("all")
    @ApiOperation(notes = "",value="查询系统的cpu,内存使用率")
    public ServiceModel searchAll(){
         ServiceModel model = service.searchAll();
 
         return model;
    }
 
}