mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 15:08:47 -07:00
feat: Add new API controllers for progression events, room consumables, currencies, earnings distributions, screen share reports, subscription seasons, and UGC purchasables
- Implemented ProgressionEventsController to handle progression event retrieval and active events. - Created RoomConsumablesController for listing and purchasing room consumables. - Developed RoomCurrenciesController for managing room currencies, including creation, updates, and balance retrieval. - Added RoomEarningsDistributionsController to fetch earnings distribution data for rooms. - Introduced ScreenShareReportsController for reporting screen share incidents. - Established SubscriptionSeasonsController to provide current subscription season details and rewards. - Launched UgcPurchasablesController for managing user-generated content purchasables, including bulk operations. - Added new data entities for customization and room economy, including custom avatar items, room currencies, and UGC purchasables.
This commit is contained in:
@@ -74,6 +74,14 @@ public class DorkNetDbContext(DbContextOptions<DorkNetDbContext> options) : DbCo
|
||||
public DbSet<ClubSubscriptionEntity> ClubSubscriptions => Set<ClubSubscriptionEntity>();
|
||||
public DbSet<SignupCodeEntity> SignupCodes => Set<SignupCodeEntity>();
|
||||
public DbSet<PendingDeviceEntity> PendingDevices => Set<PendingDeviceEntity>();
|
||||
public DbSet<CustomAvatarItemEntity> CustomAvatarItems => Set<CustomAvatarItemEntity>();
|
||||
public DbSet<CustomAvatarItemOwnershipEntity> CustomAvatarItemOwnership => Set<CustomAvatarItemOwnershipEntity>();
|
||||
public DbSet<ItemWishlistEntity> ItemWishlists => Set<ItemWishlistEntity>();
|
||||
public DbSet<KeepsakeEntity> Keepsakes => Set<KeepsakeEntity>();
|
||||
public DbSet<RoomCurrencyEntity> RoomCurrencies => Set<RoomCurrencyEntity>();
|
||||
public DbSet<RoomCurrencyBalanceEntity> RoomCurrencyBalances => Set<RoomCurrencyBalanceEntity>();
|
||||
public DbSet<RoomCurrencyPurchaseOfferEntity> RoomCurrencyPurchaseOffers => Set<RoomCurrencyPurchaseOfferEntity>();
|
||||
public DbSet<UgcPurchasableEntity> UgcPurchasables => Set<UgcPurchasableEntity>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -679,5 +687,64 @@ public class DorkNetDbContext(DbContextOptions<DorkNetDbContext> options) : DbCo
|
||||
e.HasKey(c => new { c.RoomId, c.Channel });
|
||||
e.HasIndex(c => c.RoomId);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<CustomAvatarItemEntity>(e =>
|
||||
{
|
||||
e.HasKey(i => i.Id);
|
||||
e.HasIndex(i => i.PublicId).IsUnique();
|
||||
e.HasIndex(i => i.CreatorPlayerId);
|
||||
e.HasIndex(i => i.IsPublic);
|
||||
e.HasIndex(i => i.IsFeatured);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<CustomAvatarItemOwnershipEntity>(e =>
|
||||
{
|
||||
e.HasKey(o => o.Id);
|
||||
e.HasIndex(o => new { o.PlayerId, o.CustomAvatarItemId }).IsUnique();
|
||||
e.HasIndex(o => o.CustomAvatarItemId);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ItemWishlistEntity>(e =>
|
||||
{
|
||||
e.HasKey(w => w.Id);
|
||||
e.HasIndex(w => new { w.PlayerId, w.ItemKey, w.ItemType }).IsUnique();
|
||||
});
|
||||
|
||||
modelBuilder.Entity<KeepsakeEntity>(e =>
|
||||
{
|
||||
e.HasKey(k => k.Id);
|
||||
e.HasIndex(k => k.PlayerId);
|
||||
e.HasIndex(k => new { k.PlayerId, k.EventKey });
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RoomCurrencyEntity>(e =>
|
||||
{
|
||||
e.HasKey(c => c.Id);
|
||||
e.HasIndex(c => c.PublicId).IsUnique();
|
||||
e.HasIndex(c => c.RoomId);
|
||||
e.HasIndex(c => c.CreatorPlayerId);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RoomCurrencyBalanceEntity>(e =>
|
||||
{
|
||||
e.HasKey(b => b.Id);
|
||||
e.HasIndex(b => new { b.PlayerId, b.RoomCurrencyId }).IsUnique();
|
||||
e.HasIndex(b => b.RoomCurrencyId);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RoomCurrencyPurchaseOfferEntity>(e =>
|
||||
{
|
||||
e.HasKey(o => o.Id);
|
||||
e.HasIndex(o => o.PublicId).IsUnique();
|
||||
e.HasIndex(o => o.RoomCurrencyId);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<UgcPurchasableEntity>(e =>
|
||||
{
|
||||
e.HasKey(p => p.Id);
|
||||
e.HasIndex(p => p.PublicId).IsUnique();
|
||||
e.HasIndex(p => p.RoomId);
|
||||
e.HasIndex(p => p.CreatorPlayerId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DorkNet.Server.Data.Entities;
|
||||
|
||||
public class CustomAvatarItemEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public Guid PublicId { get; set; } = Guid.NewGuid();
|
||||
|
||||
public long CreatorPlayerId { get; set; }
|
||||
|
||||
[MaxLength(128)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(1024)]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public int Price { get; set; } = 100;
|
||||
|
||||
public int ItemType { get; set; } = 0;
|
||||
|
||||
public int BaseAvatarItemId { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string Color { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(256)]
|
||||
public string ImageName { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(256)]
|
||||
public string AssetName { get; set; } = string.Empty;
|
||||
|
||||
public bool IsPublic { get; set; }
|
||||
|
||||
public bool IsFeatured { get; set; }
|
||||
|
||||
public long CheerCount { get; set; }
|
||||
|
||||
public long PurchaseCount { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class CustomAvatarItemOwnershipEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
public long CustomAvatarItemId { get; set; }
|
||||
|
||||
public DateTime AcquiredAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class ItemWishlistEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
[MaxLength(128)]
|
||||
public string ItemKey { get; set; } = string.Empty;
|
||||
|
||||
public int ItemType { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class KeepsakeEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public long PlayerId { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string Category { get; set; } = "general";
|
||||
|
||||
[MaxLength(128)]
|
||||
public string EventKey { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(128)]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(1024)]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(256)]
|
||||
public string ImageName { get; set; } = string.Empty;
|
||||
|
||||
public DateTime EarnedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -85,6 +85,7 @@ public class InventionEntity
|
||||
|
||||
public int CheerCount { get; set; } = 0;
|
||||
public int SpawnCount { get; set; } = 0;
|
||||
public int Price { get; set; } = 0;
|
||||
|
||||
/// <summary>Soft-delete flag. When set, the row is hidden from
|
||||
/// browse / search / detail endpoints but stays in the table so
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DorkNet.Server.Data.Entities;
|
||||
|
||||
public class RoomCurrencyEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public Guid PublicId { get; set; } = Guid.NewGuid();
|
||||
public long RoomId { get; set; }
|
||||
public long CreatorPlayerId { get; set; }
|
||||
[MaxLength(64)] public string Name { get; set; } = string.Empty;
|
||||
[MaxLength(512)] public string Description { get; set; } = string.Empty;
|
||||
[MaxLength(256)] public string ImageName { get; set; } = string.Empty;
|
||||
public int DailyLimit { get; set; } = 0;
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class RoomCurrencyBalanceEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long PlayerId { get; set; }
|
||||
public long RoomCurrencyId { get; set; }
|
||||
public long Balance { get; set; }
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class RoomCurrencyPurchaseOfferEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public Guid PublicId { get; set; } = Guid.NewGuid();
|
||||
public long RoomCurrencyId { get; set; }
|
||||
[MaxLength(64)] public string Name { get; set; } = string.Empty;
|
||||
public int Amount { get; set; }
|
||||
public int Price { get; set; }
|
||||
public int CurrencyType { get; set; } = 2;
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class UgcPurchasableEntity
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public Guid PublicId { get; set; } = Guid.NewGuid();
|
||||
public long RoomId { get; set; }
|
||||
public long CreatorPlayerId { get; set; }
|
||||
[MaxLength(128)] public string Name { get; set; } = string.Empty;
|
||||
[MaxLength(1024)] public string Description { get; set; } = string.Empty;
|
||||
[MaxLength(256)] public string ImageName { get; set; } = string.Empty;
|
||||
public int Price { get; set; }
|
||||
public int CurrencyType { get; set; } = 2;
|
||||
public int ItemType { get; set; }
|
||||
public bool IsFeatured { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
@@ -47,6 +47,12 @@ public class RoomEntity
|
||||
public bool IsAGRoom { get; set; } = true;
|
||||
|
||||
public bool IsDormRoom { get; set; } = false;
|
||||
public bool IsStudioRoom { get; set; } = false;
|
||||
public bool IsRoomLinkedToRecRoomStudio { get; set; } = false;
|
||||
|
||||
[MaxLength(128)]
|
||||
public string StudioSessionId { get; set; } = string.Empty;
|
||||
|
||||
public bool CloningAllowed { get; set; } = false;
|
||||
public bool SupportsVRLow { get; set; } = true;
|
||||
public bool SupportsMobile { get; set; } = false;
|
||||
|
||||
Reference in New Issue
Block a user