
* Update to .net8.0 LTS (closes #271) * Add ARM docker container support (closes #245) * Library updates (closes #260 and #261) * Database updates to support changes in the latest IGDB client version * Version number will no longer be displayed when built from source
65 lines
2.1 KiB
C#
65 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Security.Cryptography;
|
|
using System.Threading.Tasks;
|
|
using gaseous_server.Classes;
|
|
using gaseous_signature_parser.models.RomSignatureObject;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Asp.Versioning;
|
|
|
|
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
|
|
namespace gaseous_server.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("api/v{version:apiVersion}/[controller]/[action]")]
|
|
[ApiVersion("1.0")]
|
|
[ApiVersion("1.1")]
|
|
[Authorize]
|
|
public class SignaturesController : Controller
|
|
{
|
|
/// <summary>
|
|
/// Get the current signature counts from the database
|
|
/// </summary>
|
|
/// <returns>Number of sources, publishers, games, and rom signatures in the database</returns>
|
|
[MapToApiVersion("1.0")]
|
|
[MapToApiVersion("1.1")]
|
|
[HttpGet]
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
public Models.Signatures_Status Status()
|
|
{
|
|
return new Models.Signatures_Status();
|
|
}
|
|
|
|
[MapToApiVersion("1.0")]
|
|
[MapToApiVersion("1.1")]
|
|
[HttpGet]
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
public List<gaseous_server.Models.Signatures_Games> GetSignature(string md5 = "", string sha1 = "")
|
|
{
|
|
SignatureManagement signatureManagement = new SignatureManagement();
|
|
return signatureManagement.GetSignature(md5, sha1);
|
|
}
|
|
|
|
[MapToApiVersion("1.0")]
|
|
[MapToApiVersion("1.1")]
|
|
[HttpGet]
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
public List<gaseous_server.Models.Signatures_Games> GetByTosecName(string TosecName = "")
|
|
{
|
|
if (TosecName.Length > 0)
|
|
{
|
|
SignatureManagement signatureManagement = new SignatureManagement();
|
|
return signatureManagement.GetByTosecName(TosecName);
|
|
} else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|