package com.community.huiju.controller;


import com.community.huiju.common.base.BaseController;
import com.community.huiju.common.base.ResponseBean;
import com.community.huiju.service.ITpEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 设备表 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-05-16
 */
@RestController
@RequestMapping("/")
@Api(value = "设备 API", description = "设备 API")
public class TpEquipmentController extends BaseController {

    @Autowired
    private ITpEquipmentService iTpEquipmentService;


    @ApiOperation(value = "获取监控列表数据 HLS",notes = "根据小区ID获取")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path",dataTypeClass = Integer.class, name = "communityId",value = "小区ID"),
            @ApiImplicitParam(paramType = "query",dataTypeClass = Integer.class,name = "pageNo",value = "第几页"),
            @ApiImplicitParam(paramType = "query",dataTypeClass = Integer.class,name = "pageSize",value = "一页多少行"),
            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "appid", value = "appid"),
            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "datetime", value = "时间戳"),
            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "encrypt", value = "加密方式"),
            @ApiImplicitParam(dataTypeClass = String.class, paramType = "query", name = "sign", value = "签名"),
    })
    @RequestMapping(value = "/equipment/monitoring/{communityId}",method = RequestMethod.GET)
    public ResponseBean getListHLS(@PathVariable("communityId") Integer communityId,
                                   @RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
                                   @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize) {

        ResponseBean responseBean = new ResponseBean();
        responseBean = iTpEquipmentService.getMonitoringByCommunityId(communityId, pageNo, pageSize);
        return responseBean;
    }


}
