package com.fastbee.data.controller.gis.water;

import com.fastbee.common.core.controller.BaseController;
import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.ggroup.domain.GSiteDevice;
import com.fastbee.ggroup.domain.vo.GSiteDeviceVo;
import com.fastbee.ggroup.service.IGSiteDeviceService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/gis/site/device")
@Api(tags = "站点设备")
public class GSiteDeviceController extends BaseController {

    @Autowired
    private IGSiteDeviceService gSiteDeviceService;

    /**
     * 查询站点未关联的设备列表
     * @param siteId 站点id
     * @param groupId 设备组id
     */
    @GetMapping("/unbind")
    public AjaxResult getUnbindDeviceList(Long siteId,Long groupId) {
        List<GSiteDeviceVo> gSiteDeviceList = gSiteDeviceService.selectUnbindDeviceList(siteId,groupId);
        return AjaxResult.success(gSiteDeviceList);
    }
    /**
     * 查询站点已关联的设备列表
     * @param siteId 站点id
     * @param groupId 设备组id
     */
    @GetMapping("/bind")
    public AjaxResult getBindDeviceList(Long siteId,Long groupId) {
        List<GSiteDeviceVo> gSiteDeviceList = gSiteDeviceService.selectBindDeviceList(siteId,groupId);
        return AjaxResult.success(gSiteDeviceList);
    }
}
