ent

package
v0.0.0-...-22bdbfd Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeBrand         = "Brand"
	TypeCategory      = "Category"
	TypeComment       = "Comment"
	TypeProperty      = "Property"
	TypePropertyValue = "PropertyValue"
	TypeSku           = "Sku"
	TypeSpu           = "Spu"
)

Variables

View Source
var DefaultBrandOrder = Desc(brand.FieldID)

DefaultBrandOrder is the default ordering of Brand.

View Source
var DefaultCategoryOrder = Desc(category.FieldID)

DefaultCategoryOrder is the default ordering of Category.

View Source
var DefaultCommentOrder = Desc(comment.FieldID)

DefaultCommentOrder is the default ordering of Comment.

View Source
var DefaultPropertyOrder = Desc(property.FieldID)

DefaultPropertyOrder is the default ordering of Property.

View Source
var DefaultPropertyValueOrder = Desc(propertyvalue.FieldID)

DefaultPropertyValueOrder is the default ordering of PropertyValue.

View Source
var DefaultSkuOrder = Desc(sku.FieldID)

DefaultSkuOrder is the default ordering of Sku.

View Source
var DefaultSpuOrder = Desc(spu.FieldID)

DefaultSpuOrder is the default ordering of Spu.

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Brand

type Brand struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// 品牌名称
	Name string `json:"name,omitempty"`
	// 品牌图片
	PicURL string `json:"pic_url,omitempty"`
	// 品牌描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BrandQuery when eager-loading is set.
	Edges BrandEdges `json:"edges"`
	// contains filtered or unexported fields
}

Brand is the model entity for the Brand schema.

func (*Brand) QuerySpus

func (b *Brand) QuerySpus() *SpuQuery

QuerySpus queries the "spus" edge of the Brand entity.

func (*Brand) String

func (b *Brand) String() string

String implements the fmt.Stringer.

func (*Brand) Unwrap

func (b *Brand) Unwrap() *Brand

Unwrap unwraps the Brand entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Brand) Update

func (b *Brand) Update() *BrandUpdateOne

Update returns a builder for updating this Brand. Note that you need to call Brand.Unwrap() before calling this method if this Brand was returned from a transaction, and the transaction was committed or rolled back.

func (*Brand) Value

func (b *Brand) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Brand. This includes values selected through modifiers, order, etc.

type BrandClient

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

BrandClient is a client for the Brand schema.

func NewBrandClient

func NewBrandClient(c config) *BrandClient

NewBrandClient returns a client for the Brand from the given config.

func (*BrandClient) Create

func (c *BrandClient) Create() *BrandCreate

Create returns a builder for creating a Brand entity.

func (*BrandClient) CreateBulk

func (c *BrandClient) CreateBulk(builders ...*BrandCreate) *BrandCreateBulk

CreateBulk returns a builder for creating a bulk of Brand entities.

func (*BrandClient) Delete

func (c *BrandClient) Delete() *BrandDelete

Delete returns a delete builder for Brand.

func (*BrandClient) DeleteOne

func (c *BrandClient) DeleteOne(b *Brand) *BrandDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BrandClient) DeleteOneID

func (c *BrandClient) DeleteOneID(id uint64) *BrandDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*BrandClient) Get

func (c *BrandClient) Get(ctx context.Context, id uint64) (*Brand, error)

Get returns a Brand entity by its id.

func (*BrandClient) GetX

func (c *BrandClient) GetX(ctx context.Context, id uint64) *Brand

GetX is like Get, but panics if an error occurs.

func (*BrandClient) Hooks

func (c *BrandClient) Hooks() []Hook

Hooks returns the client hooks.

func (*BrandClient) Intercept

func (c *BrandClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `brand.Intercept(f(g(h())))`.

func (*BrandClient) Interceptors

func (c *BrandClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*BrandClient) MapCreateBulk

func (c *BrandClient) MapCreateBulk(slice any, setFunc func(*BrandCreate, int)) *BrandCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*BrandClient) Query

func (c *BrandClient) Query() *BrandQuery

Query returns a query builder for Brand.

func (*BrandClient) QuerySpus

func (c *BrandClient) QuerySpus(b *Brand) *SpuQuery

QuerySpus queries the spus edge of a Brand.

func (*BrandClient) Update

func (c *BrandClient) Update() *BrandUpdate

Update returns an update builder for Brand.

func (*BrandClient) UpdateOne

func (c *BrandClient) UpdateOne(b *Brand) *BrandUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BrandClient) UpdateOneID

func (c *BrandClient) UpdateOneID(id uint64) *BrandUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BrandClient) Use

func (c *BrandClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `brand.Hooks(f(g(h())))`.

type BrandCreate

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

BrandCreate is the builder for creating a Brand entity.

func (*BrandCreate) AddSpuIDs

func (bc *BrandCreate) AddSpuIDs(ids ...uint64) *BrandCreate

AddSpuIDs adds the "spus" edge to the Spu entity by IDs.

func (*BrandCreate) AddSpus

func (bc *BrandCreate) AddSpus(s ...*Spu) *BrandCreate

AddSpus adds the "spus" edges to the Spu entity.

func (*BrandCreate) Exec

func (bc *BrandCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BrandCreate) ExecX

func (bc *BrandCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BrandCreate) Mutation

func (bc *BrandCreate) Mutation() *BrandMutation

Mutation returns the BrandMutation object of the builder.

func (*BrandCreate) Save

func (bc *BrandCreate) Save(ctx context.Context) (*Brand, error)

Save creates the Brand in the database.

func (*BrandCreate) SaveX

func (bc *BrandCreate) SaveX(ctx context.Context) *Brand

SaveX calls Save and panics if Save returns an error.

func (*BrandCreate) SetCreatedAt

func (bc *BrandCreate) SetCreatedAt(t time.Time) *BrandCreate

SetCreatedAt sets the "created_at" field.

func (*BrandCreate) SetDeletedAt

func (bc *BrandCreate) SetDeletedAt(t time.Time) *BrandCreate

SetDeletedAt sets the "deleted_at" field.

func (*BrandCreate) SetDescription

func (bc *BrandCreate) SetDescription(s string) *BrandCreate

SetDescription sets the "description" field.

func (*BrandCreate) SetID

func (bc *BrandCreate) SetID(u uint64) *BrandCreate

SetID sets the "id" field.

func (*BrandCreate) SetName

func (bc *BrandCreate) SetName(s string) *BrandCreate

SetName sets the "name" field.

func (*BrandCreate) SetNillableCreatedAt

func (bc *BrandCreate) SetNillableCreatedAt(t *time.Time) *BrandCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*BrandCreate) SetNillableDeletedAt

func (bc *BrandCreate) SetNillableDeletedAt(t *time.Time) *BrandCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BrandCreate) SetNillableDescription

func (bc *BrandCreate) SetNillableDescription(s *string) *BrandCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*BrandCreate) SetNillableSort

func (bc *BrandCreate) SetNillableSort(u *uint32) *BrandCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*BrandCreate) SetNillableStatus

func (bc *BrandCreate) SetNillableStatus(u *uint8) *BrandCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*BrandCreate) SetNillableUpdatedAt

func (bc *BrandCreate) SetNillableUpdatedAt(t *time.Time) *BrandCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*BrandCreate) SetNotNilDeletedAt

func (b *BrandCreate) SetNotNilDeletedAt(value *time.Time) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetNotNilDescription

func (b *BrandCreate) SetNotNilDescription(value *string) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetNotNilName

func (b *BrandCreate) SetNotNilName(value *string) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetNotNilPicURL

func (b *BrandCreate) SetNotNilPicURL(value *string) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetNotNilSort

func (b *BrandCreate) SetNotNilSort(value *uint32) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetNotNilStatus

func (b *BrandCreate) SetNotNilStatus(value *uint8) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetNotNilUpdatedAt

func (b *BrandCreate) SetNotNilUpdatedAt(value *time.Time) *BrandCreate

set field if value's pointer is not nil.

func (*BrandCreate) SetPicURL

func (bc *BrandCreate) SetPicURL(s string) *BrandCreate

SetPicURL sets the "pic_url" field.

func (*BrandCreate) SetSort

func (bc *BrandCreate) SetSort(u uint32) *BrandCreate

SetSort sets the "sort" field.

func (*BrandCreate) SetStatus

func (bc *BrandCreate) SetStatus(u uint8) *BrandCreate

SetStatus sets the "status" field.

func (*BrandCreate) SetUpdatedAt

func (bc *BrandCreate) SetUpdatedAt(t time.Time) *BrandCreate

SetUpdatedAt sets the "updated_at" field.

type BrandCreateBulk

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

BrandCreateBulk is the builder for creating many Brand entities in bulk.

func (*BrandCreateBulk) Exec

func (bcb *BrandCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BrandCreateBulk) ExecX

func (bcb *BrandCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BrandCreateBulk) Save

func (bcb *BrandCreateBulk) Save(ctx context.Context) ([]*Brand, error)

Save creates the Brand entities in the database.

func (*BrandCreateBulk) SaveX

func (bcb *BrandCreateBulk) SaveX(ctx context.Context) []*Brand

SaveX is like Save, but panics if an error occurs.

type BrandDelete

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

BrandDelete is the builder for deleting a Brand entity.

func (*BrandDelete) Exec

func (bd *BrandDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*BrandDelete) ExecX

func (bd *BrandDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*BrandDelete) Where

func (bd *BrandDelete) Where(ps ...predicate.Brand) *BrandDelete

Where appends a list predicates to the BrandDelete builder.

type BrandDeleteOne

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

BrandDeleteOne is the builder for deleting a single Brand entity.

func (*BrandDeleteOne) Exec

func (bdo *BrandDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BrandDeleteOne) ExecX

func (bdo *BrandDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BrandDeleteOne) Where

func (bdo *BrandDeleteOne) Where(ps ...predicate.Brand) *BrandDeleteOne

Where appends a list predicates to the BrandDelete builder.

type BrandEdges

type BrandEdges struct {
	// Spus holds the value of the spus edge.
	Spus []*Spu `json:"spus,omitempty"`
	// contains filtered or unexported fields
}

BrandEdges holds the relations/edges for other nodes in the graph.

func (BrandEdges) SpusOrErr

func (e BrandEdges) SpusOrErr() ([]*Spu, error)

SpusOrErr returns the Spus value or an error if the edge was not loaded in eager-loading.

type BrandGroupBy

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

BrandGroupBy is the group-by builder for Brand entities.

func (*BrandGroupBy) Aggregate

func (bgb *BrandGroupBy) Aggregate(fns ...AggregateFunc) *BrandGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*BrandGroupBy) Bool

func (s *BrandGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) BoolX

func (s *BrandGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BrandGroupBy) Bools

func (s *BrandGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) BoolsX

func (s *BrandGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BrandGroupBy) Float64

func (s *BrandGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) Float64X

func (s *BrandGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BrandGroupBy) Float64s

func (s *BrandGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) Float64sX

func (s *BrandGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BrandGroupBy) Int

func (s *BrandGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) IntX

func (s *BrandGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BrandGroupBy) Ints

func (s *BrandGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) IntsX

func (s *BrandGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BrandGroupBy) Scan

func (bgb *BrandGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*BrandGroupBy) ScanX

func (s *BrandGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*BrandGroupBy) String

func (s *BrandGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) StringX

func (s *BrandGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BrandGroupBy) Strings

func (s *BrandGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BrandGroupBy) StringsX

func (s *BrandGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BrandMutation

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

BrandMutation represents an operation that mutates the Brand nodes in the graph.

func (*BrandMutation) AddField

func (m *BrandMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BrandMutation) AddSort

func (m *BrandMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*BrandMutation) AddSpuIDs

func (m *BrandMutation) AddSpuIDs(ids ...uint64)

AddSpuIDs adds the "spus" edge to the Spu entity by ids.

func (*BrandMutation) AddStatus

func (m *BrandMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*BrandMutation) AddedEdges

func (m *BrandMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*BrandMutation) AddedField

func (m *BrandMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BrandMutation) AddedFields

func (m *BrandMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*BrandMutation) AddedIDs

func (m *BrandMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*BrandMutation) AddedSort

func (m *BrandMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*BrandMutation) AddedStatus

func (m *BrandMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*BrandMutation) ClearDeletedAt

func (m *BrandMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BrandMutation) ClearDescription

func (m *BrandMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*BrandMutation) ClearEdge

func (m *BrandMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*BrandMutation) ClearField

func (m *BrandMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*BrandMutation) ClearSpus

func (m *BrandMutation) ClearSpus()

ClearSpus clears the "spus" edge to the Spu entity.

func (*BrandMutation) ClearStatus

func (m *BrandMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*BrandMutation) ClearedEdges

func (m *BrandMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*BrandMutation) ClearedFields

func (m *BrandMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (BrandMutation) Client

func (m BrandMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*BrandMutation) CreatedAt

func (m *BrandMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*BrandMutation) DeletedAt

func (m *BrandMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*BrandMutation) DeletedAtCleared

func (m *BrandMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*BrandMutation) Description

func (m *BrandMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*BrandMutation) DescriptionCleared

func (m *BrandMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*BrandMutation) EdgeCleared

func (m *BrandMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*BrandMutation) Field

func (m *BrandMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BrandMutation) FieldCleared

func (m *BrandMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*BrandMutation) Fields

func (m *BrandMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*BrandMutation) ID

func (m *BrandMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*BrandMutation) IDs

func (m *BrandMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*BrandMutation) Name

func (m *BrandMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*BrandMutation) OldCreatedAt

func (m *BrandMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldDeletedAt

func (m *BrandMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldDescription

func (m *BrandMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldField

func (m *BrandMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*BrandMutation) OldName

func (m *BrandMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldPicURL

func (m *BrandMutation) OldPicURL(ctx context.Context) (v string, err error)

OldPicURL returns the old "pic_url" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldSort

func (m *BrandMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldStatus

func (m *BrandMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) OldUpdatedAt

func (m *BrandMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Brand entity. If the Brand object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BrandMutation) Op

func (m *BrandMutation) Op() Op

Op returns the operation name.

func (*BrandMutation) PicURL

func (m *BrandMutation) PicURL() (r string, exists bool)

PicURL returns the value of the "pic_url" field in the mutation.

func (*BrandMutation) RemoveSpuIDs

func (m *BrandMutation) RemoveSpuIDs(ids ...uint64)

RemoveSpuIDs removes the "spus" edge to the Spu entity by IDs.

func (*BrandMutation) RemovedEdges

func (m *BrandMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*BrandMutation) RemovedIDs

func (m *BrandMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*BrandMutation) RemovedSpusIDs

func (m *BrandMutation) RemovedSpusIDs() (ids []uint64)

RemovedSpus returns the removed IDs of the "spus" edge to the Spu entity.

func (*BrandMutation) ResetCreatedAt

func (m *BrandMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BrandMutation) ResetDeletedAt

func (m *BrandMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*BrandMutation) ResetDescription

func (m *BrandMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*BrandMutation) ResetEdge

func (m *BrandMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*BrandMutation) ResetField

func (m *BrandMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*BrandMutation) ResetName

func (m *BrandMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*BrandMutation) ResetPicURL

func (m *BrandMutation) ResetPicURL()

ResetPicURL resets all changes to the "pic_url" field.

func (*BrandMutation) ResetSort

func (m *BrandMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*BrandMutation) ResetSpus

func (m *BrandMutation) ResetSpus()

ResetSpus resets all changes to the "spus" edge.

func (*BrandMutation) ResetStatus

func (m *BrandMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*BrandMutation) ResetUpdatedAt

func (m *BrandMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BrandMutation) SetCreatedAt

func (m *BrandMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*BrandMutation) SetDeletedAt

func (m *BrandMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*BrandMutation) SetDescription

func (m *BrandMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*BrandMutation) SetField

func (m *BrandMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BrandMutation) SetID

func (m *BrandMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Brand entities.

func (*BrandMutation) SetName

func (m *BrandMutation) SetName(s string)

SetName sets the "name" field.

func (*BrandMutation) SetOp

func (m *BrandMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BrandMutation) SetPicURL

func (m *BrandMutation) SetPicURL(s string)

SetPicURL sets the "pic_url" field.

func (*BrandMutation) SetSort

func (m *BrandMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*BrandMutation) SetStatus

func (m *BrandMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*BrandMutation) SetUpdatedAt

func (m *BrandMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*BrandMutation) Sort

func (m *BrandMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*BrandMutation) SpusCleared

func (m *BrandMutation) SpusCleared() bool

SpusCleared reports if the "spus" edge to the Spu entity was cleared.

func (*BrandMutation) SpusIDs

func (m *BrandMutation) SpusIDs() (ids []uint64)

SpusIDs returns the "spus" edge IDs in the mutation.

func (*BrandMutation) Status

func (m *BrandMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*BrandMutation) StatusCleared

func (m *BrandMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (BrandMutation) Tx

func (m BrandMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*BrandMutation) Type

func (m *BrandMutation) Type() string

Type returns the node type of this mutation (Brand).

func (*BrandMutation) UpdatedAt

func (m *BrandMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*BrandMutation) Where

func (m *BrandMutation) Where(ps ...predicate.Brand)

Where appends a list predicates to the BrandMutation builder.

func (*BrandMutation) WhereP

func (m *BrandMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the BrandMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type BrandPageList

type BrandPageList struct {
	List        []*Brand     `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

BrandPageList is Brand PageList result.

type BrandPager

type BrandPager struct {
	Order  brand.OrderOption
	Filter func(*BrandQuery) (*BrandQuery, error)
}

func (*BrandPager) ApplyFilter

func (p *BrandPager) ApplyFilter(query *BrandQuery) (*BrandQuery, error)

type BrandPaginateOption

type BrandPaginateOption func(*BrandPager)

BrandPaginateOption enables pagination customization.

type BrandQuery

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

BrandQuery is the builder for querying Brand entities.

func (*BrandQuery) Aggregate

func (bq *BrandQuery) Aggregate(fns ...AggregateFunc) *BrandSelect

Aggregate returns a BrandSelect configured with the given aggregations.

func (*BrandQuery) All

func (bq *BrandQuery) All(ctx context.Context) ([]*Brand, error)

All executes the query and returns a list of Brands.

func (*BrandQuery) AllX

func (bq *BrandQuery) AllX(ctx context.Context) []*Brand

AllX is like All, but panics if an error occurs.

func (*BrandQuery) Clone

func (bq *BrandQuery) Clone() *BrandQuery

Clone returns a duplicate of the BrandQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*BrandQuery) Count

func (bq *BrandQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BrandQuery) CountX

func (bq *BrandQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*BrandQuery) Exist

func (bq *BrandQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*BrandQuery) ExistX

func (bq *BrandQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*BrandQuery) First

func (bq *BrandQuery) First(ctx context.Context) (*Brand, error)

First returns the first Brand entity from the query. Returns a *NotFoundError when no Brand was found.

func (*BrandQuery) FirstID

func (bq *BrandQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Brand ID from the query. Returns a *NotFoundError when no Brand ID was found.

func (*BrandQuery) FirstIDX

func (bq *BrandQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*BrandQuery) FirstX

func (bq *BrandQuery) FirstX(ctx context.Context) *Brand

FirstX is like First, but panics if an error occurs.

func (*BrandQuery) GroupBy

func (bq *BrandQuery) GroupBy(field string, fields ...string) *BrandGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Brand.Query().
	GroupBy(brand.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BrandQuery) IDs

func (bq *BrandQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Brand IDs.

func (*BrandQuery) IDsX

func (bq *BrandQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*BrandQuery) Limit

func (bq *BrandQuery) Limit(limit int) *BrandQuery

Limit the number of records to be returned by this query.

func (*BrandQuery) Offset

func (bq *BrandQuery) Offset(offset int) *BrandQuery

Offset to start from.

func (*BrandQuery) Only

func (bq *BrandQuery) Only(ctx context.Context) (*Brand, error)

Only returns a single Brand entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Brand entity is found. Returns a *NotFoundError when no Brand entities are found.

func (*BrandQuery) OnlyID

func (bq *BrandQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Brand ID in the query. Returns a *NotSingularError when more than one Brand ID is found. Returns a *NotFoundError when no entities are found.

func (*BrandQuery) OnlyIDX

func (bq *BrandQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*BrandQuery) OnlyX

func (bq *BrandQuery) OnlyX(ctx context.Context) *Brand

OnlyX is like Only, but panics if an error occurs.

func (*BrandQuery) Order

func (bq *BrandQuery) Order(o ...brand.OrderOption) *BrandQuery

Order specifies how the records should be ordered.

func (*BrandQuery) Page

func (b *BrandQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...BrandPaginateOption,
) (*BrandPageList, error)

func (*BrandQuery) QuerySpus

func (bq *BrandQuery) QuerySpus() *SpuQuery

QuerySpus chains the current query on the "spus" edge.

func (*BrandQuery) Select

func (bq *BrandQuery) Select(fields ...string) *BrandSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Brand.Query().
	Select(brand.FieldCreatedAt).
	Scan(ctx, &v)

func (*BrandQuery) Unique

func (bq *BrandQuery) Unique(unique bool) *BrandQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*BrandQuery) Where

func (bq *BrandQuery) Where(ps ...predicate.Brand) *BrandQuery

Where adds a new predicate for the BrandQuery builder.

func (*BrandQuery) WithSpus

func (bq *BrandQuery) WithSpus(opts ...func(*SpuQuery)) *BrandQuery

WithSpus tells the query-builder to eager-load the nodes that are connected to the "spus" edge. The optional arguments are used to configure the query builder of the edge.

type BrandSelect

type BrandSelect struct {
	*BrandQuery
	// contains filtered or unexported fields
}

BrandSelect is the builder for selecting fields of Brand entities.

func (*BrandSelect) Aggregate

func (bs *BrandSelect) Aggregate(fns ...AggregateFunc) *BrandSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BrandSelect) Bool

func (s *BrandSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BrandSelect) BoolX

func (s *BrandSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BrandSelect) Bools

func (s *BrandSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BrandSelect) BoolsX

func (s *BrandSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BrandSelect) Float64

func (s *BrandSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BrandSelect) Float64X

func (s *BrandSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BrandSelect) Float64s

func (s *BrandSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BrandSelect) Float64sX

func (s *BrandSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BrandSelect) Int

func (s *BrandSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BrandSelect) IntX

func (s *BrandSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BrandSelect) Ints

func (s *BrandSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BrandSelect) IntsX

func (s *BrandSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BrandSelect) Scan

func (bs *BrandSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*BrandSelect) ScanX

func (s *BrandSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*BrandSelect) String

func (s *BrandSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BrandSelect) StringX

func (s *BrandSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BrandSelect) Strings

func (s *BrandSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BrandSelect) StringsX

func (s *BrandSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BrandUpdate

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

BrandUpdate is the builder for updating Brand entities.

func (*BrandUpdate) AddSort

func (bu *BrandUpdate) AddSort(u int32) *BrandUpdate

AddSort adds u to the "sort" field.

func (*BrandUpdate) AddSpuIDs

func (bu *BrandUpdate) AddSpuIDs(ids ...uint64) *BrandUpdate

AddSpuIDs adds the "spus" edge to the Spu entity by IDs.

func (*BrandUpdate) AddSpus

func (bu *BrandUpdate) AddSpus(s ...*Spu) *BrandUpdate

AddSpus adds the "spus" edges to the Spu entity.

func (*BrandUpdate) AddStatus

func (bu *BrandUpdate) AddStatus(u int8) *BrandUpdate

AddStatus adds u to the "status" field.

func (*BrandUpdate) ClearDeletedAt

func (bu *BrandUpdate) ClearDeletedAt() *BrandUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BrandUpdate) ClearDescription

func (bu *BrandUpdate) ClearDescription() *BrandUpdate

ClearDescription clears the value of the "description" field.

func (*BrandUpdate) ClearSpus

func (bu *BrandUpdate) ClearSpus() *BrandUpdate

ClearSpus clears all "spus" edges to the Spu entity.

func (*BrandUpdate) ClearStatus

func (bu *BrandUpdate) ClearStatus() *BrandUpdate

ClearStatus clears the value of the "status" field.

func (*BrandUpdate) Exec

func (bu *BrandUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BrandUpdate) ExecX

func (bu *BrandUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BrandUpdate) Mutation

func (bu *BrandUpdate) Mutation() *BrandMutation

Mutation returns the BrandMutation object of the builder.

func (*BrandUpdate) RemoveSpuIDs

func (bu *BrandUpdate) RemoveSpuIDs(ids ...uint64) *BrandUpdate

RemoveSpuIDs removes the "spus" edge to Spu entities by IDs.

func (*BrandUpdate) RemoveSpus

func (bu *BrandUpdate) RemoveSpus(s ...*Spu) *BrandUpdate

RemoveSpus removes "spus" edges to Spu entities.

func (*BrandUpdate) Save

func (bu *BrandUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*BrandUpdate) SaveX

func (bu *BrandUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*BrandUpdate) SetDeletedAt

func (bu *BrandUpdate) SetDeletedAt(t time.Time) *BrandUpdate

SetDeletedAt sets the "deleted_at" field.

func (*BrandUpdate) SetDescription

func (bu *BrandUpdate) SetDescription(s string) *BrandUpdate

SetDescription sets the "description" field.

func (*BrandUpdate) SetName

func (bu *BrandUpdate) SetName(s string) *BrandUpdate

SetName sets the "name" field.

func (*BrandUpdate) SetNillableDeletedAt

func (bu *BrandUpdate) SetNillableDeletedAt(t *time.Time) *BrandUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BrandUpdate) SetNillableDescription

func (bu *BrandUpdate) SetNillableDescription(s *string) *BrandUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*BrandUpdate) SetNillableSort

func (bu *BrandUpdate) SetNillableSort(u *uint32) *BrandUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*BrandUpdate) SetNillableStatus

func (bu *BrandUpdate) SetNillableStatus(u *uint8) *BrandUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*BrandUpdate) SetNotNilDeletedAt

func (b *BrandUpdate) SetNotNilDeletedAt(value *time.Time) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetNotNilDescription

func (b *BrandUpdate) SetNotNilDescription(value *string) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetNotNilName

func (b *BrandUpdate) SetNotNilName(value *string) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetNotNilPicURL

func (b *BrandUpdate) SetNotNilPicURL(value *string) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetNotNilSort

func (b *BrandUpdate) SetNotNilSort(value *uint32) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetNotNilStatus

func (b *BrandUpdate) SetNotNilStatus(value *uint8) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetNotNilUpdatedAt

func (b *BrandUpdate) SetNotNilUpdatedAt(value *time.Time) *BrandUpdate

set field if value's pointer is not nil.

func (*BrandUpdate) SetPicURL

func (bu *BrandUpdate) SetPicURL(s string) *BrandUpdate

SetPicURL sets the "pic_url" field.

func (*BrandUpdate) SetSort

func (bu *BrandUpdate) SetSort(u uint32) *BrandUpdate

SetSort sets the "sort" field.

func (*BrandUpdate) SetStatus

func (bu *BrandUpdate) SetStatus(u uint8) *BrandUpdate

SetStatus sets the "status" field.

func (*BrandUpdate) SetUpdatedAt

func (bu *BrandUpdate) SetUpdatedAt(t time.Time) *BrandUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BrandUpdate) Where

func (bu *BrandUpdate) Where(ps ...predicate.Brand) *BrandUpdate

Where appends a list predicates to the BrandUpdate builder.

type BrandUpdateOne

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

BrandUpdateOne is the builder for updating a single Brand entity.

func (*BrandUpdateOne) AddSort

func (buo *BrandUpdateOne) AddSort(u int32) *BrandUpdateOne

AddSort adds u to the "sort" field.

func (*BrandUpdateOne) AddSpuIDs

func (buo *BrandUpdateOne) AddSpuIDs(ids ...uint64) *BrandUpdateOne

AddSpuIDs adds the "spus" edge to the Spu entity by IDs.

func (*BrandUpdateOne) AddSpus

func (buo *BrandUpdateOne) AddSpus(s ...*Spu) *BrandUpdateOne

AddSpus adds the "spus" edges to the Spu entity.

func (*BrandUpdateOne) AddStatus

func (buo *BrandUpdateOne) AddStatus(u int8) *BrandUpdateOne

AddStatus adds u to the "status" field.

func (*BrandUpdateOne) ClearDeletedAt

func (buo *BrandUpdateOne) ClearDeletedAt() *BrandUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BrandUpdateOne) ClearDescription

func (buo *BrandUpdateOne) ClearDescription() *BrandUpdateOne

ClearDescription clears the value of the "description" field.

func (*BrandUpdateOne) ClearSpus

func (buo *BrandUpdateOne) ClearSpus() *BrandUpdateOne

ClearSpus clears all "spus" edges to the Spu entity.

func (*BrandUpdateOne) ClearStatus

func (buo *BrandUpdateOne) ClearStatus() *BrandUpdateOne

ClearStatus clears the value of the "status" field.

func (*BrandUpdateOne) Exec

func (buo *BrandUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BrandUpdateOne) ExecX

func (buo *BrandUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BrandUpdateOne) Mutation

func (buo *BrandUpdateOne) Mutation() *BrandMutation

Mutation returns the BrandMutation object of the builder.

func (*BrandUpdateOne) RemoveSpuIDs

func (buo *BrandUpdateOne) RemoveSpuIDs(ids ...uint64) *BrandUpdateOne

RemoveSpuIDs removes the "spus" edge to Spu entities by IDs.

func (*BrandUpdateOne) RemoveSpus

func (buo *BrandUpdateOne) RemoveSpus(s ...*Spu) *BrandUpdateOne

RemoveSpus removes "spus" edges to Spu entities.

func (*BrandUpdateOne) Save

func (buo *BrandUpdateOne) Save(ctx context.Context) (*Brand, error)

Save executes the query and returns the updated Brand entity.

func (*BrandUpdateOne) SaveX

func (buo *BrandUpdateOne) SaveX(ctx context.Context) *Brand

SaveX is like Save, but panics if an error occurs.

func (*BrandUpdateOne) Select

func (buo *BrandUpdateOne) Select(field string, fields ...string) *BrandUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*BrandUpdateOne) SetDeletedAt

func (buo *BrandUpdateOne) SetDeletedAt(t time.Time) *BrandUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*BrandUpdateOne) SetDescription

func (buo *BrandUpdateOne) SetDescription(s string) *BrandUpdateOne

SetDescription sets the "description" field.

func (*BrandUpdateOne) SetName

func (buo *BrandUpdateOne) SetName(s string) *BrandUpdateOne

SetName sets the "name" field.

func (*BrandUpdateOne) SetNillableDeletedAt

func (buo *BrandUpdateOne) SetNillableDeletedAt(t *time.Time) *BrandUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*BrandUpdateOne) SetNillableDescription

func (buo *BrandUpdateOne) SetNillableDescription(s *string) *BrandUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*BrandUpdateOne) SetNillableSort

func (buo *BrandUpdateOne) SetNillableSort(u *uint32) *BrandUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*BrandUpdateOne) SetNillableStatus

func (buo *BrandUpdateOne) SetNillableStatus(u *uint8) *BrandUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*BrandUpdateOne) SetNotNilDeletedAt

func (b *BrandUpdateOne) SetNotNilDeletedAt(value *time.Time) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetNotNilDescription

func (b *BrandUpdateOne) SetNotNilDescription(value *string) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetNotNilName

func (b *BrandUpdateOne) SetNotNilName(value *string) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetNotNilPicURL

func (b *BrandUpdateOne) SetNotNilPicURL(value *string) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetNotNilSort

func (b *BrandUpdateOne) SetNotNilSort(value *uint32) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetNotNilStatus

func (b *BrandUpdateOne) SetNotNilStatus(value *uint8) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetNotNilUpdatedAt

func (b *BrandUpdateOne) SetNotNilUpdatedAt(value *time.Time) *BrandUpdateOne

set field if value's pointer is not nil.

func (*BrandUpdateOne) SetPicURL

func (buo *BrandUpdateOne) SetPicURL(s string) *BrandUpdateOne

SetPicURL sets the "pic_url" field.

func (*BrandUpdateOne) SetSort

func (buo *BrandUpdateOne) SetSort(u uint32) *BrandUpdateOne

SetSort sets the "sort" field.

func (*BrandUpdateOne) SetStatus

func (buo *BrandUpdateOne) SetStatus(u uint8) *BrandUpdateOne

SetStatus sets the "status" field.

func (*BrandUpdateOne) SetUpdatedAt

func (buo *BrandUpdateOne) SetUpdatedAt(t time.Time) *BrandUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BrandUpdateOne) Where

func (buo *BrandUpdateOne) Where(ps ...predicate.Brand) *BrandUpdateOne

Where appends a list predicates to the BrandUpdate builder.

type Brands

type Brands []*Brand

Brands is a parsable slice of Brand.

type Categories

type Categories []*Category

Categories is a parsable slice of Category.

type Category

type Category struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// 父分类编号
	ParentID uint64 `json:"parent_id,omitempty"`
	// 分类名称
	Name string `json:"name,omitempty"`
	// 移动端分类图
	PicURL string `json:"pic_url,omitempty"`
	// PC 端分类图
	BigPicURL string `json:"big_pic_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CategoryQuery when eager-loading is set.
	Edges CategoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Category is the model entity for the Category schema.

func (*Category) QueryChildren

func (c *Category) QueryChildren() *CategoryQuery

QueryChildren queries the "children" edge of the Category entity.

func (*Category) QueryParent

func (c *Category) QueryParent() *CategoryQuery

QueryParent queries the "parent" edge of the Category entity.

func (*Category) QuerySpus

func (c *Category) QuerySpus() *SpuQuery

QuerySpus queries the "spus" edge of the Category entity.

func (*Category) String

func (c *Category) String() string

String implements the fmt.Stringer.

func (*Category) Unwrap

func (c *Category) Unwrap() *Category

Unwrap unwraps the Category entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Category) Update

func (c *Category) Update() *CategoryUpdateOne

Update returns a builder for updating this Category. Note that you need to call Category.Unwrap() before calling this method if this Category was returned from a transaction, and the transaction was committed or rolled back.

func (*Category) Value

func (c *Category) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Category. This includes values selected through modifiers, order, etc.

type CategoryClient

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

CategoryClient is a client for the Category schema.

func NewCategoryClient

func NewCategoryClient(c config) *CategoryClient

NewCategoryClient returns a client for the Category from the given config.

func (*CategoryClient) Create

func (c *CategoryClient) Create() *CategoryCreate

Create returns a builder for creating a Category entity.

func (*CategoryClient) CreateBulk

func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk

CreateBulk returns a builder for creating a bulk of Category entities.

func (*CategoryClient) Delete

func (c *CategoryClient) Delete() *CategoryDelete

Delete returns a delete builder for Category.

func (*CategoryClient) DeleteOne

func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CategoryClient) DeleteOneID

func (c *CategoryClient) DeleteOneID(id uint64) *CategoryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CategoryClient) Get

func (c *CategoryClient) Get(ctx context.Context, id uint64) (*Category, error)

Get returns a Category entity by its id.

func (*CategoryClient) GetX

func (c *CategoryClient) GetX(ctx context.Context, id uint64) *Category

GetX is like Get, but panics if an error occurs.

func (*CategoryClient) Hooks

func (c *CategoryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CategoryClient) Intercept

func (c *CategoryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `category.Intercept(f(g(h())))`.

func (*CategoryClient) Interceptors

func (c *CategoryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CategoryClient) MapCreateBulk

func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CategoryClient) Query

func (c *CategoryClient) Query() *CategoryQuery

Query returns a query builder for Category.

func (*CategoryClient) QueryChildren

func (c *CategoryClient) QueryChildren(ca *Category) *CategoryQuery

QueryChildren queries the children edge of a Category.

func (*CategoryClient) QueryParent

func (c *CategoryClient) QueryParent(ca *Category) *CategoryQuery

QueryParent queries the parent edge of a Category.

func (*CategoryClient) QuerySpus

func (c *CategoryClient) QuerySpus(ca *Category) *SpuQuery

QuerySpus queries the spus edge of a Category.

func (*CategoryClient) Update

func (c *CategoryClient) Update() *CategoryUpdate

Update returns an update builder for Category.

func (*CategoryClient) UpdateOne

func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategoryClient) UpdateOneID

func (c *CategoryClient) UpdateOneID(id uint64) *CategoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategoryClient) Use

func (c *CategoryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `category.Hooks(f(g(h())))`.

type CategoryCreate

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

CategoryCreate is the builder for creating a Category entity.

func (*CategoryCreate) AddChildIDs

func (cc *CategoryCreate) AddChildIDs(ids ...uint64) *CategoryCreate

AddChildIDs adds the "children" edge to the Category entity by IDs.

func (*CategoryCreate) AddChildren

func (cc *CategoryCreate) AddChildren(c ...*Category) *CategoryCreate

AddChildren adds the "children" edges to the Category entity.

func (*CategoryCreate) AddSpuIDs

func (cc *CategoryCreate) AddSpuIDs(ids ...uint64) *CategoryCreate

AddSpuIDs adds the "spus" edge to the Spu entity by IDs.

func (*CategoryCreate) AddSpus

func (cc *CategoryCreate) AddSpus(s ...*Spu) *CategoryCreate

AddSpus adds the "spus" edges to the Spu entity.

func (*CategoryCreate) Exec

func (cc *CategoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryCreate) ExecX

func (cc *CategoryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryCreate) Mutation

func (cc *CategoryCreate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryCreate) Save

func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)

Save creates the Category in the database.

func (*CategoryCreate) SaveX

func (cc *CategoryCreate) SaveX(ctx context.Context) *Category

SaveX calls Save and panics if Save returns an error.

func (*CategoryCreate) SetBigPicURL

func (cc *CategoryCreate) SetBigPicURL(s string) *CategoryCreate

SetBigPicURL sets the "big_pic_url" field.

func (*CategoryCreate) SetCreatedAt

func (cc *CategoryCreate) SetCreatedAt(t time.Time) *CategoryCreate

SetCreatedAt sets the "created_at" field.

func (*CategoryCreate) SetDeletedAt

func (cc *CategoryCreate) SetDeletedAt(t time.Time) *CategoryCreate

SetDeletedAt sets the "deleted_at" field.

func (*CategoryCreate) SetID

func (cc *CategoryCreate) SetID(u uint64) *CategoryCreate

SetID sets the "id" field.

func (*CategoryCreate) SetName

func (cc *CategoryCreate) SetName(s string) *CategoryCreate

SetName sets the "name" field.

func (*CategoryCreate) SetNillableBigPicURL

func (cc *CategoryCreate) SetNillableBigPicURL(s *string) *CategoryCreate

SetNillableBigPicURL sets the "big_pic_url" field if the given value is not nil.

func (*CategoryCreate) SetNillableCreatedAt

func (cc *CategoryCreate) SetNillableCreatedAt(t *time.Time) *CategoryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CategoryCreate) SetNillableDeletedAt

func (cc *CategoryCreate) SetNillableDeletedAt(t *time.Time) *CategoryCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CategoryCreate) SetNillableParentID

func (cc *CategoryCreate) SetNillableParentID(u *uint64) *CategoryCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*CategoryCreate) SetNillableSort

func (cc *CategoryCreate) SetNillableSort(u *uint32) *CategoryCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*CategoryCreate) SetNillableStatus

func (cc *CategoryCreate) SetNillableStatus(u *uint8) *CategoryCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CategoryCreate) SetNillableUpdatedAt

func (cc *CategoryCreate) SetNillableUpdatedAt(t *time.Time) *CategoryCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CategoryCreate) SetNotNilBigPicURL

func (c *CategoryCreate) SetNotNilBigPicURL(value *string) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilDeletedAt

func (c *CategoryCreate) SetNotNilDeletedAt(value *time.Time) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilName

func (c *CategoryCreate) SetNotNilName(value *string) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilParentID

func (c *CategoryCreate) SetNotNilParentID(value *uint64) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilPicURL

func (c *CategoryCreate) SetNotNilPicURL(value *string) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilSort

func (c *CategoryCreate) SetNotNilSort(value *uint32) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilStatus

func (c *CategoryCreate) SetNotNilStatus(value *uint8) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetNotNilUpdatedAt

func (c *CategoryCreate) SetNotNilUpdatedAt(value *time.Time) *CategoryCreate

set field if value's pointer is not nil.

func (*CategoryCreate) SetParent

func (cc *CategoryCreate) SetParent(c *Category) *CategoryCreate

SetParent sets the "parent" edge to the Category entity.

func (*CategoryCreate) SetParentID

func (cc *CategoryCreate) SetParentID(u uint64) *CategoryCreate

SetParentID sets the "parent_id" field.

func (*CategoryCreate) SetPicURL

func (cc *CategoryCreate) SetPicURL(s string) *CategoryCreate

SetPicURL sets the "pic_url" field.

func (*CategoryCreate) SetSort

func (cc *CategoryCreate) SetSort(u uint32) *CategoryCreate

SetSort sets the "sort" field.

func (*CategoryCreate) SetStatus

func (cc *CategoryCreate) SetStatus(u uint8) *CategoryCreate

SetStatus sets the "status" field.

func (*CategoryCreate) SetUpdatedAt

func (cc *CategoryCreate) SetUpdatedAt(t time.Time) *CategoryCreate

SetUpdatedAt sets the "updated_at" field.

type CategoryCreateBulk

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

CategoryCreateBulk is the builder for creating many Category entities in bulk.

func (*CategoryCreateBulk) Exec

func (ccb *CategoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryCreateBulk) ExecX

func (ccb *CategoryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryCreateBulk) Save

func (ccb *CategoryCreateBulk) Save(ctx context.Context) ([]*Category, error)

Save creates the Category entities in the database.

func (*CategoryCreateBulk) SaveX

func (ccb *CategoryCreateBulk) SaveX(ctx context.Context) []*Category

SaveX is like Save, but panics if an error occurs.

type CategoryDelete

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

CategoryDelete is the builder for deleting a Category entity.

func (*CategoryDelete) Exec

func (cd *CategoryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CategoryDelete) ExecX

func (cd *CategoryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CategoryDelete) Where

func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete

Where appends a list predicates to the CategoryDelete builder.

type CategoryDeleteOne

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

CategoryDeleteOne is the builder for deleting a single Category entity.

func (*CategoryDeleteOne) Exec

func (cdo *CategoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CategoryDeleteOne) ExecX

func (cdo *CategoryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryDeleteOne) Where

Where appends a list predicates to the CategoryDelete builder.

type CategoryEdges

type CategoryEdges struct {
	// Spus holds the value of the spus edge.
	Spus []*Spu `json:"spus,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *Category `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Category `json:"children,omitempty"`
	// contains filtered or unexported fields
}

CategoryEdges holds the relations/edges for other nodes in the graph.

func (CategoryEdges) ChildrenOrErr

func (e CategoryEdges) ChildrenOrErr() ([]*Category, error)

ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.

func (CategoryEdges) ParentOrErr

func (e CategoryEdges) ParentOrErr() (*Category, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (CategoryEdges) SpusOrErr

func (e CategoryEdges) SpusOrErr() ([]*Spu, error)

SpusOrErr returns the Spus value or an error if the edge was not loaded in eager-loading.

type CategoryGroupBy

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

CategoryGroupBy is the group-by builder for Category entities.

func (*CategoryGroupBy) Aggregate

func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CategoryGroupBy) Bool

func (s *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) BoolX

func (s *CategoryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CategoryGroupBy) Bools

func (s *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) BoolsX

func (s *CategoryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CategoryGroupBy) Float64

func (s *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) Float64X

func (s *CategoryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CategoryGroupBy) Float64s

func (s *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) Float64sX

func (s *CategoryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CategoryGroupBy) Int

func (s *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) IntX

func (s *CategoryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CategoryGroupBy) Ints

func (s *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) IntsX

func (s *CategoryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CategoryGroupBy) Scan

func (cgb *CategoryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CategoryGroupBy) ScanX

func (s *CategoryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CategoryGroupBy) String

func (s *CategoryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) StringX

func (s *CategoryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CategoryGroupBy) Strings

func (s *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CategoryGroupBy) StringsX

func (s *CategoryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CategoryMutation

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

CategoryMutation represents an operation that mutates the Category nodes in the graph.

func (*CategoryMutation) AddChildIDs

func (m *CategoryMutation) AddChildIDs(ids ...uint64)

AddChildIDs adds the "children" edge to the Category entity by ids.

func (*CategoryMutation) AddField

func (m *CategoryMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CategoryMutation) AddSort

func (m *CategoryMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*CategoryMutation) AddSpuIDs

func (m *CategoryMutation) AddSpuIDs(ids ...uint64)

AddSpuIDs adds the "spus" edge to the Spu entity by ids.

func (*CategoryMutation) AddStatus

func (m *CategoryMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*CategoryMutation) AddedEdges

func (m *CategoryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CategoryMutation) AddedField

func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CategoryMutation) AddedFields

func (m *CategoryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CategoryMutation) AddedIDs

func (m *CategoryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CategoryMutation) AddedSort

func (m *CategoryMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*CategoryMutation) AddedStatus

func (m *CategoryMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*CategoryMutation) BigPicURL

func (m *CategoryMutation) BigPicURL() (r string, exists bool)

BigPicURL returns the value of the "big_pic_url" field in the mutation.

func (*CategoryMutation) BigPicURLCleared

func (m *CategoryMutation) BigPicURLCleared() bool

BigPicURLCleared returns if the "big_pic_url" field was cleared in this mutation.

func (*CategoryMutation) ChildrenCleared

func (m *CategoryMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Category entity was cleared.

func (*CategoryMutation) ChildrenIDs

func (m *CategoryMutation) ChildrenIDs() (ids []uint64)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*CategoryMutation) ClearBigPicURL

func (m *CategoryMutation) ClearBigPicURL()

ClearBigPicURL clears the value of the "big_pic_url" field.

func (*CategoryMutation) ClearChildren

func (m *CategoryMutation) ClearChildren()

ClearChildren clears the "children" edge to the Category entity.

func (*CategoryMutation) ClearDeletedAt

func (m *CategoryMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CategoryMutation) ClearEdge

func (m *CategoryMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*CategoryMutation) ClearField

func (m *CategoryMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*CategoryMutation) ClearParent

func (m *CategoryMutation) ClearParent()

ClearParent clears the "parent" edge to the Category entity.

func (*CategoryMutation) ClearParentID

func (m *CategoryMutation) ClearParentID()

ClearParentID clears the value of the "parent_id" field.

func (*CategoryMutation) ClearSpus

func (m *CategoryMutation) ClearSpus()

ClearSpus clears the "spus" edge to the Spu entity.

func (*CategoryMutation) ClearStatus

func (m *CategoryMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*CategoryMutation) ClearedEdges

func (m *CategoryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CategoryMutation) ClearedFields

func (m *CategoryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CategoryMutation) Client

func (m CategoryMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CategoryMutation) CreatedAt

func (m *CategoryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CategoryMutation) DeletedAt

func (m *CategoryMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*CategoryMutation) DeletedAtCleared

func (m *CategoryMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*CategoryMutation) EdgeCleared

func (m *CategoryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CategoryMutation) Field

func (m *CategoryMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CategoryMutation) FieldCleared

func (m *CategoryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CategoryMutation) Fields

func (m *CategoryMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*CategoryMutation) ID

func (m *CategoryMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CategoryMutation) IDs

func (m *CategoryMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CategoryMutation) Name

func (m *CategoryMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*CategoryMutation) OldBigPicURL

func (m *CategoryMutation) OldBigPicURL(ctx context.Context) (v string, err error)

OldBigPicURL returns the old "big_pic_url" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldCreatedAt

func (m *CategoryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldDeletedAt

func (m *CategoryMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldField

func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*CategoryMutation) OldName

func (m *CategoryMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldParentID

func (m *CategoryMutation) OldParentID(ctx context.Context) (v uint64, err error)

OldParentID returns the old "parent_id" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldPicURL

func (m *CategoryMutation) OldPicURL(ctx context.Context) (v string, err error)

OldPicURL returns the old "pic_url" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldSort

func (m *CategoryMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldStatus

func (m *CategoryMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) OldUpdatedAt

func (m *CategoryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Category entity. If the Category object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CategoryMutation) Op

func (m *CategoryMutation) Op() Op

Op returns the operation name.

func (*CategoryMutation) ParentCleared

func (m *CategoryMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Category entity was cleared.

func (*CategoryMutation) ParentID

func (m *CategoryMutation) ParentID() (r uint64, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*CategoryMutation) ParentIDCleared

func (m *CategoryMutation) ParentIDCleared() bool

ParentIDCleared returns if the "parent_id" field was cleared in this mutation.

func (*CategoryMutation) ParentIDs

func (m *CategoryMutation) ParentIDs() (ids []uint64)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (*CategoryMutation) PicURL

func (m *CategoryMutation) PicURL() (r string, exists bool)

PicURL returns the value of the "pic_url" field in the mutation.

func (*CategoryMutation) RemoveChildIDs

func (m *CategoryMutation) RemoveChildIDs(ids ...uint64)

RemoveChildIDs removes the "children" edge to the Category entity by IDs.

func (*CategoryMutation) RemoveSpuIDs

func (m *CategoryMutation) RemoveSpuIDs(ids ...uint64)

RemoveSpuIDs removes the "spus" edge to the Spu entity by IDs.

func (*CategoryMutation) RemovedChildrenIDs

func (m *CategoryMutation) RemovedChildrenIDs() (ids []uint64)

RemovedChildren returns the removed IDs of the "children" edge to the Category entity.

func (*CategoryMutation) RemovedEdges

func (m *CategoryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CategoryMutation) RemovedIDs

func (m *CategoryMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*CategoryMutation) RemovedSpusIDs

func (m *CategoryMutation) RemovedSpusIDs() (ids []uint64)

RemovedSpus returns the removed IDs of the "spus" edge to the Spu entity.

func (*CategoryMutation) ResetBigPicURL

func (m *CategoryMutation) ResetBigPicURL()

ResetBigPicURL resets all changes to the "big_pic_url" field.

func (*CategoryMutation) ResetChildren

func (m *CategoryMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*CategoryMutation) ResetCreatedAt

func (m *CategoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CategoryMutation) ResetDeletedAt

func (m *CategoryMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CategoryMutation) ResetEdge

func (m *CategoryMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*CategoryMutation) ResetField

func (m *CategoryMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*CategoryMutation) ResetName

func (m *CategoryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CategoryMutation) ResetParent

func (m *CategoryMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*CategoryMutation) ResetParentID

func (m *CategoryMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*CategoryMutation) ResetPicURL

func (m *CategoryMutation) ResetPicURL()

ResetPicURL resets all changes to the "pic_url" field.

func (*CategoryMutation) ResetSort

func (m *CategoryMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*CategoryMutation) ResetSpus

func (m *CategoryMutation) ResetSpus()

ResetSpus resets all changes to the "spus" edge.

func (*CategoryMutation) ResetStatus

func (m *CategoryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*CategoryMutation) ResetUpdatedAt

func (m *CategoryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CategoryMutation) SetBigPicURL

func (m *CategoryMutation) SetBigPicURL(s string)

SetBigPicURL sets the "big_pic_url" field.

func (*CategoryMutation) SetCreatedAt

func (m *CategoryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CategoryMutation) SetDeletedAt

func (m *CategoryMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*CategoryMutation) SetField

func (m *CategoryMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CategoryMutation) SetID

func (m *CategoryMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Category entities.

func (*CategoryMutation) SetName

func (m *CategoryMutation) SetName(s string)

SetName sets the "name" field.

func (*CategoryMutation) SetOp

func (m *CategoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CategoryMutation) SetParentID

func (m *CategoryMutation) SetParentID(u uint64)

SetParentID sets the "parent_id" field.

func (*CategoryMutation) SetPicURL

func (m *CategoryMutation) SetPicURL(s string)

SetPicURL sets the "pic_url" field.

func (*CategoryMutation) SetSort

func (m *CategoryMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*CategoryMutation) SetStatus

func (m *CategoryMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*CategoryMutation) SetUpdatedAt

func (m *CategoryMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CategoryMutation) Sort

func (m *CategoryMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*CategoryMutation) SpusCleared

func (m *CategoryMutation) SpusCleared() bool

SpusCleared reports if the "spus" edge to the Spu entity was cleared.

func (*CategoryMutation) SpusIDs

func (m *CategoryMutation) SpusIDs() (ids []uint64)

SpusIDs returns the "spus" edge IDs in the mutation.

func (*CategoryMutation) Status

func (m *CategoryMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*CategoryMutation) StatusCleared

func (m *CategoryMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (CategoryMutation) Tx

func (m CategoryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CategoryMutation) Type

func (m *CategoryMutation) Type() string

Type returns the node type of this mutation (Category).

func (*CategoryMutation) UpdatedAt

func (m *CategoryMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CategoryMutation) Where

func (m *CategoryMutation) Where(ps ...predicate.Category)

Where appends a list predicates to the CategoryMutation builder.

func (*CategoryMutation) WhereP

func (m *CategoryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CategoryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CategoryPageList

type CategoryPageList struct {
	List        []*Category  `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

CategoryPageList is Category PageList result.

type CategoryPager

type CategoryPager struct {
	Order  category.OrderOption
	Filter func(*CategoryQuery) (*CategoryQuery, error)
}

func (*CategoryPager) ApplyFilter

func (p *CategoryPager) ApplyFilter(query *CategoryQuery) (*CategoryQuery, error)

type CategoryPaginateOption

type CategoryPaginateOption func(*CategoryPager)

CategoryPaginateOption enables pagination customization.

type CategoryQuery

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

CategoryQuery is the builder for querying Category entities.

func (*CategoryQuery) Aggregate

func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate returns a CategorySelect configured with the given aggregations.

func (*CategoryQuery) All

func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)

All executes the query and returns a list of Categories.

func (*CategoryQuery) AllX

func (cq *CategoryQuery) AllX(ctx context.Context) []*Category

AllX is like All, but panics if an error occurs.

func (*CategoryQuery) Clone

func (cq *CategoryQuery) Clone() *CategoryQuery

Clone returns a duplicate of the CategoryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CategoryQuery) Count

func (cq *CategoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CategoryQuery) CountX

func (cq *CategoryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CategoryQuery) Exist

func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CategoryQuery) ExistX

func (cq *CategoryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CategoryQuery) First

func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)

First returns the first Category entity from the query. Returns a *NotFoundError when no Category was found.

func (*CategoryQuery) FirstID

func (cq *CategoryQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Category ID from the query. Returns a *NotFoundError when no Category ID was found.

func (*CategoryQuery) FirstIDX

func (cq *CategoryQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*CategoryQuery) FirstX

func (cq *CategoryQuery) FirstX(ctx context.Context) *Category

FirstX is like First, but panics if an error occurs.

func (*CategoryQuery) GroupBy

func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Category.Query().
	GroupBy(category.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CategoryQuery) IDs

func (cq *CategoryQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Category IDs.

func (*CategoryQuery) IDsX

func (cq *CategoryQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*CategoryQuery) Limit

func (cq *CategoryQuery) Limit(limit int) *CategoryQuery

Limit the number of records to be returned by this query.

func (*CategoryQuery) Offset

func (cq *CategoryQuery) Offset(offset int) *CategoryQuery

Offset to start from.

func (*CategoryQuery) Only

func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)

Only returns a single Category entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Category entity is found. Returns a *NotFoundError when no Category entities are found.

func (*CategoryQuery) OnlyID

func (cq *CategoryQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Category ID in the query. Returns a *NotSingularError when more than one Category ID is found. Returns a *NotFoundError when no entities are found.

func (*CategoryQuery) OnlyIDX

func (cq *CategoryQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CategoryQuery) OnlyX

func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category

OnlyX is like Only, but panics if an error occurs.

func (*CategoryQuery) Order

Order specifies how the records should be ordered.

func (*CategoryQuery) Page

func (c *CategoryQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...CategoryPaginateOption,
) (*CategoryPageList, error)

func (*CategoryQuery) QueryChildren

func (cq *CategoryQuery) QueryChildren() *CategoryQuery

QueryChildren chains the current query on the "children" edge.

func (*CategoryQuery) QueryParent

func (cq *CategoryQuery) QueryParent() *CategoryQuery

QueryParent chains the current query on the "parent" edge.

func (*CategoryQuery) QuerySpus

func (cq *CategoryQuery) QuerySpus() *SpuQuery

QuerySpus chains the current query on the "spus" edge.

func (*CategoryQuery) Select

func (cq *CategoryQuery) Select(fields ...string) *CategorySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Category.Query().
	Select(category.FieldCreatedAt).
	Scan(ctx, &v)

func (*CategoryQuery) Unique

func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*CategoryQuery) Where

func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery

Where adds a new predicate for the CategoryQuery builder.

func (*CategoryQuery) WithChildren

func (cq *CategoryQuery) WithChildren(opts ...func(*CategoryQuery)) *CategoryQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (*CategoryQuery) WithParent

func (cq *CategoryQuery) WithParent(opts ...func(*CategoryQuery)) *CategoryQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

func (*CategoryQuery) WithSpus

func (cq *CategoryQuery) WithSpus(opts ...func(*SpuQuery)) *CategoryQuery

WithSpus tells the query-builder to eager-load the nodes that are connected to the "spus" edge. The optional arguments are used to configure the query builder of the edge.

type CategorySelect

type CategorySelect struct {
	*CategoryQuery
	// contains filtered or unexported fields
}

CategorySelect is the builder for selecting fields of Category entities.

func (*CategorySelect) Aggregate

func (cs *CategorySelect) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CategorySelect) Bool

func (s *CategorySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CategorySelect) BoolX

func (s *CategorySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CategorySelect) Bools

func (s *CategorySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CategorySelect) BoolsX

func (s *CategorySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CategorySelect) Float64

func (s *CategorySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CategorySelect) Float64X

func (s *CategorySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CategorySelect) Float64s

func (s *CategorySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CategorySelect) Float64sX

func (s *CategorySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CategorySelect) Int

func (s *CategorySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CategorySelect) IntX

func (s *CategorySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CategorySelect) Ints

func (s *CategorySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CategorySelect) IntsX

func (s *CategorySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CategorySelect) Scan

func (cs *CategorySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CategorySelect) ScanX

func (s *CategorySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CategorySelect) String

func (s *CategorySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CategorySelect) StringX

func (s *CategorySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CategorySelect) Strings

func (s *CategorySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CategorySelect) StringsX

func (s *CategorySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CategoryUpdate

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

CategoryUpdate is the builder for updating Category entities.

func (*CategoryUpdate) AddChildIDs

func (cu *CategoryUpdate) AddChildIDs(ids ...uint64) *CategoryUpdate

AddChildIDs adds the "children" edge to the Category entity by IDs.

func (*CategoryUpdate) AddChildren

func (cu *CategoryUpdate) AddChildren(c ...*Category) *CategoryUpdate

AddChildren adds the "children" edges to the Category entity.

func (*CategoryUpdate) AddSort

func (cu *CategoryUpdate) AddSort(u int32) *CategoryUpdate

AddSort adds u to the "sort" field.

func (*CategoryUpdate) AddSpuIDs

func (cu *CategoryUpdate) AddSpuIDs(ids ...uint64) *CategoryUpdate

AddSpuIDs adds the "spus" edge to the Spu entity by IDs.

func (*CategoryUpdate) AddSpus

func (cu *CategoryUpdate) AddSpus(s ...*Spu) *CategoryUpdate

AddSpus adds the "spus" edges to the Spu entity.

func (*CategoryUpdate) AddStatus

func (cu *CategoryUpdate) AddStatus(u int8) *CategoryUpdate

AddStatus adds u to the "status" field.

func (*CategoryUpdate) ClearBigPicURL

func (cu *CategoryUpdate) ClearBigPicURL() *CategoryUpdate

ClearBigPicURL clears the value of the "big_pic_url" field.

func (*CategoryUpdate) ClearChildren

func (cu *CategoryUpdate) ClearChildren() *CategoryUpdate

ClearChildren clears all "children" edges to the Category entity.

func (*CategoryUpdate) ClearDeletedAt

func (cu *CategoryUpdate) ClearDeletedAt() *CategoryUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CategoryUpdate) ClearParent

func (cu *CategoryUpdate) ClearParent() *CategoryUpdate

ClearParent clears the "parent" edge to the Category entity.

func (*CategoryUpdate) ClearParentID

func (cu *CategoryUpdate) ClearParentID() *CategoryUpdate

ClearParentID clears the value of the "parent_id" field.

func (*CategoryUpdate) ClearSpus

func (cu *CategoryUpdate) ClearSpus() *CategoryUpdate

ClearSpus clears all "spus" edges to the Spu entity.

func (*CategoryUpdate) ClearStatus

func (cu *CategoryUpdate) ClearStatus() *CategoryUpdate

ClearStatus clears the value of the "status" field.

func (*CategoryUpdate) Exec

func (cu *CategoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategoryUpdate) ExecX

func (cu *CategoryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryUpdate) Mutation

func (cu *CategoryUpdate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdate) RemoveChildIDs

func (cu *CategoryUpdate) RemoveChildIDs(ids ...uint64) *CategoryUpdate

RemoveChildIDs removes the "children" edge to Category entities by IDs.

func (*CategoryUpdate) RemoveChildren

func (cu *CategoryUpdate) RemoveChildren(c ...*Category) *CategoryUpdate

RemoveChildren removes "children" edges to Category entities.

func (*CategoryUpdate) RemoveSpuIDs

func (cu *CategoryUpdate) RemoveSpuIDs(ids ...uint64) *CategoryUpdate

RemoveSpuIDs removes the "spus" edge to Spu entities by IDs.

func (*CategoryUpdate) RemoveSpus

func (cu *CategoryUpdate) RemoveSpus(s ...*Spu) *CategoryUpdate

RemoveSpus removes "spus" edges to Spu entities.

func (*CategoryUpdate) Save

func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CategoryUpdate) SaveX

func (cu *CategoryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CategoryUpdate) SetBigPicURL

func (cu *CategoryUpdate) SetBigPicURL(s string) *CategoryUpdate

SetBigPicURL sets the "big_pic_url" field.

func (*CategoryUpdate) SetDeletedAt

func (cu *CategoryUpdate) SetDeletedAt(t time.Time) *CategoryUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CategoryUpdate) SetName

func (cu *CategoryUpdate) SetName(s string) *CategoryUpdate

SetName sets the "name" field.

func (*CategoryUpdate) SetNillableBigPicURL

func (cu *CategoryUpdate) SetNillableBigPicURL(s *string) *CategoryUpdate

SetNillableBigPicURL sets the "big_pic_url" field if the given value is not nil.

func (*CategoryUpdate) SetNillableDeletedAt

func (cu *CategoryUpdate) SetNillableDeletedAt(t *time.Time) *CategoryUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CategoryUpdate) SetNillableParentID

func (cu *CategoryUpdate) SetNillableParentID(u *uint64) *CategoryUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*CategoryUpdate) SetNillableSort

func (cu *CategoryUpdate) SetNillableSort(u *uint32) *CategoryUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*CategoryUpdate) SetNillableStatus

func (cu *CategoryUpdate) SetNillableStatus(u *uint8) *CategoryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CategoryUpdate) SetNotNilBigPicURL

func (c *CategoryUpdate) SetNotNilBigPicURL(value *string) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilDeletedAt

func (c *CategoryUpdate) SetNotNilDeletedAt(value *time.Time) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilName

func (c *CategoryUpdate) SetNotNilName(value *string) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilParentID

func (c *CategoryUpdate) SetNotNilParentID(value *uint64) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilPicURL

func (c *CategoryUpdate) SetNotNilPicURL(value *string) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilSort

func (c *CategoryUpdate) SetNotNilSort(value *uint32) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilStatus

func (c *CategoryUpdate) SetNotNilStatus(value *uint8) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetNotNilUpdatedAt

func (c *CategoryUpdate) SetNotNilUpdatedAt(value *time.Time) *CategoryUpdate

set field if value's pointer is not nil.

func (*CategoryUpdate) SetParent

func (cu *CategoryUpdate) SetParent(c *Category) *CategoryUpdate

SetParent sets the "parent" edge to the Category entity.

func (*CategoryUpdate) SetParentID

func (cu *CategoryUpdate) SetParentID(u uint64) *CategoryUpdate

SetParentID sets the "parent_id" field.

func (*CategoryUpdate) SetPicURL

func (cu *CategoryUpdate) SetPicURL(s string) *CategoryUpdate

SetPicURL sets the "pic_url" field.

func (*CategoryUpdate) SetSort

func (cu *CategoryUpdate) SetSort(u uint32) *CategoryUpdate

SetSort sets the "sort" field.

func (*CategoryUpdate) SetStatus

func (cu *CategoryUpdate) SetStatus(u uint8) *CategoryUpdate

SetStatus sets the "status" field.

func (*CategoryUpdate) SetUpdatedAt

func (cu *CategoryUpdate) SetUpdatedAt(t time.Time) *CategoryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CategoryUpdate) Where

func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate

Where appends a list predicates to the CategoryUpdate builder.

type CategoryUpdateOne

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

CategoryUpdateOne is the builder for updating a single Category entity.

func (*CategoryUpdateOne) AddChildIDs

func (cuo *CategoryUpdateOne) AddChildIDs(ids ...uint64) *CategoryUpdateOne

AddChildIDs adds the "children" edge to the Category entity by IDs.

func (*CategoryUpdateOne) AddChildren

func (cuo *CategoryUpdateOne) AddChildren(c ...*Category) *CategoryUpdateOne

AddChildren adds the "children" edges to the Category entity.

func (*CategoryUpdateOne) AddSort

func (cuo *CategoryUpdateOne) AddSort(u int32) *CategoryUpdateOne

AddSort adds u to the "sort" field.

func (*CategoryUpdateOne) AddSpuIDs

func (cuo *CategoryUpdateOne) AddSpuIDs(ids ...uint64) *CategoryUpdateOne

AddSpuIDs adds the "spus" edge to the Spu entity by IDs.

func (*CategoryUpdateOne) AddSpus

func (cuo *CategoryUpdateOne) AddSpus(s ...*Spu) *CategoryUpdateOne

AddSpus adds the "spus" edges to the Spu entity.

func (*CategoryUpdateOne) AddStatus

func (cuo *CategoryUpdateOne) AddStatus(u int8) *CategoryUpdateOne

AddStatus adds u to the "status" field.

func (*CategoryUpdateOne) ClearBigPicURL

func (cuo *CategoryUpdateOne) ClearBigPicURL() *CategoryUpdateOne

ClearBigPicURL clears the value of the "big_pic_url" field.

func (*CategoryUpdateOne) ClearChildren

func (cuo *CategoryUpdateOne) ClearChildren() *CategoryUpdateOne

ClearChildren clears all "children" edges to the Category entity.

func (*CategoryUpdateOne) ClearDeletedAt

func (cuo *CategoryUpdateOne) ClearDeletedAt() *CategoryUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CategoryUpdateOne) ClearParent

func (cuo *CategoryUpdateOne) ClearParent() *CategoryUpdateOne

ClearParent clears the "parent" edge to the Category entity.

func (*CategoryUpdateOne) ClearParentID

func (cuo *CategoryUpdateOne) ClearParentID() *CategoryUpdateOne

ClearParentID clears the value of the "parent_id" field.

func (*CategoryUpdateOne) ClearSpus

func (cuo *CategoryUpdateOne) ClearSpus() *CategoryUpdateOne

ClearSpus clears all "spus" edges to the Spu entity.

func (*CategoryUpdateOne) ClearStatus

func (cuo *CategoryUpdateOne) ClearStatus() *CategoryUpdateOne

ClearStatus clears the value of the "status" field.

func (*CategoryUpdateOne) Exec

func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CategoryUpdateOne) ExecX

func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategoryUpdateOne) Mutation

func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdateOne) RemoveChildIDs

func (cuo *CategoryUpdateOne) RemoveChildIDs(ids ...uint64) *CategoryUpdateOne

RemoveChildIDs removes the "children" edge to Category entities by IDs.

func (*CategoryUpdateOne) RemoveChildren

func (cuo *CategoryUpdateOne) RemoveChildren(c ...*Category) *CategoryUpdateOne

RemoveChildren removes "children" edges to Category entities.

func (*CategoryUpdateOne) RemoveSpuIDs

func (cuo *CategoryUpdateOne) RemoveSpuIDs(ids ...uint64) *CategoryUpdateOne

RemoveSpuIDs removes the "spus" edge to Spu entities by IDs.

func (*CategoryUpdateOne) RemoveSpus

func (cuo *CategoryUpdateOne) RemoveSpus(s ...*Spu) *CategoryUpdateOne

RemoveSpus removes "spus" edges to Spu entities.

func (*CategoryUpdateOne) Save

func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)

Save executes the query and returns the updated Category entity.

func (*CategoryUpdateOne) SaveX

func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category

SaveX is like Save, but panics if an error occurs.

func (*CategoryUpdateOne) Select

func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CategoryUpdateOne) SetBigPicURL

func (cuo *CategoryUpdateOne) SetBigPicURL(s string) *CategoryUpdateOne

SetBigPicURL sets the "big_pic_url" field.

func (*CategoryUpdateOne) SetDeletedAt

func (cuo *CategoryUpdateOne) SetDeletedAt(t time.Time) *CategoryUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*CategoryUpdateOne) SetName

func (cuo *CategoryUpdateOne) SetName(s string) *CategoryUpdateOne

SetName sets the "name" field.

func (*CategoryUpdateOne) SetNillableBigPicURL

func (cuo *CategoryUpdateOne) SetNillableBigPicURL(s *string) *CategoryUpdateOne

SetNillableBigPicURL sets the "big_pic_url" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableDeletedAt

func (cuo *CategoryUpdateOne) SetNillableDeletedAt(t *time.Time) *CategoryUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableParentID

func (cuo *CategoryUpdateOne) SetNillableParentID(u *uint64) *CategoryUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableSort

func (cuo *CategoryUpdateOne) SetNillableSort(u *uint32) *CategoryUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableStatus

func (cuo *CategoryUpdateOne) SetNillableStatus(u *uint8) *CategoryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CategoryUpdateOne) SetNotNilBigPicURL

func (c *CategoryUpdateOne) SetNotNilBigPicURL(value *string) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilDeletedAt

func (c *CategoryUpdateOne) SetNotNilDeletedAt(value *time.Time) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilName

func (c *CategoryUpdateOne) SetNotNilName(value *string) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilParentID

func (c *CategoryUpdateOne) SetNotNilParentID(value *uint64) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilPicURL

func (c *CategoryUpdateOne) SetNotNilPicURL(value *string) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilSort

func (c *CategoryUpdateOne) SetNotNilSort(value *uint32) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilStatus

func (c *CategoryUpdateOne) SetNotNilStatus(value *uint8) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetNotNilUpdatedAt

func (c *CategoryUpdateOne) SetNotNilUpdatedAt(value *time.Time) *CategoryUpdateOne

set field if value's pointer is not nil.

func (*CategoryUpdateOne) SetParent

func (cuo *CategoryUpdateOne) SetParent(c *Category) *CategoryUpdateOne

SetParent sets the "parent" edge to the Category entity.

func (*CategoryUpdateOne) SetParentID

func (cuo *CategoryUpdateOne) SetParentID(u uint64) *CategoryUpdateOne

SetParentID sets the "parent_id" field.

func (*CategoryUpdateOne) SetPicURL

func (cuo *CategoryUpdateOne) SetPicURL(s string) *CategoryUpdateOne

SetPicURL sets the "pic_url" field.

func (*CategoryUpdateOne) SetSort

func (cuo *CategoryUpdateOne) SetSort(u uint32) *CategoryUpdateOne

SetSort sets the "sort" field.

func (*CategoryUpdateOne) SetStatus

func (cuo *CategoryUpdateOne) SetStatus(u uint8) *CategoryUpdateOne

SetStatus sets the "status" field.

func (*CategoryUpdateOne) SetUpdatedAt

func (cuo *CategoryUpdateOne) SetUpdatedAt(t time.Time) *CategoryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CategoryUpdateOne) Where

Where appends a list predicates to the CategoryUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Brand is the client for interacting with the Brand builders.
	Brand *BrandClient
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Property is the client for interacting with the Property builders.
	Property *PropertyClient
	// PropertyValue is the client for interacting with the PropertyValue builders.
	PropertyValue *PropertyValueClient
	// Sku is the client for interacting with the Sku builders.
	Sku *SkuClient
	// Spu is the client for interacting with the Spu builders.
	Spu *SpuClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Brand.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type Comment

type Comment struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// 评价人的用户编号,关联 MemberUserDO 的 id 编号
	UserID uint64 `json:"user_id,omitempty"`
	// 评价人名称
	UserNickname string `json:"user_nickname,omitempty"`
	// 评价人头像
	UserAvatar string `json:"user_avatar,omitempty"`
	// 是否匿名
	Anonymous bool `json:"anonymous,omitempty"`
	// 交易订单编号,关联 TradeOrderDO 的 id 编号
	OrderID uint64 `json:"order_id,omitempty"`
	// 交易订单项编号,关联 TradeOrderItemDO 的 id 编号
	OrderItemID uint64 `json:"order_item_id,omitempty"`
	// 商品 SPU 编号,关联 ProductSpuDO 的 id
	SpuID uint64 `json:"spu_id,omitempty"`
	// 商品 SPU 名称
	SpuName string `json:"spu_name,omitempty"`
	// 商品 SKU 编号,关联 ProductSkuDO 的 id 编号
	SkuID uint64 `json:"sku_id,omitempty"`
	// 图片地址
	SkuPicURL string `json:"sku_pic_url,omitempty"`
	// 属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]
	SkuProperties []entType.SkuProperty `json:"sku_properties,omitempty"`
	// 是否可见,true:显示false:隐藏
	Visible bool `json:"visible,omitempty"`
	// 评分星级1-5分
	Scores int8 `json:"scores,omitempty"`
	// 描述星级 1-5 星
	DescriptionScores int8 `json:"description_scores,omitempty"`
	// 服务星级 1-5 星
	BenefitScores int8 `json:"benefit_scores,omitempty"`
	// 评论内容
	Content string `json:"content,omitempty"`
	// 评论图片地址数组
	PicUrls string `json:"pic_urls,omitempty"`
	// 商家是否回复
	ReplyStatus bool `json:"reply_status,omitempty"`
	// 回复管理员编号,关联 AdminUserDO 的 id 编号
	ReplyUserID int `json:"reply_user_id,omitempty"`
	// 商家回复内容
	ReplyContent string `json:"reply_content,omitempty"`
	// 商家回复时间
	ReplyTime time.Time `json:"reply_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CommentQuery when eager-loading is set.
	Edges CommentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Comment is the model entity for the Comment schema.

func (*Comment) QuerySkus

func (c *Comment) QuerySkus() *SkuQuery

QuerySkus queries the "skus" edge of the Comment entity.

func (*Comment) String

func (c *Comment) String() string

String implements the fmt.Stringer.

func (*Comment) Unwrap

func (c *Comment) Unwrap() *Comment

Unwrap unwraps the Comment entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Comment) Update

func (c *Comment) Update() *CommentUpdateOne

Update returns a builder for updating this Comment. Note that you need to call Comment.Unwrap() before calling this method if this Comment was returned from a transaction, and the transaction was committed or rolled back.

func (*Comment) Value

func (c *Comment) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Comment. This includes values selected through modifiers, order, etc.

type CommentClient

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

CommentClient is a client for the Comment schema.

func NewCommentClient

func NewCommentClient(c config) *CommentClient

NewCommentClient returns a client for the Comment from the given config.

func (*CommentClient) Create

func (c *CommentClient) Create() *CommentCreate

Create returns a builder for creating a Comment entity.

func (*CommentClient) CreateBulk

func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk

CreateBulk returns a builder for creating a bulk of Comment entities.

func (*CommentClient) Delete

func (c *CommentClient) Delete() *CommentDelete

Delete returns a delete builder for Comment.

func (*CommentClient) DeleteOne

func (c *CommentClient) DeleteOne(co *Comment) *CommentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommentClient) DeleteOneID

func (c *CommentClient) DeleteOneID(id uint64) *CommentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CommentClient) Get

func (c *CommentClient) Get(ctx context.Context, id uint64) (*Comment, error)

Get returns a Comment entity by its id.

func (*CommentClient) GetX

func (c *CommentClient) GetX(ctx context.Context, id uint64) *Comment

GetX is like Get, but panics if an error occurs.

func (*CommentClient) Hooks

func (c *CommentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CommentClient) Intercept

func (c *CommentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `comment.Intercept(f(g(h())))`.

func (*CommentClient) Interceptors

func (c *CommentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CommentClient) MapCreateBulk

func (c *CommentClient) MapCreateBulk(slice any, setFunc func(*CommentCreate, int)) *CommentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CommentClient) Query

func (c *CommentClient) Query() *CommentQuery

Query returns a query builder for Comment.

func (*CommentClient) QuerySkus

func (c *CommentClient) QuerySkus(co *Comment) *SkuQuery

QuerySkus queries the skus edge of a Comment.

func (*CommentClient) Update

func (c *CommentClient) Update() *CommentUpdate

Update returns an update builder for Comment.

func (*CommentClient) UpdateOne

func (c *CommentClient) UpdateOne(co *Comment) *CommentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommentClient) UpdateOneID

func (c *CommentClient) UpdateOneID(id uint64) *CommentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommentClient) Use

func (c *CommentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `comment.Hooks(f(g(h())))`.

type CommentCreate

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

CommentCreate is the builder for creating a Comment entity.

func (*CommentCreate) Exec

func (cc *CommentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreate) ExecX

func (cc *CommentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CommentCreate) Mutation

func (cc *CommentCreate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentCreate) Save

func (cc *CommentCreate) Save(ctx context.Context) (*Comment, error)

Save creates the Comment in the database.

func (*CommentCreate) SaveX

func (cc *CommentCreate) SaveX(ctx context.Context) *Comment

SaveX calls Save and panics if Save returns an error.

func (*CommentCreate) SetAnonymous

func (cc *CommentCreate) SetAnonymous(b bool) *CommentCreate

SetAnonymous sets the "anonymous" field.

func (*CommentCreate) SetBenefitScores

func (cc *CommentCreate) SetBenefitScores(i int8) *CommentCreate

SetBenefitScores sets the "benefit_scores" field.

func (*CommentCreate) SetContent

func (cc *CommentCreate) SetContent(s string) *CommentCreate

SetContent sets the "content" field.

func (*CommentCreate) SetCreatedAt

func (cc *CommentCreate) SetCreatedAt(t time.Time) *CommentCreate

SetCreatedAt sets the "created_at" field.

func (*CommentCreate) SetDeletedAt

func (cc *CommentCreate) SetDeletedAt(t time.Time) *CommentCreate

SetDeletedAt sets the "deleted_at" field.

func (*CommentCreate) SetDescriptionScores

func (cc *CommentCreate) SetDescriptionScores(i int8) *CommentCreate

SetDescriptionScores sets the "description_scores" field.

func (*CommentCreate) SetID

func (cc *CommentCreate) SetID(u uint64) *CommentCreate

SetID sets the "id" field.

func (*CommentCreate) SetNillableAnonymous

func (cc *CommentCreate) SetNillableAnonymous(b *bool) *CommentCreate

SetNillableAnonymous sets the "anonymous" field if the given value is not nil.

func (*CommentCreate) SetNillableBenefitScores

func (cc *CommentCreate) SetNillableBenefitScores(i *int8) *CommentCreate

SetNillableBenefitScores sets the "benefit_scores" field if the given value is not nil.

func (*CommentCreate) SetNillableContent

func (cc *CommentCreate) SetNillableContent(s *string) *CommentCreate

SetNillableContent sets the "content" field if the given value is not nil.

func (*CommentCreate) SetNillableCreatedAt

func (cc *CommentCreate) SetNillableCreatedAt(t *time.Time) *CommentCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CommentCreate) SetNillableDeletedAt

func (cc *CommentCreate) SetNillableDeletedAt(t *time.Time) *CommentCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CommentCreate) SetNillableDescriptionScores

func (cc *CommentCreate) SetNillableDescriptionScores(i *int8) *CommentCreate

SetNillableDescriptionScores sets the "description_scores" field if the given value is not nil.

func (*CommentCreate) SetNillableOrderID

func (cc *CommentCreate) SetNillableOrderID(u *uint64) *CommentCreate

SetNillableOrderID sets the "order_id" field if the given value is not nil.

func (*CommentCreate) SetNillableOrderItemID

func (cc *CommentCreate) SetNillableOrderItemID(u *uint64) *CommentCreate

SetNillableOrderItemID sets the "order_item_id" field if the given value is not nil.

func (*CommentCreate) SetNillablePicUrls

func (cc *CommentCreate) SetNillablePicUrls(s *string) *CommentCreate

SetNillablePicUrls sets the "pic_urls" field if the given value is not nil.

func (*CommentCreate) SetNillableReplyContent

func (cc *CommentCreate) SetNillableReplyContent(s *string) *CommentCreate

SetNillableReplyContent sets the "reply_content" field if the given value is not nil.

func (*CommentCreate) SetNillableReplyStatus

func (cc *CommentCreate) SetNillableReplyStatus(b *bool) *CommentCreate

SetNillableReplyStatus sets the "reply_status" field if the given value is not nil.

func (*CommentCreate) SetNillableReplyTime

func (cc *CommentCreate) SetNillableReplyTime(t *time.Time) *CommentCreate

SetNillableReplyTime sets the "reply_time" field if the given value is not nil.

func (*CommentCreate) SetNillableReplyUserID

func (cc *CommentCreate) SetNillableReplyUserID(i *int) *CommentCreate

SetNillableReplyUserID sets the "reply_user_id" field if the given value is not nil.

func (*CommentCreate) SetNillableScores

func (cc *CommentCreate) SetNillableScores(i *int8) *CommentCreate

SetNillableScores sets the "scores" field if the given value is not nil.

func (*CommentCreate) SetNillableSkuID

func (cc *CommentCreate) SetNillableSkuID(u *uint64) *CommentCreate

SetNillableSkuID sets the "sku_id" field if the given value is not nil.

func (*CommentCreate) SetNillableSkusID

func (cc *CommentCreate) SetNillableSkusID(id *uint64) *CommentCreate

SetNillableSkusID sets the "skus" edge to the Sku entity by ID if the given value is not nil.

func (*CommentCreate) SetNillableSpuID

func (cc *CommentCreate) SetNillableSpuID(u *uint64) *CommentCreate

SetNillableSpuID sets the "spu_id" field if the given value is not nil.

func (*CommentCreate) SetNillableSpuName

func (cc *CommentCreate) SetNillableSpuName(s *string) *CommentCreate

SetNillableSpuName sets the "spu_name" field if the given value is not nil.

func (*CommentCreate) SetNillableUpdatedAt

func (cc *CommentCreate) SetNillableUpdatedAt(t *time.Time) *CommentCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CommentCreate) SetNillableUserAvatar

func (cc *CommentCreate) SetNillableUserAvatar(s *string) *CommentCreate

SetNillableUserAvatar sets the "user_avatar" field if the given value is not nil.

func (*CommentCreate) SetNillableUserID

func (cc *CommentCreate) SetNillableUserID(u *uint64) *CommentCreate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CommentCreate) SetNillableUserNickname

func (cc *CommentCreate) SetNillableUserNickname(s *string) *CommentCreate

SetNillableUserNickname sets the "user_nickname" field if the given value is not nil.

func (*CommentCreate) SetNillableVisible

func (cc *CommentCreate) SetNillableVisible(b *bool) *CommentCreate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*CommentCreate) SetNotNilAnonymous

func (c *CommentCreate) SetNotNilAnonymous(value *bool) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilBenefitScores

func (c *CommentCreate) SetNotNilBenefitScores(value *int8) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilContent

func (c *CommentCreate) SetNotNilContent(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilDeletedAt

func (c *CommentCreate) SetNotNilDeletedAt(value *time.Time) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilDescriptionScores

func (c *CommentCreate) SetNotNilDescriptionScores(value *int8) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilOrderID

func (c *CommentCreate) SetNotNilOrderID(value *uint64) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilOrderItemID

func (c *CommentCreate) SetNotNilOrderItemID(value *uint64) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilPicUrls

func (c *CommentCreate) SetNotNilPicUrls(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilReplyContent

func (c *CommentCreate) SetNotNilReplyContent(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilReplyStatus

func (c *CommentCreate) SetNotNilReplyStatus(value *bool) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilReplyTime

func (c *CommentCreate) SetNotNilReplyTime(value *time.Time) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilReplyUserID

func (c *CommentCreate) SetNotNilReplyUserID(value *int) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilScores

func (c *CommentCreate) SetNotNilScores(value *int8) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilSkuID

func (c *CommentCreate) SetNotNilSkuID(value *uint64) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilSkuPicURL

func (c *CommentCreate) SetNotNilSkuPicURL(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilSkuProperties

func (c *CommentCreate) SetNotNilSkuProperties(value *[]entType.SkuProperty) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilSpuID

func (c *CommentCreate) SetNotNilSpuID(value *uint64) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilSpuName

func (c *CommentCreate) SetNotNilSpuName(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilUpdatedAt

func (c *CommentCreate) SetNotNilUpdatedAt(value *time.Time) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilUserAvatar

func (c *CommentCreate) SetNotNilUserAvatar(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilUserID

func (c *CommentCreate) SetNotNilUserID(value *uint64) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilUserNickname

func (c *CommentCreate) SetNotNilUserNickname(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilVisible

func (c *CommentCreate) SetNotNilVisible(value *bool) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetOrderID

func (cc *CommentCreate) SetOrderID(u uint64) *CommentCreate

SetOrderID sets the "order_id" field.

func (*CommentCreate) SetOrderItemID

func (cc *CommentCreate) SetOrderItemID(u uint64) *CommentCreate

SetOrderItemID sets the "order_item_id" field.

func (*CommentCreate) SetPicUrls

func (cc *CommentCreate) SetPicUrls(s string) *CommentCreate

SetPicUrls sets the "pic_urls" field.

func (*CommentCreate) SetReplyContent

func (cc *CommentCreate) SetReplyContent(s string) *CommentCreate

SetReplyContent sets the "reply_content" field.

func (*CommentCreate) SetReplyStatus

func (cc *CommentCreate) SetReplyStatus(b bool) *CommentCreate

SetReplyStatus sets the "reply_status" field.

func (*CommentCreate) SetReplyTime

func (cc *CommentCreate) SetReplyTime(t time.Time) *CommentCreate

SetReplyTime sets the "reply_time" field.

func (*CommentCreate) SetReplyUserID

func (cc *CommentCreate) SetReplyUserID(i int) *CommentCreate

SetReplyUserID sets the "reply_user_id" field.

func (*CommentCreate) SetScores

func (cc *CommentCreate) SetScores(i int8) *CommentCreate

SetScores sets the "scores" field.

func (*CommentCreate) SetSkuID

func (cc *CommentCreate) SetSkuID(u uint64) *CommentCreate

SetSkuID sets the "sku_id" field.

func (*CommentCreate) SetSkuPicURL

func (cc *CommentCreate) SetSkuPicURL(s string) *CommentCreate

SetSkuPicURL sets the "sku_pic_url" field.

func (*CommentCreate) SetSkuProperties

func (cc *CommentCreate) SetSkuProperties(etp []entType.SkuProperty) *CommentCreate

SetSkuProperties sets the "sku_properties" field.

func (*CommentCreate) SetSkus

func (cc *CommentCreate) SetSkus(s *Sku) *CommentCreate

SetSkus sets the "skus" edge to the Sku entity.

func (*CommentCreate) SetSkusID

func (cc *CommentCreate) SetSkusID(id uint64) *CommentCreate

SetSkusID sets the "skus" edge to the Sku entity by ID.

func (*CommentCreate) SetSpuID

func (cc *CommentCreate) SetSpuID(u uint64) *CommentCreate

SetSpuID sets the "spu_id" field.

func (*CommentCreate) SetSpuName

func (cc *CommentCreate) SetSpuName(s string) *CommentCreate

SetSpuName sets the "spu_name" field.

func (*CommentCreate) SetUpdatedAt

func (cc *CommentCreate) SetUpdatedAt(t time.Time) *CommentCreate

SetUpdatedAt sets the "updated_at" field.

func (*CommentCreate) SetUserAvatar

func (cc *CommentCreate) SetUserAvatar(s string) *CommentCreate

SetUserAvatar sets the "user_avatar" field.

func (*CommentCreate) SetUserID

func (cc *CommentCreate) SetUserID(u uint64) *CommentCreate

SetUserID sets the "user_id" field.

func (*CommentCreate) SetUserNickname

func (cc *CommentCreate) SetUserNickname(s string) *CommentCreate

SetUserNickname sets the "user_nickname" field.

func (*CommentCreate) SetVisible

func (cc *CommentCreate) SetVisible(b bool) *CommentCreate

SetVisible sets the "visible" field.

type CommentCreateBulk

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

CommentCreateBulk is the builder for creating many Comment entities in bulk.

func (*CommentCreateBulk) Exec

func (ccb *CommentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreateBulk) ExecX

func (ccb *CommentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CommentCreateBulk) Save

func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error)

Save creates the Comment entities in the database.

func (*CommentCreateBulk) SaveX

func (ccb *CommentCreateBulk) SaveX(ctx context.Context) []*Comment

SaveX is like Save, but panics if an error occurs.

type CommentDelete

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

CommentDelete is the builder for deleting a Comment entity.

func (*CommentDelete) Exec

func (cd *CommentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CommentDelete) ExecX

func (cd *CommentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CommentDelete) Where

func (cd *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete

Where appends a list predicates to the CommentDelete builder.

type CommentDeleteOne

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

CommentDeleteOne is the builder for deleting a single Comment entity.

func (*CommentDeleteOne) Exec

func (cdo *CommentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CommentDeleteOne) ExecX

func (cdo *CommentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CommentDeleteOne) Where

Where appends a list predicates to the CommentDelete builder.

type CommentEdges

type CommentEdges struct {
	// Skus holds the value of the skus edge.
	Skus *Sku `json:"skus,omitempty"`
	// contains filtered or unexported fields
}

CommentEdges holds the relations/edges for other nodes in the graph.

func (CommentEdges) SkusOrErr

func (e CommentEdges) SkusOrErr() (*Sku, error)

SkusOrErr returns the Skus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type CommentGroupBy

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

CommentGroupBy is the group-by builder for Comment entities.

func (*CommentGroupBy) Aggregate

func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CommentGroupBy) Bool

func (s *CommentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) BoolX

func (s *CommentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CommentGroupBy) Bools

func (s *CommentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) BoolsX

func (s *CommentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CommentGroupBy) Float64

func (s *CommentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) Float64X

func (s *CommentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CommentGroupBy) Float64s

func (s *CommentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) Float64sX

func (s *CommentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CommentGroupBy) Int

func (s *CommentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) IntX

func (s *CommentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CommentGroupBy) Ints

func (s *CommentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) IntsX

func (s *CommentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CommentGroupBy) Scan

func (cgb *CommentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CommentGroupBy) ScanX

func (s *CommentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CommentGroupBy) String

func (s *CommentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) StringX

func (s *CommentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CommentGroupBy) Strings

func (s *CommentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CommentGroupBy) StringsX

func (s *CommentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CommentMutation

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

CommentMutation represents an operation that mutates the Comment nodes in the graph.

func (*CommentMutation) AddBenefitScores

func (m *CommentMutation) AddBenefitScores(i int8)

AddBenefitScores adds i to the "benefit_scores" field.

func (*CommentMutation) AddDescriptionScores

func (m *CommentMutation) AddDescriptionScores(i int8)

AddDescriptionScores adds i to the "description_scores" field.

func (*CommentMutation) AddField

func (m *CommentMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CommentMutation) AddOrderID

func (m *CommentMutation) AddOrderID(u int64)

AddOrderID adds u to the "order_id" field.

func (*CommentMutation) AddOrderItemID

func (m *CommentMutation) AddOrderItemID(u int64)

AddOrderItemID adds u to the "order_item_id" field.

func (*CommentMutation) AddReplyUserID

func (m *CommentMutation) AddReplyUserID(i int)

AddReplyUserID adds i to the "reply_user_id" field.

func (*CommentMutation) AddScores

func (m *CommentMutation) AddScores(i int8)

AddScores adds i to the "scores" field.

func (*CommentMutation) AddSpuID

func (m *CommentMutation) AddSpuID(u int64)

AddSpuID adds u to the "spu_id" field.

func (*CommentMutation) AddUserID

func (m *CommentMutation) AddUserID(u int64)

AddUserID adds u to the "user_id" field.

func (*CommentMutation) AddedBenefitScores

func (m *CommentMutation) AddedBenefitScores() (r int8, exists bool)

AddedBenefitScores returns the value that was added to the "benefit_scores" field in this mutation.

func (*CommentMutation) AddedDescriptionScores

func (m *CommentMutation) AddedDescriptionScores() (r int8, exists bool)

AddedDescriptionScores returns the value that was added to the "description_scores" field in this mutation.

func (*CommentMutation) AddedEdges

func (m *CommentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CommentMutation) AddedField

func (m *CommentMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CommentMutation) AddedFields

func (m *CommentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CommentMutation) AddedIDs

func (m *CommentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CommentMutation) AddedOrderID

func (m *CommentMutation) AddedOrderID() (r int64, exists bool)

AddedOrderID returns the value that was added to the "order_id" field in this mutation.

func (*CommentMutation) AddedOrderItemID

func (m *CommentMutation) AddedOrderItemID() (r int64, exists bool)

AddedOrderItemID returns the value that was added to the "order_item_id" field in this mutation.

func (*CommentMutation) AddedReplyUserID

func (m *CommentMutation) AddedReplyUserID() (r int, exists bool)

AddedReplyUserID returns the value that was added to the "reply_user_id" field in this mutation.

func (*CommentMutation) AddedScores

func (m *CommentMutation) AddedScores() (r int8, exists bool)

AddedScores returns the value that was added to the "scores" field in this mutation.

func (*CommentMutation) AddedSpuID

func (m *CommentMutation) AddedSpuID() (r int64, exists bool)

AddedSpuID returns the value that was added to the "spu_id" field in this mutation.

func (*CommentMutation) AddedUserID

func (m *CommentMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*CommentMutation) Anonymous

func (m *CommentMutation) Anonymous() (r bool, exists bool)

Anonymous returns the value of the "anonymous" field in the mutation.

func (*CommentMutation) AnonymousCleared

func (m *CommentMutation) AnonymousCleared() bool

AnonymousCleared returns if the "anonymous" field was cleared in this mutation.

func (*CommentMutation) AppendSkuProperties

func (m *CommentMutation) AppendSkuProperties(etp []entType.SkuProperty)

AppendSkuProperties adds etp to the "sku_properties" field.

func (*CommentMutation) AppendedSkuProperties

func (m *CommentMutation) AppendedSkuProperties() ([]entType.SkuProperty, bool)

AppendedSkuProperties returns the list of values that were appended to the "sku_properties" field in this mutation.

func (*CommentMutation) BenefitScores

func (m *CommentMutation) BenefitScores() (r int8, exists bool)

BenefitScores returns the value of the "benefit_scores" field in the mutation.

func (*CommentMutation) BenefitScoresCleared

func (m *CommentMutation) BenefitScoresCleared() bool

BenefitScoresCleared returns if the "benefit_scores" field was cleared in this mutation.

func (*CommentMutation) ClearAnonymous

func (m *CommentMutation) ClearAnonymous()

ClearAnonymous clears the value of the "anonymous" field.

func (*CommentMutation) ClearBenefitScores

func (m *CommentMutation) ClearBenefitScores()

ClearBenefitScores clears the value of the "benefit_scores" field.

func (*CommentMutation) ClearContent

func (m *CommentMutation) ClearContent()

ClearContent clears the value of the "content" field.

func (*CommentMutation) ClearDeletedAt

func (m *CommentMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommentMutation) ClearDescriptionScores

func (m *CommentMutation) ClearDescriptionScores()

ClearDescriptionScores clears the value of the "description_scores" field.

func (*CommentMutation) ClearEdge

func (m *CommentMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*CommentMutation) ClearField

func (m *CommentMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*CommentMutation) ClearOrderID

func (m *CommentMutation) ClearOrderID()

ClearOrderID clears the value of the "order_id" field.

func (*CommentMutation) ClearOrderItemID

func (m *CommentMutation) ClearOrderItemID()

ClearOrderItemID clears the value of the "order_item_id" field.

func (*CommentMutation) ClearPicUrls

func (m *CommentMutation) ClearPicUrls()

ClearPicUrls clears the value of the "pic_urls" field.

func (*CommentMutation) ClearReplyContent

func (m *CommentMutation) ClearReplyContent()

ClearReplyContent clears the value of the "reply_content" field.

func (*CommentMutation) ClearReplyStatus

func (m *CommentMutation) ClearReplyStatus()

ClearReplyStatus clears the value of the "reply_status" field.

func (*CommentMutation) ClearReplyTime

func (m *CommentMutation) ClearReplyTime()

ClearReplyTime clears the value of the "reply_time" field.

func (*CommentMutation) ClearReplyUserID

func (m *CommentMutation) ClearReplyUserID()

ClearReplyUserID clears the value of the "reply_user_id" field.

func (*CommentMutation) ClearScores

func (m *CommentMutation) ClearScores()

ClearScores clears the value of the "scores" field.

func (*CommentMutation) ClearSkuID

func (m *CommentMutation) ClearSkuID()

ClearSkuID clears the value of the "sku_id" field.

func (*CommentMutation) ClearSkuProperties

func (m *CommentMutation) ClearSkuProperties()

ClearSkuProperties clears the value of the "sku_properties" field.

func (*CommentMutation) ClearSkus

func (m *CommentMutation) ClearSkus()

ClearSkus clears the "skus" edge to the Sku entity.

func (*CommentMutation) ClearSpuID

func (m *CommentMutation) ClearSpuID()

ClearSpuID clears the value of the "spu_id" field.

func (*CommentMutation) ClearSpuName

func (m *CommentMutation) ClearSpuName()

ClearSpuName clears the value of the "spu_name" field.

func (*CommentMutation) ClearUserAvatar

func (m *CommentMutation) ClearUserAvatar()

ClearUserAvatar clears the value of the "user_avatar" field.

func (*CommentMutation) ClearUserID

func (m *CommentMutation) ClearUserID()

ClearUserID clears the value of the "user_id" field.

func (*CommentMutation) ClearUserNickname

func (m *CommentMutation) ClearUserNickname()

ClearUserNickname clears the value of the "user_nickname" field.

func (*CommentMutation) ClearVisible

func (m *CommentMutation) ClearVisible()

ClearVisible clears the value of the "visible" field.

func (*CommentMutation) ClearedEdges

func (m *CommentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CommentMutation) ClearedFields

func (m *CommentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CommentMutation) Client

func (m CommentMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CommentMutation) Content

func (m *CommentMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*CommentMutation) ContentCleared

func (m *CommentMutation) ContentCleared() bool

ContentCleared returns if the "content" field was cleared in this mutation.

func (*CommentMutation) CreatedAt

func (m *CommentMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CommentMutation) DeletedAt

func (m *CommentMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*CommentMutation) DeletedAtCleared

func (m *CommentMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*CommentMutation) DescriptionScores

func (m *CommentMutation) DescriptionScores() (r int8, exists bool)

DescriptionScores returns the value of the "description_scores" field in the mutation.

func (*CommentMutation) DescriptionScoresCleared

func (m *CommentMutation) DescriptionScoresCleared() bool

DescriptionScoresCleared returns if the "description_scores" field was cleared in this mutation.

func (*CommentMutation) EdgeCleared

func (m *CommentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CommentMutation) Field

func (m *CommentMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CommentMutation) FieldCleared

func (m *CommentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CommentMutation) Fields

func (m *CommentMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*CommentMutation) ID

func (m *CommentMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CommentMutation) IDs

func (m *CommentMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CommentMutation) OldAnonymous

func (m *CommentMutation) OldAnonymous(ctx context.Context) (v bool, err error)

OldAnonymous returns the old "anonymous" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldBenefitScores

func (m *CommentMutation) OldBenefitScores(ctx context.Context) (v int8, err error)

OldBenefitScores returns the old "benefit_scores" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldContent

func (m *CommentMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldCreatedAt

func (m *CommentMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldDeletedAt

func (m *CommentMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldDescriptionScores

func (m *CommentMutation) OldDescriptionScores(ctx context.Context) (v int8, err error)

OldDescriptionScores returns the old "description_scores" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldField

func (m *CommentMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*CommentMutation) OldOrderID

func (m *CommentMutation) OldOrderID(ctx context.Context) (v uint64, err error)

OldOrderID returns the old "order_id" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldOrderItemID

func (m *CommentMutation) OldOrderItemID(ctx context.Context) (v uint64, err error)

OldOrderItemID returns the old "order_item_id" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldPicUrls

func (m *CommentMutation) OldPicUrls(ctx context.Context) (v string, err error)

OldPicUrls returns the old "pic_urls" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldReplyContent

func (m *CommentMutation) OldReplyContent(ctx context.Context) (v string, err error)

OldReplyContent returns the old "reply_content" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldReplyStatus

func (m *CommentMutation) OldReplyStatus(ctx context.Context) (v bool, err error)

OldReplyStatus returns the old "reply_status" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldReplyTime

func (m *CommentMutation) OldReplyTime(ctx context.Context) (v time.Time, err error)

OldReplyTime returns the old "reply_time" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldReplyUserID

func (m *CommentMutation) OldReplyUserID(ctx context.Context) (v int, err error)

OldReplyUserID returns the old "reply_user_id" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldScores

func (m *CommentMutation) OldScores(ctx context.Context) (v int8, err error)

OldScores returns the old "scores" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldSkuID

func (m *CommentMutation) OldSkuID(ctx context.Context) (v uint64, err error)

OldSkuID returns the old "sku_id" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldSkuPicURL

func (m *CommentMutation) OldSkuPicURL(ctx context.Context) (v string, err error)

OldSkuPicURL returns the old "sku_pic_url" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldSkuProperties

func (m *CommentMutation) OldSkuProperties(ctx context.Context) (v []entType.SkuProperty, err error)

OldSkuProperties returns the old "sku_properties" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldSpuID

func (m *CommentMutation) OldSpuID(ctx context.Context) (v uint64, err error)

OldSpuID returns the old "spu_id" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldSpuName

func (m *CommentMutation) OldSpuName(ctx context.Context) (v string, err error)

OldSpuName returns the old "spu_name" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldUpdatedAt

func (m *CommentMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldUserAvatar

func (m *CommentMutation) OldUserAvatar(ctx context.Context) (v string, err error)

OldUserAvatar returns the old "user_avatar" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldUserID

func (m *CommentMutation) OldUserID(ctx context.Context) (v uint64, err error)

OldUserID returns the old "user_id" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldUserNickname

func (m *CommentMutation) OldUserNickname(ctx context.Context) (v string, err error)

OldUserNickname returns the old "user_nickname" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) OldVisible

func (m *CommentMutation) OldVisible(ctx context.Context) (v bool, err error)

OldVisible returns the old "visible" field's value of the Comment entity. If the Comment object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CommentMutation) Op

func (m *CommentMutation) Op() Op

Op returns the operation name.

func (*CommentMutation) OrderID

func (m *CommentMutation) OrderID() (r uint64, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*CommentMutation) OrderIDCleared

func (m *CommentMutation) OrderIDCleared() bool

OrderIDCleared returns if the "order_id" field was cleared in this mutation.

func (*CommentMutation) OrderItemID

func (m *CommentMutation) OrderItemID() (r uint64, exists bool)

OrderItemID returns the value of the "order_item_id" field in the mutation.

func (*CommentMutation) OrderItemIDCleared

func (m *CommentMutation) OrderItemIDCleared() bool

OrderItemIDCleared returns if the "order_item_id" field was cleared in this mutation.

func (*CommentMutation) PicUrls

func (m *CommentMutation) PicUrls() (r string, exists bool)

PicUrls returns the value of the "pic_urls" field in the mutation.

func (*CommentMutation) PicUrlsCleared

func (m *CommentMutation) PicUrlsCleared() bool

PicUrlsCleared returns if the "pic_urls" field was cleared in this mutation.

func (*CommentMutation) RemovedEdges

func (m *CommentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CommentMutation) RemovedIDs

func (m *CommentMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*CommentMutation) ReplyContent

func (m *CommentMutation) ReplyContent() (r string, exists bool)

ReplyContent returns the value of the "reply_content" field in the mutation.

func (*CommentMutation) ReplyContentCleared

func (m *CommentMutation) ReplyContentCleared() bool

ReplyContentCleared returns if the "reply_content" field was cleared in this mutation.

func (*CommentMutation) ReplyStatus

func (m *CommentMutation) ReplyStatus() (r bool, exists bool)

ReplyStatus returns the value of the "reply_status" field in the mutation.

func (*CommentMutation) ReplyStatusCleared

func (m *CommentMutation) ReplyStatusCleared() bool

ReplyStatusCleared returns if the "reply_status" field was cleared in this mutation.

func (*CommentMutation) ReplyTime

func (m *CommentMutation) ReplyTime() (r time.Time, exists bool)

ReplyTime returns the value of the "reply_time" field in the mutation.

func (*CommentMutation) ReplyTimeCleared

func (m *CommentMutation) ReplyTimeCleared() bool

ReplyTimeCleared returns if the "reply_time" field was cleared in this mutation.

func (*CommentMutation) ReplyUserID

func (m *CommentMutation) ReplyUserID() (r int, exists bool)

ReplyUserID returns the value of the "reply_user_id" field in the mutation.

func (*CommentMutation) ReplyUserIDCleared

func (m *CommentMutation) ReplyUserIDCleared() bool

ReplyUserIDCleared returns if the "reply_user_id" field was cleared in this mutation.

func (*CommentMutation) ResetAnonymous

func (m *CommentMutation) ResetAnonymous()

ResetAnonymous resets all changes to the "anonymous" field.

func (*CommentMutation) ResetBenefitScores

func (m *CommentMutation) ResetBenefitScores()

ResetBenefitScores resets all changes to the "benefit_scores" field.

func (*CommentMutation) ResetContent

func (m *CommentMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*CommentMutation) ResetCreatedAt

func (m *CommentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CommentMutation) ResetDeletedAt

func (m *CommentMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CommentMutation) ResetDescriptionScores

func (m *CommentMutation) ResetDescriptionScores()

ResetDescriptionScores resets all changes to the "description_scores" field.

func (*CommentMutation) ResetEdge

func (m *CommentMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*CommentMutation) ResetField

func (m *CommentMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*CommentMutation) ResetOrderID

func (m *CommentMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*CommentMutation) ResetOrderItemID

func (m *CommentMutation) ResetOrderItemID()

ResetOrderItemID resets all changes to the "order_item_id" field.

func (*CommentMutation) ResetPicUrls

func (m *CommentMutation) ResetPicUrls()

ResetPicUrls resets all changes to the "pic_urls" field.

func (*CommentMutation) ResetReplyContent

func (m *CommentMutation) ResetReplyContent()

ResetReplyContent resets all changes to the "reply_content" field.

func (*CommentMutation) ResetReplyStatus

func (m *CommentMutation) ResetReplyStatus()

ResetReplyStatus resets all changes to the "reply_status" field.

func (*CommentMutation) ResetReplyTime

func (m *CommentMutation) ResetReplyTime()

ResetReplyTime resets all changes to the "reply_time" field.

func (*CommentMutation) ResetReplyUserID

func (m *CommentMutation) ResetReplyUserID()

ResetReplyUserID resets all changes to the "reply_user_id" field.

func (*CommentMutation) ResetScores

func (m *CommentMutation) ResetScores()

ResetScores resets all changes to the "scores" field.

func (*CommentMutation) ResetSkuID

func (m *CommentMutation) ResetSkuID()

ResetSkuID resets all changes to the "sku_id" field.

func (*CommentMutation) ResetSkuPicURL

func (m *CommentMutation) ResetSkuPicURL()

ResetSkuPicURL resets all changes to the "sku_pic_url" field.

func (*CommentMutation) ResetSkuProperties

func (m *CommentMutation) ResetSkuProperties()

ResetSkuProperties resets all changes to the "sku_properties" field.

func (*CommentMutation) ResetSkus

func (m *CommentMutation) ResetSkus()

ResetSkus resets all changes to the "skus" edge.

func (*CommentMutation) ResetSpuID

func (m *CommentMutation) ResetSpuID()

ResetSpuID resets all changes to the "spu_id" field.

func (*CommentMutation) ResetSpuName

func (m *CommentMutation) ResetSpuName()

ResetSpuName resets all changes to the "spu_name" field.

func (*CommentMutation) ResetUpdatedAt

func (m *CommentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CommentMutation) ResetUserAvatar

func (m *CommentMutation) ResetUserAvatar()

ResetUserAvatar resets all changes to the "user_avatar" field.

func (*CommentMutation) ResetUserID

func (m *CommentMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*CommentMutation) ResetUserNickname

func (m *CommentMutation) ResetUserNickname()

ResetUserNickname resets all changes to the "user_nickname" field.

func (*CommentMutation) ResetVisible

func (m *CommentMutation) ResetVisible()

ResetVisible resets all changes to the "visible" field.

func (*CommentMutation) Scores

func (m *CommentMutation) Scores() (r int8, exists bool)

Scores returns the value of the "scores" field in the mutation.

func (*CommentMutation) ScoresCleared

func (m *CommentMutation) ScoresCleared() bool

ScoresCleared returns if the "scores" field was cleared in this mutation.

func (*CommentMutation) SetAnonymous

func (m *CommentMutation) SetAnonymous(b bool)

SetAnonymous sets the "anonymous" field.

func (*CommentMutation) SetBenefitScores

func (m *CommentMutation) SetBenefitScores(i int8)

SetBenefitScores sets the "benefit_scores" field.

func (*CommentMutation) SetContent

func (m *CommentMutation) SetContent(s string)

SetContent sets the "content" field.

func (*CommentMutation) SetCreatedAt

func (m *CommentMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CommentMutation) SetDeletedAt

func (m *CommentMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*CommentMutation) SetDescriptionScores

func (m *CommentMutation) SetDescriptionScores(i int8)

SetDescriptionScores sets the "description_scores" field.

func (*CommentMutation) SetField

func (m *CommentMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CommentMutation) SetID

func (m *CommentMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Comment entities.

func (*CommentMutation) SetOp

func (m *CommentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CommentMutation) SetOrderID

func (m *CommentMutation) SetOrderID(u uint64)

SetOrderID sets the "order_id" field.

func (*CommentMutation) SetOrderItemID

func (m *CommentMutation) SetOrderItemID(u uint64)

SetOrderItemID sets the "order_item_id" field.

func (*CommentMutation) SetPicUrls

func (m *CommentMutation) SetPicUrls(s string)

SetPicUrls sets the "pic_urls" field.

func (*CommentMutation) SetReplyContent

func (m *CommentMutation) SetReplyContent(s string)

SetReplyContent sets the "reply_content" field.

func (*CommentMutation) SetReplyStatus

func (m *CommentMutation) SetReplyStatus(b bool)

SetReplyStatus sets the "reply_status" field.

func (*CommentMutation) SetReplyTime

func (m *CommentMutation) SetReplyTime(t time.Time)

SetReplyTime sets the "reply_time" field.

func (*CommentMutation) SetReplyUserID

func (m *CommentMutation) SetReplyUserID(i int)

SetReplyUserID sets the "reply_user_id" field.

func (*CommentMutation) SetScores

func (m *CommentMutation) SetScores(i int8)

SetScores sets the "scores" field.

func (*CommentMutation) SetSkuID

func (m *CommentMutation) SetSkuID(u uint64)

SetSkuID sets the "sku_id" field.

func (*CommentMutation) SetSkuPicURL

func (m *CommentMutation) SetSkuPicURL(s string)

SetSkuPicURL sets the "sku_pic_url" field.

func (*CommentMutation) SetSkuProperties

func (m *CommentMutation) SetSkuProperties(etp []entType.SkuProperty)

SetSkuProperties sets the "sku_properties" field.

func (*CommentMutation) SetSkusID

func (m *CommentMutation) SetSkusID(id uint64)

SetSkusID sets the "skus" edge to the Sku entity by id.

func (*CommentMutation) SetSpuID

func (m *CommentMutation) SetSpuID(u uint64)

SetSpuID sets the "spu_id" field.

func (*CommentMutation) SetSpuName

func (m *CommentMutation) SetSpuName(s string)

SetSpuName sets the "spu_name" field.

func (*CommentMutation) SetUpdatedAt

func (m *CommentMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CommentMutation) SetUserAvatar

func (m *CommentMutation) SetUserAvatar(s string)

SetUserAvatar sets the "user_avatar" field.

func (*CommentMutation) SetUserID

func (m *CommentMutation) SetUserID(u uint64)

SetUserID sets the "user_id" field.

func (*CommentMutation) SetUserNickname

func (m *CommentMutation) SetUserNickname(s string)

SetUserNickname sets the "user_nickname" field.

func (*CommentMutation) SetVisible

func (m *CommentMutation) SetVisible(b bool)

SetVisible sets the "visible" field.

func (*CommentMutation) SkuID

func (m *CommentMutation) SkuID() (r uint64, exists bool)

SkuID returns the value of the "sku_id" field in the mutation.

func (*CommentMutation) SkuIDCleared

func (m *CommentMutation) SkuIDCleared() bool

SkuIDCleared returns if the "sku_id" field was cleared in this mutation.

func (*CommentMutation) SkuPicURL

func (m *CommentMutation) SkuPicURL() (r string, exists bool)

SkuPicURL returns the value of the "sku_pic_url" field in the mutation.

func (*CommentMutation) SkuProperties

func (m *CommentMutation) SkuProperties() (r []entType.SkuProperty, exists bool)

SkuProperties returns the value of the "sku_properties" field in the mutation.

func (*CommentMutation) SkuPropertiesCleared

func (m *CommentMutation) SkuPropertiesCleared() bool

SkuPropertiesCleared returns if the "sku_properties" field was cleared in this mutation.

func (*CommentMutation) SkusCleared

func (m *CommentMutation) SkusCleared() bool

SkusCleared reports if the "skus" edge to the Sku entity was cleared.

func (*CommentMutation) SkusID

func (m *CommentMutation) SkusID() (id uint64, exists bool)

SkusID returns the "skus" edge ID in the mutation.

func (*CommentMutation) SkusIDs

func (m *CommentMutation) SkusIDs() (ids []uint64)

SkusIDs returns the "skus" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SkusID instead. It exists only for internal usage by the builders.

func (*CommentMutation) SpuID

func (m *CommentMutation) SpuID() (r uint64, exists bool)

SpuID returns the value of the "spu_id" field in the mutation.

func (*CommentMutation) SpuIDCleared

func (m *CommentMutation) SpuIDCleared() bool

SpuIDCleared returns if the "spu_id" field was cleared in this mutation.

func (*CommentMutation) SpuName

func (m *CommentMutation) SpuName() (r string, exists bool)

SpuName returns the value of the "spu_name" field in the mutation.

func (*CommentMutation) SpuNameCleared

func (m *CommentMutation) SpuNameCleared() bool

SpuNameCleared returns if the "spu_name" field was cleared in this mutation.

func (CommentMutation) Tx

func (m CommentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CommentMutation) Type

func (m *CommentMutation) Type() string

Type returns the node type of this mutation (Comment).

func (*CommentMutation) UpdatedAt

func (m *CommentMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CommentMutation) UserAvatar

func (m *CommentMutation) UserAvatar() (r string, exists bool)

UserAvatar returns the value of the "user_avatar" field in the mutation.

func (*CommentMutation) UserAvatarCleared

func (m *CommentMutation) UserAvatarCleared() bool

UserAvatarCleared returns if the "user_avatar" field was cleared in this mutation.

func (*CommentMutation) UserID

func (m *CommentMutation) UserID() (r uint64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*CommentMutation) UserIDCleared

func (m *CommentMutation) UserIDCleared() bool

UserIDCleared returns if the "user_id" field was cleared in this mutation.

func (*CommentMutation) UserNickname

func (m *CommentMutation) UserNickname() (r string, exists bool)

UserNickname returns the value of the "user_nickname" field in the mutation.

func (*CommentMutation) UserNicknameCleared

func (m *CommentMutation) UserNicknameCleared() bool

UserNicknameCleared returns if the "user_nickname" field was cleared in this mutation.

func (*CommentMutation) Visible

func (m *CommentMutation) Visible() (r bool, exists bool)

Visible returns the value of the "visible" field in the mutation.

func (*CommentMutation) VisibleCleared

func (m *CommentMutation) VisibleCleared() bool

VisibleCleared returns if the "visible" field was cleared in this mutation.

func (*CommentMutation) Where

func (m *CommentMutation) Where(ps ...predicate.Comment)

Where appends a list predicates to the CommentMutation builder.

func (*CommentMutation) WhereP

func (m *CommentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CommentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CommentPageList

type CommentPageList struct {
	List        []*Comment   `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

CommentPageList is Comment PageList result.

type CommentPager

type CommentPager struct {
	Order  comment.OrderOption
	Filter func(*CommentQuery) (*CommentQuery, error)
}

func (*CommentPager) ApplyFilter

func (p *CommentPager) ApplyFilter(query *CommentQuery) (*CommentQuery, error)

type CommentPaginateOption

type CommentPaginateOption func(*CommentPager)

CommentPaginateOption enables pagination customization.

type CommentQuery

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

CommentQuery is the builder for querying Comment entities.

func (*CommentQuery) Aggregate

func (cq *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate returns a CommentSelect configured with the given aggregations.

func (*CommentQuery) All

func (cq *CommentQuery) All(ctx context.Context) ([]*Comment, error)

All executes the query and returns a list of Comments.

func (*CommentQuery) AllX

func (cq *CommentQuery) AllX(ctx context.Context) []*Comment

AllX is like All, but panics if an error occurs.

func (*CommentQuery) Clone

func (cq *CommentQuery) Clone() *CommentQuery

Clone returns a duplicate of the CommentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CommentQuery) Count

func (cq *CommentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CommentQuery) CountX

func (cq *CommentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CommentQuery) Exist

func (cq *CommentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CommentQuery) ExistX

func (cq *CommentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CommentQuery) First

func (cq *CommentQuery) First(ctx context.Context) (*Comment, error)

First returns the first Comment entity from the query. Returns a *NotFoundError when no Comment was found.

func (*CommentQuery) FirstID

func (cq *CommentQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Comment ID from the query. Returns a *NotFoundError when no Comment ID was found.

func (*CommentQuery) FirstIDX

func (cq *CommentQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*CommentQuery) FirstX

func (cq *CommentQuery) FirstX(ctx context.Context) *Comment

FirstX is like First, but panics if an error occurs.

func (*CommentQuery) GroupBy

func (cq *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Comment.Query().
	GroupBy(comment.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CommentQuery) IDs

func (cq *CommentQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Comment IDs.

func (*CommentQuery) IDsX

func (cq *CommentQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*CommentQuery) Limit

func (cq *CommentQuery) Limit(limit int) *CommentQuery

Limit the number of records to be returned by this query.

func (*CommentQuery) Offset

func (cq *CommentQuery) Offset(offset int) *CommentQuery

Offset to start from.

func (*CommentQuery) Only

func (cq *CommentQuery) Only(ctx context.Context) (*Comment, error)

Only returns a single Comment entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Comment entity is found. Returns a *NotFoundError when no Comment entities are found.

func (*CommentQuery) OnlyID

func (cq *CommentQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Comment ID in the query. Returns a *NotSingularError when more than one Comment ID is found. Returns a *NotFoundError when no entities are found.

func (*CommentQuery) OnlyIDX

func (cq *CommentQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CommentQuery) OnlyX

func (cq *CommentQuery) OnlyX(ctx context.Context) *Comment

OnlyX is like Only, but panics if an error occurs.

func (*CommentQuery) Order

func (cq *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery

Order specifies how the records should be ordered.

func (*CommentQuery) Page

func (c *CommentQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...CommentPaginateOption,
) (*CommentPageList, error)

func (*CommentQuery) QuerySkus

func (cq *CommentQuery) QuerySkus() *SkuQuery

QuerySkus chains the current query on the "skus" edge.

func (*CommentQuery) Select

func (cq *CommentQuery) Select(fields ...string) *CommentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Comment.Query().
	Select(comment.FieldCreatedAt).
	Scan(ctx, &v)

func (*CommentQuery) Unique

func (cq *CommentQuery) Unique(unique bool) *CommentQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*CommentQuery) Where

func (cq *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery

Where adds a new predicate for the CommentQuery builder.

func (*CommentQuery) WithSkus

func (cq *CommentQuery) WithSkus(opts ...func(*SkuQuery)) *CommentQuery

WithSkus tells the query-builder to eager-load the nodes that are connected to the "skus" edge. The optional arguments are used to configure the query builder of the edge.

type CommentSelect

type CommentSelect struct {
	*CommentQuery
	// contains filtered or unexported fields
}

CommentSelect is the builder for selecting fields of Comment entities.

func (*CommentSelect) Aggregate

func (cs *CommentSelect) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CommentSelect) Bool

func (s *CommentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CommentSelect) BoolX

func (s *CommentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CommentSelect) Bools

func (s *CommentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CommentSelect) BoolsX

func (s *CommentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CommentSelect) Float64

func (s *CommentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CommentSelect) Float64X

func (s *CommentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CommentSelect) Float64s

func (s *CommentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CommentSelect) Float64sX

func (s *CommentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CommentSelect) Int

func (s *CommentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CommentSelect) IntX

func (s *CommentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CommentSelect) Ints

func (s *CommentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CommentSelect) IntsX

func (s *CommentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CommentSelect) Scan

func (cs *CommentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CommentSelect) ScanX

func (s *CommentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CommentSelect) String

func (s *CommentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CommentSelect) StringX

func (s *CommentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CommentSelect) Strings

func (s *CommentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CommentSelect) StringsX

func (s *CommentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CommentUpdate

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

CommentUpdate is the builder for updating Comment entities.

func (*CommentUpdate) AddBenefitScores

func (cu *CommentUpdate) AddBenefitScores(i int8) *CommentUpdate

AddBenefitScores adds i to the "benefit_scores" field.

func (*CommentUpdate) AddDescriptionScores

func (cu *CommentUpdate) AddDescriptionScores(i int8) *CommentUpdate

AddDescriptionScores adds i to the "description_scores" field.

func (*CommentUpdate) AddOrderID

func (cu *CommentUpdate) AddOrderID(u int64) *CommentUpdate

AddOrderID adds u to the "order_id" field.

func (*CommentUpdate) AddOrderItemID

func (cu *CommentUpdate) AddOrderItemID(u int64) *CommentUpdate

AddOrderItemID adds u to the "order_item_id" field.

func (*CommentUpdate) AddReplyUserID

func (cu *CommentUpdate) AddReplyUserID(i int) *CommentUpdate

AddReplyUserID adds i to the "reply_user_id" field.

func (*CommentUpdate) AddScores

func (cu *CommentUpdate) AddScores(i int8) *CommentUpdate

AddScores adds i to the "scores" field.

func (*CommentUpdate) AddSpuID

func (cu *CommentUpdate) AddSpuID(u int64) *CommentUpdate

AddSpuID adds u to the "spu_id" field.

func (*CommentUpdate) AddUserID

func (cu *CommentUpdate) AddUserID(u int64) *CommentUpdate

AddUserID adds u to the "user_id" field.

func (*CommentUpdate) AppendSkuProperties

func (cu *CommentUpdate) AppendSkuProperties(etp []entType.SkuProperty) *CommentUpdate

AppendSkuProperties appends etp to the "sku_properties" field.

func (*CommentUpdate) ClearAnonymous

func (cu *CommentUpdate) ClearAnonymous() *CommentUpdate

ClearAnonymous clears the value of the "anonymous" field.

func (*CommentUpdate) ClearBenefitScores

func (cu *CommentUpdate) ClearBenefitScores() *CommentUpdate

ClearBenefitScores clears the value of the "benefit_scores" field.

func (*CommentUpdate) ClearContent

func (cu *CommentUpdate) ClearContent() *CommentUpdate

ClearContent clears the value of the "content" field.

func (*CommentUpdate) ClearDeletedAt

func (cu *CommentUpdate) ClearDeletedAt() *CommentUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommentUpdate) ClearDescriptionScores

func (cu *CommentUpdate) ClearDescriptionScores() *CommentUpdate

ClearDescriptionScores clears the value of the "description_scores" field.

func (*CommentUpdate) ClearOrderID

func (cu *CommentUpdate) ClearOrderID() *CommentUpdate

ClearOrderID clears the value of the "order_id" field.

func (*CommentUpdate) ClearOrderItemID

func (cu *CommentUpdate) ClearOrderItemID() *CommentUpdate

ClearOrderItemID clears the value of the "order_item_id" field.

func (*CommentUpdate) ClearPicUrls

func (cu *CommentUpdate) ClearPicUrls() *CommentUpdate

ClearPicUrls clears the value of the "pic_urls" field.

func (*CommentUpdate) ClearReplyContent

func (cu *CommentUpdate) ClearReplyContent() *CommentUpdate

ClearReplyContent clears the value of the "reply_content" field.

func (*CommentUpdate) ClearReplyStatus

func (cu *CommentUpdate) ClearReplyStatus() *CommentUpdate

ClearReplyStatus clears the value of the "reply_status" field.

func (*CommentUpdate) ClearReplyTime

func (cu *CommentUpdate) ClearReplyTime() *CommentUpdate

ClearReplyTime clears the value of the "reply_time" field.

func (*CommentUpdate) ClearReplyUserID

func (cu *CommentUpdate) ClearReplyUserID() *CommentUpdate

ClearReplyUserID clears the value of the "reply_user_id" field.

func (*CommentUpdate) ClearScores

func (cu *CommentUpdate) ClearScores() *CommentUpdate

ClearScores clears the value of the "scores" field.

func (*CommentUpdate) ClearSkuID

func (cu *CommentUpdate) ClearSkuID() *CommentUpdate

ClearSkuID clears the value of the "sku_id" field.

func (*CommentUpdate) ClearSkuProperties

func (cu *CommentUpdate) ClearSkuProperties() *CommentUpdate

ClearSkuProperties clears the value of the "sku_properties" field.

func (*CommentUpdate) ClearSkus

func (cu *CommentUpdate) ClearSkus() *CommentUpdate

ClearSkus clears the "skus" edge to the Sku entity.

func (*CommentUpdate) ClearSpuID

func (cu *CommentUpdate) ClearSpuID() *CommentUpdate

ClearSpuID clears the value of the "spu_id" field.

func (*CommentUpdate) ClearSpuName

func (cu *CommentUpdate) ClearSpuName() *CommentUpdate

ClearSpuName clears the value of the "spu_name" field.

func (*CommentUpdate) ClearUserAvatar

func (cu *CommentUpdate) ClearUserAvatar() *CommentUpdate

ClearUserAvatar clears the value of the "user_avatar" field.

func (*CommentUpdate) ClearUserID

func (cu *CommentUpdate) ClearUserID() *CommentUpdate

ClearUserID clears the value of the "user_id" field.

func (*CommentUpdate) ClearUserNickname

func (cu *CommentUpdate) ClearUserNickname() *CommentUpdate

ClearUserNickname clears the value of the "user_nickname" field.

func (*CommentUpdate) ClearVisible

func (cu *CommentUpdate) ClearVisible() *CommentUpdate

ClearVisible clears the value of the "visible" field.

func (*CommentUpdate) Exec

func (cu *CommentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentUpdate) ExecX

func (cu *CommentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CommentUpdate) Mutation

func (cu *CommentUpdate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdate) Save

func (cu *CommentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CommentUpdate) SaveX

func (cu *CommentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CommentUpdate) SetAnonymous

func (cu *CommentUpdate) SetAnonymous(b bool) *CommentUpdate

SetAnonymous sets the "anonymous" field.

func (*CommentUpdate) SetBenefitScores

func (cu *CommentUpdate) SetBenefitScores(i int8) *CommentUpdate

SetBenefitScores sets the "benefit_scores" field.

func (*CommentUpdate) SetContent

func (cu *CommentUpdate) SetContent(s string) *CommentUpdate

SetContent sets the "content" field.

func (*CommentUpdate) SetDeletedAt

func (cu *CommentUpdate) SetDeletedAt(t time.Time) *CommentUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CommentUpdate) SetDescriptionScores

func (cu *CommentUpdate) SetDescriptionScores(i int8) *CommentUpdate

SetDescriptionScores sets the "description_scores" field.

func (*CommentUpdate) SetNillableAnonymous

func (cu *CommentUpdate) SetNillableAnonymous(b *bool) *CommentUpdate

SetNillableAnonymous sets the "anonymous" field if the given value is not nil.

func (*CommentUpdate) SetNillableBenefitScores

func (cu *CommentUpdate) SetNillableBenefitScores(i *int8) *CommentUpdate

SetNillableBenefitScores sets the "benefit_scores" field if the given value is not nil.

func (*CommentUpdate) SetNillableContent

func (cu *CommentUpdate) SetNillableContent(s *string) *CommentUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*CommentUpdate) SetNillableDeletedAt

func (cu *CommentUpdate) SetNillableDeletedAt(t *time.Time) *CommentUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CommentUpdate) SetNillableDescriptionScores

func (cu *CommentUpdate) SetNillableDescriptionScores(i *int8) *CommentUpdate

SetNillableDescriptionScores sets the "description_scores" field if the given value is not nil.

func (*CommentUpdate) SetNillableOrderID

func (cu *CommentUpdate) SetNillableOrderID(u *uint64) *CommentUpdate

SetNillableOrderID sets the "order_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableOrderItemID

func (cu *CommentUpdate) SetNillableOrderItemID(u *uint64) *CommentUpdate

SetNillableOrderItemID sets the "order_item_id" field if the given value is not nil.

func (*CommentUpdate) SetNillablePicUrls

func (cu *CommentUpdate) SetNillablePicUrls(s *string) *CommentUpdate

SetNillablePicUrls sets the "pic_urls" field if the given value is not nil.

func (*CommentUpdate) SetNillableReplyContent

func (cu *CommentUpdate) SetNillableReplyContent(s *string) *CommentUpdate

SetNillableReplyContent sets the "reply_content" field if the given value is not nil.

func (*CommentUpdate) SetNillableReplyStatus

func (cu *CommentUpdate) SetNillableReplyStatus(b *bool) *CommentUpdate

SetNillableReplyStatus sets the "reply_status" field if the given value is not nil.

func (*CommentUpdate) SetNillableReplyTime

func (cu *CommentUpdate) SetNillableReplyTime(t *time.Time) *CommentUpdate

SetNillableReplyTime sets the "reply_time" field if the given value is not nil.

func (*CommentUpdate) SetNillableReplyUserID

func (cu *CommentUpdate) SetNillableReplyUserID(i *int) *CommentUpdate

SetNillableReplyUserID sets the "reply_user_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableScores

func (cu *CommentUpdate) SetNillableScores(i *int8) *CommentUpdate

SetNillableScores sets the "scores" field if the given value is not nil.

func (*CommentUpdate) SetNillableSkuID

func (cu *CommentUpdate) SetNillableSkuID(u *uint64) *CommentUpdate

SetNillableSkuID sets the "sku_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableSkusID

func (cu *CommentUpdate) SetNillableSkusID(id *uint64) *CommentUpdate

SetNillableSkusID sets the "skus" edge to the Sku entity by ID if the given value is not nil.

func (*CommentUpdate) SetNillableSpuID

func (cu *CommentUpdate) SetNillableSpuID(u *uint64) *CommentUpdate

SetNillableSpuID sets the "spu_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableSpuName

func (cu *CommentUpdate) SetNillableSpuName(s *string) *CommentUpdate

SetNillableSpuName sets the "spu_name" field if the given value is not nil.

func (*CommentUpdate) SetNillableUserAvatar

func (cu *CommentUpdate) SetNillableUserAvatar(s *string) *CommentUpdate

SetNillableUserAvatar sets the "user_avatar" field if the given value is not nil.

func (*CommentUpdate) SetNillableUserID

func (cu *CommentUpdate) SetNillableUserID(u *uint64) *CommentUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableUserNickname

func (cu *CommentUpdate) SetNillableUserNickname(s *string) *CommentUpdate

SetNillableUserNickname sets the "user_nickname" field if the given value is not nil.

func (*CommentUpdate) SetNillableVisible

func (cu *CommentUpdate) SetNillableVisible(b *bool) *CommentUpdate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*CommentUpdate) SetNotNilAnonymous

func (c *CommentUpdate) SetNotNilAnonymous(value *bool) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilBenefitScores

func (c *CommentUpdate) SetNotNilBenefitScores(value *int8) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilContent

func (c *CommentUpdate) SetNotNilContent(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilDeletedAt

func (c *CommentUpdate) SetNotNilDeletedAt(value *time.Time) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilDescriptionScores

func (c *CommentUpdate) SetNotNilDescriptionScores(value *int8) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilOrderID

func (c *CommentUpdate) SetNotNilOrderID(value *uint64) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilOrderItemID

func (c *CommentUpdate) SetNotNilOrderItemID(value *uint64) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilPicUrls

func (c *CommentUpdate) SetNotNilPicUrls(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilReplyContent

func (c *CommentUpdate) SetNotNilReplyContent(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilReplyStatus

func (c *CommentUpdate) SetNotNilReplyStatus(value *bool) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilReplyTime

func (c *CommentUpdate) SetNotNilReplyTime(value *time.Time) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilReplyUserID

func (c *CommentUpdate) SetNotNilReplyUserID(value *int) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilScores

func (c *CommentUpdate) SetNotNilScores(value *int8) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilSkuID

func (c *CommentUpdate) SetNotNilSkuID(value *uint64) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilSkuPicURL

func (c *CommentUpdate) SetNotNilSkuPicURL(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilSkuProperties

func (c *CommentUpdate) SetNotNilSkuProperties(value *[]entType.SkuProperty) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilSpuID

func (c *CommentUpdate) SetNotNilSpuID(value *uint64) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilSpuName

func (c *CommentUpdate) SetNotNilSpuName(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilUpdatedAt

func (c *CommentUpdate) SetNotNilUpdatedAt(value *time.Time) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilUserAvatar

func (c *CommentUpdate) SetNotNilUserAvatar(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilUserID

func (c *CommentUpdate) SetNotNilUserID(value *uint64) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilUserNickname

func (c *CommentUpdate) SetNotNilUserNickname(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilVisible

func (c *CommentUpdate) SetNotNilVisible(value *bool) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetOrderID

func (cu *CommentUpdate) SetOrderID(u uint64) *CommentUpdate

SetOrderID sets the "order_id" field.

func (*CommentUpdate) SetOrderItemID

func (cu *CommentUpdate) SetOrderItemID(u uint64) *CommentUpdate

SetOrderItemID sets the "order_item_id" field.

func (*CommentUpdate) SetPicUrls

func (cu *CommentUpdate) SetPicUrls(s string) *CommentUpdate

SetPicUrls sets the "pic_urls" field.

func (*CommentUpdate) SetReplyContent

func (cu *CommentUpdate) SetReplyContent(s string) *CommentUpdate

SetReplyContent sets the "reply_content" field.

func (*CommentUpdate) SetReplyStatus

func (cu *CommentUpdate) SetReplyStatus(b bool) *CommentUpdate

SetReplyStatus sets the "reply_status" field.

func (*CommentUpdate) SetReplyTime

func (cu *CommentUpdate) SetReplyTime(t time.Time) *CommentUpdate

SetReplyTime sets the "reply_time" field.

func (*CommentUpdate) SetReplyUserID

func (cu *CommentUpdate) SetReplyUserID(i int) *CommentUpdate

SetReplyUserID sets the "reply_user_id" field.

func (*CommentUpdate) SetScores

func (cu *CommentUpdate) SetScores(i int8) *CommentUpdate

SetScores sets the "scores" field.

func (*CommentUpdate) SetSkuID

func (cu *CommentUpdate) SetSkuID(u uint64) *CommentUpdate

SetSkuID sets the "sku_id" field.

func (*CommentUpdate) SetSkuPicURL

func (cu *CommentUpdate) SetSkuPicURL(s string) *CommentUpdate

SetSkuPicURL sets the "sku_pic_url" field.

func (*CommentUpdate) SetSkuProperties

func (cu *CommentUpdate) SetSkuProperties(etp []entType.SkuProperty) *CommentUpdate

SetSkuProperties sets the "sku_properties" field.

func (*CommentUpdate) SetSkus

func (cu *CommentUpdate) SetSkus(s *Sku) *CommentUpdate

SetSkus sets the "skus" edge to the Sku entity.

func (*CommentUpdate) SetSkusID

func (cu *CommentUpdate) SetSkusID(id uint64) *CommentUpdate

SetSkusID sets the "skus" edge to the Sku entity by ID.

func (*CommentUpdate) SetSpuID

func (cu *CommentUpdate) SetSpuID(u uint64) *CommentUpdate

SetSpuID sets the "spu_id" field.

func (*CommentUpdate) SetSpuName

func (cu *CommentUpdate) SetSpuName(s string) *CommentUpdate

SetSpuName sets the "spu_name" field.

func (*CommentUpdate) SetUpdatedAt

func (cu *CommentUpdate) SetUpdatedAt(t time.Time) *CommentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CommentUpdate) SetUserAvatar

func (cu *CommentUpdate) SetUserAvatar(s string) *CommentUpdate

SetUserAvatar sets the "user_avatar" field.

func (*CommentUpdate) SetUserID

func (cu *CommentUpdate) SetUserID(u uint64) *CommentUpdate

SetUserID sets the "user_id" field.

func (*CommentUpdate) SetUserNickname

func (cu *CommentUpdate) SetUserNickname(s string) *CommentUpdate

SetUserNickname sets the "user_nickname" field.

func (*CommentUpdate) SetVisible

func (cu *CommentUpdate) SetVisible(b bool) *CommentUpdate

SetVisible sets the "visible" field.

func (*CommentUpdate) Where

func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate

Where appends a list predicates to the CommentUpdate builder.

type CommentUpdateOne

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

CommentUpdateOne is the builder for updating a single Comment entity.

func (*CommentUpdateOne) AddBenefitScores

func (cuo *CommentUpdateOne) AddBenefitScores(i int8) *CommentUpdateOne

AddBenefitScores adds i to the "benefit_scores" field.

func (*CommentUpdateOne) AddDescriptionScores

func (cuo *CommentUpdateOne) AddDescriptionScores(i int8) *CommentUpdateOne

AddDescriptionScores adds i to the "description_scores" field.

func (*CommentUpdateOne) AddOrderID

func (cuo *CommentUpdateOne) AddOrderID(u int64) *CommentUpdateOne

AddOrderID adds u to the "order_id" field.

func (*CommentUpdateOne) AddOrderItemID

func (cuo *CommentUpdateOne) AddOrderItemID(u int64) *CommentUpdateOne

AddOrderItemID adds u to the "order_item_id" field.

func (*CommentUpdateOne) AddReplyUserID

func (cuo *CommentUpdateOne) AddReplyUserID(i int) *CommentUpdateOne

AddReplyUserID adds i to the "reply_user_id" field.

func (*CommentUpdateOne) AddScores

func (cuo *CommentUpdateOne) AddScores(i int8) *CommentUpdateOne

AddScores adds i to the "scores" field.

func (*CommentUpdateOne) AddSpuID

func (cuo *CommentUpdateOne) AddSpuID(u int64) *CommentUpdateOne

AddSpuID adds u to the "spu_id" field.

func (*CommentUpdateOne) AddUserID

func (cuo *CommentUpdateOne) AddUserID(u int64) *CommentUpdateOne

AddUserID adds u to the "user_id" field.

func (*CommentUpdateOne) AppendSkuProperties

func (cuo *CommentUpdateOne) AppendSkuProperties(etp []entType.SkuProperty) *CommentUpdateOne

AppendSkuProperties appends etp to the "sku_properties" field.

func (*CommentUpdateOne) ClearAnonymous

func (cuo *CommentUpdateOne) ClearAnonymous() *CommentUpdateOne

ClearAnonymous clears the value of the "anonymous" field.

func (*CommentUpdateOne) ClearBenefitScores

func (cuo *CommentUpdateOne) ClearBenefitScores() *CommentUpdateOne

ClearBenefitScores clears the value of the "benefit_scores" field.

func (*CommentUpdateOne) ClearContent

func (cuo *CommentUpdateOne) ClearContent() *CommentUpdateOne

ClearContent clears the value of the "content" field.

func (*CommentUpdateOne) ClearDeletedAt

func (cuo *CommentUpdateOne) ClearDeletedAt() *CommentUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommentUpdateOne) ClearDescriptionScores

func (cuo *CommentUpdateOne) ClearDescriptionScores() *CommentUpdateOne

ClearDescriptionScores clears the value of the "description_scores" field.

func (*CommentUpdateOne) ClearOrderID

func (cuo *CommentUpdateOne) ClearOrderID() *CommentUpdateOne

ClearOrderID clears the value of the "order_id" field.

func (*CommentUpdateOne) ClearOrderItemID

func (cuo *CommentUpdateOne) ClearOrderItemID() *CommentUpdateOne

ClearOrderItemID clears the value of the "order_item_id" field.

func (*CommentUpdateOne) ClearPicUrls

func (cuo *CommentUpdateOne) ClearPicUrls() *CommentUpdateOne

ClearPicUrls clears the value of the "pic_urls" field.

func (*CommentUpdateOne) ClearReplyContent

func (cuo *CommentUpdateOne) ClearReplyContent() *CommentUpdateOne

ClearReplyContent clears the value of the "reply_content" field.

func (*CommentUpdateOne) ClearReplyStatus

func (cuo *CommentUpdateOne) ClearReplyStatus() *CommentUpdateOne

ClearReplyStatus clears the value of the "reply_status" field.

func (*CommentUpdateOne) ClearReplyTime

func (cuo *CommentUpdateOne) ClearReplyTime() *CommentUpdateOne

ClearReplyTime clears the value of the "reply_time" field.

func (*CommentUpdateOne) ClearReplyUserID

func (cuo *CommentUpdateOne) ClearReplyUserID() *CommentUpdateOne

ClearReplyUserID clears the value of the "reply_user_id" field.

func (*CommentUpdateOne) ClearScores

func (cuo *CommentUpdateOne) ClearScores() *CommentUpdateOne

ClearScores clears the value of the "scores" field.

func (*CommentUpdateOne) ClearSkuID

func (cuo *CommentUpdateOne) ClearSkuID() *CommentUpdateOne

ClearSkuID clears the value of the "sku_id" field.

func (*CommentUpdateOne) ClearSkuProperties

func (cuo *CommentUpdateOne) ClearSkuProperties() *CommentUpdateOne

ClearSkuProperties clears the value of the "sku_properties" field.

func (*CommentUpdateOne) ClearSkus

func (cuo *CommentUpdateOne) ClearSkus() *CommentUpdateOne

ClearSkus clears the "skus" edge to the Sku entity.

func (*CommentUpdateOne) ClearSpuID

func (cuo *CommentUpdateOne) ClearSpuID() *CommentUpdateOne

ClearSpuID clears the value of the "spu_id" field.

func (*CommentUpdateOne) ClearSpuName

func (cuo *CommentUpdateOne) ClearSpuName() *CommentUpdateOne

ClearSpuName clears the value of the "spu_name" field.

func (*CommentUpdateOne) ClearUserAvatar

func (cuo *CommentUpdateOne) ClearUserAvatar() *CommentUpdateOne

ClearUserAvatar clears the value of the "user_avatar" field.

func (*CommentUpdateOne) ClearUserID

func (cuo *CommentUpdateOne) ClearUserID() *CommentUpdateOne

ClearUserID clears the value of the "user_id" field.

func (*CommentUpdateOne) ClearUserNickname

func (cuo *CommentUpdateOne) ClearUserNickname() *CommentUpdateOne

ClearUserNickname clears the value of the "user_nickname" field.

func (*CommentUpdateOne) ClearVisible

func (cuo *CommentUpdateOne) ClearVisible() *CommentUpdateOne

ClearVisible clears the value of the "visible" field.

func (*CommentUpdateOne) Exec

func (cuo *CommentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommentUpdateOne) ExecX

func (cuo *CommentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CommentUpdateOne) Mutation

func (cuo *CommentUpdateOne) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdateOne) Save

func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)

Save executes the query and returns the updated Comment entity.

func (*CommentUpdateOne) SaveX

func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment

SaveX is like Save, but panics if an error occurs.

func (*CommentUpdateOne) Select

func (cuo *CommentUpdateOne) Select(field string, fields ...string) *CommentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CommentUpdateOne) SetAnonymous

func (cuo *CommentUpdateOne) SetAnonymous(b bool) *CommentUpdateOne

SetAnonymous sets the "anonymous" field.

func (*CommentUpdateOne) SetBenefitScores

func (cuo *CommentUpdateOne) SetBenefitScores(i int8) *CommentUpdateOne

SetBenefitScores sets the "benefit_scores" field.

func (*CommentUpdateOne) SetContent

func (cuo *CommentUpdateOne) SetContent(s string) *CommentUpdateOne

SetContent sets the "content" field.

func (*CommentUpdateOne) SetDeletedAt

func (cuo *CommentUpdateOne) SetDeletedAt(t time.Time) *CommentUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*CommentUpdateOne) SetDescriptionScores

func (cuo *CommentUpdateOne) SetDescriptionScores(i int8) *CommentUpdateOne

SetDescriptionScores sets the "description_scores" field.

func (*CommentUpdateOne) SetNillableAnonymous

func (cuo *CommentUpdateOne) SetNillableAnonymous(b *bool) *CommentUpdateOne

SetNillableAnonymous sets the "anonymous" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableBenefitScores

func (cuo *CommentUpdateOne) SetNillableBenefitScores(i *int8) *CommentUpdateOne

SetNillableBenefitScores sets the "benefit_scores" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableContent

func (cuo *CommentUpdateOne) SetNillableContent(s *string) *CommentUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableDeletedAt

func (cuo *CommentUpdateOne) SetNillableDeletedAt(t *time.Time) *CommentUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableDescriptionScores

func (cuo *CommentUpdateOne) SetNillableDescriptionScores(i *int8) *CommentUpdateOne

SetNillableDescriptionScores sets the "description_scores" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableOrderID

func (cuo *CommentUpdateOne) SetNillableOrderID(u *uint64) *CommentUpdateOne

SetNillableOrderID sets the "order_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableOrderItemID

func (cuo *CommentUpdateOne) SetNillableOrderItemID(u *uint64) *CommentUpdateOne

SetNillableOrderItemID sets the "order_item_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillablePicUrls

func (cuo *CommentUpdateOne) SetNillablePicUrls(s *string) *CommentUpdateOne

SetNillablePicUrls sets the "pic_urls" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableReplyContent

func (cuo *CommentUpdateOne) SetNillableReplyContent(s *string) *CommentUpdateOne

SetNillableReplyContent sets the "reply_content" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableReplyStatus

func (cuo *CommentUpdateOne) SetNillableReplyStatus(b *bool) *CommentUpdateOne

SetNillableReplyStatus sets the "reply_status" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableReplyTime

func (cuo *CommentUpdateOne) SetNillableReplyTime(t *time.Time) *CommentUpdateOne

SetNillableReplyTime sets the "reply_time" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableReplyUserID

func (cuo *CommentUpdateOne) SetNillableReplyUserID(i *int) *CommentUpdateOne

SetNillableReplyUserID sets the "reply_user_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableScores

func (cuo *CommentUpdateOne) SetNillableScores(i *int8) *CommentUpdateOne

SetNillableScores sets the "scores" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableSkuID

func (cuo *CommentUpdateOne) SetNillableSkuID(u *uint64) *CommentUpdateOne

SetNillableSkuID sets the "sku_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableSkusID

func (cuo *CommentUpdateOne) SetNillableSkusID(id *uint64) *CommentUpdateOne

SetNillableSkusID sets the "skus" edge to the Sku entity by ID if the given value is not nil.

func (*CommentUpdateOne) SetNillableSpuID

func (cuo *CommentUpdateOne) SetNillableSpuID(u *uint64) *CommentUpdateOne

SetNillableSpuID sets the "spu_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableSpuName

func (cuo *CommentUpdateOne) SetNillableSpuName(s *string) *CommentUpdateOne

SetNillableSpuName sets the "spu_name" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableUserAvatar

func (cuo *CommentUpdateOne) SetNillableUserAvatar(s *string) *CommentUpdateOne

SetNillableUserAvatar sets the "user_avatar" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableUserID

func (cuo *CommentUpdateOne) SetNillableUserID(u *uint64) *CommentUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableUserNickname

func (cuo *CommentUpdateOne) SetNillableUserNickname(s *string) *CommentUpdateOne

SetNillableUserNickname sets the "user_nickname" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableVisible

func (cuo *CommentUpdateOne) SetNillableVisible(b *bool) *CommentUpdateOne

SetNillableVisible sets the "visible" field if the given value is not nil.

func (*CommentUpdateOne) SetNotNilAnonymous

func (c *CommentUpdateOne) SetNotNilAnonymous(value *bool) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilBenefitScores

func (c *CommentUpdateOne) SetNotNilBenefitScores(value *int8) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilContent

func (c *CommentUpdateOne) SetNotNilContent(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilDeletedAt

func (c *CommentUpdateOne) SetNotNilDeletedAt(value *time.Time) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilDescriptionScores

func (c *CommentUpdateOne) SetNotNilDescriptionScores(value *int8) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilOrderID

func (c *CommentUpdateOne) SetNotNilOrderID(value *uint64) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilOrderItemID

func (c *CommentUpdateOne) SetNotNilOrderItemID(value *uint64) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilPicUrls

func (c *CommentUpdateOne) SetNotNilPicUrls(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilReplyContent

func (c *CommentUpdateOne) SetNotNilReplyContent(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilReplyStatus

func (c *CommentUpdateOne) SetNotNilReplyStatus(value *bool) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilReplyTime

func (c *CommentUpdateOne) SetNotNilReplyTime(value *time.Time) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilReplyUserID

func (c *CommentUpdateOne) SetNotNilReplyUserID(value *int) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilScores

func (c *CommentUpdateOne) SetNotNilScores(value *int8) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilSkuID

func (c *CommentUpdateOne) SetNotNilSkuID(value *uint64) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilSkuPicURL

func (c *CommentUpdateOne) SetNotNilSkuPicURL(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilSkuProperties

func (c *CommentUpdateOne) SetNotNilSkuProperties(value *[]entType.SkuProperty) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilSpuID

func (c *CommentUpdateOne) SetNotNilSpuID(value *uint64) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilSpuName

func (c *CommentUpdateOne) SetNotNilSpuName(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilUpdatedAt

func (c *CommentUpdateOne) SetNotNilUpdatedAt(value *time.Time) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilUserAvatar

func (c *CommentUpdateOne) SetNotNilUserAvatar(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilUserID

func (c *CommentUpdateOne) SetNotNilUserID(value *uint64) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilUserNickname

func (c *CommentUpdateOne) SetNotNilUserNickname(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilVisible

func (c *CommentUpdateOne) SetNotNilVisible(value *bool) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetOrderID

func (cuo *CommentUpdateOne) SetOrderID(u uint64) *CommentUpdateOne

SetOrderID sets the "order_id" field.

func (*CommentUpdateOne) SetOrderItemID

func (cuo *CommentUpdateOne) SetOrderItemID(u uint64) *CommentUpdateOne

SetOrderItemID sets the "order_item_id" field.

func (*CommentUpdateOne) SetPicUrls

func (cuo *CommentUpdateOne) SetPicUrls(s string) *CommentUpdateOne

SetPicUrls sets the "pic_urls" field.

func (*CommentUpdateOne) SetReplyContent

func (cuo *CommentUpdateOne) SetReplyContent(s string) *CommentUpdateOne

SetReplyContent sets the "reply_content" field.

func (*CommentUpdateOne) SetReplyStatus

func (cuo *CommentUpdateOne) SetReplyStatus(b bool) *CommentUpdateOne

SetReplyStatus sets the "reply_status" field.

func (*CommentUpdateOne) SetReplyTime

func (cuo *CommentUpdateOne) SetReplyTime(t time.Time) *CommentUpdateOne

SetReplyTime sets the "reply_time" field.

func (*CommentUpdateOne) SetReplyUserID

func (cuo *CommentUpdateOne) SetReplyUserID(i int) *CommentUpdateOne

SetReplyUserID sets the "reply_user_id" field.

func (*CommentUpdateOne) SetScores

func (cuo *CommentUpdateOne) SetScores(i int8) *CommentUpdateOne

SetScores sets the "scores" field.

func (*CommentUpdateOne) SetSkuID

func (cuo *CommentUpdateOne) SetSkuID(u uint64) *CommentUpdateOne

SetSkuID sets the "sku_id" field.

func (*CommentUpdateOne) SetSkuPicURL

func (cuo *CommentUpdateOne) SetSkuPicURL(s string) *CommentUpdateOne

SetSkuPicURL sets the "sku_pic_url" field.

func (*CommentUpdateOne) SetSkuProperties

func (cuo *CommentUpdateOne) SetSkuProperties(etp []entType.SkuProperty) *CommentUpdateOne

SetSkuProperties sets the "sku_properties" field.

func (*CommentUpdateOne) SetSkus

func (cuo *CommentUpdateOne) SetSkus(s *Sku) *CommentUpdateOne

SetSkus sets the "skus" edge to the Sku entity.

func (*CommentUpdateOne) SetSkusID

func (cuo *CommentUpdateOne) SetSkusID(id uint64) *CommentUpdateOne

SetSkusID sets the "skus" edge to the Sku entity by ID.

func (*CommentUpdateOne) SetSpuID

func (cuo *CommentUpdateOne) SetSpuID(u uint64) *CommentUpdateOne

SetSpuID sets the "spu_id" field.

func (*CommentUpdateOne) SetSpuName

func (cuo *CommentUpdateOne) SetSpuName(s string) *CommentUpdateOne

SetSpuName sets the "spu_name" field.

func (*CommentUpdateOne) SetUpdatedAt

func (cuo *CommentUpdateOne) SetUpdatedAt(t time.Time) *CommentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CommentUpdateOne) SetUserAvatar

func (cuo *CommentUpdateOne) SetUserAvatar(s string) *CommentUpdateOne

SetUserAvatar sets the "user_avatar" field.

func (*CommentUpdateOne) SetUserID

func (cuo *CommentUpdateOne) SetUserID(u uint64) *CommentUpdateOne

SetUserID sets the "user_id" field.

func (*CommentUpdateOne) SetUserNickname

func (cuo *CommentUpdateOne) SetUserNickname(s string) *CommentUpdateOne

SetUserNickname sets the "user_nickname" field.

func (*CommentUpdateOne) SetVisible

func (cuo *CommentUpdateOne) SetVisible(b bool) *CommentUpdateOne

SetVisible sets the "visible" field.

func (*CommentUpdateOne) Where

Where appends a list predicates to the CommentUpdate builder.

type Comments

type Comments []*Comment

Comments is a parsable slice of Comment.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageDetails

type PageDetails struct {
	Page  uint64 `json:"page"`
	Size  uint64 `json:"size"`
	Total uint64 `json:"total"`
}

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Properties

type Properties []*Property

Properties is a parsable slice of Property.

type Property

type Property struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// 名称
	Name string `json:"name,omitempty"`
	// 备注
	Remark string `json:"remark,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PropertyQuery when eager-loading is set.
	Edges PropertyEdges `json:"edges"`
	// contains filtered or unexported fields
}

Property is the model entity for the Property schema.

func (*Property) QueryPropertyValues

func (pr *Property) QueryPropertyValues() *PropertyValueQuery

QueryPropertyValues queries the "property_values" edge of the Property entity.

func (*Property) String

func (pr *Property) String() string

String implements the fmt.Stringer.

func (*Property) Unwrap

func (pr *Property) Unwrap() *Property

Unwrap unwraps the Property entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Property) Update

func (pr *Property) Update() *PropertyUpdateOne

Update returns a builder for updating this Property. Note that you need to call Property.Unwrap() before calling this method if this Property was returned from a transaction, and the transaction was committed or rolled back.

func (*Property) Value

func (pr *Property) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Property. This includes values selected through modifiers, order, etc.

type PropertyClient

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

PropertyClient is a client for the Property schema.

func NewPropertyClient

func NewPropertyClient(c config) *PropertyClient

NewPropertyClient returns a client for the Property from the given config.

func (*PropertyClient) Create

func (c *PropertyClient) Create() *PropertyCreate

Create returns a builder for creating a Property entity.

func (*PropertyClient) CreateBulk

func (c *PropertyClient) CreateBulk(builders ...*PropertyCreate) *PropertyCreateBulk

CreateBulk returns a builder for creating a bulk of Property entities.

func (*PropertyClient) Delete

func (c *PropertyClient) Delete() *PropertyDelete

Delete returns a delete builder for Property.

func (*PropertyClient) DeleteOne

func (c *PropertyClient) DeleteOne(pr *Property) *PropertyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PropertyClient) DeleteOneID

func (c *PropertyClient) DeleteOneID(id uint64) *PropertyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PropertyClient) Get

func (c *PropertyClient) Get(ctx context.Context, id uint64) (*Property, error)

Get returns a Property entity by its id.

func (*PropertyClient) GetX

func (c *PropertyClient) GetX(ctx context.Context, id uint64) *Property

GetX is like Get, but panics if an error occurs.

func (*PropertyClient) Hooks

func (c *PropertyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PropertyClient) Intercept

func (c *PropertyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `property.Intercept(f(g(h())))`.

func (*PropertyClient) Interceptors

func (c *PropertyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PropertyClient) MapCreateBulk

func (c *PropertyClient) MapCreateBulk(slice any, setFunc func(*PropertyCreate, int)) *PropertyCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PropertyClient) Query

func (c *PropertyClient) Query() *PropertyQuery

Query returns a query builder for Property.

func (*PropertyClient) QueryPropertyValues

func (c *PropertyClient) QueryPropertyValues(pr *Property) *PropertyValueQuery

QueryPropertyValues queries the property_values edge of a Property.

func (*PropertyClient) Update

func (c *PropertyClient) Update() *PropertyUpdate

Update returns an update builder for Property.

func (*PropertyClient) UpdateOne

func (c *PropertyClient) UpdateOne(pr *Property) *PropertyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PropertyClient) UpdateOneID

func (c *PropertyClient) UpdateOneID(id uint64) *PropertyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PropertyClient) Use

func (c *PropertyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `property.Hooks(f(g(h())))`.

type PropertyCreate

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

PropertyCreate is the builder for creating a Property entity.

func (*PropertyCreate) AddPropertyValueIDs

func (pc *PropertyCreate) AddPropertyValueIDs(ids ...uint64) *PropertyCreate

AddPropertyValueIDs adds the "property_values" edge to the PropertyValue entity by IDs.

func (*PropertyCreate) AddPropertyValues

func (pc *PropertyCreate) AddPropertyValues(p ...*PropertyValue) *PropertyCreate

AddPropertyValues adds the "property_values" edges to the PropertyValue entity.

func (*PropertyCreate) Exec

func (pc *PropertyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PropertyCreate) ExecX

func (pc *PropertyCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyCreate) Mutation

func (pc *PropertyCreate) Mutation() *PropertyMutation

Mutation returns the PropertyMutation object of the builder.

func (*PropertyCreate) Save

func (pc *PropertyCreate) Save(ctx context.Context) (*Property, error)

Save creates the Property in the database.

func (*PropertyCreate) SaveX

func (pc *PropertyCreate) SaveX(ctx context.Context) *Property

SaveX calls Save and panics if Save returns an error.

func (*PropertyCreate) SetCreatedAt

func (pc *PropertyCreate) SetCreatedAt(t time.Time) *PropertyCreate

SetCreatedAt sets the "created_at" field.

func (*PropertyCreate) SetDeletedAt

func (pc *PropertyCreate) SetDeletedAt(t time.Time) *PropertyCreate

SetDeletedAt sets the "deleted_at" field.

func (*PropertyCreate) SetID

func (pc *PropertyCreate) SetID(u uint64) *PropertyCreate

SetID sets the "id" field.

func (*PropertyCreate) SetName

func (pc *PropertyCreate) SetName(s string) *PropertyCreate

SetName sets the "name" field.

func (*PropertyCreate) SetNillableCreatedAt

func (pc *PropertyCreate) SetNillableCreatedAt(t *time.Time) *PropertyCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PropertyCreate) SetNillableDeletedAt

func (pc *PropertyCreate) SetNillableDeletedAt(t *time.Time) *PropertyCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PropertyCreate) SetNillableName

func (pc *PropertyCreate) SetNillableName(s *string) *PropertyCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*PropertyCreate) SetNillableRemark

func (pc *PropertyCreate) SetNillableRemark(s *string) *PropertyCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PropertyCreate) SetNillableStatus

func (pc *PropertyCreate) SetNillableStatus(u *uint8) *PropertyCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PropertyCreate) SetNillableUpdatedAt

func (pc *PropertyCreate) SetNillableUpdatedAt(t *time.Time) *PropertyCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PropertyCreate) SetNotNilDeletedAt

func (pr *PropertyCreate) SetNotNilDeletedAt(value *time.Time) *PropertyCreate

set field if value's pointer is not nil.

func (*PropertyCreate) SetNotNilName

func (pr *PropertyCreate) SetNotNilName(value *string) *PropertyCreate

set field if value's pointer is not nil.

func (*PropertyCreate) SetNotNilRemark

func (pr *PropertyCreate) SetNotNilRemark(value *string) *PropertyCreate

set field if value's pointer is not nil.

func (*PropertyCreate) SetNotNilStatus

func (pr *PropertyCreate) SetNotNilStatus(value *uint8) *PropertyCreate

set field if value's pointer is not nil.

func (*PropertyCreate) SetNotNilUpdatedAt

func (pr *PropertyCreate) SetNotNilUpdatedAt(value *time.Time) *PropertyCreate

set field if value's pointer is not nil.

func (*PropertyCreate) SetRemark

func (pc *PropertyCreate) SetRemark(s string) *PropertyCreate

SetRemark sets the "remark" field.

func (*PropertyCreate) SetStatus

func (pc *PropertyCreate) SetStatus(u uint8) *PropertyCreate

SetStatus sets the "status" field.

func (*PropertyCreate) SetUpdatedAt

func (pc *PropertyCreate) SetUpdatedAt(t time.Time) *PropertyCreate

SetUpdatedAt sets the "updated_at" field.

type PropertyCreateBulk

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

PropertyCreateBulk is the builder for creating many Property entities in bulk.

func (*PropertyCreateBulk) Exec

func (pcb *PropertyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PropertyCreateBulk) ExecX

func (pcb *PropertyCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyCreateBulk) Save

func (pcb *PropertyCreateBulk) Save(ctx context.Context) ([]*Property, error)

Save creates the Property entities in the database.

func (*PropertyCreateBulk) SaveX

func (pcb *PropertyCreateBulk) SaveX(ctx context.Context) []*Property

SaveX is like Save, but panics if an error occurs.

type PropertyDelete

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

PropertyDelete is the builder for deleting a Property entity.

func (*PropertyDelete) Exec

func (pd *PropertyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PropertyDelete) ExecX

func (pd *PropertyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PropertyDelete) Where

func (pd *PropertyDelete) Where(ps ...predicate.Property) *PropertyDelete

Where appends a list predicates to the PropertyDelete builder.

type PropertyDeleteOne

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

PropertyDeleteOne is the builder for deleting a single Property entity.

func (*PropertyDeleteOne) Exec

func (pdo *PropertyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PropertyDeleteOne) ExecX

func (pdo *PropertyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyDeleteOne) Where

Where appends a list predicates to the PropertyDelete builder.

type PropertyEdges

type PropertyEdges struct {
	// PropertyValues holds the value of the property_values edge.
	PropertyValues []*PropertyValue `json:"property_values,omitempty"`
	// contains filtered or unexported fields
}

PropertyEdges holds the relations/edges for other nodes in the graph.

func (PropertyEdges) PropertyValuesOrErr

func (e PropertyEdges) PropertyValuesOrErr() ([]*PropertyValue, error)

PropertyValuesOrErr returns the PropertyValues value or an error if the edge was not loaded in eager-loading.

type PropertyGroupBy

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

PropertyGroupBy is the group-by builder for Property entities.

func (*PropertyGroupBy) Aggregate

func (pgb *PropertyGroupBy) Aggregate(fns ...AggregateFunc) *PropertyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PropertyGroupBy) Bool

func (s *PropertyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) BoolX

func (s *PropertyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PropertyGroupBy) Bools

func (s *PropertyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) BoolsX

func (s *PropertyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PropertyGroupBy) Float64

func (s *PropertyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) Float64X

func (s *PropertyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PropertyGroupBy) Float64s

func (s *PropertyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) Float64sX

func (s *PropertyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PropertyGroupBy) Int

func (s *PropertyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) IntX

func (s *PropertyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PropertyGroupBy) Ints

func (s *PropertyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) IntsX

func (s *PropertyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PropertyGroupBy) Scan

func (pgb *PropertyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PropertyGroupBy) ScanX

func (s *PropertyGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PropertyGroupBy) String

func (s *PropertyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) StringX

func (s *PropertyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PropertyGroupBy) Strings

func (s *PropertyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PropertyGroupBy) StringsX

func (s *PropertyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PropertyMutation

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

PropertyMutation represents an operation that mutates the Property nodes in the graph.

func (*PropertyMutation) AddField

func (m *PropertyMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PropertyMutation) AddPropertyValueIDs

func (m *PropertyMutation) AddPropertyValueIDs(ids ...uint64)

AddPropertyValueIDs adds the "property_values" edge to the PropertyValue entity by ids.

func (*PropertyMutation) AddStatus

func (m *PropertyMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*PropertyMutation) AddedEdges

func (m *PropertyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PropertyMutation) AddedField

func (m *PropertyMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PropertyMutation) AddedFields

func (m *PropertyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PropertyMutation) AddedIDs

func (m *PropertyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PropertyMutation) AddedStatus

func (m *PropertyMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*PropertyMutation) ClearDeletedAt

func (m *PropertyMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PropertyMutation) ClearEdge

func (m *PropertyMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PropertyMutation) ClearField

func (m *PropertyMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PropertyMutation) ClearName

func (m *PropertyMutation) ClearName()

ClearName clears the value of the "name" field.

func (*PropertyMutation) ClearPropertyValues

func (m *PropertyMutation) ClearPropertyValues()

ClearPropertyValues clears the "property_values" edge to the PropertyValue entity.

func (*PropertyMutation) ClearRemark

func (m *PropertyMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*PropertyMutation) ClearStatus

func (m *PropertyMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*PropertyMutation) ClearedEdges

func (m *PropertyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PropertyMutation) ClearedFields

func (m *PropertyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PropertyMutation) Client

func (m PropertyMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PropertyMutation) CreatedAt

func (m *PropertyMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PropertyMutation) DeletedAt

func (m *PropertyMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PropertyMutation) DeletedAtCleared

func (m *PropertyMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PropertyMutation) EdgeCleared

func (m *PropertyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PropertyMutation) Field

func (m *PropertyMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PropertyMutation) FieldCleared

func (m *PropertyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PropertyMutation) Fields

func (m *PropertyMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PropertyMutation) ID

func (m *PropertyMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PropertyMutation) IDs

func (m *PropertyMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PropertyMutation) Name

func (m *PropertyMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PropertyMutation) NameCleared

func (m *PropertyMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*PropertyMutation) OldCreatedAt

func (m *PropertyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Property entity. If the Property object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyMutation) OldDeletedAt

func (m *PropertyMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Property entity. If the Property object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyMutation) OldField

func (m *PropertyMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PropertyMutation) OldName

func (m *PropertyMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Property entity. If the Property object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyMutation) OldRemark

func (m *PropertyMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the Property entity. If the Property object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyMutation) OldStatus

func (m *PropertyMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Property entity. If the Property object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyMutation) OldUpdatedAt

func (m *PropertyMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Property entity. If the Property object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyMutation) Op

func (m *PropertyMutation) Op() Op

Op returns the operation name.

func (*PropertyMutation) PropertyValuesCleared

func (m *PropertyMutation) PropertyValuesCleared() bool

PropertyValuesCleared reports if the "property_values" edge to the PropertyValue entity was cleared.

func (*PropertyMutation) PropertyValuesIDs

func (m *PropertyMutation) PropertyValuesIDs() (ids []uint64)

PropertyValuesIDs returns the "property_values" edge IDs in the mutation.

func (*PropertyMutation) Remark

func (m *PropertyMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*PropertyMutation) RemarkCleared

func (m *PropertyMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*PropertyMutation) RemovePropertyValueIDs

func (m *PropertyMutation) RemovePropertyValueIDs(ids ...uint64)

RemovePropertyValueIDs removes the "property_values" edge to the PropertyValue entity by IDs.

func (*PropertyMutation) RemovedEdges

func (m *PropertyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PropertyMutation) RemovedIDs

func (m *PropertyMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PropertyMutation) RemovedPropertyValuesIDs

func (m *PropertyMutation) RemovedPropertyValuesIDs() (ids []uint64)

RemovedPropertyValues returns the removed IDs of the "property_values" edge to the PropertyValue entity.

func (*PropertyMutation) ResetCreatedAt

func (m *PropertyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PropertyMutation) ResetDeletedAt

func (m *PropertyMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PropertyMutation) ResetEdge

func (m *PropertyMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PropertyMutation) ResetField

func (m *PropertyMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PropertyMutation) ResetName

func (m *PropertyMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PropertyMutation) ResetPropertyValues

func (m *PropertyMutation) ResetPropertyValues()

ResetPropertyValues resets all changes to the "property_values" edge.

func (*PropertyMutation) ResetRemark

func (m *PropertyMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*PropertyMutation) ResetStatus

func (m *PropertyMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PropertyMutation) ResetUpdatedAt

func (m *PropertyMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PropertyMutation) SetCreatedAt

func (m *PropertyMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PropertyMutation) SetDeletedAt

func (m *PropertyMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PropertyMutation) SetField

func (m *PropertyMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PropertyMutation) SetID

func (m *PropertyMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Property entities.

func (*PropertyMutation) SetName

func (m *PropertyMutation) SetName(s string)

SetName sets the "name" field.

func (*PropertyMutation) SetOp

func (m *PropertyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PropertyMutation) SetRemark

func (m *PropertyMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*PropertyMutation) SetStatus

func (m *PropertyMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*PropertyMutation) SetUpdatedAt

func (m *PropertyMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PropertyMutation) Status

func (m *PropertyMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*PropertyMutation) StatusCleared

func (m *PropertyMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (PropertyMutation) Tx

func (m PropertyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PropertyMutation) Type

func (m *PropertyMutation) Type() string

Type returns the node type of this mutation (Property).

func (*PropertyMutation) UpdatedAt

func (m *PropertyMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PropertyMutation) Where

func (m *PropertyMutation) Where(ps ...predicate.Property)

Where appends a list predicates to the PropertyMutation builder.

func (*PropertyMutation) WhereP

func (m *PropertyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PropertyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PropertyPageList

type PropertyPageList struct {
	List        []*Property  `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

PropertyPageList is Property PageList result.

type PropertyPager

type PropertyPager struct {
	Order  property.OrderOption
	Filter func(*PropertyQuery) (*PropertyQuery, error)
}

func (*PropertyPager) ApplyFilter

func (p *PropertyPager) ApplyFilter(query *PropertyQuery) (*PropertyQuery, error)

type PropertyPaginateOption

type PropertyPaginateOption func(*PropertyPager)

PropertyPaginateOption enables pagination customization.

type PropertyQuery

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

PropertyQuery is the builder for querying Property entities.

func (*PropertyQuery) Aggregate

func (pq *PropertyQuery) Aggregate(fns ...AggregateFunc) *PropertySelect

Aggregate returns a PropertySelect configured with the given aggregations.

func (*PropertyQuery) All

func (pq *PropertyQuery) All(ctx context.Context) ([]*Property, error)

All executes the query and returns a list of Properties.

func (*PropertyQuery) AllX

func (pq *PropertyQuery) AllX(ctx context.Context) []*Property

AllX is like All, but panics if an error occurs.

func (*PropertyQuery) Clone

func (pq *PropertyQuery) Clone() *PropertyQuery

Clone returns a duplicate of the PropertyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PropertyQuery) Count

func (pq *PropertyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PropertyQuery) CountX

func (pq *PropertyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PropertyQuery) Exist

func (pq *PropertyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PropertyQuery) ExistX

func (pq *PropertyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PropertyQuery) First

func (pq *PropertyQuery) First(ctx context.Context) (*Property, error)

First returns the first Property entity from the query. Returns a *NotFoundError when no Property was found.

func (*PropertyQuery) FirstID

func (pq *PropertyQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Property ID from the query. Returns a *NotFoundError when no Property ID was found.

func (*PropertyQuery) FirstIDX

func (pq *PropertyQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*PropertyQuery) FirstX

func (pq *PropertyQuery) FirstX(ctx context.Context) *Property

FirstX is like First, but panics if an error occurs.

func (*PropertyQuery) GroupBy

func (pq *PropertyQuery) GroupBy(field string, fields ...string) *PropertyGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Property.Query().
	GroupBy(property.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PropertyQuery) IDs

func (pq *PropertyQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Property IDs.

func (*PropertyQuery) IDsX

func (pq *PropertyQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*PropertyQuery) Limit

func (pq *PropertyQuery) Limit(limit int) *PropertyQuery

Limit the number of records to be returned by this query.

func (*PropertyQuery) Offset

func (pq *PropertyQuery) Offset(offset int) *PropertyQuery

Offset to start from.

func (*PropertyQuery) Only

func (pq *PropertyQuery) Only(ctx context.Context) (*Property, error)

Only returns a single Property entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Property entity is found. Returns a *NotFoundError when no Property entities are found.

func (*PropertyQuery) OnlyID

func (pq *PropertyQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Property ID in the query. Returns a *NotSingularError when more than one Property ID is found. Returns a *NotFoundError when no entities are found.

func (*PropertyQuery) OnlyIDX

func (pq *PropertyQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PropertyQuery) OnlyX

func (pq *PropertyQuery) OnlyX(ctx context.Context) *Property

OnlyX is like Only, but panics if an error occurs.

func (*PropertyQuery) Order

Order specifies how the records should be ordered.

func (*PropertyQuery) Page

func (pr *PropertyQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...PropertyPaginateOption,
) (*PropertyPageList, error)

func (*PropertyQuery) QueryPropertyValues

func (pq *PropertyQuery) QueryPropertyValues() *PropertyValueQuery

QueryPropertyValues chains the current query on the "property_values" edge.

func (*PropertyQuery) Select

func (pq *PropertyQuery) Select(fields ...string) *PropertySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Property.Query().
	Select(property.FieldCreatedAt).
	Scan(ctx, &v)

func (*PropertyQuery) Unique

func (pq *PropertyQuery) Unique(unique bool) *PropertyQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PropertyQuery) Where

func (pq *PropertyQuery) Where(ps ...predicate.Property) *PropertyQuery

Where adds a new predicate for the PropertyQuery builder.

func (*PropertyQuery) WithPropertyValues

func (pq *PropertyQuery) WithPropertyValues(opts ...func(*PropertyValueQuery)) *PropertyQuery

WithPropertyValues tells the query-builder to eager-load the nodes that are connected to the "property_values" edge. The optional arguments are used to configure the query builder of the edge.

type PropertySelect

type PropertySelect struct {
	*PropertyQuery
	// contains filtered or unexported fields
}

PropertySelect is the builder for selecting fields of Property entities.

func (*PropertySelect) Aggregate

func (ps *PropertySelect) Aggregate(fns ...AggregateFunc) *PropertySelect

Aggregate adds the given aggregation functions to the selector query.

func (*PropertySelect) Bool

func (s *PropertySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PropertySelect) BoolX

func (s *PropertySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PropertySelect) Bools

func (s *PropertySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PropertySelect) BoolsX

func (s *PropertySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PropertySelect) Float64

func (s *PropertySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PropertySelect) Float64X

func (s *PropertySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PropertySelect) Float64s

func (s *PropertySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PropertySelect) Float64sX

func (s *PropertySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PropertySelect) Int

func (s *PropertySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PropertySelect) IntX

func (s *PropertySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PropertySelect) Ints

func (s *PropertySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PropertySelect) IntsX

func (s *PropertySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PropertySelect) Scan

func (ps *PropertySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PropertySelect) ScanX

func (s *PropertySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PropertySelect) String

func (s *PropertySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PropertySelect) StringX

func (s *PropertySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PropertySelect) Strings

func (s *PropertySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PropertySelect) StringsX

func (s *PropertySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PropertyUpdate

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

PropertyUpdate is the builder for updating Property entities.

func (*PropertyUpdate) AddPropertyValueIDs

func (pu *PropertyUpdate) AddPropertyValueIDs(ids ...uint64) *PropertyUpdate

AddPropertyValueIDs adds the "property_values" edge to the PropertyValue entity by IDs.

func (*PropertyUpdate) AddPropertyValues

func (pu *PropertyUpdate) AddPropertyValues(p ...*PropertyValue) *PropertyUpdate

AddPropertyValues adds the "property_values" edges to the PropertyValue entity.

func (*PropertyUpdate) AddStatus

func (pu *PropertyUpdate) AddStatus(u int8) *PropertyUpdate

AddStatus adds u to the "status" field.

func (*PropertyUpdate) ClearDeletedAt

func (pu *PropertyUpdate) ClearDeletedAt() *PropertyUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PropertyUpdate) ClearName

func (pu *PropertyUpdate) ClearName() *PropertyUpdate

ClearName clears the value of the "name" field.

func (*PropertyUpdate) ClearPropertyValues

func (pu *PropertyUpdate) ClearPropertyValues() *PropertyUpdate

ClearPropertyValues clears all "property_values" edges to the PropertyValue entity.

func (*PropertyUpdate) ClearRemark

func (pu *PropertyUpdate) ClearRemark() *PropertyUpdate

ClearRemark clears the value of the "remark" field.

func (*PropertyUpdate) ClearStatus

func (pu *PropertyUpdate) ClearStatus() *PropertyUpdate

ClearStatus clears the value of the "status" field.

func (*PropertyUpdate) Exec

func (pu *PropertyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PropertyUpdate) ExecX

func (pu *PropertyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyUpdate) Mutation

func (pu *PropertyUpdate) Mutation() *PropertyMutation

Mutation returns the PropertyMutation object of the builder.

func (*PropertyUpdate) RemovePropertyValueIDs

func (pu *PropertyUpdate) RemovePropertyValueIDs(ids ...uint64) *PropertyUpdate

RemovePropertyValueIDs removes the "property_values" edge to PropertyValue entities by IDs.

func (*PropertyUpdate) RemovePropertyValues

func (pu *PropertyUpdate) RemovePropertyValues(p ...*PropertyValue) *PropertyUpdate

RemovePropertyValues removes "property_values" edges to PropertyValue entities.

func (*PropertyUpdate) Save

func (pu *PropertyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PropertyUpdate) SaveX

func (pu *PropertyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PropertyUpdate) SetDeletedAt

func (pu *PropertyUpdate) SetDeletedAt(t time.Time) *PropertyUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PropertyUpdate) SetName

func (pu *PropertyUpdate) SetName(s string) *PropertyUpdate

SetName sets the "name" field.

func (*PropertyUpdate) SetNillableDeletedAt

func (pu *PropertyUpdate) SetNillableDeletedAt(t *time.Time) *PropertyUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PropertyUpdate) SetNillableName

func (pu *PropertyUpdate) SetNillableName(s *string) *PropertyUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PropertyUpdate) SetNillableRemark

func (pu *PropertyUpdate) SetNillableRemark(s *string) *PropertyUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PropertyUpdate) SetNillableStatus

func (pu *PropertyUpdate) SetNillableStatus(u *uint8) *PropertyUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PropertyUpdate) SetNotNilDeletedAt

func (pr *PropertyUpdate) SetNotNilDeletedAt(value *time.Time) *PropertyUpdate

set field if value's pointer is not nil.

func (*PropertyUpdate) SetNotNilName

func (pr *PropertyUpdate) SetNotNilName(value *string) *PropertyUpdate

set field if value's pointer is not nil.

func (*PropertyUpdate) SetNotNilRemark

func (pr *PropertyUpdate) SetNotNilRemark(value *string) *PropertyUpdate

set field if value's pointer is not nil.

func (*PropertyUpdate) SetNotNilStatus

func (pr *PropertyUpdate) SetNotNilStatus(value *uint8) *PropertyUpdate

set field if value's pointer is not nil.

func (*PropertyUpdate) SetNotNilUpdatedAt

func (pr *PropertyUpdate) SetNotNilUpdatedAt(value *time.Time) *PropertyUpdate

set field if value's pointer is not nil.

func (*PropertyUpdate) SetRemark

func (pu *PropertyUpdate) SetRemark(s string) *PropertyUpdate

SetRemark sets the "remark" field.

func (*PropertyUpdate) SetStatus

func (pu *PropertyUpdate) SetStatus(u uint8) *PropertyUpdate

SetStatus sets the "status" field.

func (*PropertyUpdate) SetUpdatedAt

func (pu *PropertyUpdate) SetUpdatedAt(t time.Time) *PropertyUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PropertyUpdate) Where

func (pu *PropertyUpdate) Where(ps ...predicate.Property) *PropertyUpdate

Where appends a list predicates to the PropertyUpdate builder.

type PropertyUpdateOne

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

PropertyUpdateOne is the builder for updating a single Property entity.

func (*PropertyUpdateOne) AddPropertyValueIDs

func (puo *PropertyUpdateOne) AddPropertyValueIDs(ids ...uint64) *PropertyUpdateOne

AddPropertyValueIDs adds the "property_values" edge to the PropertyValue entity by IDs.

func (*PropertyUpdateOne) AddPropertyValues

func (puo *PropertyUpdateOne) AddPropertyValues(p ...*PropertyValue) *PropertyUpdateOne

AddPropertyValues adds the "property_values" edges to the PropertyValue entity.

func (*PropertyUpdateOne) AddStatus

func (puo *PropertyUpdateOne) AddStatus(u int8) *PropertyUpdateOne

AddStatus adds u to the "status" field.

func (*PropertyUpdateOne) ClearDeletedAt

func (puo *PropertyUpdateOne) ClearDeletedAt() *PropertyUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PropertyUpdateOne) ClearName

func (puo *PropertyUpdateOne) ClearName() *PropertyUpdateOne

ClearName clears the value of the "name" field.

func (*PropertyUpdateOne) ClearPropertyValues

func (puo *PropertyUpdateOne) ClearPropertyValues() *PropertyUpdateOne

ClearPropertyValues clears all "property_values" edges to the PropertyValue entity.

func (*PropertyUpdateOne) ClearRemark

func (puo *PropertyUpdateOne) ClearRemark() *PropertyUpdateOne

ClearRemark clears the value of the "remark" field.

func (*PropertyUpdateOne) ClearStatus

func (puo *PropertyUpdateOne) ClearStatus() *PropertyUpdateOne

ClearStatus clears the value of the "status" field.

func (*PropertyUpdateOne) Exec

func (puo *PropertyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PropertyUpdateOne) ExecX

func (puo *PropertyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyUpdateOne) Mutation

func (puo *PropertyUpdateOne) Mutation() *PropertyMutation

Mutation returns the PropertyMutation object of the builder.

func (*PropertyUpdateOne) RemovePropertyValueIDs

func (puo *PropertyUpdateOne) RemovePropertyValueIDs(ids ...uint64) *PropertyUpdateOne

RemovePropertyValueIDs removes the "property_values" edge to PropertyValue entities by IDs.

func (*PropertyUpdateOne) RemovePropertyValues

func (puo *PropertyUpdateOne) RemovePropertyValues(p ...*PropertyValue) *PropertyUpdateOne

RemovePropertyValues removes "property_values" edges to PropertyValue entities.

func (*PropertyUpdateOne) Save

func (puo *PropertyUpdateOne) Save(ctx context.Context) (*Property, error)

Save executes the query and returns the updated Property entity.

func (*PropertyUpdateOne) SaveX

func (puo *PropertyUpdateOne) SaveX(ctx context.Context) *Property

SaveX is like Save, but panics if an error occurs.

func (*PropertyUpdateOne) Select

func (puo *PropertyUpdateOne) Select(field string, fields ...string) *PropertyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PropertyUpdateOne) SetDeletedAt

func (puo *PropertyUpdateOne) SetDeletedAt(t time.Time) *PropertyUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PropertyUpdateOne) SetName

func (puo *PropertyUpdateOne) SetName(s string) *PropertyUpdateOne

SetName sets the "name" field.

func (*PropertyUpdateOne) SetNillableDeletedAt

func (puo *PropertyUpdateOne) SetNillableDeletedAt(t *time.Time) *PropertyUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PropertyUpdateOne) SetNillableName

func (puo *PropertyUpdateOne) SetNillableName(s *string) *PropertyUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PropertyUpdateOne) SetNillableRemark

func (puo *PropertyUpdateOne) SetNillableRemark(s *string) *PropertyUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PropertyUpdateOne) SetNillableStatus

func (puo *PropertyUpdateOne) SetNillableStatus(u *uint8) *PropertyUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PropertyUpdateOne) SetNotNilDeletedAt

func (pr *PropertyUpdateOne) SetNotNilDeletedAt(value *time.Time) *PropertyUpdateOne

set field if value's pointer is not nil.

func (*PropertyUpdateOne) SetNotNilName

func (pr *PropertyUpdateOne) SetNotNilName(value *string) *PropertyUpdateOne

set field if value's pointer is not nil.

func (*PropertyUpdateOne) SetNotNilRemark

func (pr *PropertyUpdateOne) SetNotNilRemark(value *string) *PropertyUpdateOne

set field if value's pointer is not nil.

func (*PropertyUpdateOne) SetNotNilStatus

func (pr *PropertyUpdateOne) SetNotNilStatus(value *uint8) *PropertyUpdateOne

set field if value's pointer is not nil.

func (*PropertyUpdateOne) SetNotNilUpdatedAt

func (pr *PropertyUpdateOne) SetNotNilUpdatedAt(value *time.Time) *PropertyUpdateOne

set field if value's pointer is not nil.

func (*PropertyUpdateOne) SetRemark

func (puo *PropertyUpdateOne) SetRemark(s string) *PropertyUpdateOne

SetRemark sets the "remark" field.

func (*PropertyUpdateOne) SetStatus

func (puo *PropertyUpdateOne) SetStatus(u uint8) *PropertyUpdateOne

SetStatus sets the "status" field.

func (*PropertyUpdateOne) SetUpdatedAt

func (puo *PropertyUpdateOne) SetUpdatedAt(t time.Time) *PropertyUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PropertyUpdateOne) Where

Where appends a list predicates to the PropertyUpdate builder.

type PropertyValue

type PropertyValue struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// 属性项的编号
	PropertyID uint64 `json:"property_id,omitempty"`
	// 名称
	Name string `json:"name,omitempty"`
	// 备注
	Remark string `json:"remark,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PropertyValueQuery when eager-loading is set.
	Edges PropertyValueEdges `json:"edges"`
	// contains filtered or unexported fields
}

PropertyValue is the model entity for the PropertyValue schema.

func (*PropertyValue) QueryPropertys

func (pv *PropertyValue) QueryPropertys() *PropertyQuery

QueryPropertys queries the "propertys" edge of the PropertyValue entity.

func (*PropertyValue) String

func (pv *PropertyValue) String() string

String implements the fmt.Stringer.

func (*PropertyValue) Unwrap

func (pv *PropertyValue) Unwrap() *PropertyValue

Unwrap unwraps the PropertyValue entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*PropertyValue) Update

func (pv *PropertyValue) Update() *PropertyValueUpdateOne

Update returns a builder for updating this PropertyValue. Note that you need to call PropertyValue.Unwrap() before calling this method if this PropertyValue was returned from a transaction, and the transaction was committed or rolled back.

func (*PropertyValue) Value

func (pv *PropertyValue) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PropertyValue. This includes values selected through modifiers, order, etc.

type PropertyValueClient

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

PropertyValueClient is a client for the PropertyValue schema.

func NewPropertyValueClient

func NewPropertyValueClient(c config) *PropertyValueClient

NewPropertyValueClient returns a client for the PropertyValue from the given config.

func (*PropertyValueClient) Create

Create returns a builder for creating a PropertyValue entity.

func (*PropertyValueClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PropertyValue entities.

func (*PropertyValueClient) Delete

Delete returns a delete builder for PropertyValue.

func (*PropertyValueClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PropertyValueClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PropertyValueClient) Get

Get returns a PropertyValue entity by its id.

func (*PropertyValueClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PropertyValueClient) Hooks

func (c *PropertyValueClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PropertyValueClient) Intercept

func (c *PropertyValueClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `propertyvalue.Intercept(f(g(h())))`.

func (*PropertyValueClient) Interceptors

func (c *PropertyValueClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PropertyValueClient) MapCreateBulk

func (c *PropertyValueClient) MapCreateBulk(slice any, setFunc func(*PropertyValueCreate, int)) *PropertyValueCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PropertyValueClient) Query

Query returns a query builder for PropertyValue.

func (*PropertyValueClient) QueryPropertys

func (c *PropertyValueClient) QueryPropertys(pv *PropertyValue) *PropertyQuery

QueryPropertys queries the propertys edge of a PropertyValue.

func (*PropertyValueClient) Update

Update returns an update builder for PropertyValue.

func (*PropertyValueClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PropertyValueClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PropertyValueClient) Use

func (c *PropertyValueClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `propertyvalue.Hooks(f(g(h())))`.

type PropertyValueCreate

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

PropertyValueCreate is the builder for creating a PropertyValue entity.

func (*PropertyValueCreate) Exec

func (pvc *PropertyValueCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PropertyValueCreate) ExecX

func (pvc *PropertyValueCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyValueCreate) Mutation

func (pvc *PropertyValueCreate) Mutation() *PropertyValueMutation

Mutation returns the PropertyValueMutation object of the builder.

func (*PropertyValueCreate) Save

Save creates the PropertyValue in the database.

func (*PropertyValueCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PropertyValueCreate) SetCreatedAt

func (pvc *PropertyValueCreate) SetCreatedAt(t time.Time) *PropertyValueCreate

SetCreatedAt sets the "created_at" field.

func (*PropertyValueCreate) SetDeletedAt

func (pvc *PropertyValueCreate) SetDeletedAt(t time.Time) *PropertyValueCreate

SetDeletedAt sets the "deleted_at" field.

func (*PropertyValueCreate) SetID

SetID sets the "id" field.

func (*PropertyValueCreate) SetName

SetName sets the "name" field.

func (*PropertyValueCreate) SetNillableCreatedAt

func (pvc *PropertyValueCreate) SetNillableCreatedAt(t *time.Time) *PropertyValueCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PropertyValueCreate) SetNillableDeletedAt

func (pvc *PropertyValueCreate) SetNillableDeletedAt(t *time.Time) *PropertyValueCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PropertyValueCreate) SetNillableName

func (pvc *PropertyValueCreate) SetNillableName(s *string) *PropertyValueCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*PropertyValueCreate) SetNillablePropertyID

func (pvc *PropertyValueCreate) SetNillablePropertyID(u *uint64) *PropertyValueCreate

SetNillablePropertyID sets the "property_id" field if the given value is not nil.

func (*PropertyValueCreate) SetNillablePropertysID

func (pvc *PropertyValueCreate) SetNillablePropertysID(id *uint64) *PropertyValueCreate

SetNillablePropertysID sets the "propertys" edge to the Property entity by ID if the given value is not nil.

func (*PropertyValueCreate) SetNillableRemark

func (pvc *PropertyValueCreate) SetNillableRemark(s *string) *PropertyValueCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PropertyValueCreate) SetNillableUpdatedAt

func (pvc *PropertyValueCreate) SetNillableUpdatedAt(t *time.Time) *PropertyValueCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PropertyValueCreate) SetNotNilDeletedAt

func (pv *PropertyValueCreate) SetNotNilDeletedAt(value *time.Time) *PropertyValueCreate

set field if value's pointer is not nil.

func (*PropertyValueCreate) SetNotNilName

func (pv *PropertyValueCreate) SetNotNilName(value *string) *PropertyValueCreate

set field if value's pointer is not nil.

func (*PropertyValueCreate) SetNotNilPropertyID

func (pv *PropertyValueCreate) SetNotNilPropertyID(value *uint64) *PropertyValueCreate

set field if value's pointer is not nil.

func (*PropertyValueCreate) SetNotNilRemark

func (pv *PropertyValueCreate) SetNotNilRemark(value *string) *PropertyValueCreate

set field if value's pointer is not nil.

func (*PropertyValueCreate) SetNotNilUpdatedAt

func (pv *PropertyValueCreate) SetNotNilUpdatedAt(value *time.Time) *PropertyValueCreate

set field if value's pointer is not nil.

func (*PropertyValueCreate) SetPropertyID

func (pvc *PropertyValueCreate) SetPropertyID(u uint64) *PropertyValueCreate

SetPropertyID sets the "property_id" field.

func (*PropertyValueCreate) SetPropertys

func (pvc *PropertyValueCreate) SetPropertys(p *Property) *PropertyValueCreate

SetPropertys sets the "propertys" edge to the Property entity.

func (*PropertyValueCreate) SetPropertysID

func (pvc *PropertyValueCreate) SetPropertysID(id uint64) *PropertyValueCreate

SetPropertysID sets the "propertys" edge to the Property entity by ID.

func (*PropertyValueCreate) SetRemark

func (pvc *PropertyValueCreate) SetRemark(s string) *PropertyValueCreate

SetRemark sets the "remark" field.

func (*PropertyValueCreate) SetUpdatedAt

func (pvc *PropertyValueCreate) SetUpdatedAt(t time.Time) *PropertyValueCreate

SetUpdatedAt sets the "updated_at" field.

type PropertyValueCreateBulk

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

PropertyValueCreateBulk is the builder for creating many PropertyValue entities in bulk.

func (*PropertyValueCreateBulk) Exec

func (pvcb *PropertyValueCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PropertyValueCreateBulk) ExecX

func (pvcb *PropertyValueCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyValueCreateBulk) Save

Save creates the PropertyValue entities in the database.

func (*PropertyValueCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PropertyValueDelete

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

PropertyValueDelete is the builder for deleting a PropertyValue entity.

func (*PropertyValueDelete) Exec

func (pvd *PropertyValueDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PropertyValueDelete) ExecX

func (pvd *PropertyValueDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PropertyValueDelete) Where

Where appends a list predicates to the PropertyValueDelete builder.

type PropertyValueDeleteOne

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

PropertyValueDeleteOne is the builder for deleting a single PropertyValue entity.

func (*PropertyValueDeleteOne) Exec

func (pvdo *PropertyValueDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PropertyValueDeleteOne) ExecX

func (pvdo *PropertyValueDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyValueDeleteOne) Where

Where appends a list predicates to the PropertyValueDelete builder.

type PropertyValueEdges

type PropertyValueEdges struct {
	// Propertys holds the value of the propertys edge.
	Propertys *Property `json:"propertys,omitempty"`
	// contains filtered or unexported fields
}

PropertyValueEdges holds the relations/edges for other nodes in the graph.

func (PropertyValueEdges) PropertysOrErr

func (e PropertyValueEdges) PropertysOrErr() (*Property, error)

PropertysOrErr returns the Propertys value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PropertyValueGroupBy

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

PropertyValueGroupBy is the group-by builder for PropertyValue entities.

func (*PropertyValueGroupBy) Aggregate

func (pvgb *PropertyValueGroupBy) Aggregate(fns ...AggregateFunc) *PropertyValueGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PropertyValueGroupBy) Bool

func (s *PropertyValueGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) BoolX

func (s *PropertyValueGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PropertyValueGroupBy) Bools

func (s *PropertyValueGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) BoolsX

func (s *PropertyValueGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PropertyValueGroupBy) Float64

func (s *PropertyValueGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) Float64X

func (s *PropertyValueGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PropertyValueGroupBy) Float64s

func (s *PropertyValueGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) Float64sX

func (s *PropertyValueGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PropertyValueGroupBy) Int

func (s *PropertyValueGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) IntX

func (s *PropertyValueGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PropertyValueGroupBy) Ints

func (s *PropertyValueGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) IntsX

func (s *PropertyValueGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PropertyValueGroupBy) Scan

func (pvgb *PropertyValueGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PropertyValueGroupBy) ScanX

func (s *PropertyValueGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PropertyValueGroupBy) String

func (s *PropertyValueGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) StringX

func (s *PropertyValueGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PropertyValueGroupBy) Strings

func (s *PropertyValueGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PropertyValueGroupBy) StringsX

func (s *PropertyValueGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PropertyValueMutation

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

PropertyValueMutation represents an operation that mutates the PropertyValue nodes in the graph.

func (*PropertyValueMutation) AddField

func (m *PropertyValueMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PropertyValueMutation) AddedEdges

func (m *PropertyValueMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PropertyValueMutation) AddedField

func (m *PropertyValueMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PropertyValueMutation) AddedFields

func (m *PropertyValueMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PropertyValueMutation) AddedIDs

func (m *PropertyValueMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PropertyValueMutation) ClearDeletedAt

func (m *PropertyValueMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PropertyValueMutation) ClearEdge

func (m *PropertyValueMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PropertyValueMutation) ClearField

func (m *PropertyValueMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PropertyValueMutation) ClearName

func (m *PropertyValueMutation) ClearName()

ClearName clears the value of the "name" field.

func (*PropertyValueMutation) ClearPropertyID

func (m *PropertyValueMutation) ClearPropertyID()

ClearPropertyID clears the value of the "property_id" field.

func (*PropertyValueMutation) ClearPropertys

func (m *PropertyValueMutation) ClearPropertys()

ClearPropertys clears the "propertys" edge to the Property entity.

func (*PropertyValueMutation) ClearRemark

func (m *PropertyValueMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*PropertyValueMutation) ClearedEdges

func (m *PropertyValueMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PropertyValueMutation) ClearedFields

func (m *PropertyValueMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PropertyValueMutation) Client

func (m PropertyValueMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PropertyValueMutation) CreatedAt

func (m *PropertyValueMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PropertyValueMutation) DeletedAt

func (m *PropertyValueMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PropertyValueMutation) DeletedAtCleared

func (m *PropertyValueMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PropertyValueMutation) EdgeCleared

func (m *PropertyValueMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PropertyValueMutation) Field

func (m *PropertyValueMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PropertyValueMutation) FieldCleared

func (m *PropertyValueMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PropertyValueMutation) Fields

func (m *PropertyValueMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PropertyValueMutation) ID

func (m *PropertyValueMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PropertyValueMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PropertyValueMutation) Name

func (m *PropertyValueMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PropertyValueMutation) NameCleared

func (m *PropertyValueMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*PropertyValueMutation) OldCreatedAt

func (m *PropertyValueMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PropertyValue entity. If the PropertyValue object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyValueMutation) OldDeletedAt

func (m *PropertyValueMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the PropertyValue entity. If the PropertyValue object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyValueMutation) OldField

func (m *PropertyValueMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PropertyValueMutation) OldName

func (m *PropertyValueMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the PropertyValue entity. If the PropertyValue object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyValueMutation) OldPropertyID

func (m *PropertyValueMutation) OldPropertyID(ctx context.Context) (v uint64, err error)

OldPropertyID returns the old "property_id" field's value of the PropertyValue entity. If the PropertyValue object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyValueMutation) OldRemark

func (m *PropertyValueMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the PropertyValue entity. If the PropertyValue object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyValueMutation) OldUpdatedAt

func (m *PropertyValueMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PropertyValue entity. If the PropertyValue object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PropertyValueMutation) Op

func (m *PropertyValueMutation) Op() Op

Op returns the operation name.

func (*PropertyValueMutation) PropertyID

func (m *PropertyValueMutation) PropertyID() (r uint64, exists bool)

PropertyID returns the value of the "property_id" field in the mutation.

func (*PropertyValueMutation) PropertyIDCleared

func (m *PropertyValueMutation) PropertyIDCleared() bool

PropertyIDCleared returns if the "property_id" field was cleared in this mutation.

func (*PropertyValueMutation) PropertysCleared

func (m *PropertyValueMutation) PropertysCleared() bool

PropertysCleared reports if the "propertys" edge to the Property entity was cleared.

func (*PropertyValueMutation) PropertysID

func (m *PropertyValueMutation) PropertysID() (id uint64, exists bool)

PropertysID returns the "propertys" edge ID in the mutation.

func (*PropertyValueMutation) PropertysIDs

func (m *PropertyValueMutation) PropertysIDs() (ids []uint64)

PropertysIDs returns the "propertys" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PropertysID instead. It exists only for internal usage by the builders.

func (*PropertyValueMutation) Remark

func (m *PropertyValueMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*PropertyValueMutation) RemarkCleared

func (m *PropertyValueMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*PropertyValueMutation) RemovedEdges

func (m *PropertyValueMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PropertyValueMutation) RemovedIDs

func (m *PropertyValueMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PropertyValueMutation) ResetCreatedAt

func (m *PropertyValueMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PropertyValueMutation) ResetDeletedAt

func (m *PropertyValueMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PropertyValueMutation) ResetEdge

func (m *PropertyValueMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PropertyValueMutation) ResetField

func (m *PropertyValueMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PropertyValueMutation) ResetName

func (m *PropertyValueMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PropertyValueMutation) ResetPropertyID

func (m *PropertyValueMutation) ResetPropertyID()

ResetPropertyID resets all changes to the "property_id" field.

func (*PropertyValueMutation) ResetPropertys

func (m *PropertyValueMutation) ResetPropertys()

ResetPropertys resets all changes to the "propertys" edge.

func (*PropertyValueMutation) ResetRemark

func (m *PropertyValueMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*PropertyValueMutation) ResetUpdatedAt

func (m *PropertyValueMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PropertyValueMutation) SetCreatedAt

func (m *PropertyValueMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PropertyValueMutation) SetDeletedAt

func (m *PropertyValueMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PropertyValueMutation) SetField

func (m *PropertyValueMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PropertyValueMutation) SetID

func (m *PropertyValueMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of PropertyValue entities.

func (*PropertyValueMutation) SetName

func (m *PropertyValueMutation) SetName(s string)

SetName sets the "name" field.

func (*PropertyValueMutation) SetOp

func (m *PropertyValueMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PropertyValueMutation) SetPropertyID

func (m *PropertyValueMutation) SetPropertyID(u uint64)

SetPropertyID sets the "property_id" field.

func (*PropertyValueMutation) SetPropertysID

func (m *PropertyValueMutation) SetPropertysID(id uint64)

SetPropertysID sets the "propertys" edge to the Property entity by id.

func (*PropertyValueMutation) SetRemark

func (m *PropertyValueMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*PropertyValueMutation) SetUpdatedAt

func (m *PropertyValueMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (PropertyValueMutation) Tx

func (m PropertyValueMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PropertyValueMutation) Type

func (m *PropertyValueMutation) Type() string

Type returns the node type of this mutation (PropertyValue).

func (*PropertyValueMutation) UpdatedAt

func (m *PropertyValueMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PropertyValueMutation) Where

Where appends a list predicates to the PropertyValueMutation builder.

func (*PropertyValueMutation) WhereP

func (m *PropertyValueMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PropertyValueMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PropertyValuePageList

type PropertyValuePageList struct {
	List        []*PropertyValue `json:"list"`
	PageDetails *PageDetails     `json:"pageDetails"`
}

PropertyValuePageList is PropertyValue PageList result.

type PropertyValuePager

type PropertyValuePager struct {
	Order  propertyvalue.OrderOption
	Filter func(*PropertyValueQuery) (*PropertyValueQuery, error)
}

func (*PropertyValuePager) ApplyFilter

type PropertyValuePaginateOption

type PropertyValuePaginateOption func(*PropertyValuePager)

PropertyValuePaginateOption enables pagination customization.

type PropertyValueQuery

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

PropertyValueQuery is the builder for querying PropertyValue entities.

func (*PropertyValueQuery) Aggregate

func (pvq *PropertyValueQuery) Aggregate(fns ...AggregateFunc) *PropertyValueSelect

Aggregate returns a PropertyValueSelect configured with the given aggregations.

func (*PropertyValueQuery) All

All executes the query and returns a list of PropertyValues.

func (*PropertyValueQuery) AllX

func (pvq *PropertyValueQuery) AllX(ctx context.Context) []*PropertyValue

AllX is like All, but panics if an error occurs.

func (*PropertyValueQuery) Clone

func (pvq *PropertyValueQuery) Clone() *PropertyValueQuery

Clone returns a duplicate of the PropertyValueQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PropertyValueQuery) Count

func (pvq *PropertyValueQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PropertyValueQuery) CountX

func (pvq *PropertyValueQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PropertyValueQuery) Exist

func (pvq *PropertyValueQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PropertyValueQuery) ExistX

func (pvq *PropertyValueQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PropertyValueQuery) First

First returns the first PropertyValue entity from the query. Returns a *NotFoundError when no PropertyValue was found.

func (*PropertyValueQuery) FirstID

func (pvq *PropertyValueQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first PropertyValue ID from the query. Returns a *NotFoundError when no PropertyValue ID was found.

func (*PropertyValueQuery) FirstIDX

func (pvq *PropertyValueQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*PropertyValueQuery) FirstX

func (pvq *PropertyValueQuery) FirstX(ctx context.Context) *PropertyValue

FirstX is like First, but panics if an error occurs.

func (*PropertyValueQuery) GroupBy

func (pvq *PropertyValueQuery) GroupBy(field string, fields ...string) *PropertyValueGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PropertyValue.Query().
	GroupBy(propertyvalue.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PropertyValueQuery) IDs

func (pvq *PropertyValueQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of PropertyValue IDs.

func (*PropertyValueQuery) IDsX

func (pvq *PropertyValueQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*PropertyValueQuery) Limit

func (pvq *PropertyValueQuery) Limit(limit int) *PropertyValueQuery

Limit the number of records to be returned by this query.

func (*PropertyValueQuery) Offset

func (pvq *PropertyValueQuery) Offset(offset int) *PropertyValueQuery

Offset to start from.

func (*PropertyValueQuery) Only

Only returns a single PropertyValue entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PropertyValue entity is found. Returns a *NotFoundError when no PropertyValue entities are found.

func (*PropertyValueQuery) OnlyID

func (pvq *PropertyValueQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only PropertyValue ID in the query. Returns a *NotSingularError when more than one PropertyValue ID is found. Returns a *NotFoundError when no entities are found.

func (*PropertyValueQuery) OnlyIDX

func (pvq *PropertyValueQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PropertyValueQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PropertyValueQuery) Order

Order specifies how the records should be ordered.

func (*PropertyValueQuery) Page

func (pv *PropertyValueQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...PropertyValuePaginateOption,
) (*PropertyValuePageList, error)

func (*PropertyValueQuery) QueryPropertys

func (pvq *PropertyValueQuery) QueryPropertys() *PropertyQuery

QueryPropertys chains the current query on the "propertys" edge.

func (*PropertyValueQuery) Select

func (pvq *PropertyValueQuery) Select(fields ...string) *PropertyValueSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.PropertyValue.Query().
	Select(propertyvalue.FieldCreatedAt).
	Scan(ctx, &v)

func (*PropertyValueQuery) Unique

func (pvq *PropertyValueQuery) Unique(unique bool) *PropertyValueQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PropertyValueQuery) Where

Where adds a new predicate for the PropertyValueQuery builder.

func (*PropertyValueQuery) WithPropertys

func (pvq *PropertyValueQuery) WithPropertys(opts ...func(*PropertyQuery)) *PropertyValueQuery

WithPropertys tells the query-builder to eager-load the nodes that are connected to the "propertys" edge. The optional arguments are used to configure the query builder of the edge.

type PropertyValueSelect

type PropertyValueSelect struct {
	*PropertyValueQuery
	// contains filtered or unexported fields
}

PropertyValueSelect is the builder for selecting fields of PropertyValue entities.

func (*PropertyValueSelect) Aggregate

func (pvs *PropertyValueSelect) Aggregate(fns ...AggregateFunc) *PropertyValueSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PropertyValueSelect) Bool

func (s *PropertyValueSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) BoolX

func (s *PropertyValueSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PropertyValueSelect) Bools

func (s *PropertyValueSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) BoolsX

func (s *PropertyValueSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PropertyValueSelect) Float64

func (s *PropertyValueSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) Float64X

func (s *PropertyValueSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PropertyValueSelect) Float64s

func (s *PropertyValueSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) Float64sX

func (s *PropertyValueSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PropertyValueSelect) Int

func (s *PropertyValueSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) IntX

func (s *PropertyValueSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PropertyValueSelect) Ints

func (s *PropertyValueSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) IntsX

func (s *PropertyValueSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PropertyValueSelect) Scan

func (pvs *PropertyValueSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PropertyValueSelect) ScanX

func (s *PropertyValueSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PropertyValueSelect) String

func (s *PropertyValueSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) StringX

func (s *PropertyValueSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PropertyValueSelect) Strings

func (s *PropertyValueSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PropertyValueSelect) StringsX

func (s *PropertyValueSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PropertyValueUpdate

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

PropertyValueUpdate is the builder for updating PropertyValue entities.

func (*PropertyValueUpdate) ClearDeletedAt

func (pvu *PropertyValueUpdate) ClearDeletedAt() *PropertyValueUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PropertyValueUpdate) ClearName

func (pvu *PropertyValueUpdate) ClearName() *PropertyValueUpdate

ClearName clears the value of the "name" field.

func (*PropertyValueUpdate) ClearPropertyID

func (pvu *PropertyValueUpdate) ClearPropertyID() *PropertyValueUpdate

ClearPropertyID clears the value of the "property_id" field.

func (*PropertyValueUpdate) ClearPropertys

func (pvu *PropertyValueUpdate) ClearPropertys() *PropertyValueUpdate

ClearPropertys clears the "propertys" edge to the Property entity.

func (*PropertyValueUpdate) ClearRemark

func (pvu *PropertyValueUpdate) ClearRemark() *PropertyValueUpdate

ClearRemark clears the value of the "remark" field.

func (*PropertyValueUpdate) Exec

func (pvu *PropertyValueUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PropertyValueUpdate) ExecX

func (pvu *PropertyValueUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyValueUpdate) Mutation

func (pvu *PropertyValueUpdate) Mutation() *PropertyValueMutation

Mutation returns the PropertyValueMutation object of the builder.

func (*PropertyValueUpdate) Save

func (pvu *PropertyValueUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PropertyValueUpdate) SaveX

func (pvu *PropertyValueUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PropertyValueUpdate) SetDeletedAt

func (pvu *PropertyValueUpdate) SetDeletedAt(t time.Time) *PropertyValueUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PropertyValueUpdate) SetName

SetName sets the "name" field.

func (*PropertyValueUpdate) SetNillableDeletedAt

func (pvu *PropertyValueUpdate) SetNillableDeletedAt(t *time.Time) *PropertyValueUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PropertyValueUpdate) SetNillableName

func (pvu *PropertyValueUpdate) SetNillableName(s *string) *PropertyValueUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PropertyValueUpdate) SetNillablePropertyID

func (pvu *PropertyValueUpdate) SetNillablePropertyID(u *uint64) *PropertyValueUpdate

SetNillablePropertyID sets the "property_id" field if the given value is not nil.

func (*PropertyValueUpdate) SetNillablePropertysID

func (pvu *PropertyValueUpdate) SetNillablePropertysID(id *uint64) *PropertyValueUpdate

SetNillablePropertysID sets the "propertys" edge to the Property entity by ID if the given value is not nil.

func (*PropertyValueUpdate) SetNillableRemark

func (pvu *PropertyValueUpdate) SetNillableRemark(s *string) *PropertyValueUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PropertyValueUpdate) SetNotNilDeletedAt

func (pv *PropertyValueUpdate) SetNotNilDeletedAt(value *time.Time) *PropertyValueUpdate

set field if value's pointer is not nil.

func (*PropertyValueUpdate) SetNotNilName

func (pv *PropertyValueUpdate) SetNotNilName(value *string) *PropertyValueUpdate

set field if value's pointer is not nil.

func (*PropertyValueUpdate) SetNotNilPropertyID

func (pv *PropertyValueUpdate) SetNotNilPropertyID(value *uint64) *PropertyValueUpdate

set field if value's pointer is not nil.

func (*PropertyValueUpdate) SetNotNilRemark

func (pv *PropertyValueUpdate) SetNotNilRemark(value *string) *PropertyValueUpdate

set field if value's pointer is not nil.

func (*PropertyValueUpdate) SetNotNilUpdatedAt

func (pv *PropertyValueUpdate) SetNotNilUpdatedAt(value *time.Time) *PropertyValueUpdate

set field if value's pointer is not nil.

func (*PropertyValueUpdate) SetPropertyID

func (pvu *PropertyValueUpdate) SetPropertyID(u uint64) *PropertyValueUpdate

SetPropertyID sets the "property_id" field.

func (*PropertyValueUpdate) SetPropertys

func (pvu *PropertyValueUpdate) SetPropertys(p *Property) *PropertyValueUpdate

SetPropertys sets the "propertys" edge to the Property entity.

func (*PropertyValueUpdate) SetPropertysID

func (pvu *PropertyValueUpdate) SetPropertysID(id uint64) *PropertyValueUpdate

SetPropertysID sets the "propertys" edge to the Property entity by ID.

func (*PropertyValueUpdate) SetRemark

func (pvu *PropertyValueUpdate) SetRemark(s string) *PropertyValueUpdate

SetRemark sets the "remark" field.

func (*PropertyValueUpdate) SetUpdatedAt

func (pvu *PropertyValueUpdate) SetUpdatedAt(t time.Time) *PropertyValueUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PropertyValueUpdate) Where

Where appends a list predicates to the PropertyValueUpdate builder.

type PropertyValueUpdateOne

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

PropertyValueUpdateOne is the builder for updating a single PropertyValue entity.

func (*PropertyValueUpdateOne) ClearDeletedAt

func (pvuo *PropertyValueUpdateOne) ClearDeletedAt() *PropertyValueUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PropertyValueUpdateOne) ClearName

ClearName clears the value of the "name" field.

func (*PropertyValueUpdateOne) ClearPropertyID

func (pvuo *PropertyValueUpdateOne) ClearPropertyID() *PropertyValueUpdateOne

ClearPropertyID clears the value of the "property_id" field.

func (*PropertyValueUpdateOne) ClearPropertys

func (pvuo *PropertyValueUpdateOne) ClearPropertys() *PropertyValueUpdateOne

ClearPropertys clears the "propertys" edge to the Property entity.

func (*PropertyValueUpdateOne) ClearRemark

func (pvuo *PropertyValueUpdateOne) ClearRemark() *PropertyValueUpdateOne

ClearRemark clears the value of the "remark" field.

func (*PropertyValueUpdateOne) Exec

func (pvuo *PropertyValueUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PropertyValueUpdateOne) ExecX

func (pvuo *PropertyValueUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PropertyValueUpdateOne) Mutation

Mutation returns the PropertyValueMutation object of the builder.

func (*PropertyValueUpdateOne) Save

Save executes the query and returns the updated PropertyValue entity.

func (*PropertyValueUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PropertyValueUpdateOne) Select

func (pvuo *PropertyValueUpdateOne) Select(field string, fields ...string) *PropertyValueUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PropertyValueUpdateOne) SetDeletedAt

func (pvuo *PropertyValueUpdateOne) SetDeletedAt(t time.Time) *PropertyValueUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PropertyValueUpdateOne) SetName

SetName sets the "name" field.

func (*PropertyValueUpdateOne) SetNillableDeletedAt

func (pvuo *PropertyValueUpdateOne) SetNillableDeletedAt(t *time.Time) *PropertyValueUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PropertyValueUpdateOne) SetNillableName

func (pvuo *PropertyValueUpdateOne) SetNillableName(s *string) *PropertyValueUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PropertyValueUpdateOne) SetNillablePropertyID

func (pvuo *PropertyValueUpdateOne) SetNillablePropertyID(u *uint64) *PropertyValueUpdateOne

SetNillablePropertyID sets the "property_id" field if the given value is not nil.

func (*PropertyValueUpdateOne) SetNillablePropertysID

func (pvuo *PropertyValueUpdateOne) SetNillablePropertysID(id *uint64) *PropertyValueUpdateOne

SetNillablePropertysID sets the "propertys" edge to the Property entity by ID if the given value is not nil.

func (*PropertyValueUpdateOne) SetNillableRemark

func (pvuo *PropertyValueUpdateOne) SetNillableRemark(s *string) *PropertyValueUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PropertyValueUpdateOne) SetNotNilDeletedAt

func (pv *PropertyValueUpdateOne) SetNotNilDeletedAt(value *time.Time) *PropertyValueUpdateOne

set field if value's pointer is not nil.

func (*PropertyValueUpdateOne) SetNotNilName

func (pv *PropertyValueUpdateOne) SetNotNilName(value *string) *PropertyValueUpdateOne

set field if value's pointer is not nil.

func (*PropertyValueUpdateOne) SetNotNilPropertyID

func (pv *PropertyValueUpdateOne) SetNotNilPropertyID(value *uint64) *PropertyValueUpdateOne

set field if value's pointer is not nil.

func (*PropertyValueUpdateOne) SetNotNilRemark

func (pv *PropertyValueUpdateOne) SetNotNilRemark(value *string) *PropertyValueUpdateOne

set field if value's pointer is not nil.

func (*PropertyValueUpdateOne) SetNotNilUpdatedAt

func (pv *PropertyValueUpdateOne) SetNotNilUpdatedAt(value *time.Time) *PropertyValueUpdateOne

set field if value's pointer is not nil.

func (*PropertyValueUpdateOne) SetPropertyID

func (pvuo *PropertyValueUpdateOne) SetPropertyID(u uint64) *PropertyValueUpdateOne

SetPropertyID sets the "property_id" field.

func (*PropertyValueUpdateOne) SetPropertys

func (pvuo *PropertyValueUpdateOne) SetPropertys(p *Property) *PropertyValueUpdateOne

SetPropertys sets the "propertys" edge to the Property entity.

func (*PropertyValueUpdateOne) SetPropertysID

func (pvuo *PropertyValueUpdateOne) SetPropertysID(id uint64) *PropertyValueUpdateOne

SetPropertysID sets the "propertys" edge to the Property entity by ID.

func (*PropertyValueUpdateOne) SetRemark

SetRemark sets the "remark" field.

func (*PropertyValueUpdateOne) SetUpdatedAt

func (pvuo *PropertyValueUpdateOne) SetUpdatedAt(t time.Time) *PropertyValueUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PropertyValueUpdateOne) Where

Where appends a list predicates to the PropertyValueUpdate builder.

type PropertyValues

type PropertyValues []*PropertyValue

PropertyValues is a parsable slice of PropertyValue.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Sku

type Sku struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// spu编号
	SpuID uint64 `json:"spu_id,omitempty"`
	// 属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]
	Properties []entType.SkuProperty `json:"properties,omitempty"`
	// 商品价格,单位:分
	Price int32 `json:"price,omitempty"`
	// 市场价,单位:分
	MarketPrice int32 `json:"market_price,omitempty"`
	// 成本价,单位: 分
	CostPrice int32 `json:"cost_price,omitempty"`
	// SKU 的条形码
	BarCode string `json:"bar_code,omitempty"`
	// 图片地址
	PicURL string `json:"pic_url,omitempty"`
	// 库存
	Stock int32 `json:"stock,omitempty"`
	// 商品重量,单位:kg 千克
	Weight float64 `json:"weight,omitempty"`
	// 商品体积,单位:m^3 平米
	Volume float64 `json:"volume,omitempty"`
	// 一级分销的佣金,单位:分
	FirstBrokeragePrice int32 `json:"first_brokerage_price,omitempty"`
	// 二级分销的佣金,单位:分
	SecondBrokeragePrice float64 `json:"second_brokerage_price,omitempty"`
	// 商品销量
	SalesCount int32 `json:"sales_count,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SkuQuery when eager-loading is set.
	Edges SkuEdges `json:"edges"`
	// contains filtered or unexported fields
}

Sku is the model entity for the Sku schema.

func (*Sku) QueryComments

func (s *Sku) QueryComments() *CommentQuery

QueryComments queries the "comments" edge of the Sku entity.

func (*Sku) QuerySpus

func (s *Sku) QuerySpus() *SpuQuery

QuerySpus queries the "spus" edge of the Sku entity.

func (*Sku) String

func (s *Sku) String() string

String implements the fmt.Stringer.

func (*Sku) Unwrap

func (s *Sku) Unwrap() *Sku

Unwrap unwraps the Sku entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Sku) Update

func (s *Sku) Update() *SkuUpdateOne

Update returns a builder for updating this Sku. Note that you need to call Sku.Unwrap() before calling this method if this Sku was returned from a transaction, and the transaction was committed or rolled back.

func (*Sku) Value

func (s *Sku) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Sku. This includes values selected through modifiers, order, etc.

type SkuClient

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

SkuClient is a client for the Sku schema.

func NewSkuClient

func NewSkuClient(c config) *SkuClient

NewSkuClient returns a client for the Sku from the given config.

func (*SkuClient) Create

func (c *SkuClient) Create() *SkuCreate

Create returns a builder for creating a Sku entity.

func (*SkuClient) CreateBulk

func (c *SkuClient) CreateBulk(builders ...*SkuCreate) *SkuCreateBulk

CreateBulk returns a builder for creating a bulk of Sku entities.

func (*SkuClient) Delete

func (c *SkuClient) Delete() *SkuDelete

Delete returns a delete builder for Sku.

func (*SkuClient) DeleteOne

func (c *SkuClient) DeleteOne(s *Sku) *SkuDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SkuClient) DeleteOneID

func (c *SkuClient) DeleteOneID(id uint64) *SkuDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SkuClient) Get

func (c *SkuClient) Get(ctx context.Context, id uint64) (*Sku, error)

Get returns a Sku entity by its id.

func (*SkuClient) GetX

func (c *SkuClient) GetX(ctx context.Context, id uint64) *Sku

GetX is like Get, but panics if an error occurs.

func (*SkuClient) Hooks

func (c *SkuClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SkuClient) Intercept

func (c *SkuClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sku.Intercept(f(g(h())))`.

func (*SkuClient) Interceptors

func (c *SkuClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SkuClient) MapCreateBulk

func (c *SkuClient) MapCreateBulk(slice any, setFunc func(*SkuCreate, int)) *SkuCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SkuClient) Query

func (c *SkuClient) Query() *SkuQuery

Query returns a query builder for Sku.

func (*SkuClient) QueryComments

func (c *SkuClient) QueryComments(s *Sku) *CommentQuery

QueryComments queries the comments edge of a Sku.

func (*SkuClient) QuerySpus

func (c *SkuClient) QuerySpus(s *Sku) *SpuQuery

QuerySpus queries the spus edge of a Sku.

func (*SkuClient) Update

func (c *SkuClient) Update() *SkuUpdate

Update returns an update builder for Sku.

func (*SkuClient) UpdateOne

func (c *SkuClient) UpdateOne(s *Sku) *SkuUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SkuClient) UpdateOneID

func (c *SkuClient) UpdateOneID(id uint64) *SkuUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SkuClient) Use

func (c *SkuClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sku.Hooks(f(g(h())))`.

type SkuCreate

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

SkuCreate is the builder for creating a Sku entity.

func (*SkuCreate) AddCommentIDs

func (sc *SkuCreate) AddCommentIDs(ids ...uint64) *SkuCreate

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*SkuCreate) AddComments

func (sc *SkuCreate) AddComments(c ...*Comment) *SkuCreate

AddComments adds the "comments" edges to the Comment entity.

func (*SkuCreate) Exec

func (sc *SkuCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SkuCreate) ExecX

func (sc *SkuCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SkuCreate) Mutation

func (sc *SkuCreate) Mutation() *SkuMutation

Mutation returns the SkuMutation object of the builder.

func (*SkuCreate) Save

func (sc *SkuCreate) Save(ctx context.Context) (*Sku, error)

Save creates the Sku in the database.

func (*SkuCreate) SaveX

func (sc *SkuCreate) SaveX(ctx context.Context) *Sku

SaveX calls Save and panics if Save returns an error.

func (*SkuCreate) SetBarCode

func (sc *SkuCreate) SetBarCode(s string) *SkuCreate

SetBarCode sets the "bar_code" field.

func (*SkuCreate) SetCostPrice

func (sc *SkuCreate) SetCostPrice(i int32) *SkuCreate

SetCostPrice sets the "cost_price" field.

func (*SkuCreate) SetCreatedAt

func (sc *SkuCreate) SetCreatedAt(t time.Time) *SkuCreate

SetCreatedAt sets the "created_at" field.

func (*SkuCreate) SetDeletedAt

func (sc *SkuCreate) SetDeletedAt(t time.Time) *SkuCreate

SetDeletedAt sets the "deleted_at" field.

func (*SkuCreate) SetFirstBrokeragePrice

func (sc *SkuCreate) SetFirstBrokeragePrice(i int32) *SkuCreate

SetFirstBrokeragePrice sets the "first_brokerage_price" field.

func (*SkuCreate) SetID

func (sc *SkuCreate) SetID(u uint64) *SkuCreate

SetID sets the "id" field.

func (*SkuCreate) SetMarketPrice

func (sc *SkuCreate) SetMarketPrice(i int32) *SkuCreate

SetMarketPrice sets the "market_price" field.

func (*SkuCreate) SetNillableBarCode

func (sc *SkuCreate) SetNillableBarCode(s *string) *SkuCreate

SetNillableBarCode sets the "bar_code" field if the given value is not nil.

func (*SkuCreate) SetNillableCreatedAt

func (sc *SkuCreate) SetNillableCreatedAt(t *time.Time) *SkuCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SkuCreate) SetNillableDeletedAt

func (sc *SkuCreate) SetNillableDeletedAt(t *time.Time) *SkuCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SkuCreate) SetNillableFirstBrokeragePrice

func (sc *SkuCreate) SetNillableFirstBrokeragePrice(i *int32) *SkuCreate

SetNillableFirstBrokeragePrice sets the "first_brokerage_price" field if the given value is not nil.

func (*SkuCreate) SetNillableMarketPrice

func (sc *SkuCreate) SetNillableMarketPrice(i *int32) *SkuCreate

SetNillableMarketPrice sets the "market_price" field if the given value is not nil.

func (*SkuCreate) SetNillableSalesCount

func (sc *SkuCreate) SetNillableSalesCount(i *int32) *SkuCreate

SetNillableSalesCount sets the "sales_count" field if the given value is not nil.

func (*SkuCreate) SetNillableSecondBrokeragePrice

func (sc *SkuCreate) SetNillableSecondBrokeragePrice(f *float64) *SkuCreate

SetNillableSecondBrokeragePrice sets the "second_brokerage_price" field if the given value is not nil.

func (*SkuCreate) SetNillableSpuID

func (sc *SkuCreate) SetNillableSpuID(u *uint64) *SkuCreate

SetNillableSpuID sets the "spu_id" field if the given value is not nil.

func (*SkuCreate) SetNillableSpusID

func (sc *SkuCreate) SetNillableSpusID(id *uint64) *SkuCreate

SetNillableSpusID sets the "spus" edge to the Spu entity by ID if the given value is not nil.

func (*SkuCreate) SetNillableStock

func (sc *SkuCreate) SetNillableStock(i *int32) *SkuCreate

SetNillableStock sets the "stock" field if the given value is not nil.

func (*SkuCreate) SetNillableUpdatedAt

func (sc *SkuCreate) SetNillableUpdatedAt(t *time.Time) *SkuCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SkuCreate) SetNillableVolume

func (sc *SkuCreate) SetNillableVolume(f *float64) *SkuCreate

SetNillableVolume sets the "volume" field if the given value is not nil.

func (*SkuCreate) SetNillableWeight

func (sc *SkuCreate) SetNillableWeight(f *float64) *SkuCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*SkuCreate) SetNotNilBarCode

func (s *SkuCreate) SetNotNilBarCode(value *string) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilCostPrice

func (s *SkuCreate) SetNotNilCostPrice(value *int32) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilDeletedAt

func (s *SkuCreate) SetNotNilDeletedAt(value *time.Time) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilFirstBrokeragePrice

func (s *SkuCreate) SetNotNilFirstBrokeragePrice(value *int32) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilMarketPrice

func (s *SkuCreate) SetNotNilMarketPrice(value *int32) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilPicURL

func (s *SkuCreate) SetNotNilPicURL(value *string) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilPrice

func (s *SkuCreate) SetNotNilPrice(value *int32) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilProperties

func (s *SkuCreate) SetNotNilProperties(value *[]entType.SkuProperty) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilSalesCount

func (s *SkuCreate) SetNotNilSalesCount(value *int32) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilSecondBrokeragePrice

func (s *SkuCreate) SetNotNilSecondBrokeragePrice(value *float64) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilSpuID

func (s *SkuCreate) SetNotNilSpuID(value *uint64) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilStock

func (s *SkuCreate) SetNotNilStock(value *int32) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilUpdatedAt

func (s *SkuCreate) SetNotNilUpdatedAt(value *time.Time) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilVolume

func (s *SkuCreate) SetNotNilVolume(value *float64) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetNotNilWeight

func (s *SkuCreate) SetNotNilWeight(value *float64) *SkuCreate

set field if value's pointer is not nil.

func (*SkuCreate) SetPicURL

func (sc *SkuCreate) SetPicURL(s string) *SkuCreate

SetPicURL sets the "pic_url" field.

func (*SkuCreate) SetPrice

func (sc *SkuCreate) SetPrice(i int32) *SkuCreate

SetPrice sets the "price" field.

func (*SkuCreate) SetProperties

func (sc *SkuCreate) SetProperties(etp []entType.SkuProperty) *SkuCreate

SetProperties sets the "properties" field.

func (*SkuCreate) SetSalesCount

func (sc *SkuCreate) SetSalesCount(i int32) *SkuCreate

SetSalesCount sets the "sales_count" field.

func (*SkuCreate) SetSecondBrokeragePrice

func (sc *SkuCreate) SetSecondBrokeragePrice(f float64) *SkuCreate

SetSecondBrokeragePrice sets the "second_brokerage_price" field.

func (*SkuCreate) SetSpuID

func (sc *SkuCreate) SetSpuID(u uint64) *SkuCreate

SetSpuID sets the "spu_id" field.

func (*SkuCreate) SetSpus

func (sc *SkuCreate) SetSpus(s *Spu) *SkuCreate

SetSpus sets the "spus" edge to the Spu entity.

func (*SkuCreate) SetSpusID

func (sc *SkuCreate) SetSpusID(id uint64) *SkuCreate

SetSpusID sets the "spus" edge to the Spu entity by ID.

func (*SkuCreate) SetStock

func (sc *SkuCreate) SetStock(i int32) *SkuCreate

SetStock sets the "stock" field.

func (*SkuCreate) SetUpdatedAt

func (sc *SkuCreate) SetUpdatedAt(t time.Time) *SkuCreate

SetUpdatedAt sets the "updated_at" field.

func (*SkuCreate) SetVolume

func (sc *SkuCreate) SetVolume(f float64) *SkuCreate

SetVolume sets the "volume" field.

func (*SkuCreate) SetWeight

func (sc *SkuCreate) SetWeight(f float64) *SkuCreate

SetWeight sets the "weight" field.

type SkuCreateBulk

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

SkuCreateBulk is the builder for creating many Sku entities in bulk.

func (*SkuCreateBulk) Exec

func (scb *SkuCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SkuCreateBulk) ExecX

func (scb *SkuCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SkuCreateBulk) Save

func (scb *SkuCreateBulk) Save(ctx context.Context) ([]*Sku, error)

Save creates the Sku entities in the database.

func (*SkuCreateBulk) SaveX

func (scb *SkuCreateBulk) SaveX(ctx context.Context) []*Sku

SaveX is like Save, but panics if an error occurs.

type SkuDelete

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

SkuDelete is the builder for deleting a Sku entity.

func (*SkuDelete) Exec

func (sd *SkuDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SkuDelete) ExecX

func (sd *SkuDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SkuDelete) Where

func (sd *SkuDelete) Where(ps ...predicate.Sku) *SkuDelete

Where appends a list predicates to the SkuDelete builder.

type SkuDeleteOne

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

SkuDeleteOne is the builder for deleting a single Sku entity.

func (*SkuDeleteOne) Exec

func (sdo *SkuDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SkuDeleteOne) ExecX

func (sdo *SkuDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SkuDeleteOne) Where

func (sdo *SkuDeleteOne) Where(ps ...predicate.Sku) *SkuDeleteOne

Where appends a list predicates to the SkuDelete builder.

type SkuEdges

type SkuEdges struct {
	// Spus holds the value of the spus edge.
	Spus *Spu `json:"spus,omitempty"`
	// Comments holds the value of the comments edge.
	Comments []*Comment `json:"comments,omitempty"`
	// contains filtered or unexported fields
}

SkuEdges holds the relations/edges for other nodes in the graph.

func (SkuEdges) CommentsOrErr

func (e SkuEdges) CommentsOrErr() ([]*Comment, error)

CommentsOrErr returns the Comments value or an error if the edge was not loaded in eager-loading.

func (SkuEdges) SpusOrErr

func (e SkuEdges) SpusOrErr() (*Spu, error)

SpusOrErr returns the Spus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SkuGroupBy

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

SkuGroupBy is the group-by builder for Sku entities.

func (*SkuGroupBy) Aggregate

func (sgb *SkuGroupBy) Aggregate(fns ...AggregateFunc) *SkuGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SkuGroupBy) Bool

func (s *SkuGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) BoolX

func (s *SkuGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SkuGroupBy) Bools

func (s *SkuGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) BoolsX

func (s *SkuGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SkuGroupBy) Float64

func (s *SkuGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) Float64X

func (s *SkuGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SkuGroupBy) Float64s

func (s *SkuGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) Float64sX

func (s *SkuGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SkuGroupBy) Int

func (s *SkuGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) IntX

func (s *SkuGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SkuGroupBy) Ints

func (s *SkuGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) IntsX

func (s *SkuGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SkuGroupBy) Scan

func (sgb *SkuGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SkuGroupBy) ScanX

func (s *SkuGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SkuGroupBy) String

func (s *SkuGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) StringX

func (s *SkuGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SkuGroupBy) Strings

func (s *SkuGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SkuGroupBy) StringsX

func (s *SkuGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SkuMutation

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

SkuMutation represents an operation that mutates the Sku nodes in the graph.

func (*SkuMutation) AddCommentIDs

func (m *SkuMutation) AddCommentIDs(ids ...uint64)

AddCommentIDs adds the "comments" edge to the Comment entity by ids.

func (*SkuMutation) AddCostPrice

func (m *SkuMutation) AddCostPrice(i int32)

AddCostPrice adds i to the "cost_price" field.

func (*SkuMutation) AddField

func (m *SkuMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SkuMutation) AddFirstBrokeragePrice

func (m *SkuMutation) AddFirstBrokeragePrice(i int32)

AddFirstBrokeragePrice adds i to the "first_brokerage_price" field.

func (*SkuMutation) AddMarketPrice

func (m *SkuMutation) AddMarketPrice(i int32)

AddMarketPrice adds i to the "market_price" field.

func (*SkuMutation) AddPrice

func (m *SkuMutation) AddPrice(i int32)

AddPrice adds i to the "price" field.

func (*SkuMutation) AddSalesCount

func (m *SkuMutation) AddSalesCount(i int32)

AddSalesCount adds i to the "sales_count" field.

func (*SkuMutation) AddSecondBrokeragePrice

func (m *SkuMutation) AddSecondBrokeragePrice(f float64)

AddSecondBrokeragePrice adds f to the "second_brokerage_price" field.

func (*SkuMutation) AddStock

func (m *SkuMutation) AddStock(i int32)

AddStock adds i to the "stock" field.

func (*SkuMutation) AddVolume

func (m *SkuMutation) AddVolume(f float64)

AddVolume adds f to the "volume" field.

func (*SkuMutation) AddWeight

func (m *SkuMutation) AddWeight(f float64)

AddWeight adds f to the "weight" field.

func (*SkuMutation) AddedCostPrice

func (m *SkuMutation) AddedCostPrice() (r int32, exists bool)

AddedCostPrice returns the value that was added to the "cost_price" field in this mutation.

func (*SkuMutation) AddedEdges

func (m *SkuMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SkuMutation) AddedField

func (m *SkuMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SkuMutation) AddedFields

func (m *SkuMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SkuMutation) AddedFirstBrokeragePrice

func (m *SkuMutation) AddedFirstBrokeragePrice() (r int32, exists bool)

AddedFirstBrokeragePrice returns the value that was added to the "first_brokerage_price" field in this mutation.

func (*SkuMutation) AddedIDs

func (m *SkuMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SkuMutation) AddedMarketPrice

func (m *SkuMutation) AddedMarketPrice() (r int32, exists bool)

AddedMarketPrice returns the value that was added to the "market_price" field in this mutation.

func (*SkuMutation) AddedPrice

func (m *SkuMutation) AddedPrice() (r int32, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*SkuMutation) AddedSalesCount

func (m *SkuMutation) AddedSalesCount() (r int32, exists bool)

AddedSalesCount returns the value that was added to the "sales_count" field in this mutation.

func (*SkuMutation) AddedSecondBrokeragePrice

func (m *SkuMutation) AddedSecondBrokeragePrice() (r float64, exists bool)

AddedSecondBrokeragePrice returns the value that was added to the "second_brokerage_price" field in this mutation.

func (*SkuMutation) AddedStock

func (m *SkuMutation) AddedStock() (r int32, exists bool)

AddedStock returns the value that was added to the "stock" field in this mutation.

func (*SkuMutation) AddedVolume

func (m *SkuMutation) AddedVolume() (r float64, exists bool)

AddedVolume returns the value that was added to the "volume" field in this mutation.

func (*SkuMutation) AddedWeight

func (m *SkuMutation) AddedWeight() (r float64, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*SkuMutation) AppendProperties

func (m *SkuMutation) AppendProperties(etp []entType.SkuProperty)

AppendProperties adds etp to the "properties" field.

func (*SkuMutation) AppendedProperties

func (m *SkuMutation) AppendedProperties() ([]entType.SkuProperty, bool)

AppendedProperties returns the list of values that were appended to the "properties" field in this mutation.

func (*SkuMutation) BarCode

func (m *SkuMutation) BarCode() (r string, exists bool)

BarCode returns the value of the "bar_code" field in the mutation.

func (*SkuMutation) BarCodeCleared

func (m *SkuMutation) BarCodeCleared() bool

BarCodeCleared returns if the "bar_code" field was cleared in this mutation.

func (*SkuMutation) ClearBarCode

func (m *SkuMutation) ClearBarCode()

ClearBarCode clears the value of the "bar_code" field.

func (*SkuMutation) ClearComments

func (m *SkuMutation) ClearComments()

ClearComments clears the "comments" edge to the Comment entity.

func (*SkuMutation) ClearDeletedAt

func (m *SkuMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*SkuMutation) ClearEdge

func (m *SkuMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*SkuMutation) ClearField

func (m *SkuMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*SkuMutation) ClearFirstBrokeragePrice

func (m *SkuMutation) ClearFirstBrokeragePrice()

ClearFirstBrokeragePrice clears the value of the "first_brokerage_price" field.

func (*SkuMutation) ClearMarketPrice

func (m *SkuMutation) ClearMarketPrice()

ClearMarketPrice clears the value of the "market_price" field.

func (*SkuMutation) ClearProperties

func (m *SkuMutation) ClearProperties()

ClearProperties clears the value of the "properties" field.

func (*SkuMutation) ClearSalesCount

func (m *SkuMutation) ClearSalesCount()

ClearSalesCount clears the value of the "sales_count" field.

func (*SkuMutation) ClearSecondBrokeragePrice

func (m *SkuMutation) ClearSecondBrokeragePrice()

ClearSecondBrokeragePrice clears the value of the "second_brokerage_price" field.

func (*SkuMutation) ClearSpuID

func (m *SkuMutation) ClearSpuID()

ClearSpuID clears the value of the "spu_id" field.

func (*SkuMutation) ClearSpus

func (m *SkuMutation) ClearSpus()

ClearSpus clears the "spus" edge to the Spu entity.

func (*SkuMutation) ClearStock

func (m *SkuMutation) ClearStock()

ClearStock clears the value of the "stock" field.

func (*SkuMutation) ClearVolume

func (m *SkuMutation) ClearVolume()

ClearVolume clears the value of the "volume" field.

func (*SkuMutation) ClearWeight

func (m *SkuMutation) ClearWeight()

ClearWeight clears the value of the "weight" field.

func (*SkuMutation) ClearedEdges

func (m *SkuMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SkuMutation) ClearedFields

func (m *SkuMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SkuMutation) Client

func (m SkuMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*SkuMutation) CommentsCleared

func (m *SkuMutation) CommentsCleared() bool

CommentsCleared reports if the "comments" edge to the Comment entity was cleared.

func (*SkuMutation) CommentsIDs

func (m *SkuMutation) CommentsIDs() (ids []uint64)

CommentsIDs returns the "comments" edge IDs in the mutation.

func (*SkuMutation) CostPrice

func (m *SkuMutation) CostPrice() (r int32, exists bool)

CostPrice returns the value of the "cost_price" field in the mutation.

func (*SkuMutation) CreatedAt

func (m *SkuMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SkuMutation) DeletedAt

func (m *SkuMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*SkuMutation) DeletedAtCleared

func (m *SkuMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*SkuMutation) EdgeCleared

func (m *SkuMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SkuMutation) Field

func (m *SkuMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SkuMutation) FieldCleared

func (m *SkuMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SkuMutation) Fields

func (m *SkuMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*SkuMutation) FirstBrokeragePrice

func (m *SkuMutation) FirstBrokeragePrice() (r int32, exists bool)

FirstBrokeragePrice returns the value of the "first_brokerage_price" field in the mutation.

func (*SkuMutation) FirstBrokeragePriceCleared

func (m *SkuMutation) FirstBrokeragePriceCleared() bool

FirstBrokeragePriceCleared returns if the "first_brokerage_price" field was cleared in this mutation.

func (*SkuMutation) ID

func (m *SkuMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SkuMutation) IDs

func (m *SkuMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SkuMutation) MarketPrice

func (m *SkuMutation) MarketPrice() (r int32, exists bool)

MarketPrice returns the value of the "market_price" field in the mutation.

func (*SkuMutation) MarketPriceCleared

func (m *SkuMutation) MarketPriceCleared() bool

MarketPriceCleared returns if the "market_price" field was cleared in this mutation.

func (*SkuMutation) OldBarCode

func (m *SkuMutation) OldBarCode(ctx context.Context) (v string, err error)

OldBarCode returns the old "bar_code" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldCostPrice

func (m *SkuMutation) OldCostPrice(ctx context.Context) (v int32, err error)

OldCostPrice returns the old "cost_price" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldCreatedAt

func (m *SkuMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldDeletedAt

func (m *SkuMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldField

func (m *SkuMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*SkuMutation) OldFirstBrokeragePrice

func (m *SkuMutation) OldFirstBrokeragePrice(ctx context.Context) (v int32, err error)

OldFirstBrokeragePrice returns the old "first_brokerage_price" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldMarketPrice

func (m *SkuMutation) OldMarketPrice(ctx context.Context) (v int32, err error)

OldMarketPrice returns the old "market_price" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldPicURL

func (m *SkuMutation) OldPicURL(ctx context.Context) (v string, err error)

OldPicURL returns the old "pic_url" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldPrice

func (m *SkuMutation) OldPrice(ctx context.Context) (v int32, err error)

OldPrice returns the old "price" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldProperties

func (m *SkuMutation) OldProperties(ctx context.Context) (v []entType.SkuProperty, err error)

OldProperties returns the old "properties" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldSalesCount

func (m *SkuMutation) OldSalesCount(ctx context.Context) (v int32, err error)

OldSalesCount returns the old "sales_count" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldSecondBrokeragePrice

func (m *SkuMutation) OldSecondBrokeragePrice(ctx context.Context) (v float64, err error)

OldSecondBrokeragePrice returns the old "second_brokerage_price" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldSpuID

func (m *SkuMutation) OldSpuID(ctx context.Context) (v uint64, err error)

OldSpuID returns the old "spu_id" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldStock

func (m *SkuMutation) OldStock(ctx context.Context) (v int32, err error)

OldStock returns the old "stock" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldUpdatedAt

func (m *SkuMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldVolume

func (m *SkuMutation) OldVolume(ctx context.Context) (v float64, err error)

OldVolume returns the old "volume" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) OldWeight

func (m *SkuMutation) OldWeight(ctx context.Context) (v float64, err error)

OldWeight returns the old "weight" field's value of the Sku entity. If the Sku object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SkuMutation) Op

func (m *SkuMutation) Op() Op

Op returns the operation name.

func (*SkuMutation) PicURL

func (m *SkuMutation) PicURL() (r string, exists bool)

PicURL returns the value of the "pic_url" field in the mutation.

func (*SkuMutation) Price

func (m *SkuMutation) Price() (r int32, exists bool)

Price returns the value of the "price" field in the mutation.

func (*SkuMutation) Properties

func (m *SkuMutation) Properties() (r []entType.SkuProperty, exists bool)

Properties returns the value of the "properties" field in the mutation.

func (*SkuMutation) PropertiesCleared

func (m *SkuMutation) PropertiesCleared() bool

PropertiesCleared returns if the "properties" field was cleared in this mutation.

func (*SkuMutation) RemoveCommentIDs

func (m *SkuMutation) RemoveCommentIDs(ids ...uint64)

RemoveCommentIDs removes the "comments" edge to the Comment entity by IDs.

func (*SkuMutation) RemovedCommentsIDs

func (m *SkuMutation) RemovedCommentsIDs() (ids []uint64)

RemovedComments returns the removed IDs of the "comments" edge to the Comment entity.

func (*SkuMutation) RemovedEdges

func (m *SkuMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SkuMutation) RemovedIDs

func (m *SkuMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SkuMutation) ResetBarCode

func (m *SkuMutation) ResetBarCode()

ResetBarCode resets all changes to the "bar_code" field.

func (*SkuMutation) ResetComments

func (m *SkuMutation) ResetComments()

ResetComments resets all changes to the "comments" edge.

func (*SkuMutation) ResetCostPrice

func (m *SkuMutation) ResetCostPrice()

ResetCostPrice resets all changes to the "cost_price" field.

func (*SkuMutation) ResetCreatedAt

func (m *SkuMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SkuMutation) ResetDeletedAt

func (m *SkuMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*SkuMutation) ResetEdge

func (m *SkuMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*SkuMutation) ResetField

func (m *SkuMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*SkuMutation) ResetFirstBrokeragePrice

func (m *SkuMutation) ResetFirstBrokeragePrice()

ResetFirstBrokeragePrice resets all changes to the "first_brokerage_price" field.

func (*SkuMutation) ResetMarketPrice

func (m *SkuMutation) ResetMarketPrice()

ResetMarketPrice resets all changes to the "market_price" field.

func (*SkuMutation) ResetPicURL

func (m *SkuMutation) ResetPicURL()

ResetPicURL resets all changes to the "pic_url" field.

func (*SkuMutation) ResetPrice

func (m *SkuMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*SkuMutation) ResetProperties

func (m *SkuMutation) ResetProperties()

ResetProperties resets all changes to the "properties" field.

func (*SkuMutation) ResetSalesCount

func (m *SkuMutation) ResetSalesCount()

ResetSalesCount resets all changes to the "sales_count" field.

func (*SkuMutation) ResetSecondBrokeragePrice

func (m *SkuMutation) ResetSecondBrokeragePrice()

ResetSecondBrokeragePrice resets all changes to the "second_brokerage_price" field.

func (*SkuMutation) ResetSpuID

func (m *SkuMutation) ResetSpuID()

ResetSpuID resets all changes to the "spu_id" field.

func (*SkuMutation) ResetSpus

func (m *SkuMutation) ResetSpus()

ResetSpus resets all changes to the "spus" edge.

func (*SkuMutation) ResetStock

func (m *SkuMutation) ResetStock()

ResetStock resets all changes to the "stock" field.

func (*SkuMutation) ResetUpdatedAt

func (m *SkuMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SkuMutation) ResetVolume

func (m *SkuMutation) ResetVolume()

ResetVolume resets all changes to the "volume" field.

func (*SkuMutation) ResetWeight

func (m *SkuMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*SkuMutation) SalesCount

func (m *SkuMutation) SalesCount() (r int32, exists bool)

SalesCount returns the value of the "sales_count" field in the mutation.

func (*SkuMutation) SalesCountCleared

func (m *SkuMutation) SalesCountCleared() bool

SalesCountCleared returns if the "sales_count" field was cleared in this mutation.

func (*SkuMutation) SecondBrokeragePrice

func (m *SkuMutation) SecondBrokeragePrice() (r float64, exists bool)

SecondBrokeragePrice returns the value of the "second_brokerage_price" field in the mutation.

func (*SkuMutation) SecondBrokeragePriceCleared

func (m *SkuMutation) SecondBrokeragePriceCleared() bool

SecondBrokeragePriceCleared returns if the "second_brokerage_price" field was cleared in this mutation.

func (*SkuMutation) SetBarCode

func (m *SkuMutation) SetBarCode(s string)

SetBarCode sets the "bar_code" field.

func (*SkuMutation) SetCostPrice

func (m *SkuMutation) SetCostPrice(i int32)

SetCostPrice sets the "cost_price" field.

func (*SkuMutation) SetCreatedAt

func (m *SkuMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SkuMutation) SetDeletedAt

func (m *SkuMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*SkuMutation) SetField

func (m *SkuMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SkuMutation) SetFirstBrokeragePrice

func (m *SkuMutation) SetFirstBrokeragePrice(i int32)

SetFirstBrokeragePrice sets the "first_brokerage_price" field.

func (*SkuMutation) SetID

func (m *SkuMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Sku entities.

func (*SkuMutation) SetMarketPrice

func (m *SkuMutation) SetMarketPrice(i int32)

SetMarketPrice sets the "market_price" field.

func (*SkuMutation) SetOp

func (m *SkuMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SkuMutation) SetPicURL

func (m *SkuMutation) SetPicURL(s string)

SetPicURL sets the "pic_url" field.

func (*SkuMutation) SetPrice

func (m *SkuMutation) SetPrice(i int32)

SetPrice sets the "price" field.

func (*SkuMutation) SetProperties

func (m *SkuMutation) SetProperties(etp []entType.SkuProperty)

SetProperties sets the "properties" field.

func (*SkuMutation) SetSalesCount

func (m *SkuMutation) SetSalesCount(i int32)

SetSalesCount sets the "sales_count" field.

func (*SkuMutation) SetSecondBrokeragePrice

func (m *SkuMutation) SetSecondBrokeragePrice(f float64)

SetSecondBrokeragePrice sets the "second_brokerage_price" field.

func (*SkuMutation) SetSpuID

func (m *SkuMutation) SetSpuID(u uint64)

SetSpuID sets the "spu_id" field.

func (*SkuMutation) SetSpusID

func (m *SkuMutation) SetSpusID(id uint64)

SetSpusID sets the "spus" edge to the Spu entity by id.

func (*SkuMutation) SetStock

func (m *SkuMutation) SetStock(i int32)

SetStock sets the "stock" field.

func (*SkuMutation) SetUpdatedAt

func (m *SkuMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SkuMutation) SetVolume

func (m *SkuMutation) SetVolume(f float64)

SetVolume sets the "volume" field.

func (*SkuMutation) SetWeight

func (m *SkuMutation) SetWeight(f float64)

SetWeight sets the "weight" field.

func (*SkuMutation) SpuID

func (m *SkuMutation) SpuID() (r uint64, exists bool)

SpuID returns the value of the "spu_id" field in the mutation.

func (*SkuMutation) SpuIDCleared

func (m *SkuMutation) SpuIDCleared() bool

SpuIDCleared returns if the "spu_id" field was cleared in this mutation.

func (*SkuMutation) SpusCleared

func (m *SkuMutation) SpusCleared() bool

SpusCleared reports if the "spus" edge to the Spu entity was cleared.

func (*SkuMutation) SpusID

func (m *SkuMutation) SpusID() (id uint64, exists bool)

SpusID returns the "spus" edge ID in the mutation.

func (*SkuMutation) SpusIDs

func (m *SkuMutation) SpusIDs() (ids []uint64)

SpusIDs returns the "spus" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SpusID instead. It exists only for internal usage by the builders.

func (*SkuMutation) Stock

func (m *SkuMutation) Stock() (r int32, exists bool)

Stock returns the value of the "stock" field in the mutation.

func (*SkuMutation) StockCleared

func (m *SkuMutation) StockCleared() bool

StockCleared returns if the "stock" field was cleared in this mutation.

func (SkuMutation) Tx

func (m SkuMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SkuMutation) Type

func (m *SkuMutation) Type() string

Type returns the node type of this mutation (Sku).

func (*SkuMutation) UpdatedAt

func (m *SkuMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SkuMutation) Volume

func (m *SkuMutation) Volume() (r float64, exists bool)

Volume returns the value of the "volume" field in the mutation.

func (*SkuMutation) VolumeCleared

func (m *SkuMutation) VolumeCleared() bool

VolumeCleared returns if the "volume" field was cleared in this mutation.

func (*SkuMutation) Weight

func (m *SkuMutation) Weight() (r float64, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*SkuMutation) WeightCleared

func (m *SkuMutation) WeightCleared() bool

WeightCleared returns if the "weight" field was cleared in this mutation.

func (*SkuMutation) Where

func (m *SkuMutation) Where(ps ...predicate.Sku)

Where appends a list predicates to the SkuMutation builder.

func (*SkuMutation) WhereP

func (m *SkuMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SkuMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SkuPageList

type SkuPageList struct {
	List        []*Sku       `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

SkuPageList is Sku PageList result.

type SkuPager

type SkuPager struct {
	Order  sku.OrderOption
	Filter func(*SkuQuery) (*SkuQuery, error)
}

func (*SkuPager) ApplyFilter

func (p *SkuPager) ApplyFilter(query *SkuQuery) (*SkuQuery, error)

type SkuPaginateOption

type SkuPaginateOption func(*SkuPager)

SkuPaginateOption enables pagination customization.

type SkuQuery

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

SkuQuery is the builder for querying Sku entities.

func (*SkuQuery) Aggregate

func (sq *SkuQuery) Aggregate(fns ...AggregateFunc) *SkuSelect

Aggregate returns a SkuSelect configured with the given aggregations.

func (*SkuQuery) All

func (sq *SkuQuery) All(ctx context.Context) ([]*Sku, error)

All executes the query and returns a list of Skus.

func (*SkuQuery) AllX

func (sq *SkuQuery) AllX(ctx context.Context) []*Sku

AllX is like All, but panics if an error occurs.

func (*SkuQuery) Clone

func (sq *SkuQuery) Clone() *SkuQuery

Clone returns a duplicate of the SkuQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SkuQuery) Count

func (sq *SkuQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SkuQuery) CountX

func (sq *SkuQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SkuQuery) Exist

func (sq *SkuQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SkuQuery) ExistX

func (sq *SkuQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SkuQuery) First

func (sq *SkuQuery) First(ctx context.Context) (*Sku, error)

First returns the first Sku entity from the query. Returns a *NotFoundError when no Sku was found.

func (*SkuQuery) FirstID

func (sq *SkuQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Sku ID from the query. Returns a *NotFoundError when no Sku ID was found.

func (*SkuQuery) FirstIDX

func (sq *SkuQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*SkuQuery) FirstX

func (sq *SkuQuery) FirstX(ctx context.Context) *Sku

FirstX is like First, but panics if an error occurs.

func (*SkuQuery) GroupBy

func (sq *SkuQuery) GroupBy(field string, fields ...string) *SkuGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Sku.Query().
	GroupBy(sku.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SkuQuery) IDs

func (sq *SkuQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Sku IDs.

func (*SkuQuery) IDsX

func (sq *SkuQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*SkuQuery) Limit

func (sq *SkuQuery) Limit(limit int) *SkuQuery

Limit the number of records to be returned by this query.

func (*SkuQuery) Offset

func (sq *SkuQuery) Offset(offset int) *SkuQuery

Offset to start from.

func (*SkuQuery) Only

func (sq *SkuQuery) Only(ctx context.Context) (*Sku, error)

Only returns a single Sku entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Sku entity is found. Returns a *NotFoundError when no Sku entities are found.

func (*SkuQuery) OnlyID

func (sq *SkuQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Sku ID in the query. Returns a *NotSingularError when more than one Sku ID is found. Returns a *NotFoundError when no entities are found.

func (*SkuQuery) OnlyIDX

func (sq *SkuQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SkuQuery) OnlyX

func (sq *SkuQuery) OnlyX(ctx context.Context) *Sku

OnlyX is like Only, but panics if an error occurs.

func (*SkuQuery) Order

func (sq *SkuQuery) Order(o ...sku.OrderOption) *SkuQuery

Order specifies how the records should be ordered.

func (*SkuQuery) Page

func (s *SkuQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...SkuPaginateOption,
) (*SkuPageList, error)

func (*SkuQuery) QueryComments

func (sq *SkuQuery) QueryComments() *CommentQuery

QueryComments chains the current query on the "comments" edge.

func (*SkuQuery) QuerySpus

func (sq *SkuQuery) QuerySpus() *SpuQuery

QuerySpus chains the current query on the "spus" edge.

func (*SkuQuery) Select

func (sq *SkuQuery) Select(fields ...string) *SkuSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Sku.Query().
	Select(sku.FieldCreatedAt).
	Scan(ctx, &v)

func (*SkuQuery) Unique

func (sq *SkuQuery) Unique(unique bool) *SkuQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SkuQuery) Where

func (sq *SkuQuery) Where(ps ...predicate.Sku) *SkuQuery

Where adds a new predicate for the SkuQuery builder.

func (*SkuQuery) WithComments

func (sq *SkuQuery) WithComments(opts ...func(*CommentQuery)) *SkuQuery

WithComments tells the query-builder to eager-load the nodes that are connected to the "comments" edge. The optional arguments are used to configure the query builder of the edge.

func (*SkuQuery) WithSpus

func (sq *SkuQuery) WithSpus(opts ...func(*SpuQuery)) *SkuQuery

WithSpus tells the query-builder to eager-load the nodes that are connected to the "spus" edge. The optional arguments are used to configure the query builder of the edge.

type SkuSelect

type SkuSelect struct {
	*SkuQuery
	// contains filtered or unexported fields
}

SkuSelect is the builder for selecting fields of Sku entities.

func (*SkuSelect) Aggregate

func (ss *SkuSelect) Aggregate(fns ...AggregateFunc) *SkuSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SkuSelect) Bool

func (s *SkuSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SkuSelect) BoolX

func (s *SkuSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SkuSelect) Bools

func (s *SkuSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SkuSelect) BoolsX

func (s *SkuSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SkuSelect) Float64

func (s *SkuSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SkuSelect) Float64X

func (s *SkuSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SkuSelect) Float64s

func (s *SkuSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SkuSelect) Float64sX

func (s *SkuSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SkuSelect) Int

func (s *SkuSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SkuSelect) IntX

func (s *SkuSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SkuSelect) Ints

func (s *SkuSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SkuSelect) IntsX

func (s *SkuSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SkuSelect) Scan

func (ss *SkuSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SkuSelect) ScanX

func (s *SkuSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SkuSelect) String

func (s *SkuSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SkuSelect) StringX

func (s *SkuSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SkuSelect) Strings

func (s *SkuSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SkuSelect) StringsX

func (s *SkuSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SkuUpdate

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

SkuUpdate is the builder for updating Sku entities.

func (*SkuUpdate) AddCommentIDs

func (su *SkuUpdate) AddCommentIDs(ids ...uint64) *SkuUpdate

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*SkuUpdate) AddComments

func (su *SkuUpdate) AddComments(c ...*Comment) *SkuUpdate

AddComments adds the "comments" edges to the Comment entity.

func (*SkuUpdate) AddCostPrice

func (su *SkuUpdate) AddCostPrice(i int32) *SkuUpdate

AddCostPrice adds i to the "cost_price" field.

func (*SkuUpdate) AddFirstBrokeragePrice

func (su *SkuUpdate) AddFirstBrokeragePrice(i int32) *SkuUpdate

AddFirstBrokeragePrice adds i to the "first_brokerage_price" field.

func (*SkuUpdate) AddMarketPrice

func (su *SkuUpdate) AddMarketPrice(i int32) *SkuUpdate

AddMarketPrice adds i to the "market_price" field.

func (*SkuUpdate) AddPrice

func (su *SkuUpdate) AddPrice(i int32) *SkuUpdate

AddPrice adds i to the "price" field.

func (*SkuUpdate) AddSalesCount

func (su *SkuUpdate) AddSalesCount(i int32) *SkuUpdate

AddSalesCount adds i to the "sales_count" field.

func (*SkuUpdate) AddSecondBrokeragePrice

func (su *SkuUpdate) AddSecondBrokeragePrice(f float64) *SkuUpdate

AddSecondBrokeragePrice adds f to the "second_brokerage_price" field.

func (*SkuUpdate) AddStock

func (su *SkuUpdate) AddStock(i int32) *SkuUpdate

AddStock adds i to the "stock" field.

func (*SkuUpdate) AddVolume

func (su *SkuUpdate) AddVolume(f float64) *SkuUpdate

AddVolume adds f to the "volume" field.

func (*SkuUpdate) AddWeight

func (su *SkuUpdate) AddWeight(f float64) *SkuUpdate

AddWeight adds f to the "weight" field.

func (*SkuUpdate) AppendProperties

func (su *SkuUpdate) AppendProperties(etp []entType.SkuProperty) *SkuUpdate

AppendProperties appends etp to the "properties" field.

func (*SkuUpdate) ClearBarCode

func (su *SkuUpdate) ClearBarCode() *SkuUpdate

ClearBarCode clears the value of the "bar_code" field.

func (*SkuUpdate) ClearComments

func (su *SkuUpdate) ClearComments() *SkuUpdate

ClearComments clears all "comments" edges to the Comment entity.

func (*SkuUpdate) ClearDeletedAt

func (su *SkuUpdate) ClearDeletedAt() *SkuUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*SkuUpdate) ClearFirstBrokeragePrice

func (su *SkuUpdate) ClearFirstBrokeragePrice() *SkuUpdate

ClearFirstBrokeragePrice clears the value of the "first_brokerage_price" field.

func (*SkuUpdate) ClearMarketPrice

func (su *SkuUpdate) ClearMarketPrice() *SkuUpdate

ClearMarketPrice clears the value of the "market_price" field.

func (*SkuUpdate) ClearProperties

func (su *SkuUpdate) ClearProperties() *SkuUpdate

ClearProperties clears the value of the "properties" field.

func (*SkuUpdate) ClearSalesCount

func (su *SkuUpdate) ClearSalesCount() *SkuUpdate

ClearSalesCount clears the value of the "sales_count" field.

func (*SkuUpdate) ClearSecondBrokeragePrice

func (su *SkuUpdate) ClearSecondBrokeragePrice() *SkuUpdate

ClearSecondBrokeragePrice clears the value of the "second_brokerage_price" field.

func (*SkuUpdate) ClearSpuID

func (su *SkuUpdate) ClearSpuID() *SkuUpdate

ClearSpuID clears the value of the "spu_id" field.

func (*SkuUpdate) ClearSpus

func (su *SkuUpdate) ClearSpus() *SkuUpdate

ClearSpus clears the "spus" edge to the Spu entity.

func (*SkuUpdate) ClearStock

func (su *SkuUpdate) ClearStock() *SkuUpdate

ClearStock clears the value of the "stock" field.

func (*SkuUpdate) ClearVolume

func (su *SkuUpdate) ClearVolume() *SkuUpdate

ClearVolume clears the value of the "volume" field.

func (*SkuUpdate) ClearWeight

func (su *SkuUpdate) ClearWeight() *SkuUpdate

ClearWeight clears the value of the "weight" field.

func (*SkuUpdate) Exec

func (su *SkuUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SkuUpdate) ExecX

func (su *SkuUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SkuUpdate) Mutation

func (su *SkuUpdate) Mutation() *SkuMutation

Mutation returns the SkuMutation object of the builder.

func (*SkuUpdate) RemoveCommentIDs

func (su *SkuUpdate) RemoveCommentIDs(ids ...uint64) *SkuUpdate

RemoveCommentIDs removes the "comments" edge to Comment entities by IDs.

func (*SkuUpdate) RemoveComments

func (su *SkuUpdate) RemoveComments(c ...*Comment) *SkuUpdate

RemoveComments removes "comments" edges to Comment entities.

func (*SkuUpdate) Save

func (su *SkuUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SkuUpdate) SaveX

func (su *SkuUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SkuUpdate) SetBarCode

func (su *SkuUpdate) SetBarCode(s string) *SkuUpdate

SetBarCode sets the "bar_code" field.

func (*SkuUpdate) SetCostPrice

func (su *SkuUpdate) SetCostPrice(i int32) *SkuUpdate

SetCostPrice sets the "cost_price" field.

func (*SkuUpdate) SetDeletedAt

func (su *SkuUpdate) SetDeletedAt(t time.Time) *SkuUpdate

SetDeletedAt sets the "deleted_at" field.

func (*SkuUpdate) SetFirstBrokeragePrice

func (su *SkuUpdate) SetFirstBrokeragePrice(i int32) *SkuUpdate

SetFirstBrokeragePrice sets the "first_brokerage_price" field.

func (*SkuUpdate) SetMarketPrice

func (su *SkuUpdate) SetMarketPrice(i int32) *SkuUpdate

SetMarketPrice sets the "market_price" field.

func (*SkuUpdate) SetNillableBarCode

func (su *SkuUpdate) SetNillableBarCode(s *string) *SkuUpdate

SetNillableBarCode sets the "bar_code" field if the given value is not nil.

func (*SkuUpdate) SetNillableDeletedAt

func (su *SkuUpdate) SetNillableDeletedAt(t *time.Time) *SkuUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SkuUpdate) SetNillableFirstBrokeragePrice

func (su *SkuUpdate) SetNillableFirstBrokeragePrice(i *int32) *SkuUpdate

SetNillableFirstBrokeragePrice sets the "first_brokerage_price" field if the given value is not nil.

func (*SkuUpdate) SetNillableMarketPrice

func (su *SkuUpdate) SetNillableMarketPrice(i *int32) *SkuUpdate

SetNillableMarketPrice sets the "market_price" field if the given value is not nil.

func (*SkuUpdate) SetNillableSalesCount

func (su *SkuUpdate) SetNillableSalesCount(i *int32) *SkuUpdate

SetNillableSalesCount sets the "sales_count" field if the given value is not nil.

func (*SkuUpdate) SetNillableSecondBrokeragePrice

func (su *SkuUpdate) SetNillableSecondBrokeragePrice(f *float64) *SkuUpdate

SetNillableSecondBrokeragePrice sets the "second_brokerage_price" field if the given value is not nil.

func (*SkuUpdate) SetNillableSpuID

func (su *SkuUpdate) SetNillableSpuID(u *uint64) *SkuUpdate

SetNillableSpuID sets the "spu_id" field if the given value is not nil.

func (*SkuUpdate) SetNillableSpusID

func (su *SkuUpdate) SetNillableSpusID(id *uint64) *SkuUpdate

SetNillableSpusID sets the "spus" edge to the Spu entity by ID if the given value is not nil.

func (*SkuUpdate) SetNillableStock

func (su *SkuUpdate) SetNillableStock(i *int32) *SkuUpdate

SetNillableStock sets the "stock" field if the given value is not nil.

func (*SkuUpdate) SetNillableVolume

func (su *SkuUpdate) SetNillableVolume(f *float64) *SkuUpdate

SetNillableVolume sets the "volume" field if the given value is not nil.

func (*SkuUpdate) SetNillableWeight

func (su *SkuUpdate) SetNillableWeight(f *float64) *SkuUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*SkuUpdate) SetNotNilBarCode

func (s *SkuUpdate) SetNotNilBarCode(value *string) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilCostPrice

func (s *SkuUpdate) SetNotNilCostPrice(value *int32) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilDeletedAt

func (s *SkuUpdate) SetNotNilDeletedAt(value *time.Time) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilFirstBrokeragePrice

func (s *SkuUpdate) SetNotNilFirstBrokeragePrice(value *int32) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilMarketPrice

func (s *SkuUpdate) SetNotNilMarketPrice(value *int32) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilPicURL

func (s *SkuUpdate) SetNotNilPicURL(value *string) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilPrice

func (s *SkuUpdate) SetNotNilPrice(value *int32) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilProperties

func (s *SkuUpdate) SetNotNilProperties(value *[]entType.SkuProperty) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilSalesCount

func (s *SkuUpdate) SetNotNilSalesCount(value *int32) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilSecondBrokeragePrice

func (s *SkuUpdate) SetNotNilSecondBrokeragePrice(value *float64) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilSpuID

func (s *SkuUpdate) SetNotNilSpuID(value *uint64) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilStock

func (s *SkuUpdate) SetNotNilStock(value *int32) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilUpdatedAt

func (s *SkuUpdate) SetNotNilUpdatedAt(value *time.Time) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilVolume

func (s *SkuUpdate) SetNotNilVolume(value *float64) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetNotNilWeight

func (s *SkuUpdate) SetNotNilWeight(value *float64) *SkuUpdate

set field if value's pointer is not nil.

func (*SkuUpdate) SetPicURL

func (su *SkuUpdate) SetPicURL(s string) *SkuUpdate

SetPicURL sets the "pic_url" field.

func (*SkuUpdate) SetPrice

func (su *SkuUpdate) SetPrice(i int32) *SkuUpdate

SetPrice sets the "price" field.

func (*SkuUpdate) SetProperties

func (su *SkuUpdate) SetProperties(etp []entType.SkuProperty) *SkuUpdate

SetProperties sets the "properties" field.

func (*SkuUpdate) SetSalesCount

func (su *SkuUpdate) SetSalesCount(i int32) *SkuUpdate

SetSalesCount sets the "sales_count" field.

func (*SkuUpdate) SetSecondBrokeragePrice

func (su *SkuUpdate) SetSecondBrokeragePrice(f float64) *SkuUpdate

SetSecondBrokeragePrice sets the "second_brokerage_price" field.

func (*SkuUpdate) SetSpuID

func (su *SkuUpdate) SetSpuID(u uint64) *SkuUpdate

SetSpuID sets the "spu_id" field.

func (*SkuUpdate) SetSpus

func (su *SkuUpdate) SetSpus(s *Spu) *SkuUpdate

SetSpus sets the "spus" edge to the Spu entity.

func (*SkuUpdate) SetSpusID

func (su *SkuUpdate) SetSpusID(id uint64) *SkuUpdate

SetSpusID sets the "spus" edge to the Spu entity by ID.

func (*SkuUpdate) SetStock

func (su *SkuUpdate) SetStock(i int32) *SkuUpdate

SetStock sets the "stock" field.

func (*SkuUpdate) SetUpdatedAt

func (su *SkuUpdate) SetUpdatedAt(t time.Time) *SkuUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SkuUpdate) SetVolume

func (su *SkuUpdate) SetVolume(f float64) *SkuUpdate

SetVolume sets the "volume" field.

func (*SkuUpdate) SetWeight

func (su *SkuUpdate) SetWeight(f float64) *SkuUpdate

SetWeight sets the "weight" field.

func (*SkuUpdate) Where

func (su *SkuUpdate) Where(ps ...predicate.Sku) *SkuUpdate

Where appends a list predicates to the SkuUpdate builder.

type SkuUpdateOne

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

SkuUpdateOne is the builder for updating a single Sku entity.

func (*SkuUpdateOne) AddCommentIDs

func (suo *SkuUpdateOne) AddCommentIDs(ids ...uint64) *SkuUpdateOne

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*SkuUpdateOne) AddComments

func (suo *SkuUpdateOne) AddComments(c ...*Comment) *SkuUpdateOne

AddComments adds the "comments" edges to the Comment entity.

func (*SkuUpdateOne) AddCostPrice

func (suo *SkuUpdateOne) AddCostPrice(i int32) *SkuUpdateOne

AddCostPrice adds i to the "cost_price" field.

func (*SkuUpdateOne) AddFirstBrokeragePrice

func (suo *SkuUpdateOne) AddFirstBrokeragePrice(i int32) *SkuUpdateOne

AddFirstBrokeragePrice adds i to the "first_brokerage_price" field.

func (*SkuUpdateOne) AddMarketPrice

func (suo *SkuUpdateOne) AddMarketPrice(i int32) *SkuUpdateOne

AddMarketPrice adds i to the "market_price" field.

func (*SkuUpdateOne) AddPrice

func (suo *SkuUpdateOne) AddPrice(i int32) *SkuUpdateOne

AddPrice adds i to the "price" field.

func (*SkuUpdateOne) AddSalesCount

func (suo *SkuUpdateOne) AddSalesCount(i int32) *SkuUpdateOne

AddSalesCount adds i to the "sales_count" field.

func (*SkuUpdateOne) AddSecondBrokeragePrice

func (suo *SkuUpdateOne) AddSecondBrokeragePrice(f float64) *SkuUpdateOne

AddSecondBrokeragePrice adds f to the "second_brokerage_price" field.

func (*SkuUpdateOne) AddStock

func (suo *SkuUpdateOne) AddStock(i int32) *SkuUpdateOne

AddStock adds i to the "stock" field.

func (*SkuUpdateOne) AddVolume

func (suo *SkuUpdateOne) AddVolume(f float64) *SkuUpdateOne

AddVolume adds f to the "volume" field.

func (*SkuUpdateOne) AddWeight

func (suo *SkuUpdateOne) AddWeight(f float64) *SkuUpdateOne

AddWeight adds f to the "weight" field.

func (*SkuUpdateOne) AppendProperties

func (suo *SkuUpdateOne) AppendProperties(etp []entType.SkuProperty) *SkuUpdateOne

AppendProperties appends etp to the "properties" field.

func (*SkuUpdateOne) ClearBarCode

func (suo *SkuUpdateOne) ClearBarCode() *SkuUpdateOne

ClearBarCode clears the value of the "bar_code" field.

func (*SkuUpdateOne) ClearComments

func (suo *SkuUpdateOne) ClearComments() *SkuUpdateOne

ClearComments clears all "comments" edges to the Comment entity.

func (*SkuUpdateOne) ClearDeletedAt

func (suo *SkuUpdateOne) ClearDeletedAt() *SkuUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*SkuUpdateOne) ClearFirstBrokeragePrice

func (suo *SkuUpdateOne) ClearFirstBrokeragePrice() *SkuUpdateOne

ClearFirstBrokeragePrice clears the value of the "first_brokerage_price" field.

func (*SkuUpdateOne) ClearMarketPrice

func (suo *SkuUpdateOne) ClearMarketPrice() *SkuUpdateOne

ClearMarketPrice clears the value of the "market_price" field.

func (*SkuUpdateOne) ClearProperties

func (suo *SkuUpdateOne) ClearProperties() *SkuUpdateOne

ClearProperties clears the value of the "properties" field.

func (*SkuUpdateOne) ClearSalesCount

func (suo *SkuUpdateOne) ClearSalesCount() *SkuUpdateOne

ClearSalesCount clears the value of the "sales_count" field.

func (*SkuUpdateOne) ClearSecondBrokeragePrice

func (suo *SkuUpdateOne) ClearSecondBrokeragePrice() *SkuUpdateOne

ClearSecondBrokeragePrice clears the value of the "second_brokerage_price" field.

func (*SkuUpdateOne) ClearSpuID

func (suo *SkuUpdateOne) ClearSpuID() *SkuUpdateOne

ClearSpuID clears the value of the "spu_id" field.

func (*SkuUpdateOne) ClearSpus

func (suo *SkuUpdateOne) ClearSpus() *SkuUpdateOne

ClearSpus clears the "spus" edge to the Spu entity.

func (*SkuUpdateOne) ClearStock

func (suo *SkuUpdateOne) ClearStock() *SkuUpdateOne

ClearStock clears the value of the "stock" field.

func (*SkuUpdateOne) ClearVolume

func (suo *SkuUpdateOne) ClearVolume() *SkuUpdateOne

ClearVolume clears the value of the "volume" field.

func (*SkuUpdateOne) ClearWeight

func (suo *SkuUpdateOne) ClearWeight() *SkuUpdateOne

ClearWeight clears the value of the "weight" field.

func (*SkuUpdateOne) Exec

func (suo *SkuUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SkuUpdateOne) ExecX

func (suo *SkuUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SkuUpdateOne) Mutation

func (suo *SkuUpdateOne) Mutation() *SkuMutation

Mutation returns the SkuMutation object of the builder.

func (*SkuUpdateOne) RemoveCommentIDs

func (suo *SkuUpdateOne) RemoveCommentIDs(ids ...uint64) *SkuUpdateOne

RemoveCommentIDs removes the "comments" edge to Comment entities by IDs.

func (*SkuUpdateOne) RemoveComments

func (suo *SkuUpdateOne) RemoveComments(c ...*Comment) *SkuUpdateOne

RemoveComments removes "comments" edges to Comment entities.

func (*SkuUpdateOne) Save

func (suo *SkuUpdateOne) Save(ctx context.Context) (*Sku, error)

Save executes the query and returns the updated Sku entity.

func (*SkuUpdateOne) SaveX

func (suo *SkuUpdateOne) SaveX(ctx context.Context) *Sku

SaveX is like Save, but panics if an error occurs.

func (*SkuUpdateOne) Select

func (suo *SkuUpdateOne) Select(field string, fields ...string) *SkuUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SkuUpdateOne) SetBarCode

func (suo *SkuUpdateOne) SetBarCode(s string) *SkuUpdateOne

SetBarCode sets the "bar_code" field.

func (*SkuUpdateOne) SetCostPrice

func (suo *SkuUpdateOne) SetCostPrice(i int32) *SkuUpdateOne

SetCostPrice sets the "cost_price" field.

func (*SkuUpdateOne) SetDeletedAt

func (suo *SkuUpdateOne) SetDeletedAt(t time.Time) *SkuUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*SkuUpdateOne) SetFirstBrokeragePrice

func (suo *SkuUpdateOne) SetFirstBrokeragePrice(i int32) *SkuUpdateOne

SetFirstBrokeragePrice sets the "first_brokerage_price" field.

func (*SkuUpdateOne) SetMarketPrice

func (suo *SkuUpdateOne) SetMarketPrice(i int32) *SkuUpdateOne

SetMarketPrice sets the "market_price" field.

func (*SkuUpdateOne) SetNillableBarCode

func (suo *SkuUpdateOne) SetNillableBarCode(s *string) *SkuUpdateOne

SetNillableBarCode sets the "bar_code" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableDeletedAt

func (suo *SkuUpdateOne) SetNillableDeletedAt(t *time.Time) *SkuUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableFirstBrokeragePrice

func (suo *SkuUpdateOne) SetNillableFirstBrokeragePrice(i *int32) *SkuUpdateOne

SetNillableFirstBrokeragePrice sets the "first_brokerage_price" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableMarketPrice

func (suo *SkuUpdateOne) SetNillableMarketPrice(i *int32) *SkuUpdateOne

SetNillableMarketPrice sets the "market_price" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableSalesCount

func (suo *SkuUpdateOne) SetNillableSalesCount(i *int32) *SkuUpdateOne

SetNillableSalesCount sets the "sales_count" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableSecondBrokeragePrice

func (suo *SkuUpdateOne) SetNillableSecondBrokeragePrice(f *float64) *SkuUpdateOne

SetNillableSecondBrokeragePrice sets the "second_brokerage_price" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableSpuID

func (suo *SkuUpdateOne) SetNillableSpuID(u *uint64) *SkuUpdateOne

SetNillableSpuID sets the "spu_id" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableSpusID

func (suo *SkuUpdateOne) SetNillableSpusID(id *uint64) *SkuUpdateOne

SetNillableSpusID sets the "spus" edge to the Spu entity by ID if the given value is not nil.

func (*SkuUpdateOne) SetNillableStock

func (suo *SkuUpdateOne) SetNillableStock(i *int32) *SkuUpdateOne

SetNillableStock sets the "stock" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableVolume

func (suo *SkuUpdateOne) SetNillableVolume(f *float64) *SkuUpdateOne

SetNillableVolume sets the "volume" field if the given value is not nil.

func (*SkuUpdateOne) SetNillableWeight

func (suo *SkuUpdateOne) SetNillableWeight(f *float64) *SkuUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*SkuUpdateOne) SetNotNilBarCode

func (s *SkuUpdateOne) SetNotNilBarCode(value *string) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilCostPrice

func (s *SkuUpdateOne) SetNotNilCostPrice(value *int32) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilDeletedAt

func (s *SkuUpdateOne) SetNotNilDeletedAt(value *time.Time) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilFirstBrokeragePrice

func (s *SkuUpdateOne) SetNotNilFirstBrokeragePrice(value *int32) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilMarketPrice

func (s *SkuUpdateOne) SetNotNilMarketPrice(value *int32) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilPicURL

func (s *SkuUpdateOne) SetNotNilPicURL(value *string) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilPrice

func (s *SkuUpdateOne) SetNotNilPrice(value *int32) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilProperties

func (s *SkuUpdateOne) SetNotNilProperties(value *[]entType.SkuProperty) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilSalesCount

func (s *SkuUpdateOne) SetNotNilSalesCount(value *int32) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilSecondBrokeragePrice

func (s *SkuUpdateOne) SetNotNilSecondBrokeragePrice(value *float64) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilSpuID

func (s *SkuUpdateOne) SetNotNilSpuID(value *uint64) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilStock

func (s *SkuUpdateOne) SetNotNilStock(value *int32) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilUpdatedAt

func (s *SkuUpdateOne) SetNotNilUpdatedAt(value *time.Time) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilVolume

func (s *SkuUpdateOne) SetNotNilVolume(value *float64) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetNotNilWeight

func (s *SkuUpdateOne) SetNotNilWeight(value *float64) *SkuUpdateOne

set field if value's pointer is not nil.

func (*SkuUpdateOne) SetPicURL

func (suo *SkuUpdateOne) SetPicURL(s string) *SkuUpdateOne

SetPicURL sets the "pic_url" field.

func (*SkuUpdateOne) SetPrice

func (suo *SkuUpdateOne) SetPrice(i int32) *SkuUpdateOne

SetPrice sets the "price" field.

func (*SkuUpdateOne) SetProperties

func (suo *SkuUpdateOne) SetProperties(etp []entType.SkuProperty) *SkuUpdateOne

SetProperties sets the "properties" field.

func (*SkuUpdateOne) SetSalesCount

func (suo *SkuUpdateOne) SetSalesCount(i int32) *SkuUpdateOne

SetSalesCount sets the "sales_count" field.

func (*SkuUpdateOne) SetSecondBrokeragePrice

func (suo *SkuUpdateOne) SetSecondBrokeragePrice(f float64) *SkuUpdateOne

SetSecondBrokeragePrice sets the "second_brokerage_price" field.

func (*SkuUpdateOne) SetSpuID

func (suo *SkuUpdateOne) SetSpuID(u uint64) *SkuUpdateOne

SetSpuID sets the "spu_id" field.

func (*SkuUpdateOne) SetSpus

func (suo *SkuUpdateOne) SetSpus(s *Spu) *SkuUpdateOne

SetSpus sets the "spus" edge to the Spu entity.

func (*SkuUpdateOne) SetSpusID

func (suo *SkuUpdateOne) SetSpusID(id uint64) *SkuUpdateOne

SetSpusID sets the "spus" edge to the Spu entity by ID.

func (*SkuUpdateOne) SetStock

func (suo *SkuUpdateOne) SetStock(i int32) *SkuUpdateOne

SetStock sets the "stock" field.

func (*SkuUpdateOne) SetUpdatedAt

func (suo *SkuUpdateOne) SetUpdatedAt(t time.Time) *SkuUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SkuUpdateOne) SetVolume

func (suo *SkuUpdateOne) SetVolume(f float64) *SkuUpdateOne

SetVolume sets the "volume" field.

func (*SkuUpdateOne) SetWeight

func (suo *SkuUpdateOne) SetWeight(f float64) *SkuUpdateOne

SetWeight sets the "weight" field.

func (*SkuUpdateOne) Where

func (suo *SkuUpdateOne) Where(ps ...predicate.Sku) *SkuUpdateOne

Where appends a list predicates to the SkuUpdate builder.

type Skus

type Skus []*Sku

Skus is a parsable slice of Sku.

type Spu

type Spu struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// 商品名称
	Name string `json:"name,omitempty"`
	// 关键字
	Keyword string `json:"keyword,omitempty"`
	// 商品简介
	Introduction string `json:"introduction,omitempty"`
	// 商品详情
	Description string `json:"description,omitempty"`
	// 条形码
	BarCode string `json:"bar_code,omitempty"`
	// 商品分类编号
	CategoryID uint64 `json:"category_id,omitempty"`
	// 商品品牌编号
	BrandID uint64 `json:"brand_id,omitempty"`
	// 商品封面图
	PicURL string `json:"pic_url,omitempty"`
	// 商品轮播图地址数组,以逗号分隔最多上传15张
	SliderPicUrls []string `json:"slider_pic_urls,omitempty"`
	// 商品视频
	VideoURL string `json:"video_url,omitempty"`
	// 单位
	Unit uint8 `json:"unit,omitempty"`
	// 规格类型:0 单规格 1 多规格
	SpecType bool `json:"spec_type,omitempty"`
	// 商品价格,单位使用:分
	Price int32 `json:"price,omitempty"`
	// 市场价,单位使用:分
	MarketPrice int32 `json:"market_price,omitempty"`
	// 成本价,单位: 分
	CostPrice int32 `json:"cost_price,omitempty"`
	// 库存
	Stock int32 `json:"stock,omitempty"`
	// 物流配置模板编号
	DeliveryTemplateID uint64 `json:"deliveryTemplate_id,omitempty"`
	// 是否热卖推荐
	RecommendHot bool `json:"recommend_hot,omitempty"`
	// 是否优惠推荐
	RecommendBenefit bool `json:"recommend_benefit,omitempty"`
	// 是否精品推荐
	RecommendBest bool `json:"recommend_best,omitempty"`
	// 是否新品推荐
	RecommendNew bool `json:"recommend_new,omitempty"`
	// 是否优品推荐
	RecommendGood bool `json:"recommend_good,omitempty"`
	// 赠送积分
	GiveIntegral int32 `json:"give_integral,omitempty"`
	// 赠送积分
	GiveCouponTemplateIds []uint64 `json:"give_coupon_template_ids,omitempty"`
	// 赠送积分
	SubCommissionType bool `json:"sub_commission_type,omitempty"`
	// 赠送积分
	ActivityOrders []int32 `json:"activity_orders,omitempty"`
	// 商品销量
	SalesCount int32 `json:"sales_count,omitempty"`
	// 虚拟销量
	VirtualSalesCount int32 `json:"virtual_sales_count,omitempty"`
	// 商品点击量
	BrowseCount int32 `json:"browse_count,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SpuQuery when eager-loading is set.
	Edges SpuEdges `json:"edges"`
	// contains filtered or unexported fields
}

Spu is the model entity for the Spu schema.

func (*Spu) QueryBrands

func (s *Spu) QueryBrands() *BrandQuery

QueryBrands queries the "brands" edge of the Spu entity.

func (*Spu) QueryCategorys

func (s *Spu) QueryCategorys() *CategoryQuery

QueryCategorys queries the "categorys" edge of the Spu entity.

func (*Spu) QuerySkus

func (s *Spu) QuerySkus() *SkuQuery

QuerySkus queries the "skus" edge of the Spu entity.

func (*Spu) String

func (s *Spu) String() string

String implements the fmt.Stringer.

func (*Spu) Unwrap

func (s *Spu) Unwrap() *Spu

Unwrap unwraps the Spu entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Spu) Update

func (s *Spu) Update() *SpuUpdateOne

Update returns a builder for updating this Spu. Note that you need to call Spu.Unwrap() before calling this method if this Spu was returned from a transaction, and the transaction was committed or rolled back.

func (*Spu) Value

func (s *Spu) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Spu. This includes values selected through modifiers, order, etc.

type SpuClient

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

SpuClient is a client for the Spu schema.

func NewSpuClient

func NewSpuClient(c config) *SpuClient

NewSpuClient returns a client for the Spu from the given config.

func (*SpuClient) Create

func (c *SpuClient) Create() *SpuCreate

Create returns a builder for creating a Spu entity.

func (*SpuClient) CreateBulk

func (c *SpuClient) CreateBulk(builders ...*SpuCreate) *SpuCreateBulk

CreateBulk returns a builder for creating a bulk of Spu entities.

func (*SpuClient) Delete

func (c *SpuClient) Delete() *SpuDelete

Delete returns a delete builder for Spu.

func (*SpuClient) DeleteOne

func (c *SpuClient) DeleteOne(s *Spu) *SpuDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SpuClient) DeleteOneID

func (c *SpuClient) DeleteOneID(id uint64) *SpuDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SpuClient) Get

func (c *SpuClient) Get(ctx context.Context, id uint64) (*Spu, error)

Get returns a Spu entity by its id.

func (*SpuClient) GetX

func (c *SpuClient) GetX(ctx context.Context, id uint64) *Spu

GetX is like Get, but panics if an error occurs.

func (*SpuClient) Hooks

func (c *SpuClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SpuClient) Intercept

func (c *SpuClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `spu.Intercept(f(g(h())))`.

func (*SpuClient) Interceptors

func (c *SpuClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SpuClient) MapCreateBulk

func (c *SpuClient) MapCreateBulk(slice any, setFunc func(*SpuCreate, int)) *SpuCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SpuClient) Query

func (c *SpuClient) Query() *SpuQuery

Query returns a query builder for Spu.

func (*SpuClient) QueryBrands

func (c *SpuClient) QueryBrands(s *Spu) *BrandQuery

QueryBrands queries the brands edge of a Spu.

func (*SpuClient) QueryCategorys

func (c *SpuClient) QueryCategorys(s *Spu) *CategoryQuery

QueryCategorys queries the categorys edge of a Spu.

func (*SpuClient) QuerySkus

func (c *SpuClient) QuerySkus(s *Spu) *SkuQuery

QuerySkus queries the skus edge of a Spu.

func (*SpuClient) Update

func (c *SpuClient) Update() *SpuUpdate

Update returns an update builder for Spu.

func (*SpuClient) UpdateOne

func (c *SpuClient) UpdateOne(s *Spu) *SpuUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SpuClient) UpdateOneID

func (c *SpuClient) UpdateOneID(id uint64) *SpuUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SpuClient) Use

func (c *SpuClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `spu.Hooks(f(g(h())))`.

type SpuCreate

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

SpuCreate is the builder for creating a Spu entity.

func (*SpuCreate) AddSkuIDs

func (sc *SpuCreate) AddSkuIDs(ids ...uint64) *SpuCreate

AddSkuIDs adds the "skus" edge to the Sku entity by IDs.

func (*SpuCreate) AddSkus

func (sc *SpuCreate) AddSkus(s ...*Sku) *SpuCreate

AddSkus adds the "skus" edges to the Sku entity.

func (*SpuCreate) Exec

func (sc *SpuCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SpuCreate) ExecX

func (sc *SpuCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SpuCreate) Mutation

func (sc *SpuCreate) Mutation() *SpuMutation

Mutation returns the SpuMutation object of the builder.

func (*SpuCreate) Save

func (sc *SpuCreate) Save(ctx context.Context) (*Spu, error)

Save creates the Spu in the database.

func (*SpuCreate) SaveX

func (sc *SpuCreate) SaveX(ctx context.Context) *Spu

SaveX calls Save and panics if Save returns an error.

func (*SpuCreate) SetActivityOrders

func (sc *SpuCreate) SetActivityOrders(i []int32) *SpuCreate

SetActivityOrders sets the "activity_orders" field.

func (*SpuCreate) SetBarCode

func (sc *SpuCreate) SetBarCode(s string) *SpuCreate

SetBarCode sets the "bar_code" field.

func (*SpuCreate) SetBrandID

func (sc *SpuCreate) SetBrandID(u uint64) *SpuCreate

SetBrandID sets the "brand_id" field.

func (*SpuCreate) SetBrands

func (sc *SpuCreate) SetBrands(b *Brand) *SpuCreate

SetBrands sets the "brands" edge to the Brand entity.

func (*SpuCreate) SetBrandsID

func (sc *SpuCreate) SetBrandsID(id uint64) *SpuCreate

SetBrandsID sets the "brands" edge to the Brand entity by ID.

func (*SpuCreate) SetBrowseCount

func (sc *SpuCreate) SetBrowseCount(i int32) *SpuCreate

SetBrowseCount sets the "browse_count" field.

func (*SpuCreate) SetCategoryID

func (sc *SpuCreate) SetCategoryID(u uint64) *SpuCreate

SetCategoryID sets the "category_id" field.

func (*SpuCreate) SetCategorys

func (sc *SpuCreate) SetCategorys(c *Category) *SpuCreate

SetCategorys sets the "categorys" edge to the Category entity.

func (*SpuCreate) SetCategorysID

func (sc *SpuCreate) SetCategorysID(id uint64) *SpuCreate

SetCategorysID sets the "categorys" edge to the Category entity by ID.

func (*SpuCreate) SetCostPrice

func (sc *SpuCreate) SetCostPrice(i int32) *SpuCreate

SetCostPrice sets the "cost_price" field.

func (*SpuCreate) SetCreatedAt

func (sc *SpuCreate) SetCreatedAt(t time.Time) *SpuCreate

SetCreatedAt sets the "created_at" field.

func (*SpuCreate) SetDeletedAt

func (sc *SpuCreate) SetDeletedAt(t time.Time) *SpuCreate

SetDeletedAt sets the "deleted_at" field.

func (*SpuCreate) SetDeliveryTemplateID

func (sc *SpuCreate) SetDeliveryTemplateID(u uint64) *SpuCreate

SetDeliveryTemplateID sets the "deliveryTemplate_id" field.

func (*SpuCreate) SetDescription

func (sc *SpuCreate) SetDescription(s string) *SpuCreate

SetDescription sets the "description" field.

func (*SpuCreate) SetGiveCouponTemplateIds

func (sc *SpuCreate) SetGiveCouponTemplateIds(u []uint64) *SpuCreate

SetGiveCouponTemplateIds sets the "give_coupon_template_ids" field.

func (*SpuCreate) SetGiveIntegral

func (sc *SpuCreate) SetGiveIntegral(i int32) *SpuCreate

SetGiveIntegral sets the "give_integral" field.

func (*SpuCreate) SetID

func (sc *SpuCreate) SetID(u uint64) *SpuCreate

SetID sets the "id" field.

func (*SpuCreate) SetIntroduction

func (sc *SpuCreate) SetIntroduction(s string) *SpuCreate

SetIntroduction sets the "introduction" field.

func (*SpuCreate) SetKeyword

func (sc *SpuCreate) SetKeyword(s string) *SpuCreate

SetKeyword sets the "keyword" field.

func (*SpuCreate) SetMarketPrice

func (sc *SpuCreate) SetMarketPrice(i int32) *SpuCreate

SetMarketPrice sets the "market_price" field.

func (*SpuCreate) SetName

func (sc *SpuCreate) SetName(s string) *SpuCreate

SetName sets the "name" field.

func (*SpuCreate) SetNillableBarCode

func (sc *SpuCreate) SetNillableBarCode(s *string) *SpuCreate

SetNillableBarCode sets the "bar_code" field if the given value is not nil.

func (*SpuCreate) SetNillableBrandID

func (sc *SpuCreate) SetNillableBrandID(u *uint64) *SpuCreate

SetNillableBrandID sets the "brand_id" field if the given value is not nil.

func (*SpuCreate) SetNillableBrandsID

func (sc *SpuCreate) SetNillableBrandsID(id *uint64) *SpuCreate

SetNillableBrandsID sets the "brands" edge to the Brand entity by ID if the given value is not nil.

func (*SpuCreate) SetNillableBrowseCount

func (sc *SpuCreate) SetNillableBrowseCount(i *int32) *SpuCreate

SetNillableBrowseCount sets the "browse_count" field if the given value is not nil.

func (*SpuCreate) SetNillableCategoryID

func (sc *SpuCreate) SetNillableCategoryID(u *uint64) *SpuCreate

SetNillableCategoryID sets the "category_id" field if the given value is not nil.

func (*SpuCreate) SetNillableCategorysID

func (sc *SpuCreate) SetNillableCategorysID(id *uint64) *SpuCreate

SetNillableCategorysID sets the "categorys" edge to the Category entity by ID if the given value is not nil.

func (*SpuCreate) SetNillableCreatedAt

func (sc *SpuCreate) SetNillableCreatedAt(t *time.Time) *SpuCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SpuCreate) SetNillableDeletedAt

func (sc *SpuCreate) SetNillableDeletedAt(t *time.Time) *SpuCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SpuCreate) SetNillableDeliveryTemplateID

func (sc *SpuCreate) SetNillableDeliveryTemplateID(u *uint64) *SpuCreate

SetNillableDeliveryTemplateID sets the "deliveryTemplate_id" field if the given value is not nil.

func (*SpuCreate) SetNillableDescription

func (sc *SpuCreate) SetNillableDescription(s *string) *SpuCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SpuCreate) SetNillableGiveIntegral

func (sc *SpuCreate) SetNillableGiveIntegral(i *int32) *SpuCreate

SetNillableGiveIntegral sets the "give_integral" field if the given value is not nil.

func (*SpuCreate) SetNillableIntroduction

func (sc *SpuCreate) SetNillableIntroduction(s *string) *SpuCreate

SetNillableIntroduction sets the "introduction" field if the given value is not nil.

func (*SpuCreate) SetNillableKeyword

func (sc *SpuCreate) SetNillableKeyword(s *string) *SpuCreate

SetNillableKeyword sets the "keyword" field if the given value is not nil.

func (*SpuCreate) SetNillableMarketPrice

func (sc *SpuCreate) SetNillableMarketPrice(i *int32) *SpuCreate

SetNillableMarketPrice sets the "market_price" field if the given value is not nil.

func (*SpuCreate) SetNillableRecommendBenefit

func (sc *SpuCreate) SetNillableRecommendBenefit(b *bool) *SpuCreate

SetNillableRecommendBenefit sets the "recommend_benefit" field if the given value is not nil.

func (*SpuCreate) SetNillableRecommendBest

func (sc *SpuCreate) SetNillableRecommendBest(b *bool) *SpuCreate

SetNillableRecommendBest sets the "recommend_best" field if the given value is not nil.

func (*SpuCreate) SetNillableRecommendGood

func (sc *SpuCreate) SetNillableRecommendGood(b *bool) *SpuCreate

SetNillableRecommendGood sets the "recommend_good" field if the given value is not nil.

func (*SpuCreate) SetNillableRecommendHot

func (sc *SpuCreate) SetNillableRecommendHot(b *bool) *SpuCreate

SetNillableRecommendHot sets the "recommend_hot" field if the given value is not nil.

func (*SpuCreate) SetNillableRecommendNew

func (sc *SpuCreate) SetNillableRecommendNew(b *bool) *SpuCreate

SetNillableRecommendNew sets the "recommend_new" field if the given value is not nil.

func (*SpuCreate) SetNillableSalesCount

func (sc *SpuCreate) SetNillableSalesCount(i *int32) *SpuCreate

SetNillableSalesCount sets the "sales_count" field if the given value is not nil.

func (*SpuCreate) SetNillableSort

func (sc *SpuCreate) SetNillableSort(u *uint32) *SpuCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*SpuCreate) SetNillableSpecType

func (sc *SpuCreate) SetNillableSpecType(b *bool) *SpuCreate

SetNillableSpecType sets the "spec_type" field if the given value is not nil.

func (*SpuCreate) SetNillableStatus

func (sc *SpuCreate) SetNillableStatus(u *uint8) *SpuCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SpuCreate) SetNillableSubCommissionType

func (sc *SpuCreate) SetNillableSubCommissionType(b *bool) *SpuCreate

SetNillableSubCommissionType sets the "sub_commission_type" field if the given value is not nil.

func (*SpuCreate) SetNillableUpdatedAt

func (sc *SpuCreate) SetNillableUpdatedAt(t *time.Time) *SpuCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SpuCreate) SetNillableVideoURL

func (sc *SpuCreate) SetNillableVideoURL(s *string) *SpuCreate

SetNillableVideoURL sets the "video_url" field if the given value is not nil.

func (*SpuCreate) SetNillableVirtualSalesCount

func (sc *SpuCreate) SetNillableVirtualSalesCount(i *int32) *SpuCreate

SetNillableVirtualSalesCount sets the "virtual_sales_count" field if the given value is not nil.

func (*SpuCreate) SetNotNilActivityOrders

func (s *SpuCreate) SetNotNilActivityOrders(value *[]int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilBarCode

func (s *SpuCreate) SetNotNilBarCode(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilBrandID

func (s *SpuCreate) SetNotNilBrandID(value *uint64) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilBrowseCount

func (s *SpuCreate) SetNotNilBrowseCount(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilCategoryID

func (s *SpuCreate) SetNotNilCategoryID(value *uint64) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilCostPrice

func (s *SpuCreate) SetNotNilCostPrice(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilDeletedAt

func (s *SpuCreate) SetNotNilDeletedAt(value *time.Time) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilDeliveryTemplateID

func (s *SpuCreate) SetNotNilDeliveryTemplateID(value *uint64) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilDescription

func (s *SpuCreate) SetNotNilDescription(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilGiveCouponTemplateIds

func (s *SpuCreate) SetNotNilGiveCouponTemplateIds(value *[]uint64) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilGiveIntegral

func (s *SpuCreate) SetNotNilGiveIntegral(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilIntroduction

func (s *SpuCreate) SetNotNilIntroduction(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilKeyword

func (s *SpuCreate) SetNotNilKeyword(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilMarketPrice

func (s *SpuCreate) SetNotNilMarketPrice(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilName

func (s *SpuCreate) SetNotNilName(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilPicURL

func (s *SpuCreate) SetNotNilPicURL(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilPrice

func (s *SpuCreate) SetNotNilPrice(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilRecommendBenefit

func (s *SpuCreate) SetNotNilRecommendBenefit(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilRecommendBest

func (s *SpuCreate) SetNotNilRecommendBest(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilRecommendGood

func (s *SpuCreate) SetNotNilRecommendGood(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilRecommendHot

func (s *SpuCreate) SetNotNilRecommendHot(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilRecommendNew

func (s *SpuCreate) SetNotNilRecommendNew(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilSalesCount

func (s *SpuCreate) SetNotNilSalesCount(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilSliderPicUrls

func (s *SpuCreate) SetNotNilSliderPicUrls(value *[]string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilSort

func (s *SpuCreate) SetNotNilSort(value *uint32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilSpecType

func (s *SpuCreate) SetNotNilSpecType(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilStatus

func (s *SpuCreate) SetNotNilStatus(value *uint8) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilStock

func (s *SpuCreate) SetNotNilStock(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilSubCommissionType

func (s *SpuCreate) SetNotNilSubCommissionType(value *bool) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilUnit

func (s *SpuCreate) SetNotNilUnit(value *uint8) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilUpdatedAt

func (s *SpuCreate) SetNotNilUpdatedAt(value *time.Time) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilVideoURL

func (s *SpuCreate) SetNotNilVideoURL(value *string) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetNotNilVirtualSalesCount

func (s *SpuCreate) SetNotNilVirtualSalesCount(value *int32) *SpuCreate

set field if value's pointer is not nil.

func (*SpuCreate) SetPicURL

func (sc *SpuCreate) SetPicURL(s string) *SpuCreate

SetPicURL sets the "pic_url" field.

func (*SpuCreate) SetPrice

func (sc *SpuCreate) SetPrice(i int32) *SpuCreate

SetPrice sets the "price" field.

func (*SpuCreate) SetRecommendBenefit

func (sc *SpuCreate) SetRecommendBenefit(b bool) *SpuCreate

SetRecommendBenefit sets the "recommend_benefit" field.

func (*SpuCreate) SetRecommendBest

func (sc *SpuCreate) SetRecommendBest(b bool) *SpuCreate

SetRecommendBest sets the "recommend_best" field.

func (*SpuCreate) SetRecommendGood

func (sc *SpuCreate) SetRecommendGood(b bool) *SpuCreate

SetRecommendGood sets the "recommend_good" field.

func (*SpuCreate) SetRecommendHot

func (sc *SpuCreate) SetRecommendHot(b bool) *SpuCreate

SetRecommendHot sets the "recommend_hot" field.

func (*SpuCreate) SetRecommendNew

func (sc *SpuCreate) SetRecommendNew(b bool) *SpuCreate

SetRecommendNew sets the "recommend_new" field.

func (*SpuCreate) SetSalesCount

func (sc *SpuCreate) SetSalesCount(i int32) *SpuCreate

SetSalesCount sets the "sales_count" field.

func (*SpuCreate) SetSliderPicUrls

func (sc *SpuCreate) SetSliderPicUrls(s []string) *SpuCreate

SetSliderPicUrls sets the "slider_pic_urls" field.

func (*SpuCreate) SetSort

func (sc *SpuCreate) SetSort(u uint32) *SpuCreate

SetSort sets the "sort" field.

func (*SpuCreate) SetSpecType

func (sc *SpuCreate) SetSpecType(b bool) *SpuCreate

SetSpecType sets the "spec_type" field.

func (*SpuCreate) SetStatus

func (sc *SpuCreate) SetStatus(u uint8) *SpuCreate

SetStatus sets the "status" field.

func (*SpuCreate) SetStock

func (sc *SpuCreate) SetStock(i int32) *SpuCreate

SetStock sets the "stock" field.

func (*SpuCreate) SetSubCommissionType

func (sc *SpuCreate) SetSubCommissionType(b bool) *SpuCreate

SetSubCommissionType sets the "sub_commission_type" field.

func (*SpuCreate) SetUnit

func (sc *SpuCreate) SetUnit(u uint8) *SpuCreate

SetUnit sets the "unit" field.

func (*SpuCreate) SetUpdatedAt

func (sc *SpuCreate) SetUpdatedAt(t time.Time) *SpuCreate

SetUpdatedAt sets the "updated_at" field.

func (*SpuCreate) SetVideoURL

func (sc *SpuCreate) SetVideoURL(s string) *SpuCreate

SetVideoURL sets the "video_url" field.

func (*SpuCreate) SetVirtualSalesCount

func (sc *SpuCreate) SetVirtualSalesCount(i int32) *SpuCreate

SetVirtualSalesCount sets the "virtual_sales_count" field.

type SpuCreateBulk

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

SpuCreateBulk is the builder for creating many Spu entities in bulk.

func (*SpuCreateBulk) Exec

func (scb *SpuCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SpuCreateBulk) ExecX

func (scb *SpuCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SpuCreateBulk) Save

func (scb *SpuCreateBulk) Save(ctx context.Context) ([]*Spu, error)

Save creates the Spu entities in the database.

func (*SpuCreateBulk) SaveX

func (scb *SpuCreateBulk) SaveX(ctx context.Context) []*Spu

SaveX is like Save, but panics if an error occurs.

type SpuDelete

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

SpuDelete is the builder for deleting a Spu entity.

func (*SpuDelete) Exec

func (sd *SpuDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SpuDelete) ExecX

func (sd *SpuDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SpuDelete) Where

func (sd *SpuDelete) Where(ps ...predicate.Spu) *SpuDelete

Where appends a list predicates to the SpuDelete builder.

type SpuDeleteOne

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

SpuDeleteOne is the builder for deleting a single Spu entity.

func (*SpuDeleteOne) Exec

func (sdo *SpuDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SpuDeleteOne) ExecX

func (sdo *SpuDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SpuDeleteOne) Where

func (sdo *SpuDeleteOne) Where(ps ...predicate.Spu) *SpuDeleteOne

Where appends a list predicates to the SpuDelete builder.

type SpuEdges

type SpuEdges struct {
	// Skus holds the value of the skus edge.
	Skus []*Sku `json:"skus,omitempty"`
	// Brands holds the value of the brands edge.
	Brands *Brand `json:"brands,omitempty"`
	// Categorys holds the value of the categorys edge.
	Categorys *Category `json:"categorys,omitempty"`
	// contains filtered or unexported fields
}

SpuEdges holds the relations/edges for other nodes in the graph.

func (SpuEdges) BrandsOrErr

func (e SpuEdges) BrandsOrErr() (*Brand, error)

BrandsOrErr returns the Brands value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (SpuEdges) CategorysOrErr

func (e SpuEdges) CategorysOrErr() (*Category, error)

CategorysOrErr returns the Categorys value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (SpuEdges) SkusOrErr

func (e SpuEdges) SkusOrErr() ([]*Sku, error)

SkusOrErr returns the Skus value or an error if the edge was not loaded in eager-loading.

type SpuGroupBy

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

SpuGroupBy is the group-by builder for Spu entities.

func (*SpuGroupBy) Aggregate

func (sgb *SpuGroupBy) Aggregate(fns ...AggregateFunc) *SpuGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SpuGroupBy) Bool

func (s *SpuGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) BoolX

func (s *SpuGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SpuGroupBy) Bools

func (s *SpuGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) BoolsX

func (s *SpuGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SpuGroupBy) Float64

func (s *SpuGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) Float64X

func (s *SpuGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SpuGroupBy) Float64s

func (s *SpuGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) Float64sX

func (s *SpuGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SpuGroupBy) Int

func (s *SpuGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) IntX

func (s *SpuGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SpuGroupBy) Ints

func (s *SpuGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) IntsX

func (s *SpuGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SpuGroupBy) Scan

func (sgb *SpuGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SpuGroupBy) ScanX

func (s *SpuGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SpuGroupBy) String

func (s *SpuGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) StringX

func (s *SpuGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SpuGroupBy) Strings

func (s *SpuGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SpuGroupBy) StringsX

func (s *SpuGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SpuMutation

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

SpuMutation represents an operation that mutates the Spu nodes in the graph.

func (*SpuMutation) ActivityOrders

func (m *SpuMutation) ActivityOrders() (r []int32, exists bool)

ActivityOrders returns the value of the "activity_orders" field in the mutation.

func (*SpuMutation) ActivityOrdersCleared

func (m *SpuMutation) ActivityOrdersCleared() bool

ActivityOrdersCleared returns if the "activity_orders" field was cleared in this mutation.

func (*SpuMutation) AddBrowseCount

func (m *SpuMutation) AddBrowseCount(i int32)

AddBrowseCount adds i to the "browse_count" field.

func (*SpuMutation) AddCostPrice

func (m *SpuMutation) AddCostPrice(i int32)

AddCostPrice adds i to the "cost_price" field.

func (*SpuMutation) AddDeliveryTemplateID

func (m *SpuMutation) AddDeliveryTemplateID(u int64)

AddDeliveryTemplateID adds u to the "deliveryTemplate_id" field.

func (*SpuMutation) AddField

func (m *SpuMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SpuMutation) AddGiveIntegral

func (m *SpuMutation) AddGiveIntegral(i int32)

AddGiveIntegral adds i to the "give_integral" field.

func (*SpuMutation) AddMarketPrice

func (m *SpuMutation) AddMarketPrice(i int32)

AddMarketPrice adds i to the "market_price" field.

func (*SpuMutation) AddPrice

func (m *SpuMutation) AddPrice(i int32)

AddPrice adds i to the "price" field.

func (*SpuMutation) AddSalesCount

func (m *SpuMutation) AddSalesCount(i int32)

AddSalesCount adds i to the "sales_count" field.

func (*SpuMutation) AddSkuIDs

func (m *SpuMutation) AddSkuIDs(ids ...uint64)

AddSkuIDs adds the "skus" edge to the Sku entity by ids.

func (*SpuMutation) AddSort

func (m *SpuMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*SpuMutation) AddStatus

func (m *SpuMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*SpuMutation) AddStock

func (m *SpuMutation) AddStock(i int32)

AddStock adds i to the "stock" field.

func (*SpuMutation) AddUnit

func (m *SpuMutation) AddUnit(u int8)

AddUnit adds u to the "unit" field.

func (*SpuMutation) AddVirtualSalesCount

func (m *SpuMutation) AddVirtualSalesCount(i int32)

AddVirtualSalesCount adds i to the "virtual_sales_count" field.

func (*SpuMutation) AddedBrowseCount

func (m *SpuMutation) AddedBrowseCount() (r int32, exists bool)

AddedBrowseCount returns the value that was added to the "browse_count" field in this mutation.

func (*SpuMutation) AddedCostPrice

func (m *SpuMutation) AddedCostPrice() (r int32, exists bool)

AddedCostPrice returns the value that was added to the "cost_price" field in this mutation.

func (*SpuMutation) AddedDeliveryTemplateID

func (m *SpuMutation) AddedDeliveryTemplateID() (r int64, exists bool)

AddedDeliveryTemplateID returns the value that was added to the "deliveryTemplate_id" field in this mutation.

func (*SpuMutation) AddedEdges

func (m *SpuMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SpuMutation) AddedField

func (m *SpuMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SpuMutation) AddedFields

func (m *SpuMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SpuMutation) AddedGiveIntegral

func (m *SpuMutation) AddedGiveIntegral() (r int32, exists bool)

AddedGiveIntegral returns the value that was added to the "give_integral" field in this mutation.

func (*SpuMutation) AddedIDs

func (m *SpuMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SpuMutation) AddedMarketPrice

func (m *SpuMutation) AddedMarketPrice() (r int32, exists bool)

AddedMarketPrice returns the value that was added to the "market_price" field in this mutation.

func (*SpuMutation) AddedPrice

func (m *SpuMutation) AddedPrice() (r int32, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*SpuMutation) AddedSalesCount

func (m *SpuMutation) AddedSalesCount() (r int32, exists bool)

AddedSalesCount returns the value that was added to the "sales_count" field in this mutation.

func (*SpuMutation) AddedSort

func (m *SpuMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*SpuMutation) AddedStatus

func (m *SpuMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*SpuMutation) AddedStock

func (m *SpuMutation) AddedStock() (r int32, exists bool)

AddedStock returns the value that was added to the "stock" field in this mutation.

func (*SpuMutation) AddedUnit

func (m *SpuMutation) AddedUnit() (r int8, exists bool)

AddedUnit returns the value that was added to the "unit" field in this mutation.

func (*SpuMutation) AddedVirtualSalesCount

func (m *SpuMutation) AddedVirtualSalesCount() (r int32, exists bool)

AddedVirtualSalesCount returns the value that was added to the "virtual_sales_count" field in this mutation.

func (*SpuMutation) AppendActivityOrders

func (m *SpuMutation) AppendActivityOrders(i []int32)

AppendActivityOrders adds i to the "activity_orders" field.

func (*SpuMutation) AppendGiveCouponTemplateIds

func (m *SpuMutation) AppendGiveCouponTemplateIds(u []uint64)

AppendGiveCouponTemplateIds adds u to the "give_coupon_template_ids" field.

func (*SpuMutation) AppendSliderPicUrls

func (m *SpuMutation) AppendSliderPicUrls(s []string)

AppendSliderPicUrls adds s to the "slider_pic_urls" field.

func (*SpuMutation) AppendedActivityOrders

func (m *SpuMutation) AppendedActivityOrders() ([]int32, bool)

AppendedActivityOrders returns the list of values that were appended to the "activity_orders" field in this mutation.

func (*SpuMutation) AppendedGiveCouponTemplateIds

func (m *SpuMutation) AppendedGiveCouponTemplateIds() ([]uint64, bool)

AppendedGiveCouponTemplateIds returns the list of values that were appended to the "give_coupon_template_ids" field in this mutation.

func (*SpuMutation) AppendedSliderPicUrls

func (m *SpuMutation) AppendedSliderPicUrls() ([]string, bool)

AppendedSliderPicUrls returns the list of values that were appended to the "slider_pic_urls" field in this mutation.

func (*SpuMutation) BarCode

func (m *SpuMutation) BarCode() (r string, exists bool)

BarCode returns the value of the "bar_code" field in the mutation.

func (*SpuMutation) BarCodeCleared

func (m *SpuMutation) BarCodeCleared() bool

BarCodeCleared returns if the "bar_code" field was cleared in this mutation.

func (*SpuMutation) BrandID

func (m *SpuMutation) BrandID() (r uint64, exists bool)

BrandID returns the value of the "brand_id" field in the mutation.

func (*SpuMutation) BrandIDCleared

func (m *SpuMutation) BrandIDCleared() bool

BrandIDCleared returns if the "brand_id" field was cleared in this mutation.

func (*SpuMutation) BrandsCleared

func (m *SpuMutation) BrandsCleared() bool

BrandsCleared reports if the "brands" edge to the Brand entity was cleared.

func (*SpuMutation) BrandsID

func (m *SpuMutation) BrandsID() (id uint64, exists bool)

BrandsID returns the "brands" edge ID in the mutation.

func (*SpuMutation) BrandsIDs

func (m *SpuMutation) BrandsIDs() (ids []uint64)

BrandsIDs returns the "brands" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BrandsID instead. It exists only for internal usage by the builders.

func (*SpuMutation) BrowseCount

func (m *SpuMutation) BrowseCount() (r int32, exists bool)

BrowseCount returns the value of the "browse_count" field in the mutation.

func (*SpuMutation) BrowseCountCleared

func (m *SpuMutation) BrowseCountCleared() bool

BrowseCountCleared returns if the "browse_count" field was cleared in this mutation.

func (*SpuMutation) CategoryID

func (m *SpuMutation) CategoryID() (r uint64, exists bool)

CategoryID returns the value of the "category_id" field in the mutation.

func (*SpuMutation) CategoryIDCleared

func (m *SpuMutation) CategoryIDCleared() bool

CategoryIDCleared returns if the "category_id" field was cleared in this mutation.

func (*SpuMutation) CategorysCleared

func (m *SpuMutation) CategorysCleared() bool

CategorysCleared reports if the "categorys" edge to the Category entity was cleared.

func (*SpuMutation) CategorysID

func (m *SpuMutation) CategorysID() (id uint64, exists bool)

CategorysID returns the "categorys" edge ID in the mutation.

func (*SpuMutation) CategorysIDs

func (m *SpuMutation) CategorysIDs() (ids []uint64)

CategorysIDs returns the "categorys" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CategorysID instead. It exists only for internal usage by the builders.

func (*SpuMutation) ClearActivityOrders

func (m *SpuMutation) ClearActivityOrders()

ClearActivityOrders clears the value of the "activity_orders" field.

func (*SpuMutation) ClearBarCode

func (m *SpuMutation) ClearBarCode()

ClearBarCode clears the value of the "bar_code" field.

func (*SpuMutation) ClearBrandID

func (m *SpuMutation) ClearBrandID()

ClearBrandID clears the value of the "brand_id" field.

func (*SpuMutation) ClearBrands

func (m *SpuMutation) ClearBrands()

ClearBrands clears the "brands" edge to the Brand entity.

func (*SpuMutation) ClearBrowseCount

func (m *SpuMutation) ClearBrowseCount()

ClearBrowseCount clears the value of the "browse_count" field.

func (*SpuMutation) ClearCategoryID

func (m *SpuMutation) ClearCategoryID()

ClearCategoryID clears the value of the "category_id" field.

func (*SpuMutation) ClearCategorys

func (m *SpuMutation) ClearCategorys()

ClearCategorys clears the "categorys" edge to the Category entity.

func (*SpuMutation) ClearDeletedAt

func (m *SpuMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*SpuMutation) ClearDeliveryTemplateID

func (m *SpuMutation) ClearDeliveryTemplateID()

ClearDeliveryTemplateID clears the value of the "deliveryTemplate_id" field.

func (*SpuMutation) ClearDescription

func (m *SpuMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*SpuMutation) ClearEdge

func (m *SpuMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*SpuMutation) ClearField

func (m *SpuMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*SpuMutation) ClearGiveCouponTemplateIds

func (m *SpuMutation) ClearGiveCouponTemplateIds()

ClearGiveCouponTemplateIds clears the value of the "give_coupon_template_ids" field.

func (*SpuMutation) ClearGiveIntegral

func (m *SpuMutation) ClearGiveIntegral()

ClearGiveIntegral clears the value of the "give_integral" field.

func (*SpuMutation) ClearIntroduction

func (m *SpuMutation) ClearIntroduction()

ClearIntroduction clears the value of the "introduction" field.

func (*SpuMutation) ClearKeyword

func (m *SpuMutation) ClearKeyword()

ClearKeyword clears the value of the "keyword" field.

func (*SpuMutation) ClearMarketPrice

func (m *SpuMutation) ClearMarketPrice()

ClearMarketPrice clears the value of the "market_price" field.

func (*SpuMutation) ClearRecommendBenefit

func (m *SpuMutation) ClearRecommendBenefit()

ClearRecommendBenefit clears the value of the "recommend_benefit" field.

func (*SpuMutation) ClearRecommendBest

func (m *SpuMutation) ClearRecommendBest()

ClearRecommendBest clears the value of the "recommend_best" field.

func (*SpuMutation) ClearRecommendGood

func (m *SpuMutation) ClearRecommendGood()

ClearRecommendGood clears the value of the "recommend_good" field.

func (*SpuMutation) ClearRecommendHot

func (m *SpuMutation) ClearRecommendHot()

ClearRecommendHot clears the value of the "recommend_hot" field.

func (*SpuMutation) ClearRecommendNew

func (m *SpuMutation) ClearRecommendNew()

ClearRecommendNew clears the value of the "recommend_new" field.

func (*SpuMutation) ClearSalesCount

func (m *SpuMutation) ClearSalesCount()

ClearSalesCount clears the value of the "sales_count" field.

func (*SpuMutation) ClearSkus

func (m *SpuMutation) ClearSkus()

ClearSkus clears the "skus" edge to the Sku entity.

func (*SpuMutation) ClearSliderPicUrls

func (m *SpuMutation) ClearSliderPicUrls()

ClearSliderPicUrls clears the value of the "slider_pic_urls" field.

func (*SpuMutation) ClearSpecType

func (m *SpuMutation) ClearSpecType()

ClearSpecType clears the value of the "spec_type" field.

func (*SpuMutation) ClearStatus

func (m *SpuMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*SpuMutation) ClearSubCommissionType

func (m *SpuMutation) ClearSubCommissionType()

ClearSubCommissionType clears the value of the "sub_commission_type" field.

func (*SpuMutation) ClearVideoURL

func (m *SpuMutation) ClearVideoURL()

ClearVideoURL clears the value of the "video_url" field.

func (*SpuMutation) ClearVirtualSalesCount

func (m *SpuMutation) ClearVirtualSalesCount()

ClearVirtualSalesCount clears the value of the "virtual_sales_count" field.

func (*SpuMutation) ClearedEdges

func (m *SpuMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SpuMutation) ClearedFields

func (m *SpuMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SpuMutation) Client

func (m SpuMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*SpuMutation) CostPrice

func (m *SpuMutation) CostPrice() (r int32, exists bool)

CostPrice returns the value of the "cost_price" field in the mutation.

func (*SpuMutation) CreatedAt

func (m *SpuMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SpuMutation) DeletedAt

func (m *SpuMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*SpuMutation) DeletedAtCleared

func (m *SpuMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*SpuMutation) DeliveryTemplateID

func (m *SpuMutation) DeliveryTemplateID() (r uint64, exists bool)

DeliveryTemplateID returns the value of the "deliveryTemplate_id" field in the mutation.

func (*SpuMutation) DeliveryTemplateIDCleared

func (m *SpuMutation) DeliveryTemplateIDCleared() bool

DeliveryTemplateIDCleared returns if the "deliveryTemplate_id" field was cleared in this mutation.

func (*SpuMutation) Description

func (m *SpuMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*SpuMutation) DescriptionCleared

func (m *SpuMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*SpuMutation) EdgeCleared

func (m *SpuMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SpuMutation) Field

func (m *SpuMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SpuMutation) FieldCleared

func (m *SpuMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SpuMutation) Fields

func (m *SpuMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*SpuMutation) GiveCouponTemplateIds

func (m *SpuMutation) GiveCouponTemplateIds() (r []uint64, exists bool)

GiveCouponTemplateIds returns the value of the "give_coupon_template_ids" field in the mutation.

func (*SpuMutation) GiveCouponTemplateIdsCleared

func (m *SpuMutation) GiveCouponTemplateIdsCleared() bool

GiveCouponTemplateIdsCleared returns if the "give_coupon_template_ids" field was cleared in this mutation.

func (*SpuMutation) GiveIntegral

func (m *SpuMutation) GiveIntegral() (r int32, exists bool)

GiveIntegral returns the value of the "give_integral" field in the mutation.

func (*SpuMutation) GiveIntegralCleared

func (m *SpuMutation) GiveIntegralCleared() bool

GiveIntegralCleared returns if the "give_integral" field was cleared in this mutation.

func (*SpuMutation) ID

func (m *SpuMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SpuMutation) IDs

func (m *SpuMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SpuMutation) Introduction

func (m *SpuMutation) Introduction() (r string, exists bool)

Introduction returns the value of the "introduction" field in the mutation.

func (*SpuMutation) IntroductionCleared

func (m *SpuMutation) IntroductionCleared() bool

IntroductionCleared returns if the "introduction" field was cleared in this mutation.

func (*SpuMutation) Keyword

func (m *SpuMutation) Keyword() (r string, exists bool)

Keyword returns the value of the "keyword" field in the mutation.

func (*SpuMutation) KeywordCleared

func (m *SpuMutation) KeywordCleared() bool

KeywordCleared returns if the "keyword" field was cleared in this mutation.

func (*SpuMutation) MarketPrice

func (m *SpuMutation) MarketPrice() (r int32, exists bool)

MarketPrice returns the value of the "market_price" field in the mutation.

func (*SpuMutation) MarketPriceCleared

func (m *SpuMutation) MarketPriceCleared() bool

MarketPriceCleared returns if the "market_price" field was cleared in this mutation.

func (*SpuMutation) Name

func (m *SpuMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SpuMutation) OldActivityOrders

func (m *SpuMutation) OldActivityOrders(ctx context.Context) (v []int32, err error)

OldActivityOrders returns the old "activity_orders" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldBarCode

func (m *SpuMutation) OldBarCode(ctx context.Context) (v string, err error)

OldBarCode returns the old "bar_code" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldBrandID

func (m *SpuMutation) OldBrandID(ctx context.Context) (v uint64, err error)

OldBrandID returns the old "brand_id" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldBrowseCount

func (m *SpuMutation) OldBrowseCount(ctx context.Context) (v int32, err error)

OldBrowseCount returns the old "browse_count" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldCategoryID

func (m *SpuMutation) OldCategoryID(ctx context.Context) (v uint64, err error)

OldCategoryID returns the old "category_id" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldCostPrice

func (m *SpuMutation) OldCostPrice(ctx context.Context) (v int32, err error)

OldCostPrice returns the old "cost_price" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldCreatedAt

func (m *SpuMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldDeletedAt

func (m *SpuMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldDeliveryTemplateID

func (m *SpuMutation) OldDeliveryTemplateID(ctx context.Context) (v uint64, err error)

OldDeliveryTemplateID returns the old "deliveryTemplate_id" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldDescription

func (m *SpuMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldField

func (m *SpuMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*SpuMutation) OldGiveCouponTemplateIds

func (m *SpuMutation) OldGiveCouponTemplateIds(ctx context.Context) (v []uint64, err error)

OldGiveCouponTemplateIds returns the old "give_coupon_template_ids" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldGiveIntegral

func (m *SpuMutation) OldGiveIntegral(ctx context.Context) (v int32, err error)

OldGiveIntegral returns the old "give_integral" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldIntroduction

func (m *SpuMutation) OldIntroduction(ctx context.Context) (v string, err error)

OldIntroduction returns the old "introduction" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldKeyword

func (m *SpuMutation) OldKeyword(ctx context.Context) (v string, err error)

OldKeyword returns the old "keyword" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldMarketPrice

func (m *SpuMutation) OldMarketPrice(ctx context.Context) (v int32, err error)

OldMarketPrice returns the old "market_price" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldName

func (m *SpuMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldPicURL

func (m *SpuMutation) OldPicURL(ctx context.Context) (v string, err error)

OldPicURL returns the old "pic_url" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldPrice

func (m *SpuMutation) OldPrice(ctx context.Context) (v int32, err error)

OldPrice returns the old "price" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldRecommendBenefit

func (m *SpuMutation) OldRecommendBenefit(ctx context.Context) (v bool, err error)

OldRecommendBenefit returns the old "recommend_benefit" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldRecommendBest

func (m *SpuMutation) OldRecommendBest(ctx context.Context) (v bool, err error)

OldRecommendBest returns the old "recommend_best" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldRecommendGood

func (m *SpuMutation) OldRecommendGood(ctx context.Context) (v bool, err error)

OldRecommendGood returns the old "recommend_good" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldRecommendHot

func (m *SpuMutation) OldRecommendHot(ctx context.Context) (v bool, err error)

OldRecommendHot returns the old "recommend_hot" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldRecommendNew

func (m *SpuMutation) OldRecommendNew(ctx context.Context) (v bool, err error)

OldRecommendNew returns the old "recommend_new" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldSalesCount

func (m *SpuMutation) OldSalesCount(ctx context.Context) (v int32, err error)

OldSalesCount returns the old "sales_count" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldSliderPicUrls

func (m *SpuMutation) OldSliderPicUrls(ctx context.Context) (v []string, err error)

OldSliderPicUrls returns the old "slider_pic_urls" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldSort

func (m *SpuMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldSpecType

func (m *SpuMutation) OldSpecType(ctx context.Context) (v bool, err error)

OldSpecType returns the old "spec_type" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldStatus

func (m *SpuMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldStock

func (m *SpuMutation) OldStock(ctx context.Context) (v int32, err error)

OldStock returns the old "stock" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldSubCommissionType

func (m *SpuMutation) OldSubCommissionType(ctx context.Context) (v bool, err error)

OldSubCommissionType returns the old "sub_commission_type" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldUnit

func (m *SpuMutation) OldUnit(ctx context.Context) (v uint8, err error)

OldUnit returns the old "unit" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldUpdatedAt

func (m *SpuMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldVideoURL

func (m *SpuMutation) OldVideoURL(ctx context.Context) (v string, err error)

OldVideoURL returns the old "video_url" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) OldVirtualSalesCount

func (m *SpuMutation) OldVirtualSalesCount(ctx context.Context) (v int32, err error)

OldVirtualSalesCount returns the old "virtual_sales_count" field's value of the Spu entity. If the Spu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*SpuMutation) Op

func (m *SpuMutation) Op() Op

Op returns the operation name.

func (*SpuMutation) PicURL

func (m *SpuMutation) PicURL() (r string, exists bool)

PicURL returns the value of the "pic_url" field in the mutation.

func (*SpuMutation) Price

func (m *SpuMutation) Price() (r int32, exists bool)

Price returns the value of the "price" field in the mutation.

func (*SpuMutation) RecommendBenefit

func (m *SpuMutation) RecommendBenefit() (r bool, exists bool)

RecommendBenefit returns the value of the "recommend_benefit" field in the mutation.

func (*SpuMutation) RecommendBenefitCleared

func (m *SpuMutation) RecommendBenefitCleared() bool

RecommendBenefitCleared returns if the "recommend_benefit" field was cleared in this mutation.

func (*SpuMutation) RecommendBest

func (m *SpuMutation) RecommendBest() (r bool, exists bool)

RecommendBest returns the value of the "recommend_best" field in the mutation.

func (*SpuMutation) RecommendBestCleared

func (m *SpuMutation) RecommendBestCleared() bool

RecommendBestCleared returns if the "recommend_best" field was cleared in this mutation.

func (*SpuMutation) RecommendGood

func (m *SpuMutation) RecommendGood() (r bool, exists bool)

RecommendGood returns the value of the "recommend_good" field in the mutation.

func (*SpuMutation) RecommendGoodCleared

func (m *SpuMutation) RecommendGoodCleared() bool

RecommendGoodCleared returns if the "recommend_good" field was cleared in this mutation.

func (*SpuMutation) RecommendHot

func (m *SpuMutation) RecommendHot() (r bool, exists bool)

RecommendHot returns the value of the "recommend_hot" field in the mutation.

func (*SpuMutation) RecommendHotCleared

func (m *SpuMutation) RecommendHotCleared() bool

RecommendHotCleared returns if the "recommend_hot" field was cleared in this mutation.

func (*SpuMutation) RecommendNew

func (m *SpuMutation) RecommendNew() (r bool, exists bool)

RecommendNew returns the value of the "recommend_new" field in the mutation.

func (*SpuMutation) RecommendNewCleared

func (m *SpuMutation) RecommendNewCleared() bool

RecommendNewCleared returns if the "recommend_new" field was cleared in this mutation.

func (*SpuMutation) RemoveSkuIDs

func (m *SpuMutation) RemoveSkuIDs(ids ...uint64)

RemoveSkuIDs removes the "skus" edge to the Sku entity by IDs.

func (*SpuMutation) RemovedEdges

func (m *SpuMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SpuMutation) RemovedIDs

func (m *SpuMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SpuMutation) RemovedSkusIDs

func (m *SpuMutation) RemovedSkusIDs() (ids []uint64)

RemovedSkus returns the removed IDs of the "skus" edge to the Sku entity.

func (*SpuMutation) ResetActivityOrders

func (m *SpuMutation) ResetActivityOrders()

ResetActivityOrders resets all changes to the "activity_orders" field.

func (*SpuMutation) ResetBarCode

func (m *SpuMutation) ResetBarCode()

ResetBarCode resets all changes to the "bar_code" field.

func (*SpuMutation) ResetBrandID

func (m *SpuMutation) ResetBrandID()

ResetBrandID resets all changes to the "brand_id" field.

func (*SpuMutation) ResetBrands

func (m *SpuMutation) ResetBrands()

ResetBrands resets all changes to the "brands" edge.

func (*SpuMutation) ResetBrowseCount

func (m *SpuMutation) ResetBrowseCount()

ResetBrowseCount resets all changes to the "browse_count" field.

func (*SpuMutation) ResetCategoryID

func (m *SpuMutation) ResetCategoryID()

ResetCategoryID resets all changes to the "category_id" field.

func (*SpuMutation) ResetCategorys

func (m *SpuMutation) ResetCategorys()

ResetCategorys resets all changes to the "categorys" edge.

func (*SpuMutation) ResetCostPrice

func (m *SpuMutation) ResetCostPrice()

ResetCostPrice resets all changes to the "cost_price" field.

func (*SpuMutation) ResetCreatedAt

func (m *SpuMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SpuMutation) ResetDeletedAt

func (m *SpuMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*SpuMutation) ResetDeliveryTemplateID

func (m *SpuMutation) ResetDeliveryTemplateID()

ResetDeliveryTemplateID resets all changes to the "deliveryTemplate_id" field.

func (*SpuMutation) ResetDescription

func (m *SpuMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*SpuMutation) ResetEdge

func (m *SpuMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*SpuMutation) ResetField

func (m *SpuMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*SpuMutation) ResetGiveCouponTemplateIds

func (m *SpuMutation) ResetGiveCouponTemplateIds()

ResetGiveCouponTemplateIds resets all changes to the "give_coupon_template_ids" field.

func (*SpuMutation) ResetGiveIntegral

func (m *SpuMutation) ResetGiveIntegral()

ResetGiveIntegral resets all changes to the "give_integral" field.

func (*SpuMutation) ResetIntroduction

func (m *SpuMutation) ResetIntroduction()

ResetIntroduction resets all changes to the "introduction" field.

func (*SpuMutation) ResetKeyword

func (m *SpuMutation) ResetKeyword()

ResetKeyword resets all changes to the "keyword" field.

func (*SpuMutation) ResetMarketPrice

func (m *SpuMutation) ResetMarketPrice()

ResetMarketPrice resets all changes to the "market_price" field.

func (*SpuMutation) ResetName

func (m *SpuMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SpuMutation) ResetPicURL

func (m *SpuMutation) ResetPicURL()

ResetPicURL resets all changes to the "pic_url" field.

func (*SpuMutation) ResetPrice

func (m *SpuMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*SpuMutation) ResetRecommendBenefit

func (m *SpuMutation) ResetRecommendBenefit()

ResetRecommendBenefit resets all changes to the "recommend_benefit" field.

func (*SpuMutation) ResetRecommendBest

func (m *SpuMutation) ResetRecommendBest()

ResetRecommendBest resets all changes to the "recommend_best" field.

func (*SpuMutation) ResetRecommendGood

func (m *SpuMutation) ResetRecommendGood()

ResetRecommendGood resets all changes to the "recommend_good" field.

func (*SpuMutation) ResetRecommendHot

func (m *SpuMutation) ResetRecommendHot()

ResetRecommendHot resets all changes to the "recommend_hot" field.

func (*SpuMutation) ResetRecommendNew

func (m *SpuMutation) ResetRecommendNew()

ResetRecommendNew resets all changes to the "recommend_new" field.

func (*SpuMutation) ResetSalesCount

func (m *SpuMutation) ResetSalesCount()

ResetSalesCount resets all changes to the "sales_count" field.

func (*SpuMutation) ResetSkus

func (m *SpuMutation) ResetSkus()

ResetSkus resets all changes to the "skus" edge.

func (*SpuMutation) ResetSliderPicUrls

func (m *SpuMutation) ResetSliderPicUrls()

ResetSliderPicUrls resets all changes to the "slider_pic_urls" field.

func (*SpuMutation) ResetSort

func (m *SpuMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*SpuMutation) ResetSpecType

func (m *SpuMutation) ResetSpecType()

ResetSpecType resets all changes to the "spec_type" field.

func (*SpuMutation) ResetStatus

func (m *SpuMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*SpuMutation) ResetStock

func (m *SpuMutation) ResetStock()

ResetStock resets all changes to the "stock" field.

func (*SpuMutation) ResetSubCommissionType

func (m *SpuMutation) ResetSubCommissionType()

ResetSubCommissionType resets all changes to the "sub_commission_type" field.

func (*SpuMutation) ResetUnit

func (m *SpuMutation) ResetUnit()

ResetUnit resets all changes to the "unit" field.

func (*SpuMutation) ResetUpdatedAt

func (m *SpuMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SpuMutation) ResetVideoURL

func (m *SpuMutation) ResetVideoURL()

ResetVideoURL resets all changes to the "video_url" field.

func (*SpuMutation) ResetVirtualSalesCount

func (m *SpuMutation) ResetVirtualSalesCount()

ResetVirtualSalesCount resets all changes to the "virtual_sales_count" field.

func (*SpuMutation) SalesCount

func (m *SpuMutation) SalesCount() (r int32, exists bool)

SalesCount returns the value of the "sales_count" field in the mutation.

func (*SpuMutation) SalesCountCleared

func (m *SpuMutation) SalesCountCleared() bool

SalesCountCleared returns if the "sales_count" field was cleared in this mutation.

func (*SpuMutation) SetActivityOrders

func (m *SpuMutation) SetActivityOrders(i []int32)

SetActivityOrders sets the "activity_orders" field.

func (*SpuMutation) SetBarCode

func (m *SpuMutation) SetBarCode(s string)

SetBarCode sets the "bar_code" field.

func (*SpuMutation) SetBrandID

func (m *SpuMutation) SetBrandID(u uint64)

SetBrandID sets the "brand_id" field.

func (*SpuMutation) SetBrandsID

func (m *SpuMutation) SetBrandsID(id uint64)

SetBrandsID sets the "brands" edge to the Brand entity by id.

func (*SpuMutation) SetBrowseCount

func (m *SpuMutation) SetBrowseCount(i int32)

SetBrowseCount sets the "browse_count" field.

func (*SpuMutation) SetCategoryID

func (m *SpuMutation) SetCategoryID(u uint64)

SetCategoryID sets the "category_id" field.

func (*SpuMutation) SetCategorysID

func (m *SpuMutation) SetCategorysID(id uint64)

SetCategorysID sets the "categorys" edge to the Category entity by id.

func (*SpuMutation) SetCostPrice

func (m *SpuMutation) SetCostPrice(i int32)

SetCostPrice sets the "cost_price" field.

func (*SpuMutation) SetCreatedAt

func (m *SpuMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SpuMutation) SetDeletedAt

func (m *SpuMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*SpuMutation) SetDeliveryTemplateID

func (m *SpuMutation) SetDeliveryTemplateID(u uint64)

SetDeliveryTemplateID sets the "deliveryTemplate_id" field.

func (*SpuMutation) SetDescription

func (m *SpuMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*SpuMutation) SetField

func (m *SpuMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SpuMutation) SetGiveCouponTemplateIds

func (m *SpuMutation) SetGiveCouponTemplateIds(u []uint64)

SetGiveCouponTemplateIds sets the "give_coupon_template_ids" field.

func (*SpuMutation) SetGiveIntegral

func (m *SpuMutation) SetGiveIntegral(i int32)

SetGiveIntegral sets the "give_integral" field.

func (*SpuMutation) SetID

func (m *SpuMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Spu entities.

func (*SpuMutation) SetIntroduction

func (m *SpuMutation) SetIntroduction(s string)

SetIntroduction sets the "introduction" field.

func (*SpuMutation) SetKeyword

func (m *SpuMutation) SetKeyword(s string)

SetKeyword sets the "keyword" field.

func (*SpuMutation) SetMarketPrice

func (m *SpuMutation) SetMarketPrice(i int32)

SetMarketPrice sets the "market_price" field.

func (*SpuMutation) SetName

func (m *SpuMutation) SetName(s string)

SetName sets the "name" field.

func (*SpuMutation) SetOp

func (m *SpuMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SpuMutation) SetPicURL

func (m *SpuMutation) SetPicURL(s string)

SetPicURL sets the "pic_url" field.

func (*SpuMutation) SetPrice

func (m *SpuMutation) SetPrice(i int32)

SetPrice sets the "price" field.

func (*SpuMutation) SetRecommendBenefit

func (m *SpuMutation) SetRecommendBenefit(b bool)

SetRecommendBenefit sets the "recommend_benefit" field.

func (*SpuMutation) SetRecommendBest

func (m *SpuMutation) SetRecommendBest(b bool)

SetRecommendBest sets the "recommend_best" field.

func (*SpuMutation) SetRecommendGood

func (m *SpuMutation) SetRecommendGood(b bool)

SetRecommendGood sets the "recommend_good" field.

func (*SpuMutation) SetRecommendHot

func (m *SpuMutation) SetRecommendHot(b bool)

SetRecommendHot sets the "recommend_hot" field.

func (*SpuMutation) SetRecommendNew

func (m *SpuMutation) SetRecommendNew(b bool)

SetRecommendNew sets the "recommend_new" field.

func (*SpuMutation) SetSalesCount

func (m *SpuMutation) SetSalesCount(i int32)

SetSalesCount sets the "sales_count" field.

func (*SpuMutation) SetSliderPicUrls

func (m *SpuMutation) SetSliderPicUrls(s []string)

SetSliderPicUrls sets the "slider_pic_urls" field.

func (*SpuMutation) SetSort

func (m *SpuMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*SpuMutation) SetSpecType

func (m *SpuMutation) SetSpecType(b bool)

SetSpecType sets the "spec_type" field.

func (*SpuMutation) SetStatus

func (m *SpuMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*SpuMutation) SetStock

func (m *SpuMutation) SetStock(i int32)

SetStock sets the "stock" field.

func (*SpuMutation) SetSubCommissionType

func (m *SpuMutation) SetSubCommissionType(b bool)

SetSubCommissionType sets the "sub_commission_type" field.

func (*SpuMutation) SetUnit

func (m *SpuMutation) SetUnit(u uint8)

SetUnit sets the "unit" field.

func (*SpuMutation) SetUpdatedAt

func (m *SpuMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SpuMutation) SetVideoURL

func (m *SpuMutation) SetVideoURL(s string)

SetVideoURL sets the "video_url" field.

func (*SpuMutation) SetVirtualSalesCount

func (m *SpuMutation) SetVirtualSalesCount(i int32)

SetVirtualSalesCount sets the "virtual_sales_count" field.

func (*SpuMutation) SkusCleared

func (m *SpuMutation) SkusCleared() bool

SkusCleared reports if the "skus" edge to the Sku entity was cleared.

func (*SpuMutation) SkusIDs

func (m *SpuMutation) SkusIDs() (ids []uint64)

SkusIDs returns the "skus" edge IDs in the mutation.

func (*SpuMutation) SliderPicUrls

func (m *SpuMutation) SliderPicUrls() (r []string, exists bool)

SliderPicUrls returns the value of the "slider_pic_urls" field in the mutation.

func (*SpuMutation) SliderPicUrlsCleared

func (m *SpuMutation) SliderPicUrlsCleared() bool

SliderPicUrlsCleared returns if the "slider_pic_urls" field was cleared in this mutation.

func (*SpuMutation) Sort

func (m *SpuMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*SpuMutation) SpecType

func (m *SpuMutation) SpecType() (r bool, exists bool)

SpecType returns the value of the "spec_type" field in the mutation.

func (*SpuMutation) SpecTypeCleared

func (m *SpuMutation) SpecTypeCleared() bool

SpecTypeCleared returns if the "spec_type" field was cleared in this mutation.

func (*SpuMutation) Status

func (m *SpuMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*SpuMutation) StatusCleared

func (m *SpuMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*SpuMutation) Stock

func (m *SpuMutation) Stock() (r int32, exists bool)

Stock returns the value of the "stock" field in the mutation.

func (*SpuMutation) SubCommissionType

func (m *SpuMutation) SubCommissionType() (r bool, exists bool)

SubCommissionType returns the value of the "sub_commission_type" field in the mutation.

func (*SpuMutation) SubCommissionTypeCleared

func (m *SpuMutation) SubCommissionTypeCleared() bool

SubCommissionTypeCleared returns if the "sub_commission_type" field was cleared in this mutation.

func (SpuMutation) Tx

func (m SpuMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SpuMutation) Type

func (m *SpuMutation) Type() string

Type returns the node type of this mutation (Spu).

func (*SpuMutation) Unit

func (m *SpuMutation) Unit() (r uint8, exists bool)

Unit returns the value of the "unit" field in the mutation.

func (*SpuMutation) UpdatedAt

func (m *SpuMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SpuMutation) VideoURL

func (m *SpuMutation) VideoURL() (r string, exists bool)

VideoURL returns the value of the "video_url" field in the mutation.

func (*SpuMutation) VideoURLCleared

func (m *SpuMutation) VideoURLCleared() bool

VideoURLCleared returns if the "video_url" field was cleared in this mutation.

func (*SpuMutation) VirtualSalesCount

func (m *SpuMutation) VirtualSalesCount() (r int32, exists bool)

VirtualSalesCount returns the value of the "virtual_sales_count" field in the mutation.

func (*SpuMutation) VirtualSalesCountCleared

func (m *SpuMutation) VirtualSalesCountCleared() bool

VirtualSalesCountCleared returns if the "virtual_sales_count" field was cleared in this mutation.

func (*SpuMutation) Where

func (m *SpuMutation) Where(ps ...predicate.Spu)

Where appends a list predicates to the SpuMutation builder.

func (*SpuMutation) WhereP

func (m *SpuMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SpuMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SpuPageList

type SpuPageList struct {
	List        []*Spu       `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

SpuPageList is Spu PageList result.

type SpuPager

type SpuPager struct {
	Order  spu.OrderOption
	Filter func(*SpuQuery) (*SpuQuery, error)
}

func (*SpuPager) ApplyFilter

func (p *SpuPager) ApplyFilter(query *SpuQuery) (*SpuQuery, error)

type SpuPaginateOption

type SpuPaginateOption func(*SpuPager)

SpuPaginateOption enables pagination customization.

type SpuQuery

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

SpuQuery is the builder for querying Spu entities.

func (*SpuQuery) Aggregate

func (sq *SpuQuery) Aggregate(fns ...AggregateFunc) *SpuSelect

Aggregate returns a SpuSelect configured with the given aggregations.

func (*SpuQuery) All

func (sq *SpuQuery) All(ctx context.Context) ([]*Spu, error)

All executes the query and returns a list of Spus.

func (*SpuQuery) AllX

func (sq *SpuQuery) AllX(ctx context.Context) []*Spu

AllX is like All, but panics if an error occurs.

func (*SpuQuery) Clone

func (sq *SpuQuery) Clone() *SpuQuery

Clone returns a duplicate of the SpuQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SpuQuery) Count

func (sq *SpuQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SpuQuery) CountX

func (sq *SpuQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SpuQuery) Exist

func (sq *SpuQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SpuQuery) ExistX

func (sq *SpuQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SpuQuery) First

func (sq *SpuQuery) First(ctx context.Context) (*Spu, error)

First returns the first Spu entity from the query. Returns a *NotFoundError when no Spu was found.

func (*SpuQuery) FirstID

func (sq *SpuQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Spu ID from the query. Returns a *NotFoundError when no Spu ID was found.

func (*SpuQuery) FirstIDX

func (sq *SpuQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*SpuQuery) FirstX

func (sq *SpuQuery) FirstX(ctx context.Context) *Spu

FirstX is like First, but panics if an error occurs.

func (*SpuQuery) GroupBy

func (sq *SpuQuery) GroupBy(field string, fields ...string) *SpuGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Spu.Query().
	GroupBy(spu.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SpuQuery) IDs

func (sq *SpuQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Spu IDs.

func (*SpuQuery) IDsX

func (sq *SpuQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*SpuQuery) Limit

func (sq *SpuQuery) Limit(limit int) *SpuQuery

Limit the number of records to be returned by this query.

func (*SpuQuery) Offset

func (sq *SpuQuery) Offset(offset int) *SpuQuery

Offset to start from.

func (*SpuQuery) Only

func (sq *SpuQuery) Only(ctx context.Context) (*Spu, error)

Only returns a single Spu entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Spu entity is found. Returns a *NotFoundError when no Spu entities are found.

func (*SpuQuery) OnlyID

func (sq *SpuQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Spu ID in the query. Returns a *NotSingularError when more than one Spu ID is found. Returns a *NotFoundError when no entities are found.

func (*SpuQuery) OnlyIDX

func (sq *SpuQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SpuQuery) OnlyX

func (sq *SpuQuery) OnlyX(ctx context.Context) *Spu

OnlyX is like Only, but panics if an error occurs.

func (*SpuQuery) Order

func (sq *SpuQuery) Order(o ...spu.OrderOption) *SpuQuery

Order specifies how the records should be ordered.

func (*SpuQuery) Page

func (s *SpuQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...SpuPaginateOption,
) (*SpuPageList, error)

func (*SpuQuery) QueryBrands

func (sq *SpuQuery) QueryBrands() *BrandQuery

QueryBrands chains the current query on the "brands" edge.

func (*SpuQuery) QueryCategorys

func (sq *SpuQuery) QueryCategorys() *CategoryQuery

QueryCategorys chains the current query on the "categorys" edge.

func (*SpuQuery) QuerySkus

func (sq *SpuQuery) QuerySkus() *SkuQuery

QuerySkus chains the current query on the "skus" edge.

func (*SpuQuery) Select

func (sq *SpuQuery) Select(fields ...string) *SpuSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Spu.Query().
	Select(spu.FieldCreatedAt).
	Scan(ctx, &v)

func (*SpuQuery) Unique

func (sq *SpuQuery) Unique(unique bool) *SpuQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SpuQuery) Where

func (sq *SpuQuery) Where(ps ...predicate.Spu) *SpuQuery

Where adds a new predicate for the SpuQuery builder.

func (*SpuQuery) WithBrands

func (sq *SpuQuery) WithBrands(opts ...func(*BrandQuery)) *SpuQuery

WithBrands tells the query-builder to eager-load the nodes that are connected to the "brands" edge. The optional arguments are used to configure the query builder of the edge.

func (*SpuQuery) WithCategorys

func (sq *SpuQuery) WithCategorys(opts ...func(*CategoryQuery)) *SpuQuery

WithCategorys tells the query-builder to eager-load the nodes that are connected to the "categorys" edge. The optional arguments are used to configure the query builder of the edge.

func (*SpuQuery) WithSkus

func (sq *SpuQuery) WithSkus(opts ...func(*SkuQuery)) *SpuQuery

WithSkus tells the query-builder to eager-load the nodes that are connected to the "skus" edge. The optional arguments are used to configure the query builder of the edge.

type SpuSelect

type SpuSelect struct {
	*SpuQuery
	// contains filtered or unexported fields
}

SpuSelect is the builder for selecting fields of Spu entities.

func (*SpuSelect) Aggregate

func (ss *SpuSelect) Aggregate(fns ...AggregateFunc) *SpuSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SpuSelect) Bool

func (s *SpuSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SpuSelect) BoolX

func (s *SpuSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SpuSelect) Bools

func (s *SpuSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SpuSelect) BoolsX

func (s *SpuSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SpuSelect) Float64

func (s *SpuSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SpuSelect) Float64X

func (s *SpuSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SpuSelect) Float64s

func (s *SpuSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SpuSelect) Float64sX

func (s *SpuSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SpuSelect) Int

func (s *SpuSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SpuSelect) IntX

func (s *SpuSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SpuSelect) Ints

func (s *SpuSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SpuSelect) IntsX

func (s *SpuSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SpuSelect) Scan

func (ss *SpuSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SpuSelect) ScanX

func (s *SpuSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SpuSelect) String

func (s *SpuSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SpuSelect) StringX

func (s *SpuSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SpuSelect) Strings

func (s *SpuSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SpuSelect) StringsX

func (s *SpuSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SpuUpdate

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

SpuUpdate is the builder for updating Spu entities.

func (*SpuUpdate) AddBrowseCount

func (su *SpuUpdate) AddBrowseCount(i int32) *SpuUpdate

AddBrowseCount adds i to the "browse_count" field.

func (*SpuUpdate) AddCostPrice

func (su *SpuUpdate) AddCostPrice(i int32) *SpuUpdate

AddCostPrice adds i to the "cost_price" field.

func (*SpuUpdate) AddDeliveryTemplateID

func (su *SpuUpdate) AddDeliveryTemplateID(u int64) *SpuUpdate

AddDeliveryTemplateID adds u to the "deliveryTemplate_id" field.

func (*SpuUpdate) AddGiveIntegral

func (su *SpuUpdate) AddGiveIntegral(i int32) *SpuUpdate

AddGiveIntegral adds i to the "give_integral" field.

func (*SpuUpdate) AddMarketPrice

func (su *SpuUpdate) AddMarketPrice(i int32) *SpuUpdate

AddMarketPrice adds i to the "market_price" field.

func (*SpuUpdate) AddPrice

func (su *SpuUpdate) AddPrice(i int32) *SpuUpdate

AddPrice adds i to the "price" field.

func (*SpuUpdate) AddSalesCount

func (su *SpuUpdate) AddSalesCount(i int32) *SpuUpdate

AddSalesCount adds i to the "sales_count" field.

func (*SpuUpdate) AddSkuIDs

func (su *SpuUpdate) AddSkuIDs(ids ...uint64) *SpuUpdate

AddSkuIDs adds the "skus" edge to the Sku entity by IDs.

func (*SpuUpdate) AddSkus

func (su *SpuUpdate) AddSkus(s ...*Sku) *SpuUpdate

AddSkus adds the "skus" edges to the Sku entity.

func (*SpuUpdate) AddSort

func (su *SpuUpdate) AddSort(u int32) *SpuUpdate

AddSort adds u to the "sort" field.

func (*SpuUpdate) AddStatus

func (su *SpuUpdate) AddStatus(u int8) *SpuUpdate

AddStatus adds u to the "status" field.

func (*SpuUpdate) AddStock

func (su *SpuUpdate) AddStock(i int32) *SpuUpdate

AddStock adds i to the "stock" field.

func (*SpuUpdate) AddUnit

func (su *SpuUpdate) AddUnit(u int8) *SpuUpdate

AddUnit adds u to the "unit" field.

func (*SpuUpdate) AddVirtualSalesCount

func (su *SpuUpdate) AddVirtualSalesCount(i int32) *SpuUpdate

AddVirtualSalesCount adds i to the "virtual_sales_count" field.

func (*SpuUpdate) AppendActivityOrders

func (su *SpuUpdate) AppendActivityOrders(i []int32) *SpuUpdate

AppendActivityOrders appends i to the "activity_orders" field.

func (*SpuUpdate) AppendGiveCouponTemplateIds

func (su *SpuUpdate) AppendGiveCouponTemplateIds(u []uint64) *SpuUpdate

AppendGiveCouponTemplateIds appends u to the "give_coupon_template_ids" field.

func (*SpuUpdate) AppendSliderPicUrls

func (su *SpuUpdate) AppendSliderPicUrls(s []string) *SpuUpdate

AppendSliderPicUrls appends s to the "slider_pic_urls" field.

func (*SpuUpdate) ClearActivityOrders

func (su *SpuUpdate) ClearActivityOrders() *SpuUpdate

ClearActivityOrders clears the value of the "activity_orders" field.

func (*SpuUpdate) ClearBarCode

func (su *SpuUpdate) ClearBarCode() *SpuUpdate

ClearBarCode clears the value of the "bar_code" field.

func (*SpuUpdate) ClearBrandID

func (su *SpuUpdate) ClearBrandID() *SpuUpdate

ClearBrandID clears the value of the "brand_id" field.

func (*SpuUpdate) ClearBrands

func (su *SpuUpdate) ClearBrands() *SpuUpdate

ClearBrands clears the "brands" edge to the Brand entity.

func (*SpuUpdate) ClearBrowseCount

func (su *SpuUpdate) ClearBrowseCount() *SpuUpdate

ClearBrowseCount clears the value of the "browse_count" field.

func (*SpuUpdate) ClearCategoryID

func (su *SpuUpdate) ClearCategoryID() *SpuUpdate

ClearCategoryID clears the value of the "category_id" field.

func (*SpuUpdate) ClearCategorys

func (su *SpuUpdate) ClearCategorys() *SpuUpdate

ClearCategorys clears the "categorys" edge to the Category entity.

func (*SpuUpdate) ClearDeletedAt

func (su *SpuUpdate) ClearDeletedAt() *SpuUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*SpuUpdate) ClearDeliveryTemplateID

func (su *SpuUpdate) ClearDeliveryTemplateID() *SpuUpdate

ClearDeliveryTemplateID clears the value of the "deliveryTemplate_id" field.

func (*SpuUpdate) ClearDescription

func (su *SpuUpdate) ClearDescription() *SpuUpdate

ClearDescription clears the value of the "description" field.

func (*SpuUpdate) ClearGiveCouponTemplateIds

func (su *SpuUpdate) ClearGiveCouponTemplateIds() *SpuUpdate

ClearGiveCouponTemplateIds clears the value of the "give_coupon_template_ids" field.

func (*SpuUpdate) ClearGiveIntegral

func (su *SpuUpdate) ClearGiveIntegral() *SpuUpdate

ClearGiveIntegral clears the value of the "give_integral" field.

func (*SpuUpdate) ClearIntroduction

func (su *SpuUpdate) ClearIntroduction() *SpuUpdate

ClearIntroduction clears the value of the "introduction" field.

func (*SpuUpdate) ClearKeyword

func (su *SpuUpdate) ClearKeyword() *SpuUpdate

ClearKeyword clears the value of the "keyword" field.

func (*SpuUpdate) ClearMarketPrice

func (su *SpuUpdate) ClearMarketPrice() *SpuUpdate

ClearMarketPrice clears the value of the "market_price" field.

func (*SpuUpdate) ClearRecommendBenefit

func (su *SpuUpdate) ClearRecommendBenefit() *SpuUpdate

ClearRecommendBenefit clears the value of the "recommend_benefit" field.

func (*SpuUpdate) ClearRecommendBest

func (su *SpuUpdate) ClearRecommendBest() *SpuUpdate

ClearRecommendBest clears the value of the "recommend_best" field.

func (*SpuUpdate) ClearRecommendGood

func (su *SpuUpdate) ClearRecommendGood() *SpuUpdate

ClearRecommendGood clears the value of the "recommend_good" field.

func (*SpuUpdate) ClearRecommendHot

func (su *SpuUpdate) ClearRecommendHot() *SpuUpdate

ClearRecommendHot clears the value of the "recommend_hot" field.

func (*SpuUpdate) ClearRecommendNew

func (su *SpuUpdate) ClearRecommendNew() *SpuUpdate

ClearRecommendNew clears the value of the "recommend_new" field.

func (*SpuUpdate) ClearSalesCount

func (su *SpuUpdate) ClearSalesCount() *SpuUpdate

ClearSalesCount clears the value of the "sales_count" field.

func (*SpuUpdate) ClearSkus

func (su *SpuUpdate) ClearSkus() *SpuUpdate

ClearSkus clears all "skus" edges to the Sku entity.

func (*SpuUpdate) ClearSliderPicUrls

func (su *SpuUpdate) ClearSliderPicUrls() *SpuUpdate

ClearSliderPicUrls clears the value of the "slider_pic_urls" field.

func (*SpuUpdate) ClearSpecType

func (su *SpuUpdate) ClearSpecType() *SpuUpdate

ClearSpecType clears the value of the "spec_type" field.

func (*SpuUpdate) ClearStatus

func (su *SpuUpdate) ClearStatus() *SpuUpdate

ClearStatus clears the value of the "status" field.

func (*SpuUpdate) ClearSubCommissionType

func (su *SpuUpdate) ClearSubCommissionType() *SpuUpdate

ClearSubCommissionType clears the value of the "sub_commission_type" field.

func (*SpuUpdate) ClearVideoURL

func (su *SpuUpdate) ClearVideoURL() *SpuUpdate

ClearVideoURL clears the value of the "video_url" field.

func (*SpuUpdate) ClearVirtualSalesCount

func (su *SpuUpdate) ClearVirtualSalesCount() *SpuUpdate

ClearVirtualSalesCount clears the value of the "virtual_sales_count" field.

func (*SpuUpdate) Exec

func (su *SpuUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SpuUpdate) ExecX

func (su *SpuUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SpuUpdate) Mutation

func (su *SpuUpdate) Mutation() *SpuMutation

Mutation returns the SpuMutation object of the builder.

func (*SpuUpdate) RemoveSkuIDs

func (su *SpuUpdate) RemoveSkuIDs(ids ...uint64) *SpuUpdate

RemoveSkuIDs removes the "skus" edge to Sku entities by IDs.

func (*SpuUpdate) RemoveSkus

func (su *SpuUpdate) RemoveSkus(s ...*Sku) *SpuUpdate

RemoveSkus removes "skus" edges to Sku entities.

func (*SpuUpdate) Save

func (su *SpuUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SpuUpdate) SaveX

func (su *SpuUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SpuUpdate) SetActivityOrders

func (su *SpuUpdate) SetActivityOrders(i []int32) *SpuUpdate

SetActivityOrders sets the "activity_orders" field.

func (*SpuUpdate) SetBarCode

func (su *SpuUpdate) SetBarCode(s string) *SpuUpdate

SetBarCode sets the "bar_code" field.

func (*SpuUpdate) SetBrandID

func (su *SpuUpdate) SetBrandID(u uint64) *SpuUpdate

SetBrandID sets the "brand_id" field.

func (*SpuUpdate) SetBrands

func (su *SpuUpdate) SetBrands(b *Brand) *SpuUpdate

SetBrands sets the "brands" edge to the Brand entity.

func (*SpuUpdate) SetBrandsID

func (su *SpuUpdate) SetBrandsID(id uint64) *SpuUpdate

SetBrandsID sets the "brands" edge to the Brand entity by ID.

func (*SpuUpdate) SetBrowseCount

func (su *SpuUpdate) SetBrowseCount(i int32) *SpuUpdate

SetBrowseCount sets the "browse_count" field.

func (*SpuUpdate) SetCategoryID

func (su *SpuUpdate) SetCategoryID(u uint64) *SpuUpdate

SetCategoryID sets the "category_id" field.

func (*SpuUpdate) SetCategorys

func (su *SpuUpdate) SetCategorys(c *Category) *SpuUpdate

SetCategorys sets the "categorys" edge to the Category entity.

func (*SpuUpdate) SetCategorysID

func (su *SpuUpdate) SetCategorysID(id uint64) *SpuUpdate

SetCategorysID sets the "categorys" edge to the Category entity by ID.

func (*SpuUpdate) SetCostPrice

func (su *SpuUpdate) SetCostPrice(i int32) *SpuUpdate

SetCostPrice sets the "cost_price" field.

func (*SpuUpdate) SetDeletedAt

func (su *SpuUpdate) SetDeletedAt(t time.Time) *SpuUpdate

SetDeletedAt sets the "deleted_at" field.

func (*SpuUpdate) SetDeliveryTemplateID

func (su *SpuUpdate) SetDeliveryTemplateID(u uint64) *SpuUpdate

SetDeliveryTemplateID sets the "deliveryTemplate_id" field.

func (*SpuUpdate) SetDescription

func (su *SpuUpdate) SetDescription(s string) *SpuUpdate

SetDescription sets the "description" field.

func (*SpuUpdate) SetGiveCouponTemplateIds

func (su *SpuUpdate) SetGiveCouponTemplateIds(u []uint64) *SpuUpdate

SetGiveCouponTemplateIds sets the "give_coupon_template_ids" field.

func (*SpuUpdate) SetGiveIntegral

func (su *SpuUpdate) SetGiveIntegral(i int32) *SpuUpdate

SetGiveIntegral sets the "give_integral" field.

func (*SpuUpdate) SetIntroduction

func (su *SpuUpdate) SetIntroduction(s string) *SpuUpdate

SetIntroduction sets the "introduction" field.

func (*SpuUpdate) SetKeyword

func (su *SpuUpdate) SetKeyword(s string) *SpuUpdate

SetKeyword sets the "keyword" field.

func (*SpuUpdate) SetMarketPrice

func (su *SpuUpdate) SetMarketPrice(i int32) *SpuUpdate

SetMarketPrice sets the "market_price" field.

func (*SpuUpdate) SetName

func (su *SpuUpdate) SetName(s string) *SpuUpdate

SetName sets the "name" field.

func (*SpuUpdate) SetNillableBarCode

func (su *SpuUpdate) SetNillableBarCode(s *string) *SpuUpdate

SetNillableBarCode sets the "bar_code" field if the given value is not nil.

func (*SpuUpdate) SetNillableBrandID

func (su *SpuUpdate) SetNillableBrandID(u *uint64) *SpuUpdate

SetNillableBrandID sets the "brand_id" field if the given value is not nil.

func (*SpuUpdate) SetNillableBrandsID

func (su *SpuUpdate) SetNillableBrandsID(id *uint64) *SpuUpdate

SetNillableBrandsID sets the "brands" edge to the Brand entity by ID if the given value is not nil.

func (*SpuUpdate) SetNillableBrowseCount

func (su *SpuUpdate) SetNillableBrowseCount(i *int32) *SpuUpdate

SetNillableBrowseCount sets the "browse_count" field if the given value is not nil.

func (*SpuUpdate) SetNillableCategoryID

func (su *SpuUpdate) SetNillableCategoryID(u *uint64) *SpuUpdate

SetNillableCategoryID sets the "category_id" field if the given value is not nil.

func (*SpuUpdate) SetNillableCategorysID

func (su *SpuUpdate) SetNillableCategorysID(id *uint64) *SpuUpdate

SetNillableCategorysID sets the "categorys" edge to the Category entity by ID if the given value is not nil.

func (*SpuUpdate) SetNillableDeletedAt

func (su *SpuUpdate) SetNillableDeletedAt(t *time.Time) *SpuUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SpuUpdate) SetNillableDeliveryTemplateID

func (su *SpuUpdate) SetNillableDeliveryTemplateID(u *uint64) *SpuUpdate

SetNillableDeliveryTemplateID sets the "deliveryTemplate_id" field if the given value is not nil.

func (*SpuUpdate) SetNillableDescription

func (su *SpuUpdate) SetNillableDescription(s *string) *SpuUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SpuUpdate) SetNillableGiveIntegral

func (su *SpuUpdate) SetNillableGiveIntegral(i *int32) *SpuUpdate

SetNillableGiveIntegral sets the "give_integral" field if the given value is not nil.

func (*SpuUpdate) SetNillableIntroduction

func (su *SpuUpdate) SetNillableIntroduction(s *string) *SpuUpdate

SetNillableIntroduction sets the "introduction" field if the given value is not nil.

func (*SpuUpdate) SetNillableKeyword

func (su *SpuUpdate) SetNillableKeyword(s *string) *SpuUpdate

SetNillableKeyword sets the "keyword" field if the given value is not nil.

func (*SpuUpdate) SetNillableMarketPrice

func (su *SpuUpdate) SetNillableMarketPrice(i *int32) *SpuUpdate

SetNillableMarketPrice sets the "market_price" field if the given value is not nil.

func (*SpuUpdate) SetNillableRecommendBenefit

func (su *SpuUpdate) SetNillableRecommendBenefit(b *bool) *SpuUpdate

SetNillableRecommendBenefit sets the "recommend_benefit" field if the given value is not nil.

func (*SpuUpdate) SetNillableRecommendBest

func (su *SpuUpdate) SetNillableRecommendBest(b *bool) *SpuUpdate

SetNillableRecommendBest sets the "recommend_best" field if the given value is not nil.

func (*SpuUpdate) SetNillableRecommendGood

func (su *SpuUpdate) SetNillableRecommendGood(b *bool) *SpuUpdate

SetNillableRecommendGood sets the "recommend_good" field if the given value is not nil.

func (*SpuUpdate) SetNillableRecommendHot

func (su *SpuUpdate) SetNillableRecommendHot(b *bool) *SpuUpdate

SetNillableRecommendHot sets the "recommend_hot" field if the given value is not nil.

func (*SpuUpdate) SetNillableRecommendNew

func (su *SpuUpdate) SetNillableRecommendNew(b *bool) *SpuUpdate

SetNillableRecommendNew sets the "recommend_new" field if the given value is not nil.

func (*SpuUpdate) SetNillableSalesCount

func (su *SpuUpdate) SetNillableSalesCount(i *int32) *SpuUpdate

SetNillableSalesCount sets the "sales_count" field if the given value is not nil.

func (*SpuUpdate) SetNillableSort

func (su *SpuUpdate) SetNillableSort(u *uint32) *SpuUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*SpuUpdate) SetNillableSpecType

func (su *SpuUpdate) SetNillableSpecType(b *bool) *SpuUpdate

SetNillableSpecType sets the "spec_type" field if the given value is not nil.

func (*SpuUpdate) SetNillableStatus

func (su *SpuUpdate) SetNillableStatus(u *uint8) *SpuUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SpuUpdate) SetNillableSubCommissionType

func (su *SpuUpdate) SetNillableSubCommissionType(b *bool) *SpuUpdate

SetNillableSubCommissionType sets the "sub_commission_type" field if the given value is not nil.

func (*SpuUpdate) SetNillableVideoURL

func (su *SpuUpdate) SetNillableVideoURL(s *string) *SpuUpdate

SetNillableVideoURL sets the "video_url" field if the given value is not nil.

func (*SpuUpdate) SetNillableVirtualSalesCount

func (su *SpuUpdate) SetNillableVirtualSalesCount(i *int32) *SpuUpdate

SetNillableVirtualSalesCount sets the "virtual_sales_count" field if the given value is not nil.

func (*SpuUpdate) SetNotNilActivityOrders

func (s *SpuUpdate) SetNotNilActivityOrders(value *[]int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilBarCode

func (s *SpuUpdate) SetNotNilBarCode(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilBrandID

func (s *SpuUpdate) SetNotNilBrandID(value *uint64) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilBrowseCount

func (s *SpuUpdate) SetNotNilBrowseCount(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilCategoryID

func (s *SpuUpdate) SetNotNilCategoryID(value *uint64) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilCostPrice

func (s *SpuUpdate) SetNotNilCostPrice(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilDeletedAt

func (s *SpuUpdate) SetNotNilDeletedAt(value *time.Time) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilDeliveryTemplateID

func (s *SpuUpdate) SetNotNilDeliveryTemplateID(value *uint64) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilDescription

func (s *SpuUpdate) SetNotNilDescription(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilGiveCouponTemplateIds

func (s *SpuUpdate) SetNotNilGiveCouponTemplateIds(value *[]uint64) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilGiveIntegral

func (s *SpuUpdate) SetNotNilGiveIntegral(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilIntroduction

func (s *SpuUpdate) SetNotNilIntroduction(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilKeyword

func (s *SpuUpdate) SetNotNilKeyword(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilMarketPrice

func (s *SpuUpdate) SetNotNilMarketPrice(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilName

func (s *SpuUpdate) SetNotNilName(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilPicURL

func (s *SpuUpdate) SetNotNilPicURL(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilPrice

func (s *SpuUpdate) SetNotNilPrice(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilRecommendBenefit

func (s *SpuUpdate) SetNotNilRecommendBenefit(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilRecommendBest

func (s *SpuUpdate) SetNotNilRecommendBest(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilRecommendGood

func (s *SpuUpdate) SetNotNilRecommendGood(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilRecommendHot

func (s *SpuUpdate) SetNotNilRecommendHot(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilRecommendNew

func (s *SpuUpdate) SetNotNilRecommendNew(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilSalesCount

func (s *SpuUpdate) SetNotNilSalesCount(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilSliderPicUrls

func (s *SpuUpdate) SetNotNilSliderPicUrls(value *[]string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilSort

func (s *SpuUpdate) SetNotNilSort(value *uint32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilSpecType

func (s *SpuUpdate) SetNotNilSpecType(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilStatus

func (s *SpuUpdate) SetNotNilStatus(value *uint8) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilStock

func (s *SpuUpdate) SetNotNilStock(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilSubCommissionType

func (s *SpuUpdate) SetNotNilSubCommissionType(value *bool) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilUnit

func (s *SpuUpdate) SetNotNilUnit(value *uint8) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilUpdatedAt

func (s *SpuUpdate) SetNotNilUpdatedAt(value *time.Time) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilVideoURL

func (s *SpuUpdate) SetNotNilVideoURL(value *string) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetNotNilVirtualSalesCount

func (s *SpuUpdate) SetNotNilVirtualSalesCount(value *int32) *SpuUpdate

set field if value's pointer is not nil.

func (*SpuUpdate) SetPicURL

func (su *SpuUpdate) SetPicURL(s string) *SpuUpdate

SetPicURL sets the "pic_url" field.

func (*SpuUpdate) SetPrice

func (su *SpuUpdate) SetPrice(i int32) *SpuUpdate

SetPrice sets the "price" field.

func (*SpuUpdate) SetRecommendBenefit

func (su *SpuUpdate) SetRecommendBenefit(b bool) *SpuUpdate

SetRecommendBenefit sets the "recommend_benefit" field.

func (*SpuUpdate) SetRecommendBest

func (su *SpuUpdate) SetRecommendBest(b bool) *SpuUpdate

SetRecommendBest sets the "recommend_best" field.

func (*SpuUpdate) SetRecommendGood

func (su *SpuUpdate) SetRecommendGood(b bool) *SpuUpdate

SetRecommendGood sets the "recommend_good" field.

func (*SpuUpdate) SetRecommendHot

func (su *SpuUpdate) SetRecommendHot(b bool) *SpuUpdate

SetRecommendHot sets the "recommend_hot" field.

func (*SpuUpdate) SetRecommendNew

func (su *SpuUpdate) SetRecommendNew(b bool) *SpuUpdate

SetRecommendNew sets the "recommend_new" field.

func (*SpuUpdate) SetSalesCount

func (su *SpuUpdate) SetSalesCount(i int32) *SpuUpdate

SetSalesCount sets the "sales_count" field.

func (*SpuUpdate) SetSliderPicUrls

func (su *SpuUpdate) SetSliderPicUrls(s []string) *SpuUpdate

SetSliderPicUrls sets the "slider_pic_urls" field.

func (*SpuUpdate) SetSort

func (su *SpuUpdate) SetSort(u uint32) *SpuUpdate

SetSort sets the "sort" field.

func (*SpuUpdate) SetSpecType

func (su *SpuUpdate) SetSpecType(b bool) *SpuUpdate

SetSpecType sets the "spec_type" field.

func (*SpuUpdate) SetStatus

func (su *SpuUpdate) SetStatus(u uint8) *SpuUpdate

SetStatus sets the "status" field.

func (*SpuUpdate) SetStock

func (su *SpuUpdate) SetStock(i int32) *SpuUpdate

SetStock sets the "stock" field.

func (*SpuUpdate) SetSubCommissionType

func (su *SpuUpdate) SetSubCommissionType(b bool) *SpuUpdate

SetSubCommissionType sets the "sub_commission_type" field.

func (*SpuUpdate) SetUnit

func (su *SpuUpdate) SetUnit(u uint8) *SpuUpdate

SetUnit sets the "unit" field.

func (*SpuUpdate) SetUpdatedAt

func (su *SpuUpdate) SetUpdatedAt(t time.Time) *SpuUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SpuUpdate) SetVideoURL

func (su *SpuUpdate) SetVideoURL(s string) *SpuUpdate

SetVideoURL sets the "video_url" field.

func (*SpuUpdate) SetVirtualSalesCount

func (su *SpuUpdate) SetVirtualSalesCount(i int32) *SpuUpdate

SetVirtualSalesCount sets the "virtual_sales_count" field.

func (*SpuUpdate) Where

func (su *SpuUpdate) Where(ps ...predicate.Spu) *SpuUpdate

Where appends a list predicates to the SpuUpdate builder.

type SpuUpdateOne

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

SpuUpdateOne is the builder for updating a single Spu entity.

func (*SpuUpdateOne) AddBrowseCount

func (suo *SpuUpdateOne) AddBrowseCount(i int32) *SpuUpdateOne

AddBrowseCount adds i to the "browse_count" field.

func (*SpuUpdateOne) AddCostPrice

func (suo *SpuUpdateOne) AddCostPrice(i int32) *SpuUpdateOne

AddCostPrice adds i to the "cost_price" field.

func (*SpuUpdateOne) AddDeliveryTemplateID

func (suo *SpuUpdateOne) AddDeliveryTemplateID(u int64) *SpuUpdateOne

AddDeliveryTemplateID adds u to the "deliveryTemplate_id" field.

func (*SpuUpdateOne) AddGiveIntegral

func (suo *SpuUpdateOne) AddGiveIntegral(i int32) *SpuUpdateOne

AddGiveIntegral adds i to the "give_integral" field.

func (*SpuUpdateOne) AddMarketPrice

func (suo *SpuUpdateOne) AddMarketPrice(i int32) *SpuUpdateOne

AddMarketPrice adds i to the "market_price" field.

func (*SpuUpdateOne) AddPrice

func (suo *SpuUpdateOne) AddPrice(i int32) *SpuUpdateOne

AddPrice adds i to the "price" field.

func (*SpuUpdateOne) AddSalesCount

func (suo *SpuUpdateOne) AddSalesCount(i int32) *SpuUpdateOne

AddSalesCount adds i to the "sales_count" field.

func (*SpuUpdateOne) AddSkuIDs

func (suo *SpuUpdateOne) AddSkuIDs(ids ...uint64) *SpuUpdateOne

AddSkuIDs adds the "skus" edge to the Sku entity by IDs.

func (*SpuUpdateOne) AddSkus

func (suo *SpuUpdateOne) AddSkus(s ...*Sku) *SpuUpdateOne

AddSkus adds the "skus" edges to the Sku entity.

func (*SpuUpdateOne) AddSort

func (suo *SpuUpdateOne) AddSort(u int32) *SpuUpdateOne

AddSort adds u to the "sort" field.

func (*SpuUpdateOne) AddStatus

func (suo *SpuUpdateOne) AddStatus(u int8) *SpuUpdateOne

AddStatus adds u to the "status" field.

func (*SpuUpdateOne) AddStock

func (suo *SpuUpdateOne) AddStock(i int32) *SpuUpdateOne

AddStock adds i to the "stock" field.

func (*SpuUpdateOne) AddUnit

func (suo *SpuUpdateOne) AddUnit(u int8) *SpuUpdateOne

AddUnit adds u to the "unit" field.

func (*SpuUpdateOne) AddVirtualSalesCount

func (suo *SpuUpdateOne) AddVirtualSalesCount(i int32) *SpuUpdateOne

AddVirtualSalesCount adds i to the "virtual_sales_count" field.

func (*SpuUpdateOne) AppendActivityOrders

func (suo *SpuUpdateOne) AppendActivityOrders(i []int32) *SpuUpdateOne

AppendActivityOrders appends i to the "activity_orders" field.

func (*SpuUpdateOne) AppendGiveCouponTemplateIds

func (suo *SpuUpdateOne) AppendGiveCouponTemplateIds(u []uint64) *SpuUpdateOne

AppendGiveCouponTemplateIds appends u to the "give_coupon_template_ids" field.

func (*SpuUpdateOne) AppendSliderPicUrls

func (suo *SpuUpdateOne) AppendSliderPicUrls(s []string) *SpuUpdateOne

AppendSliderPicUrls appends s to the "slider_pic_urls" field.

func (*SpuUpdateOne) ClearActivityOrders

func (suo *SpuUpdateOne) ClearActivityOrders() *SpuUpdateOne

ClearActivityOrders clears the value of the "activity_orders" field.

func (*SpuUpdateOne) ClearBarCode

func (suo *SpuUpdateOne) ClearBarCode() *SpuUpdateOne

ClearBarCode clears the value of the "bar_code" field.

func (*SpuUpdateOne) ClearBrandID

func (suo *SpuUpdateOne) ClearBrandID() *SpuUpdateOne

ClearBrandID clears the value of the "brand_id" field.

func (*SpuUpdateOne) ClearBrands

func (suo *SpuUpdateOne) ClearBrands() *SpuUpdateOne

ClearBrands clears the "brands" edge to the Brand entity.

func (*SpuUpdateOne) ClearBrowseCount

func (suo *SpuUpdateOne) ClearBrowseCount() *SpuUpdateOne

ClearBrowseCount clears the value of the "browse_count" field.

func (*SpuUpdateOne) ClearCategoryID

func (suo *SpuUpdateOne) ClearCategoryID() *SpuUpdateOne

ClearCategoryID clears the value of the "category_id" field.

func (*SpuUpdateOne) ClearCategorys

func (suo *SpuUpdateOne) ClearCategorys() *SpuUpdateOne

ClearCategorys clears the "categorys" edge to the Category entity.

func (*SpuUpdateOne) ClearDeletedAt

func (suo *SpuUpdateOne) ClearDeletedAt() *SpuUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*SpuUpdateOne) ClearDeliveryTemplateID

func (suo *SpuUpdateOne) ClearDeliveryTemplateID() *SpuUpdateOne

ClearDeliveryTemplateID clears the value of the "deliveryTemplate_id" field.

func (*SpuUpdateOne) ClearDescription

func (suo *SpuUpdateOne) ClearDescription() *SpuUpdateOne

ClearDescription clears the value of the "description" field.

func (*SpuUpdateOne) ClearGiveCouponTemplateIds

func (suo *SpuUpdateOne) ClearGiveCouponTemplateIds() *SpuUpdateOne

ClearGiveCouponTemplateIds clears the value of the "give_coupon_template_ids" field.

func (*SpuUpdateOne) ClearGiveIntegral

func (suo *SpuUpdateOne) ClearGiveIntegral() *SpuUpdateOne

ClearGiveIntegral clears the value of the "give_integral" field.

func (*SpuUpdateOne) ClearIntroduction

func (suo *SpuUpdateOne) ClearIntroduction() *SpuUpdateOne

ClearIntroduction clears the value of the "introduction" field.

func (*SpuUpdateOne) ClearKeyword

func (suo *SpuUpdateOne) ClearKeyword() *SpuUpdateOne

ClearKeyword clears the value of the "keyword" field.

func (*SpuUpdateOne) ClearMarketPrice

func (suo *SpuUpdateOne) ClearMarketPrice() *SpuUpdateOne

ClearMarketPrice clears the value of the "market_price" field.

func (*SpuUpdateOne) ClearRecommendBenefit

func (suo *SpuUpdateOne) ClearRecommendBenefit() *SpuUpdateOne

ClearRecommendBenefit clears the value of the "recommend_benefit" field.

func (*SpuUpdateOne) ClearRecommendBest

func (suo *SpuUpdateOne) ClearRecommendBest() *SpuUpdateOne

ClearRecommendBest clears the value of the "recommend_best" field.

func (*SpuUpdateOne) ClearRecommendGood

func (suo *SpuUpdateOne) ClearRecommendGood() *SpuUpdateOne

ClearRecommendGood clears the value of the "recommend_good" field.

func (*SpuUpdateOne) ClearRecommendHot

func (suo *SpuUpdateOne) ClearRecommendHot() *SpuUpdateOne

ClearRecommendHot clears the value of the "recommend_hot" field.

func (*SpuUpdateOne) ClearRecommendNew

func (suo *SpuUpdateOne) ClearRecommendNew() *SpuUpdateOne

ClearRecommendNew clears the value of the "recommend_new" field.

func (*SpuUpdateOne) ClearSalesCount

func (suo *SpuUpdateOne) ClearSalesCount() *SpuUpdateOne

ClearSalesCount clears the value of the "sales_count" field.

func (*SpuUpdateOne) ClearSkus

func (suo *SpuUpdateOne) ClearSkus() *SpuUpdateOne

ClearSkus clears all "skus" edges to the Sku entity.

func (*SpuUpdateOne) ClearSliderPicUrls

func (suo *SpuUpdateOne) ClearSliderPicUrls() *SpuUpdateOne

ClearSliderPicUrls clears the value of the "slider_pic_urls" field.

func (*SpuUpdateOne) ClearSpecType

func (suo *SpuUpdateOne) ClearSpecType() *SpuUpdateOne

ClearSpecType clears the value of the "spec_type" field.

func (*SpuUpdateOne) ClearStatus

func (suo *SpuUpdateOne) ClearStatus() *SpuUpdateOne

ClearStatus clears the value of the "status" field.

func (*SpuUpdateOne) ClearSubCommissionType

func (suo *SpuUpdateOne) ClearSubCommissionType() *SpuUpdateOne

ClearSubCommissionType clears the value of the "sub_commission_type" field.

func (*SpuUpdateOne) ClearVideoURL

func (suo *SpuUpdateOne) ClearVideoURL() *SpuUpdateOne

ClearVideoURL clears the value of the "video_url" field.

func (*SpuUpdateOne) ClearVirtualSalesCount

func (suo *SpuUpdateOne) ClearVirtualSalesCount() *SpuUpdateOne

ClearVirtualSalesCount clears the value of the "virtual_sales_count" field.

func (*SpuUpdateOne) Exec

func (suo *SpuUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SpuUpdateOne) ExecX

func (suo *SpuUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SpuUpdateOne) Mutation

func (suo *SpuUpdateOne) Mutation() *SpuMutation

Mutation returns the SpuMutation object of the builder.

func (*SpuUpdateOne) RemoveSkuIDs

func (suo *SpuUpdateOne) RemoveSkuIDs(ids ...uint64) *SpuUpdateOne

RemoveSkuIDs removes the "skus" edge to Sku entities by IDs.

func (*SpuUpdateOne) RemoveSkus

func (suo *SpuUpdateOne) RemoveSkus(s ...*Sku) *SpuUpdateOne

RemoveSkus removes "skus" edges to Sku entities.

func (*SpuUpdateOne) Save

func (suo *SpuUpdateOne) Save(ctx context.Context) (*Spu, error)

Save executes the query and returns the updated Spu entity.

func (*SpuUpdateOne) SaveX

func (suo *SpuUpdateOne) SaveX(ctx context.Context) *Spu

SaveX is like Save, but panics if an error occurs.

func (*SpuUpdateOne) Select

func (suo *SpuUpdateOne) Select(field string, fields ...string) *SpuUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SpuUpdateOne) SetActivityOrders

func (suo *SpuUpdateOne) SetActivityOrders(i []int32) *SpuUpdateOne

SetActivityOrders sets the "activity_orders" field.

func (*SpuUpdateOne) SetBarCode

func (suo *SpuUpdateOne) SetBarCode(s string) *SpuUpdateOne

SetBarCode sets the "bar_code" field.

func (*SpuUpdateOne) SetBrandID

func (suo *SpuUpdateOne) SetBrandID(u uint64) *SpuUpdateOne

SetBrandID sets the "brand_id" field.

func (*SpuUpdateOne) SetBrands

func (suo *SpuUpdateOne) SetBrands(b *Brand) *SpuUpdateOne

SetBrands sets the "brands" edge to the Brand entity.

func (*SpuUpdateOne) SetBrandsID

func (suo *SpuUpdateOne) SetBrandsID(id uint64) *SpuUpdateOne

SetBrandsID sets the "brands" edge to the Brand entity by ID.

func (*SpuUpdateOne) SetBrowseCount

func (suo *SpuUpdateOne) SetBrowseCount(i int32) *SpuUpdateOne

SetBrowseCount sets the "browse_count" field.

func (*SpuUpdateOne) SetCategoryID

func (suo *SpuUpdateOne) SetCategoryID(u uint64) *SpuUpdateOne

SetCategoryID sets the "category_id" field.

func (*SpuUpdateOne) SetCategorys

func (suo *SpuUpdateOne) SetCategorys(c *Category) *SpuUpdateOne

SetCategorys sets the "categorys" edge to the Category entity.

func (*SpuUpdateOne) SetCategorysID

func (suo *SpuUpdateOne) SetCategorysID(id uint64) *SpuUpdateOne

SetCategorysID sets the "categorys" edge to the Category entity by ID.

func (*SpuUpdateOne) SetCostPrice

func (suo *SpuUpdateOne) SetCostPrice(i int32) *SpuUpdateOne

SetCostPrice sets the "cost_price" field.

func (*SpuUpdateOne) SetDeletedAt

func (suo *SpuUpdateOne) SetDeletedAt(t time.Time) *SpuUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*SpuUpdateOne) SetDeliveryTemplateID

func (suo *SpuUpdateOne) SetDeliveryTemplateID(u uint64) *SpuUpdateOne

SetDeliveryTemplateID sets the "deliveryTemplate_id" field.

func (*SpuUpdateOne) SetDescription

func (suo *SpuUpdateOne) SetDescription(s string) *SpuUpdateOne

SetDescription sets the "description" field.

func (*SpuUpdateOne) SetGiveCouponTemplateIds

func (suo *SpuUpdateOne) SetGiveCouponTemplateIds(u []uint64) *SpuUpdateOne

SetGiveCouponTemplateIds sets the "give_coupon_template_ids" field.

func (*SpuUpdateOne) SetGiveIntegral

func (suo *SpuUpdateOne) SetGiveIntegral(i int32) *SpuUpdateOne

SetGiveIntegral sets the "give_integral" field.

func (*SpuUpdateOne) SetIntroduction

func (suo *SpuUpdateOne) SetIntroduction(s string) *SpuUpdateOne

SetIntroduction sets the "introduction" field.

func (*SpuUpdateOne) SetKeyword

func (suo *SpuUpdateOne) SetKeyword(s string) *SpuUpdateOne

SetKeyword sets the "keyword" field.

func (*SpuUpdateOne) SetMarketPrice

func (suo *SpuUpdateOne) SetMarketPrice(i int32) *SpuUpdateOne

SetMarketPrice sets the "market_price" field.

func (*SpuUpdateOne) SetName

func (suo *SpuUpdateOne) SetName(s string) *SpuUpdateOne

SetName sets the "name" field.

func (*SpuUpdateOne) SetNillableBarCode

func (suo *SpuUpdateOne) SetNillableBarCode(s *string) *SpuUpdateOne

SetNillableBarCode sets the "bar_code" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableBrandID

func (suo *SpuUpdateOne) SetNillableBrandID(u *uint64) *SpuUpdateOne

SetNillableBrandID sets the "brand_id" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableBrandsID

func (suo *SpuUpdateOne) SetNillableBrandsID(id *uint64) *SpuUpdateOne

SetNillableBrandsID sets the "brands" edge to the Brand entity by ID if the given value is not nil.

func (*SpuUpdateOne) SetNillableBrowseCount

func (suo *SpuUpdateOne) SetNillableBrowseCount(i *int32) *SpuUpdateOne

SetNillableBrowseCount sets the "browse_count" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableCategoryID

func (suo *SpuUpdateOne) SetNillableCategoryID(u *uint64) *SpuUpdateOne

SetNillableCategoryID sets the "category_id" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableCategorysID

func (suo *SpuUpdateOne) SetNillableCategorysID(id *uint64) *SpuUpdateOne

SetNillableCategorysID sets the "categorys" edge to the Category entity by ID if the given value is not nil.

func (*SpuUpdateOne) SetNillableDeletedAt

func (suo *SpuUpdateOne) SetNillableDeletedAt(t *time.Time) *SpuUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableDeliveryTemplateID

func (suo *SpuUpdateOne) SetNillableDeliveryTemplateID(u *uint64) *SpuUpdateOne

SetNillableDeliveryTemplateID sets the "deliveryTemplate_id" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableDescription

func (suo *SpuUpdateOne) SetNillableDescription(s *string) *SpuUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableGiveIntegral

func (suo *SpuUpdateOne) SetNillableGiveIntegral(i *int32) *SpuUpdateOne

SetNillableGiveIntegral sets the "give_integral" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableIntroduction

func (suo *SpuUpdateOne) SetNillableIntroduction(s *string) *SpuUpdateOne

SetNillableIntroduction sets the "introduction" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableKeyword

func (suo *SpuUpdateOne) SetNillableKeyword(s *string) *SpuUpdateOne

SetNillableKeyword sets the "keyword" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableMarketPrice

func (suo *SpuUpdateOne) SetNillableMarketPrice(i *int32) *SpuUpdateOne

SetNillableMarketPrice sets the "market_price" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableRecommendBenefit

func (suo *SpuUpdateOne) SetNillableRecommendBenefit(b *bool) *SpuUpdateOne

SetNillableRecommendBenefit sets the "recommend_benefit" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableRecommendBest

func (suo *SpuUpdateOne) SetNillableRecommendBest(b *bool) *SpuUpdateOne

SetNillableRecommendBest sets the "recommend_best" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableRecommendGood

func (suo *SpuUpdateOne) SetNillableRecommendGood(b *bool) *SpuUpdateOne

SetNillableRecommendGood sets the "recommend_good" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableRecommendHot

func (suo *SpuUpdateOne) SetNillableRecommendHot(b *bool) *SpuUpdateOne

SetNillableRecommendHot sets the "recommend_hot" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableRecommendNew

func (suo *SpuUpdateOne) SetNillableRecommendNew(b *bool) *SpuUpdateOne

SetNillableRecommendNew sets the "recommend_new" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableSalesCount

func (suo *SpuUpdateOne) SetNillableSalesCount(i *int32) *SpuUpdateOne

SetNillableSalesCount sets the "sales_count" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableSort

func (suo *SpuUpdateOne) SetNillableSort(u *uint32) *SpuUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableSpecType

func (suo *SpuUpdateOne) SetNillableSpecType(b *bool) *SpuUpdateOne

SetNillableSpecType sets the "spec_type" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableStatus

func (suo *SpuUpdateOne) SetNillableStatus(u *uint8) *SpuUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableSubCommissionType

func (suo *SpuUpdateOne) SetNillableSubCommissionType(b *bool) *SpuUpdateOne

SetNillableSubCommissionType sets the "sub_commission_type" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableVideoURL

func (suo *SpuUpdateOne) SetNillableVideoURL(s *string) *SpuUpdateOne

SetNillableVideoURL sets the "video_url" field if the given value is not nil.

func (*SpuUpdateOne) SetNillableVirtualSalesCount

func (suo *SpuUpdateOne) SetNillableVirtualSalesCount(i *int32) *SpuUpdateOne

SetNillableVirtualSalesCount sets the "virtual_sales_count" field if the given value is not nil.

func (*SpuUpdateOne) SetNotNilActivityOrders

func (s *SpuUpdateOne) SetNotNilActivityOrders(value *[]int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilBarCode

func (s *SpuUpdateOne) SetNotNilBarCode(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilBrandID

func (s *SpuUpdateOne) SetNotNilBrandID(value *uint64) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilBrowseCount

func (s *SpuUpdateOne) SetNotNilBrowseCount(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilCategoryID

func (s *SpuUpdateOne) SetNotNilCategoryID(value *uint64) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilCostPrice

func (s *SpuUpdateOne) SetNotNilCostPrice(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilDeletedAt

func (s *SpuUpdateOne) SetNotNilDeletedAt(value *time.Time) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilDeliveryTemplateID

func (s *SpuUpdateOne) SetNotNilDeliveryTemplateID(value *uint64) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilDescription

func (s *SpuUpdateOne) SetNotNilDescription(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilGiveCouponTemplateIds

func (s *SpuUpdateOne) SetNotNilGiveCouponTemplateIds(value *[]uint64) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilGiveIntegral

func (s *SpuUpdateOne) SetNotNilGiveIntegral(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilIntroduction

func (s *SpuUpdateOne) SetNotNilIntroduction(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilKeyword

func (s *SpuUpdateOne) SetNotNilKeyword(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilMarketPrice

func (s *SpuUpdateOne) SetNotNilMarketPrice(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilName

func (s *SpuUpdateOne) SetNotNilName(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilPicURL

func (s *SpuUpdateOne) SetNotNilPicURL(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilPrice

func (s *SpuUpdateOne) SetNotNilPrice(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilRecommendBenefit

func (s *SpuUpdateOne) SetNotNilRecommendBenefit(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilRecommendBest

func (s *SpuUpdateOne) SetNotNilRecommendBest(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilRecommendGood

func (s *SpuUpdateOne) SetNotNilRecommendGood(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilRecommendHot

func (s *SpuUpdateOne) SetNotNilRecommendHot(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilRecommendNew

func (s *SpuUpdateOne) SetNotNilRecommendNew(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilSalesCount

func (s *SpuUpdateOne) SetNotNilSalesCount(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilSliderPicUrls

func (s *SpuUpdateOne) SetNotNilSliderPicUrls(value *[]string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilSort

func (s *SpuUpdateOne) SetNotNilSort(value *uint32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilSpecType

func (s *SpuUpdateOne) SetNotNilSpecType(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilStatus

func (s *SpuUpdateOne) SetNotNilStatus(value *uint8) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilStock

func (s *SpuUpdateOne) SetNotNilStock(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilSubCommissionType

func (s *SpuUpdateOne) SetNotNilSubCommissionType(value *bool) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilUnit

func (s *SpuUpdateOne) SetNotNilUnit(value *uint8) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilUpdatedAt

func (s *SpuUpdateOne) SetNotNilUpdatedAt(value *time.Time) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilVideoURL

func (s *SpuUpdateOne) SetNotNilVideoURL(value *string) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetNotNilVirtualSalesCount

func (s *SpuUpdateOne) SetNotNilVirtualSalesCount(value *int32) *SpuUpdateOne

set field if value's pointer is not nil.

func (*SpuUpdateOne) SetPicURL

func (suo *SpuUpdateOne) SetPicURL(s string) *SpuUpdateOne

SetPicURL sets the "pic_url" field.

func (*SpuUpdateOne) SetPrice

func (suo *SpuUpdateOne) SetPrice(i int32) *SpuUpdateOne

SetPrice sets the "price" field.

func (*SpuUpdateOne) SetRecommendBenefit

func (suo *SpuUpdateOne) SetRecommendBenefit(b bool) *SpuUpdateOne

SetRecommendBenefit sets the "recommend_benefit" field.

func (*SpuUpdateOne) SetRecommendBest

func (suo *SpuUpdateOne) SetRecommendBest(b bool) *SpuUpdateOne

SetRecommendBest sets the "recommend_best" field.

func (*SpuUpdateOne) SetRecommendGood

func (suo *SpuUpdateOne) SetRecommendGood(b bool) *SpuUpdateOne

SetRecommendGood sets the "recommend_good" field.

func (*SpuUpdateOne) SetRecommendHot

func (suo *SpuUpdateOne) SetRecommendHot(b bool) *SpuUpdateOne

SetRecommendHot sets the "recommend_hot" field.

func (*SpuUpdateOne) SetRecommendNew

func (suo *SpuUpdateOne) SetRecommendNew(b bool) *SpuUpdateOne

SetRecommendNew sets the "recommend_new" field.

func (*SpuUpdateOne) SetSalesCount

func (suo *SpuUpdateOne) SetSalesCount(i int32) *SpuUpdateOne

SetSalesCount sets the "sales_count" field.

func (*SpuUpdateOne) SetSliderPicUrls

func (suo *SpuUpdateOne) SetSliderPicUrls(s []string) *SpuUpdateOne

SetSliderPicUrls sets the "slider_pic_urls" field.

func (*SpuUpdateOne) SetSort

func (suo *SpuUpdateOne) SetSort(u uint32) *SpuUpdateOne

SetSort sets the "sort" field.

func (*SpuUpdateOne) SetSpecType

func (suo *SpuUpdateOne) SetSpecType(b bool) *SpuUpdateOne

SetSpecType sets the "spec_type" field.

func (*SpuUpdateOne) SetStatus

func (suo *SpuUpdateOne) SetStatus(u uint8) *SpuUpdateOne

SetStatus sets the "status" field.

func (*SpuUpdateOne) SetStock

func (suo *SpuUpdateOne) SetStock(i int32) *SpuUpdateOne

SetStock sets the "stock" field.

func (*SpuUpdateOne) SetSubCommissionType

func (suo *SpuUpdateOne) SetSubCommissionType(b bool) *SpuUpdateOne

SetSubCommissionType sets the "sub_commission_type" field.

func (*SpuUpdateOne) SetUnit

func (suo *SpuUpdateOne) SetUnit(u uint8) *SpuUpdateOne

SetUnit sets the "unit" field.

func (*SpuUpdateOne) SetUpdatedAt

func (suo *SpuUpdateOne) SetUpdatedAt(t time.Time) *SpuUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SpuUpdateOne) SetVideoURL

func (suo *SpuUpdateOne) SetVideoURL(s string) *SpuUpdateOne

SetVideoURL sets the "video_url" field.

func (*SpuUpdateOne) SetVirtualSalesCount

func (suo *SpuUpdateOne) SetVirtualSalesCount(i int32) *SpuUpdateOne

SetVirtualSalesCount sets the "virtual_sales_count" field.

func (*SpuUpdateOne) Where

func (suo *SpuUpdateOne) Where(ps ...predicate.Spu) *SpuUpdateOne

Where appends a list predicates to the SpuUpdate builder.

type Spus

type Spus []*Spu

Spus is a parsable slice of Spu.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Brand is the client for interacting with the Brand builders.
	Brand *BrandClient
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Property is the client for interacting with the Property builders.
	Property *PropertyClient
	// PropertyValue is the client for interacting with the PropertyValue builders.
	PropertyValue *PropertyValueClient
	// Sku is the client for interacting with the Sku builders.
	Sku *SkuClient
	// Spu is the client for interacting with the Spu builders.
	Spu *SpuClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

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