package com.yonge.cooleshow.student.controller;

import com.yonge.cooleshow.biz.dal.service.StudentService;
import com.yonge.cooleshow.biz.dal.service.SysUserService;
import com.yonge.cooleshow.biz.dal.wrapper.StudentIndexWrapper;
import com.yonge.cooleshow.common.controller.BaseController;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "学生首页")
@RestController
@RequestMapping("${app-config.url.student:}/index")
public class StudentIndexController extends BaseController {

    @Resource
    private SysUserService sysUserService;
    @Resource
    private StudentService studentService;


    @ApiOperation(value = "首页-数据汇总")
    @GetMapping("/summary")
    public HttpResponseResult<StudentIndexWrapper.SummaryDto> summary() {
        Long userId = sysUserService.getUserId();
        return succeed(studentService.indexSummary(userId));
    }

}
