update
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 52s

This commit is contained in:
2025-10-25 12:09:12 +08:00
parent b05f797eb1
commit 85794f13a4
9 changed files with 322 additions and 6 deletions

View File

@@ -24,6 +24,30 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
rest.WithPrefix("/api/blog"),
)
server.AddRoutes(
[]rest.Route{
{
// Get a blog post by ID
Method: http.MethodPost,
Path: "/post",
Handler: GetPostHandler(serverCtx),
},
{
// Get a list of blog posts
Method: http.MethodPost,
Path: "/posts",
Handler: ListPostsHandler(serverCtx),
},
{
// Get a list of blog tags
Method: http.MethodPost,
Path: "/tags",
Handler: ListTagsHandler(serverCtx),
},
},
rest.WithPrefix("/api/blog/view"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.SuperAdminAuthMiddleware},
@@ -58,17 +82,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
{
// Get presigned URL for file download
Method: http.MethodPost,
Path: "/file/download",
Path: "/download",
Handler: DownloadPresignedURLHandler(serverCtx),
},
{
// Get presigned URL for file upload
Method: http.MethodPost,
Path: "/file/upload",
Path: "/upload",
Handler: UploadPresignedURLHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/blog"),
rest.WithPrefix("/api/blog/file"),
)
}