Skip to content
Snippets Groups Projects
Commit ff5c0fe7 authored by Semyon Krestyaninov's avatar Semyon Krestyaninov :dog2:
Browse files

add omitempty tags

parent 4520c8be
No related branches found
No related tags found
No related merge requests found
...@@ -118,11 +118,11 @@ type Item struct { ...@@ -118,11 +118,11 @@ type Item struct {
// - {"lang":map{...}} - установка перевода для языка // - {"lang":map{...}} - установка перевода для языка
// - {"lang":map{...}, "*":nil} - установка перевода для языка, сброс остальных переводов // - {"lang":map{...}, "*":nil} - установка перевода для языка, сброс остальных переводов
// - {"*":nil} - сброс всех переводов // - {"*":nil} - сброс всех переводов
Translations map[string]map[string]interface{} `json:"translations" bson:"translations,omitempty"` Translations map[string]map[string]interface{} `json:"translations,omitempty" bson:"translations,omitempty"`
// Список идентификаторов локалей, для которых есть переводы. // Список идентификаторов локалей, для которых есть переводы.
// Соответствует ключам в translations // Соответствует ключам в translations
TranslationsIDs []string `json:"translationsIds" bson:"translations_ids,omitempty"` TranslationsIDs []string `json:"translationsIds,omitempty" bson:"translations_ids,omitempty"`
RevisionID string `json:"revId,omitempty" bson:"revision_id"` RevisionID string `json:"revId,omitempty" bson:"revision_id"`
RevisionDescription string `json:"revDescription,omitempty" bson:"revision_description"` RevisionDescription string `json:"revDescription,omitempty" bson:"revision_description"`
...@@ -131,9 +131,9 @@ type Item struct { ...@@ -131,9 +131,9 @@ type Item struct {
// Релеватность элемента при полнотекстовом поиске // Релеватность элемента при полнотекстовом поиске
SearchScore float64 `json:"searchScore,omitempty" bson:"search_score,omitempty"` SearchScore float64 `json:"searchScore,omitempty" bson:"search_score,omitempty"`
Deleted bool `json:"deleted" bson:"deleted,omitempty"` Deleted bool `json:"deleted,omitempty" bson:"deleted,omitempty"`
Hidden bool `json:"hidden" bson:"hidden,omitempty"` Hidden bool `json:"hidden,omitempty" bson:"hidden,omitempty"`
Template bool `json:"template" bson:"template,omitempty"` Template bool `json:"template,omitempty" bson:"template,omitempty"`
} }
func NewItem(spaceID, envID, collID, id string, data map[string]interface{}, translations map[string]map[string]interface{}) *Item { func NewItem(spaceID, envID, collID, id string, data map[string]interface{}, translations map[string]map[string]interface{}) *Item {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment