package com.fdkankan.platform.goods.controller.api;

import com.fdkankan.platform.agent.service.IVaildCamerasService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * 本地化版本获取每个公司可使用的相机
 */
@RestController
@RequestMapping("/service/platform/vaild/cameras")
public class VaildCamerasController   {

    @Autowired
    private IVaildCamerasService vaildCamerasService;

    /**
     * 获取企业可用相机列表
     * file     私钥内容
     * companyName  企业名称
     * @return
     */
    @RequestMapping(value = "/getVaildCameras")
    public HashMap<String,Object> getVaildCameras(@RequestParam (required = false) String file,
                                   @RequestParam (required = false) String companyName) throws Exception{
        return vaildCamerasService.getVaildCameras(file, companyName);
    }
    /**
     * 新增企业可用相机列表
     * macId     相机macId
     * wifiName  wifi名称
     * companyName  企业名称
     */
    @RequestMapping(value = "/addVaildCameras")
    public String addVaildCameras(@RequestParam (required = false) String macId,
                                  @RequestParam (required = false) String wifiName,
                                  @RequestParam (required = false) String companyName) throws Exception{
        return vaildCamerasService.addVaildCameras(macId,wifiName, companyName);
    }
    /**
     * 删除企业可用相机列表
     * macId     相机macId
     * companyName  企业名称
     */
    @RequestMapping(value = "/deleteVaildCameras")
    public String deleteVaildCameras(@RequestParam (required = false) String macId,
                                  @RequestParam (required = false) String companyName) throws Exception{
        return vaildCamerasService.deleteVaildCameras(macId, companyName);
    }


}
