mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -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:
@@ -0,0 +1,40 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using DorkNet.Server.Data;
|
||||
|
||||
namespace DorkNet.Server.Controllers.API.SubscriptionSeasons;
|
||||
|
||||
[ApiController]
|
||||
public class SubscriptionSeasonsController(DorkNetDbContext db) : ControllerBase
|
||||
{
|
||||
[HttpGet("api/subscriptionseasons/v1/seasons/current")]
|
||||
public async Task<IActionResult> Current()
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
var start = new DateTime(now.Year, now.Month, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
var end = start.AddMonths(1);
|
||||
var activeSubscribers = await db.Subscriptions.CountAsync();
|
||||
var rewards = await db.StoreItems
|
||||
.Where(i => i.IsActive)
|
||||
.OrderBy(i => i.Id)
|
||||
.Take(10)
|
||||
.Select(i => new
|
||||
{
|
||||
RewardId = i.Id,
|
||||
i.Slug,
|
||||
Name = i.DisplayName,
|
||||
i.Category,
|
||||
i.ImageName,
|
||||
})
|
||||
.ToListAsync();
|
||||
return Ok(new
|
||||
{
|
||||
SeasonId = $"{start:yyyyMM}",
|
||||
Name = $"Season {start:yyyy.MM}",
|
||||
StartAt = start,
|
||||
EndAt = end,
|
||||
ActiveSubscriberCount = activeSubscribers,
|
||||
Rewards = rewards,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user