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

@@ -64,6 +64,49 @@ type (
DeletePostResp {}
)
type (
GetPostReq {
post_id string `json:"post_id"`
}
GetPostResp {
post_id string `json:"post_id"`
title string `json:"title"`
content string `json:"content"`
cover_image_url string `json:"cover_image_url"`
created_at int64 `json:"created_at"`
updated_at int64 `json:"updated_at"`
}
)
type (
ListPostsReq {
page int `json:"page"`
page_size int `json:"page_size"`
}
ListPostsResp {
posts []ListPostsRespPosts `json:"posts"`
total_count int `json:"total_count"`
}
ListPostsRespPosts {
post_id string `json:"post_id"`
title string `json:"title"`
cover_image_url string `json:"cover_image_url"`
created_at int64 `json:"created_at"`
updated_at int64 `json:"updated_at"`
}
)
type (
ListTagsReq {}
ListTagsResp {
tags []ListTagsRespTags `json:"tags"`
}
ListTagsRespTags {
tag_id string `json:"tag_id"`
tag_name string `json:"tag_name"`
}
)
@server (
prefix: /api/blog
)
@@ -76,6 +119,32 @@ service Blog {
get /ping (PingReq) returns (PingResp)
}
@server (
prefix: /api/blog/view
)
service Blog {
@doc (
summary: "Get a blog post by ID"
description: "Get a blog post by ID"
)
@handler GetPostHandler
post /post (GetPostReq) returns (GetPostResp)
@doc (
summary: "Get a list of blog posts"
description: "Get a list of blog posts with pagination"
)
@handler ListPostsHandler
post /posts (ListPostsReq) returns (ListPostsResp)
@doc (
summary: "Get a list of blog tags"
description: "Get a list of blog tags"
)
@handler ListTagsHandler
post /tags (ListTagsReq) returns (ListTagsResp)
}
@server (
middleware: SuperAdminAuthMiddleware
prefix: /api/blog/post
@@ -105,7 +174,7 @@ service Blog {
@server (
middleware: SuperAdminAuthMiddleware
prefix: /api/blog
prefix: /api/blog/file
)
service Blog {
@doc (
@@ -113,13 +182,13 @@ service Blog {
description: "Get presigned URL for file upload"
)
@handler UploadPresignedURLHandler
post /file/upload (UploadPresignedURLReq) returns (UploadPresignedURLResp)
post /upload (UploadPresignedURLReq) returns (UploadPresignedURLResp)
@doc (
summary: "Get presigned URL for file download"
description: "Get presigned URL for file download"
)
@handler DownloadPresignedURLHandler
post /file/download (DownloadPresignedURLReq) returns (DownloadPresignedURLResp)
post /download (DownloadPresignedURLReq) returns (DownloadPresignedURLResp)
}