| | |
| | | package com.fgkj.controller.ram; |
| | | |
| | | import com.fgkj.controller.ActionUtil; |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RequestMapping("serverState") |
| | | @RestController |
| | | @Api |
| | | @Api(tags = "serverState接口") |
| | | public class Server_stateController{ |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private Server_stateService service; |
| | | |
| | | @PostMapping("/") |
| | | public ServiceModel add(@RequestBody Server_state server_state) { |
| | | // Server_state server_state = ActionUtil.getGson().fromJson(json, Server_state.class); |
| | | ServiceModel model = service.add(server_state); |
| | | @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("/") |
| | | public ServiceModel update(@RequestBody Server_state server_state) { |
| | | // Server_state server_state = ActionUtil.getGson().fromJson(json, Server_state.class); |
| | | ServiceModel model = service.update(server_state); |
| | | @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("/") |
| | | public ServiceModel delete(@RequestBody Server_state server_state) { |
| | | // Server_state server_state = ActionUtil.getGson().fromJson(json, Server_state.class); |
| | | ServiceModel model = service.delete(server_state); |
| | | @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; |
| | | } |
| | | |
| | | @GetMapping("byCondition") |
| | | public ServiceModel serchByCondition(@RequestBody Server_state server_state){ |
| | | // Server_state server_state = ActionUtil.getGson().fromJson(json, Server_state.class); |
| | | ServiceModel model = service.serchByCondition(server_state); |
| | | @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(); |
| | | |