YD_XinWei.Api/Server/YD_XinWei/Controllers/StudentController.cs
2025-01-13 21:06:59 +08:00

46 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Mvc;
using YD_XinWei.Api.Services.Interface;
using YD_XinWei.Commons.Dto.School;
namespace YD_XinWei.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>
/// <param name="teacherPhoneNo"></param>
/// <returns></returns>
[HttpGet("ClassListbyTeacher")]
public async Task<List<ClassListDto>> ClassListbyTeacher(string teacherPhoneNo)
{
var res = await _studentService.ClassListbyTeacher(teacherPhoneNo);
return res;
}
/// <summary>
/// 获取学生列表
/// </summary>
/// <param name="classId"></param>
/// <returns></returns>
[HttpGet("StudentListByClassId")]
public async Task<List<StudentListDto>> StudentListByClassId(int classId)
{
var res = await _studentService.StudentListByClassId(classId);
return res;
}
}
}