package com.zehong.web.controller.system;

import com.zehong.common.core.domain.AjaxResult;
import com.zehong.system.domain.vo.Bx06Vo;
import com.zehong.system.service.ITEntranceGuardPersonInfoService;
import com.zehong.system.service.impl.LedserviceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api("大屏推送")
@RestController
@RequestMapping("bx")
public class Bx06Controller {
    @Autowired
    private ITEntranceGuardPersonInfoService tEntranceGuardPersonInfoService;
    @ApiOperation("测试推送")
    @PostMapping("/send")
    public AjaxResult send (@RequestBody Bx06Vo bx06Vo)throws Exception
    {
        if(bx06Vo.getContents()==null||bx06Vo.getContents().length<1){
            return AjaxResult.error("请至少发送一行数据");
        }
        if(bx06Vo.getContents().length>6){
            return AjaxResult.error("最多一次发送6行数据");
        }
        LedserviceImpl.SendProgram(bx06Vo);
        return AjaxResult.success();
    }

//    @ApiOperation("测试推送2")
//    @PostMapping("/testsend")
//    public void testsend ()throws Exception
//    {
//        tEntranceGuardPersonInfoService.send2Led();
//    }

}