2021与蓝度共同重构项目,服务端
liuhaonan
2022-05-10 e2380b9138846978de9ae4295f41faa2a260800f
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
package com.sandu.ximon.admin.controller;
 
import com.sandu.common.domain.ResponseVO;
import com.sandu.common.util.ResponseUtil;
import com.sandu.ximon.admin.param.InterphoneSubParam;
import com.sandu.ximon.admin.service.InterphoneSubService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
@RestController
@AllArgsConstructor
@RequestMapping("v1/interphone/sub")
public class InterphoneSubController {
 
 
 
    private final InterphoneSubService interphoneSubService;
 
    /**
     * 新增主机
     * @param interphoneHostParam
     * @return
     */
    @PostMapping("/add")
    public ResponseVO<Object> addSub(@RequestBody InterphoneSubParam interphoneSubParam){
        return ResponseUtil.success(interphoneSubService.addSub(interphoneSubParam));
    }
 
    /**
     * 修改主机
     */
    @PostMapping("/update/{id}")
    public ResponseVO<Object> updateSub(@PathVariable Integer id, @RequestBody InterphoneSubParam interphoneSubParam){
        return ResponseUtil.success(interphoneSubService.updateSub(id,interphoneSubParam));
    }
 
    /**
     * 删除主机
     */
    @PostMapping("/delete/{id}")
    public ResponseVO<Object> deleteSub(@PathVariable Integer id){
        return ResponseUtil.success(interphoneSubService.deleteSub(id));
    }
 
    /**
     * 主机详情
     */
    @GetMapping("/detail/{id}")
    public ResponseVO<Object> detailSub(@PathVariable Integer id){
        return ResponseUtil.success(interphoneSubService.getSub(id));
    }
 
 
 
}