初始化

This commit is contained in:
李琦
2026-01-15 17:03:59 +08:00
parent 3ddd977299
commit df10ec9678
8 changed files with 188 additions and 66 deletions

View File

@@ -6,21 +6,23 @@ import (
// Post 博客文章模型
type Post struct {
ID string `json:"id"`
ID uint `json:"id"`
OriginalID string `json:"originalId,omitempty"` // For backward compatibility
Title string `json:"title"`
Category string `json:"category"`
Date time.Time `json:"date"`
Date string `json:"date"` // YYYY-MM-DD
Excerpt string `json:"excerpt"`
Content string `json:"content"`
ReadCount uint `json:"readCount"`
IsPublished int `json:"isPublished"`
IsPublished int `json:"isPublished"` // 0: draft, 1: published
Tags []Tag `json:"tags"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
// PostResponse 博客文章响应模型
type PostResponse struct {
ID string `json:"id"`
ID uint `json:"id"`
Title string `json:"title"`
Category string `json:"category"`
Date string `json:"date"`
@@ -47,11 +49,11 @@ type PostTag struct {
// PostHistory 文章历史记录模型
type PostHistory struct {
ID uint `json:"id"`
PostID string `json:"postId"`
Version uint `json:"version"`
PostID uint `json:"postId"`
Version int `json:"version"`
Title string `json:"title"`
Category string `json:"category"`
Date time.Time `json:"date"`
Date string `json:"date"`
Excerpt string `json:"excerpt"`
Content string `json:"content"`
IsPublished int `json:"isPublished"`
@@ -63,8 +65,8 @@ type PostHistory struct {
// PostHistoryResponse 文章历史记录响应模型
type PostHistoryResponse struct {
ID uint `json:"id"`
PostID string `json:"postId"`
Version uint `json:"version"`
PostID uint `json:"postId"`
Version int `json:"version"`
Title string `json:"title"`
Category string `json:"category"`
Date string `json:"date"`