package org.dromara.system.controller.common;


import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.AjaxResult;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.FormalTeacherClass;
import org.dromara.system.service.common.IAppletService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**小程序公共接口
 * @Author: tjf
 * @Date: 2023/5/25 11:46
 * @Describe:
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/applet")
public class AppletController extends BaseController {

    private final IAppletService appletService;

    /**
     * 准备下课
     */
    @PostMapping("/xiaKe")
    public R<Void> xiake( @RequestBody FormalTeacherClass formalTeacherClass)
    {
     return    appletService.xiake(formalTeacherClass);
    }

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

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

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

}
