package com.elephant.framework.galaxy.aroad.module.szgl.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.szgl.entity.SpdwVideo;
import com.elephant.framework.galaxy.aroad.module.szgl.service.SpdwVideoService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;

import java.net.URLDecoder;
import java.net.URLEncoder;


/**
 * 实时监控_日照
 *
 * @author Xingyuyang
 * @date 2019-06-03 18:15:02
 */
@RestController
@AllArgsConstructor
@RequestMapping("/szgl/spdwvideo")
public class SpdwVideoController extends BaseController  {

  private final  SpdwVideoService spdwVideoService;

  /**
   * 分页查询
   * @param page 分页对象
   * @param spdwVideo 实时监控_日照
   * @return
   */
  @GetMapping("/page")
  public R getSpdwVideoPage(Page page, SpdwVideo spdwVideo) {
    return  new R<>(spdwVideoService.page(page,Wrappers.query(spdwVideo)));
  }

	/**
	 * 通过监控名称查询实时监控_日照
	 * @param spname string
	 * @return R
	 */
	@GetMapping("/rzbyname")
	public SpdwVideo RZByName(@RequestParam("spname") String spname){
		spname = spname.replace("\"","");
		return spdwVideoService.RZByName(spname);
	}

}
