models swagger docs

This commit is contained in:
Vladimir V Maksimov
2025-11-07 18:09:04 +03:00
parent 72b757d196
commit 80e8b2e9c2
2 changed files with 27 additions and 14 deletions

View File

@@ -6,13 +6,16 @@ import (
"github.com/google/uuid"
)
// Document — логическая сущность (например, пользователь, настройки и т.п.)
// Document документ в системе
// @Description Document — контейнер, объединяющий версии и снапшоты.
// @Description Сам по себе не содержит данных (они находятся в версиях и снапшотах).
// swagger:model Document
type Document struct {
ID uuid.UUID `gorm:"type:char(36);primaryKey"`
Name string
CreatedAt time.Time
UpdatedAt time.Time
LatestVersion uuid.UUID `gorm:"type:char(36);"`
ID uuid.UUID `json:"id" gorm:"type:char(36);primaryKey" example:"550e8400-e29b-41d4-a716-446655440000"`
Name string `json:"name" example:"My Document"`
CreatedAt time.Time `json:"created_at" example:"2025-01-02T15:04:05Z"`
UpdatedAt time.Time `json:"updated_at" example:"2025-01-02T15:04:05Z"`
LatestVersion uuid.UUID `json:"latest_version" gorm:"type:char(36);" example:"c3e474u0-e29b-41d4-a716-446655440000"`
}
func (s *Document) TableName() (res string) {