diff --git a/DysonNetwork.Sphere/Post/AccountHelperClient.cs b/DysonNetwork.Sphere/Post/AccountHelperClient.cs
deleted file mode 100644
index e69de29..0000000
diff --git a/DysonNetwork.Sphere/Post/PostCategorySubController.cs b/DysonNetwork.Sphere/Post/PostCategorySubController.cs
new file mode 100644
index 0000000..2084370
--- /dev/null
+++ b/DysonNetwork.Sphere/Post/PostCategorySubController.cs
@@ -0,0 +1,44 @@
+using DysonNetwork.Shared.Models;
+using DysonNetwork.Shared.Proto;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+
+namespace DysonNetwork.Sphere.Post;
+
+[Route(("/api/categories"))]
+[ApiController]
+public class PostCategorySubController(AppDatabase db) : ControllerBase
+{
+ ///
+ /// Get all subscriptions of categories and tags for the current user
+ ///
+ /// List of active subscription
+ [HttpGet("subscriptions")]
+ [Authorize]
+ public async Task>> ListCategoriesSubscription(
+ [FromQuery] int offset = 0,
+ [FromQuery] int take = 20
+ )
+ {
+ if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
+ var accountId = Guid.Parse(currentUser.Id);
+
+ var pubQuery = db.PostCategorySubscriptions
+ .Include(ps => ps.Tag)
+ .Include(ps => ps.Category)
+ .Where(ps => ps.AccountId == accountId)
+ .OrderByDescending(ps => ps.CreatedAt)
+ .AsQueryable();
+
+ var totalCount = await pubQuery.CountAsync();
+ var subscriptions = await pubQuery
+ .Take(take)
+ .Skip(offset)
+ .ToListAsync();
+
+ Response.Headers["X-Total"] = totalCount.ToString();
+
+ return Ok(subscriptions);
+ }
+}
\ No newline at end of file
diff --git a/DysonNetwork.Sphere/Publisher/PublisherSubscriptionController.cs b/DysonNetwork.Sphere/Publisher/PublisherSubscriptionController.cs
index b656fc3..b1a4c19 100644
--- a/DysonNetwork.Sphere/Publisher/PublisherSubscriptionController.cs
+++ b/DysonNetwork.Sphere/Publisher/PublisherSubscriptionController.cs
@@ -115,36 +115,4 @@ public class PublisherSubscriptionController(
return Ok(subscriptions);
}
-
- ///
- /// Get all subscriptions of categories and tags for the current user
- ///
- /// List of active subscription
- [HttpGet("subscriptions/categories")]
- [Authorize]
- public async Task>> ListCategoriesSubscription(
- [FromQuery] int offset = 0,
- [FromQuery] int take = 20
- )
- {
- if (HttpContext.Items["CurrentUser"] is not Account currentUser) return Unauthorized();
- var accountId = Guid.Parse(currentUser.Id);
-
- var pubQuery = db.PostCategorySubscriptions
- .Include(ps => ps.Tag)
- .Include(ps => ps.Category)
- .Where(ps => ps.AccountId == accountId)
- .OrderByDescending(ps => ps.CreatedAt)
- .AsQueryable();
-
- var totalCount = await pubQuery.CountAsync();
- var subscriptions = await pubQuery
- .Take(take)
- .Skip(offset)
- .ToListAsync();
-
- Response.Headers["X-Total"] = totalCount.ToString();
-
- return Ok(subscriptions);
- }
}
\ No newline at end of file