using Microsoft.AspNetCore.Mvc; using Yi.Framework.Common.Models; using Yi.Framework.DTOModel.RABC.Student; using Yi.Framework.Interface.RABC; namespace Brick.IFServer.Controllers { [ApiController] [Route("[controller]")] public class StudentController : ControllerBase { private readonly ILogger _logger; private readonly IStudentService _studentService; public StudentController(ILogger logger, IStudentService studentService) { _logger = logger; _studentService = studentService; } [HttpDelete] [Route("ErrorTest")] public Result ErrorTest() { _studentService.GetError(); return Result.Success(); } /// /// Ôö /// /// /// [HttpPost] public async Task> Create(StudentCreateInput studentCreateInput) { var result = await _studentService.CreateAsync(studentCreateInput); return Result.Success().SetData(result); } /// /// ²é /// /// /// [HttpGet] [Route("{id}")] public async Task> GetById(Guid id) { var result = await _studentService.GetByIdAsync(id); return Result.Success().SetData(result); } /// /// ²é /// /// /// [HttpGet] public async Task>> GetLsit() { var result = await _studentService.GetListAsync(); return Result>.Success().SetData(result); } /// /// ɾ /// /// /// [HttpDelete] public async Task> Del(List ids) { await _studentService.DeleteAsync(ids); return Result.Success(); } /// /// ¸ü /// /// /// /// [HttpPut] [Route("{id}")] public async Task> Update(Guid id, StudentUpdateInput studentUpdateInput) { var result = await _studentService.UpdateAsync(id, studentUpdateInput); return Result.Success().SetData(result); } } }