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));
|
}
|
|
|
|
}
|