feat: add a 200 result schema
This commit is contained in:
@ -48,7 +48,6 @@ public class AuthController(IOptionsSnapshot<Admin> user, IOptionsSnapshot<Gener
|
||||
|
||||
[HttpGet("OAuth2")]
|
||||
[BadRequestResponse]
|
||||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
|
||||
[Produces("text/html")]
|
||||
[MaintenanceModeIgnore]
|
||||
public async Task<ContentResult> OAuth2([FromQuery] string code, [FromQuery] string state)
|
||||
|
@ -40,7 +40,7 @@ public class ImportController(IMediator mediator, IOptionsSnapshot<GeneralConfig
|
||||
/// <returns>Excel file</returns>
|
||||
[HttpPost("ImportToExcel")]
|
||||
[Produces("application/vnd.ms-excel")]
|
||||
public async Task<IActionResult> ImportToExcel([FromBody] ScheduleRequest request)
|
||||
public async Task<FileStreamResult> ImportToExcel([FromBody] ScheduleRequest request)
|
||||
{
|
||||
var result = (await mediator.Send(new GetScheduleListQuery
|
||||
{
|
||||
@ -51,9 +51,6 @@ public class ImportController(IMediator mediator, IOptionsSnapshot<GeneralConfig
|
||||
ProfessorIds = request.Professors
|
||||
})).Schedules.ToList();
|
||||
|
||||
if (result.Count == 0)
|
||||
return NoContent();
|
||||
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
using var package = new ExcelPackage();
|
||||
var worksheet = package.Workbook.Worksheets.Add("Расписание");
|
||||
|
@ -28,7 +28,7 @@ public class SecurityController(IOptionsSnapshot<GeneralConfig> generalConfig) :
|
||||
[HttpGet("GenerateTotpQrCode")]
|
||||
[Produces("image/svg+xml")]
|
||||
[MaintenanceModeIgnore]
|
||||
public IActionResult GenerateTotpQrCode(
|
||||
public ContentResult GenerateTotpQrCode(
|
||||
[FromQuery] string totpKey,
|
||||
[FromQuery] string label,
|
||||
[FromQuery] string? backgroundColor = null,
|
||||
|
Reference in New Issue
Block a user