items

package
v1.83.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemParentTypeDefault = 0
	ItemParentTypeTuning  = 1
	ItemParentTypeSport   = 2
	ItemParentTypeDesign  = 3
)
View Source
const (
	NewDays = 7
)

Variables

View Source
var (
	ErrItemNotFound = errors.New("item not found")
)

Functions

This section is empty.

Types

type Item

type Item struct {
	ID                         int64
	Catname                    string
	NameOnly                   string
	Body                       string
	ItemsCount                 int32
	NewItemsCount              int32
	ChildItemsCount            int32
	NewChildItemsCount         int32
	DescendantsCount           int32
	NewDescendantsCount        int32
	BeginYear                  int32
	EndYear                    int32
	BeginMonth                 int16
	EndMonth                   int16
	Today                      *bool
	BeginModelYear             int32
	EndModelYear               int32
	BeginModelYearFraction     string
	EndModelYearFraction       string
	SpecID                     int64
	SpecName                   string
	SpecShortName              string
	EngineItemID               int64
	ItemTypeID                 ItemType
	Description                string
	FullText                   string
	IsConcept                  bool
	IsConceptInherit           bool
	CurrentPicturesCount       int32
	ChildsCount                int32
	DescendantTwinsGroupsCount int32
	InboxPicturesCount         int32
	FullName                   string
	LogoID                     int64
	MostsActive                bool
}

type ItemLanguage added in v1.50.0

type ItemLanguage struct {
	ItemID     int64
	Language   string
	Name       string
	TextID     int64
	FullTextID int64
}

type ItemNameFormatter

type ItemNameFormatter struct{}

func (*ItemNameFormatter) FormatHTML added in v1.51.0

func (s *ItemNameFormatter) FormatHTML(item ItemNameFormatterOptions, localizer *i18n.Localizer) (string, error)

func (*ItemNameFormatter) FormatText added in v1.51.0

func (s *ItemNameFormatter) FormatText(item ItemNameFormatterOptions, localizer *i18n.Localizer) (string, error)

type ItemNameFormatterOptions

type ItemNameFormatterOptions struct {
	BeginModelYear         int32
	EndModelYear           int32
	BeginModelYearFraction string
	EndModelYearFraction   string
	Spec                   string
	SpecFull               string
	Body                   string
	Name                   string
	BeginYear              int32
	EndYear                int32
	Today                  *bool
	BeginMonth             int16
	EndMonth               int16
}

type ItemParentLanguage added in v1.49.0

type ItemParentLanguage struct {
	ItemID   int64
	ParentID int64
	Language string
	Name     string
}

type ItemPicturesOptions

type ItemPicturesOptions struct {
	TypeID        pictures.ItemPictureType
	Pictures      *PicturesOptions
	PerspectiveID int32
}

type ItemType

type ItemType int
const (
	VEHICLE   ItemType = 1
	ENGINE    ItemType = 2
	CATEGORY  ItemType = 3
	TWINS     ItemType = 4
	BRAND     ItemType = 5
	FACTORY   ItemType = 6
	MUSEUM    ItemType = 7
	PERSON    ItemType = 8
	COPYRIGHT ItemType = 9
)

type ListFields

type ListFields struct {
	NameOnly                   bool
	NameHTML                   bool
	NameDefault                bool
	Description                bool
	FullText                   bool
	HasText                    bool
	PreviewPictures            ListPreviewPicturesFields
	TotalPictures              bool
	ItemsCount                 bool
	NewItemsCount              bool
	ChildItemsCount            bool
	NewChildItemsCount         bool
	DescendantsCount           bool
	NewDescendantsCount        bool
	NameText                   bool
	CurrentPicturesCount       bool
	ChildsCount                bool
	DescendantTwinsGroupsCount bool
	InboxPicturesCount         bool
	FullName                   bool
	MostsActive                bool
	CommentsAttentionsCount    bool
}

type ListOptions

type ListOptions struct {
	Alias              string
	Language           string
	Fields             ListFields
	ItemID             int64
	ItemIDExpr         goqu.Expression
	TypeID             []ItemType
	DescendantPictures *ItemPicturesOptions
	PreviewPictures    *ItemPicturesOptions
	Limit              uint32
	Page               uint32
	OrderBy            []exp.OrderedExpression
	SortByName         bool
	ChildItems         *ListOptions
	DescendantItems    *ListOptions
	ParentItems        *ListOptions
	AncestorItems      *ListOptions
	NoParents          bool
	Catname            string
	Name               string
	IsConcept          bool
	EngineItemID       int64
	HasBeginYear       bool
	HasEndYear         bool
	HasBeginMonth      bool
	HasEndMonth        bool
}

type ListPreviewPicturesFields

type ListPreviewPicturesFields struct {
	Route   bool
	Picture ListPreviewPicturesPictureFields
}

type ListPreviewPicturesPictureFields

type ListPreviewPicturesPictureFields struct {
	NameText bool
}

type PicturesOptions

type PicturesOptions struct {
	Status      pictures.Status
	OwnerID     int64
	ItemPicture *ItemPicturesOptions
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository Main Object.

func NewRepository

func NewRepository(
	db *goqu.Database,
	mostsMinCarsCount int,
) *Repository

NewRepository constructor.

func (*Repository) AddItemVehicleType added in v1.29.0

func (s *Repository) AddItemVehicleType(ctx context.Context, itemID int64, vehicleTypeID int64) error

func (*Repository) Count

func (s *Repository) Count(ctx context.Context, options ListOptions) (int, error)

func (*Repository) CountDistinct

func (s *Repository) CountDistinct(ctx context.Context, options ListOptions) (int, error)

func (*Repository) CountSelect added in v1.65.0

func (s *Repository) CountSelect(options ListOptions) (*goqu.SelectDataset, error)

func (*Repository) Item added in v1.52.2

func (s *Repository) Item(ctx context.Context, id int64, language string, fields ListFields) (Item, error)

func (*Repository) ItemsWithPicturesCount added in v1.72.0

func (s *Repository) ItemsWithPicturesCount(
	ctx context.Context, nPictures int,
) (int32, error)

func (*Repository) LanguageList added in v1.50.0

func (s *Repository) LanguageList(ctx context.Context, itemID int64) ([]ItemLanguage, error)

func (*Repository) List

func (s *Repository) List(
	ctx context.Context, options ListOptions, pagination bool,
) ([]Item, *util.Pages, error)

func (*Repository) ParentLanguageList added in v1.49.0

func (s *Repository) ParentLanguageList(
	ctx context.Context, itemID int64, parentID int64,
) ([]ItemParentLanguage, error)

func (*Repository) RebuildCache added in v1.32.2

func (s *Repository) RebuildCache(ctx context.Context, itemID int64) (int64, error)

func (*Repository) RemoveItemVehicleType added in v1.29.0

func (s *Repository) RemoveItemVehicleType(ctx context.Context, itemID int64, vehicleTypeID int64) error

func (*Repository) Tree

func (s *Repository) Tree(ctx context.Context, id string) (*TreeItem, error)

type TreeItem

type TreeItem struct {
	ID       int64
	Name     string
	Childs   []TreeItem
	ItemType ItemType
}

Jump to

Keyboard shortcuts

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