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

This commit is contained in:
2025-10-25 09:36:58 +08:00
parent 512db143fc
commit 166382ffa8
2 changed files with 19 additions and 8 deletions

View File

@@ -37,7 +37,6 @@ type (
) )
@server ( @server (
middleware: SuperAdminAuthMiddleware
prefix: /api/blog prefix: /api/blog
) )
service Blog { service Blog {
@@ -47,7 +46,13 @@ service Blog {
) )
@handler pingHandler @handler pingHandler
get /ping (PingReq) returns (PingResp) get /ping (PingReq) returns (PingResp)
}
@server (
middleware: SuperAdminAuthMiddleware
prefix: /api/blog
)
service Blog {
@doc ( @doc (
summary: "Get presigned URL for file upload" summary: "Get presigned URL for file upload"
description: "Get presigned URL for file upload" description: "Get presigned URL for file upload"

View File

@@ -12,6 +12,18 @@ import (
) )
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
// Ping the server to check if it's alive
Method: http.MethodGet,
Path: "/ping",
Handler: pingHandler(serverCtx),
},
},
rest.WithPrefix("/api/blog"),
)
server.AddRoutes( server.AddRoutes(
rest.WithMiddlewares( rest.WithMiddlewares(
[]rest.Middleware{serverCtx.SuperAdminAuthMiddleware}, []rest.Middleware{serverCtx.SuperAdminAuthMiddleware},
@@ -28,12 +40,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/file/upload", Path: "/file/upload",
Handler: UploadPresignedURLHandler(serverCtx), Handler: UploadPresignedURLHandler(serverCtx),
}, },
{
// Ping the server to check if it's alive
Method: http.MethodGet,
Path: "/ping",
Handler: pingHandler(serverCtx),
},
}..., }...,
), ),
rest.WithPrefix("/api/blog"), rest.WithPrefix("/api/blog"),