57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
![]() |
using Microsoft.AspNetCore.Mvc;
|
|||
|
using YD_XinWei.Api.Services.Interface;
|
|||
|
using YD_XinWei.Commons.Dto.Teacher;
|
|||
|
|
|||
|
namespace YD_XinWei.Api.Controllers
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 老师端
|
|||
|
/// </summary>
|
|||
|
[ApiController]
|
|||
|
[ApiExplorerSettings(GroupName = "v1")]
|
|||
|
[Route("[controller]")]
|
|||
|
public class TeacherController : ControllerBase
|
|||
|
{
|
|||
|
private readonly ITeacherService _teacherService;
|
|||
|
public TeacherController(ITeacherService teacherService)
|
|||
|
{
|
|||
|
_teacherService = teacherService;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 老师个人信息
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpGet("TeacherProfile")]
|
|||
|
public async Task<TeacherProfileDto> TeacherProfile()
|
|||
|
{
|
|||
|
var res = await _teacherService.TeacherProfile();
|
|||
|
return res;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改个人信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="paramDto"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost("ModifyTeacherProfile")]
|
|||
|
public async Task<IActionResult> ModifyTeacherProfile([FromBody] TeacherProfileDto paramDto)
|
|||
|
{
|
|||
|
await _teacherService.ModifyTeacherProfile(paramDto);
|
|||
|
return Ok("修改成功");
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改密码
|
|||
|
/// </summary>
|
|||
|
/// <param name="paramDto"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost("ModifyTeacherPwd")]
|
|||
|
public async Task<IActionResult> ModifyTeacherPwd([FromBody] ModifyTeacherPwdDto paramDto)
|
|||
|
{
|
|||
|
await _teacherService.ModifyTeacherPwd(paramDto);
|
|||
|
return Ok("修改成功");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|