package com.fdkankan.scene.controller;

import com.fdkankan.common.controller.BaseController;
import com.fdkankan.common.response.ResultData;
import com.fdkankan.scene.service.ISceneService;
import com.fdkankan.scene.vo.DeviceSceneParamVO;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 设备中心接口-场景模块
 */
@Log4j2
@RestController
@RequestMapping("/service/device/scene")
public class DeviceSceneController extends BaseController {

    @Autowired
    private ISceneService sceneService;

    /**
     * 获取相机场景记录
     * cameraId         相机id
     * cameraType       相机类型
     * searchKey        关键词
     * endTime          结束时间
     * startTime        开始时间
     * sceneType        0表示其他，1表示文博，2表示地产，3表示电商，4表示餐饮，5表示家居,99一件换装虚拟房源
     * @return
     */
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public ResultData getScenes(@RequestBody DeviceSceneParamVO param) throws Exception {
        return sceneService.getScenes(param);
    }

    /**
     * 删除场景
     * sceneNum     场景码
     * @return
     */
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public ResultData deleteScene(@RequestBody DeviceSceneParamVO param) throws Exception {
        return sceneService.deleteScene(param.getSceneNum());
    }


}
