package com.xhkjedu.sstudy.controller.resource;

import com.xhkjedu.sstudy.model.resource.TGuide;
import com.xhkjedu.sstudy.model.resource.TGuideGroup;
import com.xhkjedu.sstudy.service.resource.GuideGroupService;
import com.xhkjedu.sstudy.vo.resource.GuideGroupVo;
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;

/**
 * @author ywx
 * @classname TGuideGroupController
 * @description 
 * @date 2020/6/2 17:01
 **/
@RestController
@RequestMapping("/guide_group")
public class GuideGroupController {
    @Resource
    private GuideGroupService guideGroupService;

    @PostMapping("/analyze")
    public ResultVo analyze(@RequestBody TGuideGroup tGuideGroup) {
        N_Utils.validation(new Object[]{tGuideGroup.getGuideid(),"预习id",1});
        List<GuideGroupVo> list = guideGroupService.findAll(tGuideGroup);
        return new ResultVo(0,"导学分析成功",list);
    }

    @PostMapping("/analyze2")
    public ResultVo analyze2(@RequestBody TGuide guide) {
        N_Utils.validation(new Object[]{guide.getGuideid(), "预习id", 1
                , guide.getCreateid(), "教师id", 1, guide.getSchoolid(), "学校id", 1});
        List list = guideGroupService.findAll2(guide);
        return new ResultVo(0, "导学分析成功", list);
    }
}
