47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using YD_WeChatApplet.Commons.Dto;
|
|
using YD_WeChatApplet.Commons.Dto.HomeWork;
|
|
using YD_WeChatApplet.Commons.Dto.School;
|
|
using YD_WeChatApplet.Services;
|
|
|
|
namespace YD_WeChatApplet.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 学生
|
|
/// </summary>
|
|
[ApiController]
|
|
[ApiExplorerSettings(GroupName = "v1")]
|
|
[Route("[controller]")]
|
|
public class StudentController : ControllerBase
|
|
{
|
|
private readonly IStudentService _studentService;
|
|
public StudentController(IStudentService studentService)
|
|
{
|
|
_studentService = studentService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取班级列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet("ClassListbyTeacher")]
|
|
public async Task<List<ClassListDto>> ClassListbyTeacher()
|
|
{
|
|
var res = await _studentService.ClassListbyTeacher();
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取学生列表
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("StudentListByClassId")]
|
|
public async Task<PageDataDto<StudentListDto>> StudentListByClassId(StudentListByClassIdDto dto)
|
|
{
|
|
var res = await _studentService.StudentListByClassId(dto);
|
|
return res;
|
|
}
|
|
}
|
|
}
|