schema

package
v0.0.0-...-ae06870 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeToPb

func AttributeToPb(c Attribute) *pbsemantic.AttributeSchema

func CategoryToPb

func CategoryToPb(c Category) *pbsemantic.Category

Types

type Attribute

type Attribute interface {
	storeql.Storable

	GetValueType() value.Type
	SetValueType(value.Type)

	GetName() string
	SetName(s string)

	RetrieveCategoryId() uint64
	SetCategoryId(p uint64)

	NewData() (data.Attribute, error)
}

type Category

type Category interface {
	storeql.Storable

	GetName() string
	SetName(string)

	GetParentId() uint64
	SetParentId(uint64)
}

type CategoryBranch

type CategoryBranch struct {
	Category

	Leafs []Category
}

func (*CategoryBranch) ToPb

func (b *CategoryBranch) ToPb() *pbsemantic.Category

type CategoryTree

type CategoryTree []*CategoryBranch

func AddCategoryToTree

func AddCategoryToTree(t CategoryTree, c Category) (CategoryTree, error)

func (CategoryTree) ToPb

func (t CategoryTree) ToPb() map[uint64]*pbsemantic.Category

type MerchantCategory

type MerchantCategory struct {
	Id uint64 `json:"id,omitempty"`

	Name     string `json:"name,omitempty"`
	ParentId uint64 `json:"parent_id,omitempty"`
}

func (*MerchantCategory) GetId

func (sp *MerchantCategory) GetId() uint64

func (*MerchantCategory) GetName

func (pc *MerchantCategory) GetName() string

func (*MerchantCategory) GetParentId

func (pc *MerchantCategory) GetParentId() uint64

func (*MerchantCategory) SQLMap

func (sp *MerchantCategory) SQLMap() map[string]driver.Value

func (*MerchantCategory) SQLTable

func (sp *MerchantCategory) SQLTable() string

func (*MerchantCategory) SetId

func (sp *MerchantCategory) SetId(id uint64)

func (*MerchantCategory) SetName

func (pc *MerchantCategory) SetName(s string)

func (*MerchantCategory) SetParentId

func (pc *MerchantCategory) SetParentId(p uint64)

type ProductAttributeSchema

type ProductAttributeSchema struct {
	Id uint64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`

	ValueType value.Type `json:"value_type,omitempty"`

	CategoryId uint64 `json:"category_id,omitempty"`
}

func FindProductAttributeSchema

func FindProductAttributeSchema(ctx context.Context, db *sqlx.DB, id uint64) (*ProductAttributeSchema, error)

func (*ProductAttributeSchema) GetId

func (sp *ProductAttributeSchema) GetId() uint64

func (*ProductAttributeSchema) GetName

func (pc *ProductAttributeSchema) GetName() string

func (*ProductAttributeSchema) GetValueType

func (pc *ProductAttributeSchema) GetValueType() value.Type

func (*ProductAttributeSchema) NewData

func (pc *ProductAttributeSchema) NewData() (data.Attribute, error)

func (*ProductAttributeSchema) RetrieveCategoryId

func (pc *ProductAttributeSchema) RetrieveCategoryId() uint64

func (*ProductAttributeSchema) SQLMap

func (sp *ProductAttributeSchema) SQLMap() map[string]driver.Value

func (*ProductAttributeSchema) SQLTable

func (sp *ProductAttributeSchema) SQLTable() string

func (*ProductAttributeSchema) SetCategoryId

func (pc *ProductAttributeSchema) SetCategoryId(p uint64)

func (*ProductAttributeSchema) SetId

func (sp *ProductAttributeSchema) SetId(id uint64)

func (*ProductAttributeSchema) SetName

func (pc *ProductAttributeSchema) SetName(s string)

func (*ProductAttributeSchema) SetValueType

func (pc *ProductAttributeSchema) SetValueType(v value.Type)

type ProductCategory

type ProductCategory struct {
	Id uint64 `json:"id,omitempty"`

	Name     string `json:"name,omitempty"`
	ParentId uint64 `json:"parent_id,omitempty"`
}

func (*ProductCategory) GetId

func (sp *ProductCategory) GetId() uint64

func (*ProductCategory) GetName

func (pc *ProductCategory) GetName() string

func (*ProductCategory) GetParentId

func (pc *ProductCategory) GetParentId() uint64

func (*ProductCategory) SQLMap

func (sp *ProductCategory) SQLMap() map[string]driver.Value

func (*ProductCategory) SQLTable

func (sp *ProductCategory) SQLTable() string

func (*ProductCategory) SetId

func (sp *ProductCategory) SetId(id uint64)

func (*ProductCategory) SetName

func (pc *ProductCategory) SetName(s string)

func (*ProductCategory) SetParentId

func (pc *ProductCategory) SetParentId(p uint64)

type ServiceProviderAttributeSchema

type ServiceProviderAttributeSchema struct {
	Id uint64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`

	ValueType value.Type `json:"value_type,omitempty"`

	CategoryId uint64 `json:"category_id,omitempty"`
}

func FindServiceProviderAttributeSchema

func FindServiceProviderAttributeSchema(ctx context.Context, db *sqlx.DB, id uint64) (*ServiceProviderAttributeSchema, error)

func (*ServiceProviderAttributeSchema) GetId

func (*ServiceProviderAttributeSchema) GetName

func (pc *ServiceProviderAttributeSchema) GetName() string

func (*ServiceProviderAttributeSchema) GetValueType

func (pc *ServiceProviderAttributeSchema) GetValueType() value.Type

func (*ServiceProviderAttributeSchema) NewData

func (*ServiceProviderAttributeSchema) RetrieveCategoryId

func (pc *ServiceProviderAttributeSchema) RetrieveCategoryId() uint64

func (*ServiceProviderAttributeSchema) SQLMap

func (*ServiceProviderAttributeSchema) SQLTable

func (sp *ServiceProviderAttributeSchema) SQLTable() string

func (*ServiceProviderAttributeSchema) SetCategoryId

func (pc *ServiceProviderAttributeSchema) SetCategoryId(p uint64)

func (*ServiceProviderAttributeSchema) SetId

func (sp *ServiceProviderAttributeSchema) SetId(id uint64)

func (*ServiceProviderAttributeSchema) SetName

func (pc *ServiceProviderAttributeSchema) SetName(s string)

func (*ServiceProviderAttributeSchema) SetValueType

func (pc *ServiceProviderAttributeSchema) SetValueType(v value.Type)

type ServiceProviderCategory

type ServiceProviderCategory struct {
	Id uint64 `json:"id,omitempty"`

	Name         string `json:"name,omitempty"`
	ParentId     uint64 `json:"parent_id,omitempty"`
	MaxVolWeight uint64 `json:"max_vol_weight,omitempty"`
}

func (*ServiceProviderCategory) GetId

func (sp *ServiceProviderCategory) GetId() uint64

func (*ServiceProviderCategory) GetName

func (pc *ServiceProviderCategory) GetName() string

func (*ServiceProviderCategory) GetParentId

func (pc *ServiceProviderCategory) GetParentId() uint64

func (*ServiceProviderCategory) SQLMap

func (sp *ServiceProviderCategory) SQLMap() map[string]driver.Value

func (*ServiceProviderCategory) SQLTable

func (sp *ServiceProviderCategory) SQLTable() string

func (*ServiceProviderCategory) SetId

func (sp *ServiceProviderCategory) SetId(id uint64)

func (*ServiceProviderCategory) SetName

func (pc *ServiceProviderCategory) SetName(s string)

func (*ServiceProviderCategory) SetParentId

func (pc *ServiceProviderCategory) SetParentId(p uint64)

Jump to

Keyboard shortcuts

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