package com.sandu.ximon.admin.controller;
|
|
import com.sandu.common.domain.ResponseVO;
|
import com.sandu.common.util.ResponseUtil;
|
import com.sandu.ximon.admin.param.InterphoneHostParam;
|
import com.sandu.ximon.admin.service.InterphoneHostService;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/v1/interphone/host")
|
public class InterphoneHostController {
|
|
private final InterphoneHostService interphoneHostService;
|
|
/**
|
* 新增主机
|
*
|
* @param interphoneHostParam
|
* @return
|
*/
|
@PostMapping("/add")
|
public ResponseVO<Object> addHost(@RequestBody InterphoneHostParam interphoneHostParam) {
|
return ResponseUtil.success(interphoneHostService.addHost(interphoneHostParam));
|
}
|
|
/**
|
* 修改主机
|
*/
|
@PostMapping("/update/{id}")
|
public ResponseVO<Object> updateHost(@PathVariable Integer id, @RequestBody InterphoneHostParam interphoneHostParam) {
|
return ResponseUtil.success(interphoneHostService.updateHost(id, interphoneHostParam));
|
}
|
|
/**
|
* 删除主机
|
*/
|
@PostMapping("/delete/{id}")
|
public ResponseVO<Object> deleteHost(@PathVariable Integer id) {
|
return ResponseUtil.success(interphoneHostService.deleteHost(id));
|
}
|
|
/**
|
* 主机详情
|
*/
|
@GetMapping("/detail/{id}")
|
public ResponseVO<Object> detailHost(@PathVariable Integer id) {
|
return ResponseUtil.success(interphoneHostService.getHost(id));
|
}
|
|
/**
|
* 删除主机
|
*/
|
@GetMapping("/getList")
|
public ResponseVO<Object> getInterphoneHostList(@PathVariable String keyword) {
|
return ResponseUtil.success(interphoneHostService.getInterphoneHostList(keyword));
|
}
|
|
|
}
|