package com.ruoyi.web.controller.common;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
import com.ruoyi.system.service.IAppletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**小程序公共接口
 * @Author: tjf
 * @Date: 2023/5/25 11:46
 * @Describe:
 */
@RestController
@RequestMapping("/applet")
public class AppletController {
    @Autowired
    private IAppletService appletService;

    /**
     * 准备下课
     */
    @PostMapping("/xiaKe")
    public AjaxResult xiake(@Validated @RequestBody FormalTeacherClass formalTeacherClass)
    {
     return    appletService.xiake(formalTeacherClass);
    }

    /**
     * 小程序首页数据
     * 共多少班级
     * 已放学 未放学
     */
    @PostMapping("/index")
    public AjaxResult index(@Validated @RequestBody FormalTeacherClass formalTeacherClass)
    {
        return  appletService.index(formalTeacherClass);
    }

    /**
     */
    @PostMapping("/indexList")
    public AjaxResult indexList(@Validated @RequestBody FormalTeacherClass formalTeacherClass)
    {
        return  appletService.indexList(formalTeacherClass);
    }

    /**
     *
     */
    @GetMapping("/pc/statistics")
    public AjaxResult pcStatistics()
    {
        return  appletService.pcStatistics();
    }

    /**
     * 家长获取下课时间
     */
    //@PostMapping("/xiaKeTime")
    public AjaxResult xiaKeTime(@Validated @RequestBody FormalTeacherClass formalTeacherClass)
    {
        return    appletService.xiaKeTime(formalTeacherClass);
    }
}
