This commit is contained in:
Paul Schneider 2026-03-01 14:09:10 +00:00
commit 93f0c2d25e
3 changed files with 20 additions and 18 deletions

View file

@ -1,15 +0,0 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Yavsc.ApiControllers
{
using System.ComponentModel.DataAnnotations;
using Yavsc.Attributes.Validation;
[Authorize,Route("~/api/test")]
public class TestApiController : Controller
{
}
}

View file

@ -171,6 +171,25 @@ namespace Yavsc.Server.Helpers
return ReceiveUserFile(user, root, f.OpenReadStream(), destFileName ?? ParseFileNameFromDisposition(f.ContentDisposition), f.ContentType, CancellationToken.None); return ReceiveUserFile(user, root, f.OpenReadStream(), destFileName ?? ParseFileNameFromDisposition(f.ContentDisposition), f.ContentType, CancellationToken.None);
} }
/// <summary>
/// Modifies the user's disk usage
/// </summary>
/// <param name="user"></param>
/// <param name="root"></param>
/// <param name="inputStream"></param>
/// <param name="destFileName"></param>
/// <param name="contentType"></param>
/// <param name="token"></param>
/// <returns></returns> <summary>
///
/// </summary>
/// <param name="user"></param>
/// <param name="root"></param>
/// <param name="inputStream"></param>
/// <param name="destFileName"></param>
/// <param name="contentType"></param>
/// <param name="token"></param>
/// <returns></returns>
public static FileReceivedInfo ReceiveUserFile(this ApplicationUser user, string root, Stream inputStream, string destFileName, string contentType, CancellationToken token) public static FileReceivedInfo ReceiveUserFile(this ApplicationUser user, string root, Stream inputStream, string destFileName, string contentType, CancellationToken token)
{ {
// TODO lock user's disk usage for this scope, // TODO lock user's disk usage for this scope,

View file

@ -76,7 +76,7 @@ namespace Yavsc.Models
builder.Entity<Notification>().Property(n => n.icon).HasDefaultValue("exclam"); builder.Entity<Notification>().Property(n => n.icon).HasDefaultValue("exclam");
builder.Entity<ChatRoomAccess>().HasKey(p => new { room = p.ChannelName, user = p.UserId }); builder.Entity<ChatRoomAccess>().HasKey(p => new { room = p.ChannelName, user = p.UserId });
builder.Entity<InstrumentRating>().HasAlternateKey(i => new { Instrument = i.InstrumentId, owner = i.OwnerId }); builder.Entity<InstrumentRating>().HasAlternateKey(i => new { Instrument = i.InstrumentId, owner = i.OwnerId });
builder.Entity<BlogAttachedFile>().HasKey(i => new { i.FileId, i.PostId});
foreach (var et in builder.Model.GetEntityTypes()) foreach (var et in builder.Model.GetEntityTypes())
{ {
if (et.ClrType.GetInterface("IBaseTrackedEntity") != null) if (et.ClrType.GetInterface("IBaseTrackedEntity") != null)
@ -283,8 +283,6 @@ namespace Yavsc.Models
public DbSet<ApiResourceProperty> ApiResourceProperties { get; set; } public DbSet<ApiResourceProperty> ApiResourceProperties { get; set; }
public DbSet<ApiScopeClaim> ApiScopeClaims { get; set; } public DbSet<ApiScopeClaim> ApiScopeClaims { get; set; }
public DbSet<ApiScopeProperty> ApiScopeProperties { get; set; } public DbSet<ApiScopeProperty> ApiScopeProperties { get; set; }
public DbSet<BlogAttachedFile> blogAttachedFiles { get; set; }
public DbSet<UploadedFile> UploadedFiles { get; set; }
} }
} }