Finished adding user support and ability to update specific novels or set your last read chapter

This commit is contained in:
2022-07-17 20:34:06 -04:00
parent e4529e11c0
commit b5c4146d4d
34 changed files with 589 additions and 59 deletions

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Treestar.Shared.Models.DBDomain;
using WebNovelPortalAPI.Middleware;
namespace WebNovelPortalAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class AuthorizedController : ControllerBase
{
protected int UserId
{
get
{
return (int) (HttpContext.Items[EnsureUserCreatedMiddleware.UserIdItemName] ?? 0);
}
}
public AuthorizedController()
{
}
}
}