- Defined all 8 data models (Page, Widget, Bookmark, Note, TagAssociation, Group, Share, Preferences) - Implemented DynamoDB table creation for all tables with proper schemas - Added GSIs for efficient querying (UserBookmarksIndex, UserNotesIndex, TagItemsIndex, UserSharesIndex) - Comprehensive test coverage for all table schemas - Updated init-db command to create all tables
21 lines
839 B
Go
21 lines
839 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Bookmark represents a link with title, URL, and optional grouping
|
|
type Bookmark struct {
|
|
ID string `dynamodbav:"bookmark_id" json:"id"`
|
|
WidgetID string `dynamodbav:"widget_id" json:"widget_id"`
|
|
UserID string `dynamodbav:"user_id" json:"user_id"`
|
|
Title string `dynamodbav:"title" json:"title"`
|
|
URL string `dynamodbav:"url" json:"url"`
|
|
GroupID *string `dynamodbav:"group_id,omitempty" json:"group_id,omitempty"`
|
|
Order int `dynamodbav:"order" json:"order"`
|
|
FaviconURL *string `dynamodbav:"favicon_url,omitempty" json:"favicon_url,omitempty"`
|
|
CreatedAt time.Time `dynamodbav:"created_at" json:"created_at"`
|
|
UpdatedAt time.Time `dynamodbav:"updated_at" json:"updated_at"`
|
|
Version int `dynamodbav:"version" json:"version"`
|
|
}
|