package com.xhkjedu.slive.controller.xz;

import com.xhkjedu.annotation.Action;
import com.xhkjedu.slive.model.xz.LXzKj;
import com.xhkjedu.slive.service.xz.XzKjService;
import com.xhkjedu.slive.vo.xz.XzDateKjVo;
import com.xhkjedu.utils.N_Utils;
import com.xhkjedu.vo.ResultVo;
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.List;

/**
 * @Description 行政直播课节详情
 * @Author WN
 * Date 2022/3/30 15:25
 **/
@RestController
@RequestMapping("/xzkj")
public class XzKjController {
    @Resource
    private XzKjService xzKjService;

    @PostMapping("/kjs")
    public ResultVo listKjsByXzid(@RequestBody LXzKj kj){
        N_Utils.validation(new Object[]{kj.getXzid(),"行政直播id",1});
        List<XzDateKjVo> rtn = xzKjService.listXzKjsByXzid(kj.getXzid());
        return new ResultVo(0,"成功获取行政直播课节详情",rtn);
    }

    /**
     * @Description 修改直播课节信息
     * @Param [kj]
     * @Return com.xhkjedu.vo.ResultVo
     * @Author wn
     * @Date 2022/3/30 17:53
     **/
    @PostMapping("/update")
    @Action("行政直播-修改课节")
    public ResultVo update(@RequestBody List<LXzKj> kjs){
       return xzKjService.updateBatch(kjs);
    }
}
