package com.yonge.cooleshow.student.task;

import com.yonge.cooleshow.biz.dal.entity.StudentTotal;
import com.yonge.cooleshow.biz.dal.service.StudentService;
import com.yonge.cooleshow.biz.dal.service.StudentTotalService;
import com.yonge.cooleshow.biz.dal.service.TeacherService;
import com.yonge.cooleshow.biz.dal.service.UserOrderService;
import com.yonge.cooleshow.biz.dal.vo.StudentTotalVo;
import com.yonge.cooleshow.biz.dal.vo.TeacherTotalVo;
import com.yonge.cooleshow.common.controller.BaseController;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: liweifan
 * @Data: 2022/3/28 15:50
 */
@RestController
@RequestMapping("/task")
public class TaskController extends BaseController {
    @Autowired
    private StudentTotalService studentTotalService;
    @Autowired
    private UserOrderService userOrderService;
    /***
     * 查询所有学生统计数据
     * @author liweifan
     * @updateTime 2022/3/29 11:58
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.util.List<com.yonge.cooleshow.biz.dal.vo.StudentTotalVo>>
     */
    @GetMapping("/queryStudentTotal")
    public HttpResponseResult<List<StudentTotal>> queryStudentTotal() {
        return succeed(studentTotalService.queryStudentTotal());
    }

    /***
     * 轮询用户订单
     * @author liweifan
     * @updateTime 2022/3/29 11:58
     * @return: com.yonge.cooleshow.common.entity.HttpResponseResult<java.util.List<com.yonge.cooleshow.biz.dal.vo.StudentTotalVo>>
     */
    @GetMapping("/pollingOrder")
    public HttpResponseResult pollingOrder() {
        userOrderService.pollingOrder();
        return succeed();
    }
}
