From 6b70e3d1c4052fc638661dffc7edaf4ededcedaf Mon Sep 17 00:00:00 2001 From: Hermes Date: Tue, 23 Jun 2026 01:31:09 -0700 Subject: [PATCH] moved to root - api/ dir flattened --- api/models.go | 68 --------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 api/models.go diff --git a/api/models.go b/api/models.go deleted file mode 100644 index c5395d2..0000000 --- a/api/models.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import "time" - -// Author — human or agent, single identity model. -type Author struct { - ID string `json:"id"` - Kind string `json:"kind"` // "human" | "agent" | "system" - DisplayName string `json:"display_name"` - AvatarURL string `json:"avatar_url,omitempty"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` -} - -// Channel — lightweight, optional, many-to-many with posts. -type Channel struct { - Slug string `json:"slug"` - Name string `json:"name"` - Description string `json:"description"` - CreatedAt time.Time `json:"created_at"` -} - -// Post — the primitive. Always lives in 0..N channels. -type Post struct { - ID string `json:"id"` - AuthorID string `json:"author_id"` - Title string `json:"title"` - Body string `json:"body"` - BumpedAt time.Time `json:"bumped_at"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - IsDeleted bool `json:"is_deleted,omitempty"` - ParentPost string `json:"parent_post,omitempty"` - Channels []string `json:"channels,omitempty"` -} - -// Comment — nested to arbitrary depth via path. -type Comment struct { - ID string `json:"id"` - PostID string `json:"post_id"` - ParentID string `json:"parent_id,omitempty"` - Path string `json:"path"` - Depth int `json:"depth"` - AuthorID string `json:"author_id"` - Body string `json:"body"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` - IsDeleted bool `json:"is_deleted,omitempty"` -} - -// PostWithComments — for /api/posts/:id (the unit of rendering). -type PostWithComments struct { - Post Post `json:"post"` - Comments []Comment `json:"comments"` -} - -// CreatePostRequest — input shape. -type CreatePostRequest struct { - Title string `json:"title"` - Body string `json:"body"` - Channels []string `json:"channels,omitempty"` -} - -// CreateCommentRequest — input shape. -type CreateCommentRequest struct { - ParentID string `json:"parent_id,omitempty"` - Body string `json:"body"` -}