adding new mindforge applications
All checks were successful
Mindforge API Build and Deploy / Build Mindforge API Image (push) Successful in 1m8s
Mindforge Cronjob Build and Deploy / Build Mindforge Cronjob Image (push) Successful in 1m19s
Mindforge API Build and Deploy / Deploy Mindforge API (internal) (push) Successful in 11s
Mindforge Cronjob Build and Deploy / Deploy Mindforge Cronjob (internal) (push) Successful in 10s
Mindforge Web Build and Deploy (internal) / Build Mindforge Web Image (push) Successful in 2m25s
Mindforge Web Build and Deploy (internal) / Deploy Mindforge Web (internal) (push) Successful in 12s

This commit is contained in:
2026-03-20 22:51:04 -03:00
parent 36e405a9a8
commit 3e09b03753
55 changed files with 4164 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Mindforge.API.Exceptions;
using Mindforge.API.Models.Requests;
using Mindforge.API.Services.Interfaces;
namespace Mindforge.API.Controllers
{
[ApiController]
[Route("api/v1/file")]
public class FileController : ControllerBase
{
private readonly IFileService _fileService;
public FileController(IFileService fileService)
{
_fileService = fileService;
}
[HttpPost("check")]
public async Task<IActionResult> CheckFile([FromBody] FileCheckRequest request)
{
if (string.IsNullOrWhiteSpace(request.FileContent) || string.IsNullOrWhiteSpace(request.CheckType))
{
throw new UserException("FileContent and CheckType are required.");
}
try
{
var base64Bytes = Convert.FromBase64String(request.FileContent);
request.FileContent = System.Text.Encoding.UTF8.GetString(base64Bytes);
}
catch (FormatException)
{
throw new UserException("FileContent must be a valid base64 string.");
}
var response = await _fileService.CheckFileAsync(request);
return Ok(new { result = response });
}
}
}