package com.sandu.ximon.admin.controller;
|
|
import com.sandu.common.domain.ResponseVO;
|
import com.sandu.common.util.ResponseUtil;
|
import com.sandu.ximon.admin.service.InterphoneHostSubService;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Map;
|
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/v1/hostBind")
|
public class InterphoneHostSubController {
|
|
private final InterphoneHostSubService interphoneHostSubService;
|
|
@PostMapping("/bind")
|
public ResponseVO<Object> bind(@RequestBody Map map) {
|
Integer hostId = (Integer) map.get("hostId");
|
Integer subId = (Integer) map.get("subId");
|
return ResponseUtil.success(interphoneHostSubService.bindHostSub(hostId, subId));
|
}
|
|
@PostMapping("/unbind/{subId}")
|
public ResponseVO<Object> unbind(@PathVariable Integer subId) {
|
return ResponseUtil.success(interphoneHostSubService.unbindHostSub(subId));
|
}
|
}
|