model

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PropertyID the property identifier for a object
	PropertyID = "bk_property_id"
	// PropertyName the property name for a object
	PropertyName = "bk_property_name"
	// PropertyGroup the property group for a object
	PropertyGroup = "bk_property_group"
	// PropertyIndex the property index for a object
	PropertyIndex = "bk_property_index"
	// Unit the unit for a object
	Unit = "unit"
	// PlaceHolder the placeholder for the property
	PlaceHolder = "placeholder"
	// IsEditable the editable for the property
	IsEditable = "editable"
	// IsRequired  mark the property status which must be set
	IsRequired = "isrequired"
	// IsReadOnly mark the property status which can not be editable
	IsReadOnly = "isreadonly"
	// IsOnly mark the property is a key
	IsOnly = "isonly"
	// IsSystem mark the property is the system inner used
	IsSystem = "bk_issystem"
	// IsApi mark the property is the api param
	IsApi = "bk_isapi"
	// PropertyType the property type definition
	PropertyType = "bk_property_type"
	// Option the field configuration information
	Option = "option"

	// GroupID the group identifier
	GroupID = "bk_group_id"
	// GroupName the group name
	GroupName = "bk_group_name"
	// GroupIndex the group index
	GroupIndex = "bk_group_index"
	// IsDefault true is default group
	IsDefault = "bk_isdefault"

	// ObjectIcon the icon name for the object
	ObjectIcon = "bk_obj_icon"
	// ObjectID the id for the object
	ObjectID = "bk_obj_id"
	// ObjectName the name for the object
	ObjectName = "bk_obj_name"
	// IsPre mark the inner object
	IsPre = "ispre"
	// IsPaused mark the object status
	IsPaused = "bk_ispaused"
	// Position the position to draw the object in the page
	Position = "position"
	// SupplierAccount the business id
	SupplierAccount = "bk_supplier_account"
	// Description to introduced object
	Description = "description"
	// Creator the creator for the object
	Creator = "creator"
	// Modifier the last modifier
	Modifier = "modifier"

	// ClassificationID the const definition
	ClassificationID = "bk_classification_id"
	// ClassificationName the const definition
	ClassificationName = "bk_classification_name"
	// ClassificationType the const definition
	ClassificationType = "bk_classification_type"
	// ClassificationIcon the const definition
	ClassificationIcon = "bk_classification_icon"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute interface {
	IsExists() (bool, error)
	Create() error
	Update() error
	Save() error

	GetRecordID() int
	SetID(id string)
	GetID() string
	SetName(name string)
	GetName() string
	SetUnit(unit string)
	GetUnit() string
	SetPlaceholder(placeHolder string)
	GetPlaceholder() string
	SetEditable()
	SetNonEditable()
	GetEditable() bool
	SetRequired()
	SetNonRequired()
	GetRequired() bool
	SetKey(isKey bool)
	GetKey() bool
	SetOption(option interface{})
	GetOption() interface{}
	SetDescrition(des string)
	GetDescription() string

	SetType(dataType FieldDataType)
	GetType() FieldDataType
}

Attribute the interface declaration for model attribute maintence

type AttributeIterator

type AttributeIterator interface {
	Next() (Attribute, error)
	ForEach(itemCallback func(item Attribute) error) error
}

AttributeIterator the attribute iterator

type Classification

type Classification interface {
	IsExists() (bool, error)
	Create() error
	Update() error
	Save() error

	GetRecordID() int
	SetID(id string)
	GetID() string
	SetName(name string)
	GetName() string
	SetIcon(iconName string)
	GetIcon() string

	CreateModel() Model
	FindModelsLikeName(supplierAccount string, modelName string) (Iterator, error)
	FindModelsByCondition(supplierAccount string, cond common.Condition) (Iterator, error)
}

Classification the interface declaration for model classification

func CreateClassification

func CreateClassification(name string) Classification

CreateClassification create a new Classification instance

type ClassificationIterator

type ClassificationIterator interface {
	Next() (Classification, error)
	ForEach(itemCallback func(item Classification) error) error
}

ClassificationIterator the classification iterator

func FindClassificationsByCondition

func FindClassificationsByCondition(supplierAccount string, cond common.Condition) (ClassificationIterator, error)

FindClassificationsByCondition find a array of the classification by the condition

func FindClassificationsLikeName

func FindClassificationsLikeName(supplierAccount, name string) (ClassificationIterator, error)

FindClassificationsLikeName find a array of the classification by the name

type FieldDataType

type FieldDataType string

FieldDataType type definition

const (
	// FieldTypeSingleChar the single char filed type
	FieldTypeSingleChar FieldDataType = "singlechar"

	// FieldTypeLongChar the long char field type
	FieldTypeLongChar FieldDataType = "longchar"

	// FieldTypeInt the int field type
	FieldTypeInt FieldDataType = "int"

	// FieldTypeEnum the enum field type
	FieldTypeEnum FieldDataType = "enum"

	// FieldTypeDate the date field type
	FieldTypeDate FieldDataType = "date"

	// FieldTypeTime the time field type
	FieldTypeTime FieldDataType = "time"

	// FieldTypeUser the user field type
	FieldTypeUser FieldDataType = "objuser"

	// FieldTypeSingleAsst the single association
	FieldTypeSingleAsst FieldDataType = "singleasst"

	// FieldTypeMultiAsst the multi association
	FieldTypeMultiAsst FieldDataType = "multiasst"

	// FieldTypeTimeZone the timezone field type
	FieldTypeTimeZone FieldDataType = "timezone"

	// FieldTypeBool the bool type
	FieldTypeBool FieldDataType = "bool"
)

type Group

type Group interface {
	IsExists() (bool, error)
	Create() error
	Update() error
	Save() error

	SetID(id string)
	GetID() string
	SetName(name string)
	GetName() string
	SetIndex(idx int)
	GetIndex() int
	SetSupplierAccount(ownerID string)
	GetSupplierAccount() string
	SetDefault()
	SetNonDefault()
	GetDefault() bool

	GetRecordID() int

	CreateAttribute() Attribute
	FindAttributesLikeName(supplierAccount string, attributeName string) (AttributeIterator, error)
	FindAttributesByCondition(supplierAccount string, cond common.Condition) (AttributeIterator, error)
}

Group the interface declaration for model maintence

type GroupIterator

type GroupIterator interface {
	Next() (Group, error)
	ForEach(itemCallback func(item Group) error) error
}

GroupIterator the group iterator

type Iterator

type Iterator interface {
	Next() (Model, error)
	ForEach(itemCallback func(item Model) error) error
}

Iterator the model iterator

type Model

type Model interface {
	IsExists() (bool, error)
	Create() error
	Update() error
	Save() error

	SetIcon(iconName string)
	GetIcon() string
	SetID(id string)
	GetID() string
	SetName(name string)
	GetName() string

	SetPaused()
	SetNonPaused()
	Paused() bool

	SetPosition(position string)
	GetPosition() string
	SetSupplierAccount(ownerID string)
	GetSupplierAccount() string
	SetDescription(desc string)
	GetDescription() string
	SetCreator(creator string)
	GetCreator() string
	SetModifier(modifier string)
	GetModifier() string

	CreateAttribute() Attribute
	CreateGroup() Group

	Attributes() ([]Attribute, error)

	FindAttributesLikeName(attributeName string) (AttributeIterator, error)
	FindAttributesByCondition(cond common.Condition) (AttributeIterator, error)

	FindGroupsLikeName(groupName string) (GroupIterator, error)
	FindGroupsByCondition(cond common.Condition) (GroupIterator, error)
}

Model the interface declaration for model maintence

Jump to

Keyboard shortcuts

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