perryhsu
2020-10-17 a543f4de1c91ef6f43aace92975c6cf28de23618
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
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RequestMapping("serverState")
@RestController
@Api
public class Server_stateController{
 
    @Autowired
    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);
        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);
 
        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);
 
        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);
 
         return model;
    } 
 
    @GetMapping("all")
    public ServiceModel searchAll(){
         ServiceModel model = service.searchAll();
 
         return model;
    }
 
}