entity

package
v0.0.0-...-5789598 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Fields = fields{
	UUID:             "_id",
	FeatureUUIDs:     "feature_uuids",
	Images:           "images",
	Translations:     "translations",
	AverageTimeSpent: "average_time_spent",
	Review:           "review",
	IsActive:         "is_active",
	IsDeleted:        "is_deleted",
	IsPayed:          "is_payed",
	Restorations:     "restorations",
	UpdatedAt:        "updated_at",
	CreatedAt:        "created_at",
	Coordinates:      "coordinates",
	Type:             "type",
}
View Source
var ImageFields = imageFields{
	Url:   "url",
	Order: "order",
}
View Source
var ReviewFields = reviewFields{
	Total:        "total",
	AveragePoint: "average_point",
}
View Source
var SeoFields = seoFields{
	Title:       "title",
	Description: "description",
	Keywords:    "keywords",
}
View Source
var TimeSpentFields = timeSpentFields{
	Min: "min",
	Max: "max",
}
View Source
var TranslationFields = translationFields{
	Title:       "title",
	Description: "description",
	Slug:        "slug",
	MarkdownURL: "markdown_url",
	Seo:         "seo",
}

Functions

func ImageField

func ImageField(field string) string

func ReviewField

func ReviewField(field string) string

func TimeSpentField

func TimeSpentField(field string) string

func TranslationField

func TranslationField(lang string, field string) string

func TranslationSeoField

func TranslationSeoField(lang string, field string) string

Types

type MongoImage

type MongoImage struct {
	Url   string `bson:"url"`
	Order int16  `bson:"order"`
}

type MongoPlace

type MongoPlace struct {
	UUID             string                      `bson:"_id,omitempty"`
	FeatureUUIDs     []string                    `bson:"feature_uuids"`
	Images           []MongoImage                `bson:"images"`
	Translations     map[string]MongoTranslation `bson:"translations"`
	AverageTimeSpent MongoTimeSpent              `bson:"average_time_spent"`
	Review           MongoReview                 `bson:"review"`
	Restorations     []MongoRestoration          `bson:"restorations"`
	Coordinates      []float64                   `bson:"coordinates"`
	IsActive         bool                        `bson:"is_active"`
	IsDeleted        bool                        `bson:"is_deleted"`
	IsPayed          bool                        `bson:"is_payed"`
	Type             string                      `bson:"type"`
	UpdatedAt        time.Time                   `bson:"updated_at"`
	CreatedAt        time.Time                   `bson:"created_at"`
}

func (*MongoPlace) FromEntity

func (e *MongoPlace) FromEntity(entity *place.Entity) *MongoPlace

func (*MongoPlace) FromEntityUpdate

func (e *MongoPlace) FromEntityUpdate(entity *place.Entity) *MongoPlace

func (*MongoPlace) ToAdminListEntity

func (e *MongoPlace) ToAdminListEntity() *place.Entity

func (*MongoPlace) ToAdminViewEntity

func (e *MongoPlace) ToAdminViewEntity() *place.Entity

func (*MongoPlace) ToListEntity

func (e *MongoPlace) ToListEntity() *place.Entity

func (*MongoPlace) ToViewEntity

func (e *MongoPlace) ToViewEntity() *place.Entity

type MongoRestoration

type MongoRestoration struct {
	StartDate *time.Time `bson:"start_date"`
	EndDate   *time.Time `bson:"end_date"`
}

type MongoReview

type MongoReview struct {
	Total        int16   `bson:"total"`
	AveragePoint float32 `bson:"average_point"`
}

type MongoSeo

type MongoSeo struct {
	Title       string `bson:"title"`
	Description string `bson:"description"`
	Keywords    string `bson:"keywords"`
}

type MongoTimeSpent

type MongoTimeSpent struct {
	Min int16 `bson:"min"`
	Max int16 `bson:"max"`
}

type MongoTranslation

type MongoTranslation struct {
	Title       string   `bson:"title"`
	Description string   `bson:"description"`
	Slug        string   `bson:"slug"`
	MarkdownURL string   `bson:"markdown_url"`
	Seo         MongoSeo `bson:"seo"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL