Files
seadoc/models/document.go
Vladimir V Maksimov b2218dd198 char -> uuid
2025-11-08 12:43:30 +03:00

25 lines
950 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package models
import (
"time"
"github.com/google/uuid"
)
// Document документ в системе
// @Description Document — контейнер, объединяющий версии и снапшоты.
// @Description Сам по себе не содержит данных (они находятся в версиях и снапшотах).
// swagger:model Document
type Document struct {
ID uuid.UUID `json:"id" gorm:"type:uuid;default:gen_random_uuid();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:uuid;" example:"c3e474u0-e29b-41d4-a716-446655440000"`
}
func (s *Document) TableName() (res string) {
res = "document"
return
}