petite factorisation

This commit is contained in:
Paul Schneider 2026-06-20 18:43:01 +01:00
commit b2a35b60ce
9 changed files with 26 additions and 32 deletions

View file

@ -1,17 +1,15 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Yavsc.Models;
using Yavsc.Models.Blog;
using Yavsc.Server.Exceptions;
using Yavsc.Server.Helpers;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Blogs.Controllers
{
[Authorize("BlogScope")]
[Produces("application/json")]
[Route("api/blog")]
[Route(APIPrefix + "/blog")]
public class BlogApiController : Controller
{

View file

@ -6,10 +6,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Yavsc.Models;
using Yavsc.Models.Blog;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Blogs.Controllers
{
[Produces("application/json")]
[Route("api/blogtags")]
[Route(APIPrefix + "/blogtags")]
public class BlogTagsApiController : Controller
{
private readonly ApplicationDbContext _context;

View file

@ -2,17 +2,16 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.Models.Blog;
using Yavsc.Server.Helpers;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Blogs.Controllers
{
[Authorize]
[Produces("application/json")]
[Route("api/blogcomments")]
[Route(APIPrefix + "/blogcomments")]
public class CommentsApiController : Controller
{
private readonly ApplicationDbContext _context;

View file

@ -2,6 +2,7 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Blogs.Controllers
{
@ -12,7 +13,7 @@ namespace Yavsc.Blogs.Controllers
using Yavsc.Abstract.Helpers;
using Yavsc.Server.Models.FileSystem;
[Authorize,Route("api/fs")]
[Authorize,Route(APIPrefix + "/fs")]
public partial class FileSystemApiController : Controller
{
readonly ApplicationDbContext dbContext;

View file

@ -9,10 +9,11 @@ using Yavsc.Models.Messaging;
using Yavsc.Services;
using Microsoft.AspNetCore.SignalR;
using Yavsc.Server.Helpers;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Blogs.Controllers
{
[Authorize, Route("api/stream")]
[Authorize, Route(APIPrefix + "/stream")]
public partial class FileSystemStreamController : Controller
{
private readonly ILogger logger;

View file

@ -1,19 +1,15 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Blogs.Controllers
{
using System.Security.Claims;
using Microsoft.EntityFrameworkCore;
using Models;
using Yavsc.Helpers;
using Yavsc.Models.Blog;
using Yavsc.Server.Helpers;
[Produces("application/json")]
[Route("~/api/PostTagsApi")]
[Route(APIPrefix + "/PostTagsApi")]
public class PostTagsApiController : Controller
{
private ApplicationDbContext _context;

View file

@ -1,17 +1,16 @@
using Microsoft.AspNetCore.Mvc;
using Yavsc.Models;
using static Yavsc.Blogs.Constants;
namespace Yavsc.Controllers
{
using System.Security.Claims;
using Microsoft.EntityFrameworkCore;
using Models.Relationship;
using Yavsc.Helpers;
using Yavsc.Server.Helpers;
[Produces("application/json")]
[Route("api/TagsApi")]
[Route(APIPrefix + "/TagsApi")]
public class TagsApiController : Controller
{
private ApplicationDbContext _context;