This commit is contained in:
2025-10-25 12:17:08 +08:00
parent 85794f13a4
commit e21f9e6d1a
2 changed files with 72 additions and 72 deletions

View File

@@ -11,99 +11,99 @@ info (
type ( type (
PingReq {} PingReq {}
PingResp { PingResp {
ok bool `json:"ok"` OK bool `json:"ok"` // Indicates if the server is healthy
} }
) )
type ( type (
UploadPresignedURLReq { UploadPresignedURLReq {
file_name string `json:"file_name"` // Original file name FileName string `json:"fileName"` // Name of the file to be uploaded
} }
UploadPresignedURLResp { UploadPresignedURLResp {
url string `json:"url"` // Presigned URL for upload Url string `json:"url"` // Presigned URL for uploading the file
file_key string `json:"file_key"` // Key to identify the uploaded file FileKey string `json:"fileKey"` // Unique key to identify the uploaded file
expire_at int64 `json:"expire_at"` // Expiration timestamp ExpireAt int64 `json:"expireAt"` // Timestamp when the presigned URL expires
} }
) )
type ( type (
DownloadPresignedURLReq { DownloadPresignedURLReq {
file_key string `json:"file_key"` // Key to identify the file to download FileKey string `json:"fileKey"` // Unique key of the file to be downloaded
} }
DownloadPresignedURLResp { DownloadPresignedURLResp {
url string `json:"url"` // Presigned URL for download Url string `json:"url"` // Presigned URL for downloading the file
expire_at int64 `json:"expire_at"` // Expiration timestamp ExpireAt int64 `json:"expireAt"` // Timestamp when the presigned URL expires
} }
) )
type ( type (
CreatePostReq { CreatePostReq {
title string `json:"title"` Title string `json:"title"` // Title of the blog post
content string `json:"content"` Content string `json:"content"` // Content/body of the blog post
cover_image_key string `json:"cover_image_key"` CoverImageKey string `json:"coverImageKey"` // Key of the cover image file (optional)
} }
CreatePostResp { CreatePostResp {
post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the created post
} }
) )
type ( type (
EditPostReq { EditPostReq {
post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post to edit
title string `json:"title"` Title string `json:"title"` // New title of the blog post
content string `json:"content"` Content string `json:"content"` // New content/body of the blog post
cover_image_key string `json:"cover_image_key"` CoverImageKey string `json:"coverImageKey"` // New key of the cover image file (optional)
} }
EditPostResp {} EditPostResp {}
) )
type ( type (
DeletePostReq { DeletePostReq {
post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post to delete
} }
DeletePostResp {} DeletePostResp {}
) )
type ( type (
GetPostReq { GetPostReq {
post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post to retrieve
} }
GetPostResp { GetPostResp {
post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post
title string `json:"title"` Title string `json:"title"` // Title of the blog post
content string `json:"content"` Content string `json:"content"` // Content/body of the blog post
cover_image_url string `json:"cover_image_url"` CoverImageUrl string `json:"coverImageUrl"` // URL of the cover image (if exists)
created_at int64 `json:"created_at"` CreatedAt int64 `json:"createdAt"` // Timestamp when the post was created
updated_at int64 `json:"updated_at"` UpdatedAt int64 `json:"updatedAt"` // Timestamp when the post was last updated
} }
) )
type ( type (
ListPostsReq { ListPostsReq {
page int `json:"page"` Page int `json:"page"` // Page number for pagination (1-based)
page_size int `json:"page_size"` PageSize int `json:"pageSize"` // Number of posts per page
} }
ListPostsResp { ListPostsResp {
posts []ListPostsRespPosts `json:"posts"` Posts []ListPostsRespPosts `json:"posts"` // Array of blog posts
total_count int `json:"total_count"` TotalCount int `json:"totalCount"` // Total number of posts available
} }
ListPostsRespPosts { ListPostsRespPosts {
post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post
title string `json:"title"` Title string `json:"title"` // Title of the blog post
cover_image_url string `json:"cover_image_url"` CoverImageUrl string `json:"coverImageUrl"` // URL of the cover image (if exists)
created_at int64 `json:"created_at"` CreatedAt int64 `json:"createdAt"` // Timestamp when the post was created
updated_at int64 `json:"updated_at"` UpdatedAt int64 `json:"updatedAt"` // Timestamp when the post was last updated
} }
) )
type ( type (
ListTagsReq {} ListTagsReq {}
ListTagsResp { ListTagsResp {
tags []ListTagsRespTags `json:"tags"` Tags []ListTagsRespTags `json:"tags"` // Array of blog tags
} }
ListTagsRespTags { ListTagsRespTags {
tag_id string `json:"tag_id"` TagId string `json:"tagId"` // Unique identifier of the tag
tag_name string `json:"tag_name"` TagName string `json:"tagName"` // Name of the tag
} }
) )

View File

@@ -4,97 +4,97 @@
package types package types
type CreatePostReq struct { type CreatePostReq struct {
Title string `json:"title"` Title string `json:"title"` // Title of the blog post
Content string `json:"content"` Content string `json:"content"` // Content/body of the blog post
Cover_image_key string `json:"cover_image_key"` CoverImageKey string `json:"coverImageKey"` // Key of the cover image file (optional)
} }
type CreatePostResp struct { type CreatePostResp struct {
Post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the created post
} }
type DeletePostReq struct { type DeletePostReq struct {
Post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post to delete
} }
type DeletePostResp struct { type DeletePostResp struct {
} }
type DownloadPresignedURLReq struct { type DownloadPresignedURLReq struct {
File_key string `json:"file_key"` // Key to identify the file to download FileKey string `json:"fileKey"` // Unique key of the file to be downloaded
} }
type DownloadPresignedURLResp struct { type DownloadPresignedURLResp struct {
Url string `json:"url"` // Presigned URL for download Url string `json:"url"` // Presigned URL for downloading the file
Expire_at int64 `json:"expire_at"` // Expiration timestamp ExpireAt int64 `json:"expireAt"` // Timestamp when the presigned URL expires
} }
type EditPostReq struct { type EditPostReq struct {
Post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post to edit
Title string `json:"title"` Title string `json:"title"` // New title of the blog post
Content string `json:"content"` Content string `json:"content"` // New content/body of the blog post
Cover_image_key string `json:"cover_image_key"` CoverImageKey string `json:"coverImageKey"` // New key of the cover image file (optional)
} }
type EditPostResp struct { type EditPostResp struct {
} }
type GetPostReq struct { type GetPostReq struct {
Post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post to retrieve
} }
type GetPostResp struct { type GetPostResp struct {
Post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post
Title string `json:"title"` Title string `json:"title"` // Title of the blog post
Content string `json:"content"` Content string `json:"content"` // Content/body of the blog post
Cover_image_url string `json:"cover_image_url"` CoverImageUrl string `json:"coverImageUrl"` // URL of the cover image (if exists)
Created_at int64 `json:"created_at"` CreatedAt int64 `json:"createdAt"` // Timestamp when the post was created
Updated_at int64 `json:"updated_at"` UpdatedAt int64 `json:"updatedAt"` // Timestamp when the post was last updated
} }
type ListPostsReq struct { type ListPostsReq struct {
Page int `json:"page"` Page int `json:"page"` // Page number for pagination (1-based)
Page_size int `json:"page_size"` PageSize int `json:"pageSize"` // Number of posts per page
} }
type ListPostsResp struct { type ListPostsResp struct {
Posts []ListPostsRespPosts `json:"posts"` Posts []ListPostsRespPosts `json:"posts"` // Array of blog posts
Total_count int `json:"total_count"` TotalCount int `json:"totalCount"` // Total number of posts available
} }
type ListPostsRespPosts struct { type ListPostsRespPosts struct {
Post_id string `json:"post_id"` PostId string `json:"postId"` // Unique identifier of the post
Title string `json:"title"` Title string `json:"title"` // Title of the blog post
Cover_image_url string `json:"cover_image_url"` CoverImageUrl string `json:"coverImageUrl"` // URL of the cover image (if exists)
Created_at int64 `json:"created_at"` CreatedAt int64 `json:"createdAt"` // Timestamp when the post was created
Updated_at int64 `json:"updated_at"` UpdatedAt int64 `json:"updatedAt"` // Timestamp when the post was last updated
} }
type ListTagsReq struct { type ListTagsReq struct {
} }
type ListTagsResp struct { type ListTagsResp struct {
Tags []ListTagsRespTags `json:"tags"` Tags []ListTagsRespTags `json:"tags"` // Array of blog tags
} }
type ListTagsRespTags struct { type ListTagsRespTags struct {
Tag_id string `json:"tag_id"` TagId string `json:"tagId"` // Unique identifier of the tag
Tag_name string `json:"tag_name"` TagName string `json:"tagName"` // Name of the tag
} }
type PingReq struct { type PingReq struct {
} }
type PingResp struct { type PingResp struct {
Ok bool `json:"ok"` OK bool `json:"ok"` // Indicates if the server is healthy
} }
type UploadPresignedURLReq struct { type UploadPresignedURLReq struct {
File_name string `json:"file_name"` // Original file name FileName string `json:"fileName"` // Name of the file to be uploaded
} }
type UploadPresignedURLResp struct { type UploadPresignedURLResp struct {
Url string `json:"url"` // Presigned URL for upload Url string `json:"url"` // Presigned URL for uploading the file
File_key string `json:"file_key"` // Key to identify the uploaded file FileKey string `json:"fileKey"` // Unique key to identify the uploaded file
Expire_at int64 `json:"expire_at"` // Expiration timestamp ExpireAt int64 `json:"expireAt"` // Timestamp when the presigned URL expires
} }