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