entity_type2property

package
v0.0.0-...-4f702ff Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityName = "entityType2Property"
	TableName  = "entity_type2property"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityType2Property

type EntityType2Property struct {
	EntityTypeID uint                    `gorm:"type:bigint not null REFERENCES \"entity_type\"(id);primaryKey" json:"entityTypeId"`
	PropertyID   uint                    `gorm:"type:bigint not null REFERENCES \"property\"(id);primaryKey" json:"propertyId"`
	IsDependent  bool                    `gorm:"type:boolean not null default false;primaryKey;" json:"isDependent"`
	EntityType   *entity_type.EntityType `json:"entityType"`
	CreatedAt    time.Time               `json:"createdAt"`
}

EntityType2Property ...

func New

func New() *EntityType2Property

New func is a constructor for the EntityType

func (*EntityType2Property) TableName

func (e *EntityType2Property) TableName() string

type IService

IService encapsulates usecase logic.

func NewService

func NewService(logger log.Logger, repo Repository) IService

NewService creates a new service.

type Repository

type Repository interface {
	SetDefaultConditions(conditions *selection_condition.SelectionCondition)
	// Get returns the album with the specified album ID.
	Get(ctx context.Context, id uint) (*EntityType2Property, error)
	First(ctx context.Context, entity *EntityType2Property) (*EntityType2Property, error)
	// Query returns the list of albums with the given offset and limit.
	Query(ctx context.Context, cond *selection_condition.SelectionCondition) ([]EntityType2Property, error)
	QueryTx(ctx context.Context, tx *gorm.DB, cond *selection_condition.SelectionCondition) ([]EntityType2Property, error)
	QueryWithEntityType(ctx context.Context, cond *selection_condition.SelectionCondition) ([]EntityType2Property, error)
	Count(ctx context.Context, cond *selection_condition.SelectionCondition) (int64, error)
	Create(ctx context.Context, entity *EntityType2Property) error
	CreateTx(ctx context.Context, tx *gorm.DB, entity *EntityType2Property) error
	Delete(ctx context.Context, entity *EntityType2Property) error
	DeleteTx(ctx context.Context, tx *gorm.DB, entity *EntityType2Property) error
}

Repository encapsulates the logic to access albums from the data source.

Jump to

Keyboard shortcuts

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