mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
0779aa8439
- 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.
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using DorkNet.Server.Auth;
|
|
using DorkNet.Server.Data;
|
|
|
|
namespace DorkNet.Server.Controllers.API.ProgressionEvents;
|
|
|
|
[ApiController]
|
|
public class ProgressionEventsController(DorkNetDbContext db) : ControllerBase
|
|
{
|
|
[HttpGet("api/progressionEvents")]
|
|
[Authorize]
|
|
public async Task<IActionResult> Progress()
|
|
{
|
|
var me = this.RequireCurrentPlayerId();
|
|
var rows = await db.ObjectiveProgress
|
|
.Where(o => o.PlayerId == me && o.Key.StartsWith("progressionEvent:"))
|
|
.OrderByDescending(o => o.ClearedAt)
|
|
.Take(100)
|
|
.Select(o => new
|
|
{
|
|
EventKey = o.Key,
|
|
o.IsCompleted,
|
|
o.ClearedAt,
|
|
})
|
|
.ToListAsync();
|
|
return Ok(rows);
|
|
}
|
|
|
|
[HttpGet("api/progressionEvents/active")]
|
|
[AllowAnonymous]
|
|
public IActionResult Active()
|
|
{
|
|
var start = DateTime.UtcNow.Date.AddDays(-(int)DateTime.UtcNow.DayOfWeek);
|
|
var end = start.AddDays(7);
|
|
return Ok(new
|
|
{
|
|
EventKey = $"weekly:{start:yyyyMMdd}",
|
|
Name = "Weekly Progression",
|
|
StartAt = start,
|
|
EndAt = end,
|
|
Active = true,
|
|
});
|
|
}
|
|
}
|