- 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
32 lines
1.2 KiB
Go
32 lines
1.2 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// ContentFormat represents the format mode of note content
|
|
type ContentFormat string
|
|
|
|
const (
|
|
ContentFormatPlain ContentFormat = "plain"
|
|
ContentFormatRTF ContentFormat = "rtf"
|
|
ContentFormatCode ContentFormat = "code"
|
|
ContentFormatYAML ContentFormat = "yaml"
|
|
ContentFormatMarkdown ContentFormat = "markdown"
|
|
)
|
|
|
|
// Note represents a text note with rich content support
|
|
type Note struct {
|
|
ID string `dynamodbav:"note_id" json:"id"`
|
|
WidgetID string `dynamodbav:"widget_id" json:"widget_id"`
|
|
UserID string `dynamodbav:"user_id" json:"user_id"`
|
|
Title *string `dynamodbav:"title,omitempty" json:"title,omitempty"`
|
|
Content string `dynamodbav:"content" json:"content"`
|
|
ContentLocation string `dynamodbav:"content_location" json:"content_location"`
|
|
Format ContentFormat `dynamodbav:"format" json:"format"`
|
|
Language *string `dynamodbav:"language,omitempty" json:"language,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"`
|
|
}
|