package com.platform.modules.live.controller;

import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.platform.common.annotation.SysLog;
import com.platform.common.utils.R;
import com.platform.modules.live.entity.LiveSceneCheckEntity;
import com.platform.modules.live.service.LiveSceneCheckService;


/**
 * 现场审核表
 * 
 * @author TROY
 * @email 
 * @date 2019-01-19 14:50:50
 */
@RestController
@RequestMapping("/live/livescenecheck")
public class LiveSceneCheckController {
	@Autowired
	private LiveSceneCheckService liveSceneCheckService;
	
	/**
	 * 列表
	 */
	@RequestMapping("/list")
	@RequiresPermissions("live:livescenecheck:list")
	public R list(LiveSceneCheckEntity liveSceneCheck){
		List list =  liveSceneCheckService.selectList(new EntityWrapper<>(liveSceneCheck));
		return R.ok().put("list", list);
	}
	
	
	/**
	 * 信息
	 */
	@RequestMapping("/info")
	@RequiresPermissions("live:livescenecheck:info")
	public R info(Integer id){
		return R.ok().put("info", liveSceneCheckService.selectById(id));
	}
	
	/**
	 * 保存
	 */
	@SysLog("保存现场审核记录")
	@RequestMapping("/save")
	@RequiresPermissions("live:livescenecheck:save")
	public R save(LiveSceneCheckEntity liveSceneCheck,BindingResult bindingResult){
		liveSceneCheckService.save(liveSceneCheck);
		return R.ok();
	}
	
	/**
	 * 修改
	 */
	@SysLog("修改现场审核记录")
	@RequestMapping("/update")
	@RequiresPermissions("live:livescenecheck:update")
	public R update(LiveSceneCheckEntity liveSceneCheck,BindingResult bindingResult){
		liveSceneCheckService.update(liveSceneCheck);
		return R.ok();
	}
	
	/**
	 * 删除
	 */
	@SysLog("删除现场审核记录")
	@RequestMapping("/delete")
	@RequiresPermissions("live:livescenecheck:delete")
	public R delete(Integer[] ids){
		liveSceneCheckService.deleteBatch(ids);
		return R.ok();
	}
	
}
