Files
PnvPanel/backend/src/PnvPanel.Infrastructure/Persistence/Configurations/MediaImageConfiguration.cs
T
Leonid Pershin c2ed3240bd
CI / Backend (build + test) (push) Failing after 1m35s
CI / Frontend (lint + typecheck + build) (push) Successful in 43s
Add media image handling and related endpoints
- Introduced `MediaImage` entity to manage images for markdown in instructions and news.
- Updated `IAppDbContext` and `AppDbContext` to include `MediaImages` DbSet.
- Implemented `DeleteMediaImageFilesAsync` method in `FactoryResetCommandHandler` to remove media images during factory reset.
- Added new API endpoints for uploading and retrieving media images, enhancing markdown support.
- Updated frontend components to utilize the new `MarkdownEditor` for image uploads in instructions and news.
- Enhanced documentation to reflect the new media handling features and API specifications.
2026-07-30 04:05:01 +03:00

21 lines
710 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PnvPanel.Domain.Media;
namespace PnvPanel.Infrastructure.Persistence.Configurations;
public class MediaImageConfiguration : IEntityTypeConfiguration<MediaImage>
{
public void Configure(EntityTypeBuilder<MediaImage> builder)
{
builder.ToTable("MediaImages");
builder.HasKey(x => x.Id);
builder.Property(x => x.FileName).IsRequired().HasMaxLength(255);
builder.Property(x => x.StoredFileName).IsRequired().HasMaxLength(100);
builder.Property(x => x.ContentType).IsRequired().HasMaxLength(100);
builder.HasIndex(x => x.StoredFileName).IsUnique();
}
}