//package com.yuchen.sass.park.service.controller.sensor;
//
//import com.alibaba.fastjson.JSON;
//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
//import com.thinkunion.smart.park.core.api.vo.ResponseVo;
//import com.yuchen.sass.park.api.vo.park.DeviceEventVo;
//import com.yuchen.sass.park.service.service.SoundLightService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.nest.springwrap.core.tool.api.R;
//import org.nest.springwrap.core.tool.utils.Func;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.util.HashMap;
//import java.util.Map;
//
//@RestController
//@AllArgsConstructor
//@RequestMapping("/soundLight")
//@Api(value = "声光报警器状态", tags = "声光报警器状态")
//public class SoundLightController {
//   @Autowired
//   SoundLightService soundLightService;
//
//   @Resource
//   private PushService pushService;
//    /**
//     * 详情
//     */
//    @PostMapping("/soundLightOpenOrClose")
//    @ApiOperationSupport(order = 1)
//    @ApiOperation(value = "详情", notes = "传入电话号码信息")
//    public R<ResponseVo> soundLightOpenOrClose(@RequestBody Map<String, Object> body) {
//        ResponseVo responseVo = soundLightService.soundLightOpenOrClose(body);
//        if("10000".equals(responseVo.getCode())) {
//            Map<String, Object> respData = (Map<String, Object>)responseVo.getData();
//            if(Func.isNotEmpty(respData)
//                    && "200".equals(respData.get("code"))) { // 保存成功
//                DeviceEventVo deviceEventVo = new DeviceEventVo();
//                deviceEventVo.setParkId("5012e");
//                deviceEventVo.setEquipmentName("声光报警器");
//                deviceEventVo.setProduct("");
//                Map<String,Object> value = new HashMap<>();
//                value.put("value","1");
//                deviceEventVo.setOut(value);
//                deviceEventVo.setPosition("");
//                deviceEventVo.setLevel(1);
//                deviceEventVo.setLevelName("一级报警");
//                deviceEventVo.setRemark("声光报警");
//                deviceEventVo.setIdentify("anti_theft_state");
//                deviceEventVo.setProductKey("bw63z6jt04p5RRTt");
//                deviceEventVo.setDeviceName("abx0cMSr48XTN6w3");
//                deviceEventVo.setEventTime(System.currentTimeMillis());
//                pushService.postEvent("",JSON.toJSONString(deviceEventVo));
//            }
//        }
//        return R.data(responseVo);
//    }
//}
