98 lines
3.0 KiB
C#
98 lines
3.0 KiB
C#
using System.ComponentModel.Design;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using YD_WeChatApplet.Api.Services.Impl;
|
|
using YD_WeChatApplet.Commons.Dto.HomeWork;
|
|
using YD_WeChatApplet.Commons.Dto.Resource;
|
|
using YD_WeChatApplet.Commons.Dto.Teacher;
|
|
using YD_WeChatApplet.Services;
|
|
|
|
namespace YD_WeChatApplet.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("修改成功");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 项目列表
|
|
/// </summary>
|
|
/// <param name="gradeId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("CategoryList")]
|
|
public async Task<List<ComboBoxDto>> CategoryList(int gradeId)
|
|
{
|
|
var res = await _teacherService.CategoryList(gradeId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 数据统计接口
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("DataStatistics")]
|
|
public async Task<DataStatisticsDto> DataStatistics([FromQuery] DataStatisticsFilterDto dto)
|
|
{
|
|
var res = await _teacherService.DataStatistics(dto);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 统计接口详情
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("DataStatisticsDetails")]
|
|
public async Task<DataStatisticsDetailsDto> DataStatisticsDetails([FromQuery] DataStatisticsDetailsFilterDto dto)
|
|
{
|
|
var res = await _teacherService.DataStatisticsDetails(dto);
|
|
return res;
|
|
}
|
|
|
|
}
|
|
}
|