|
@@ -0,0 +1,1437 @@
|
|
|
+// Code generated by ent, DO NOT EDIT.
|
|
|
+
|
|
|
+package ent
|
|
|
+
|
|
|
+import (
|
|
|
+ "context"
|
|
|
+ "errors"
|
|
|
+ "fmt"
|
|
|
+ "wechat-api/ent/addwechatfriendlog"
|
|
|
+
|
|
|
+ "entgo.io/ent/dialect/sql"
|
|
|
+ "entgo.io/ent/dialect/sql/sqlgraph"
|
|
|
+ "entgo.io/ent/schema/field"
|
|
|
+)
|
|
|
+
|
|
|
+// AddWechatFriendLogCreate is the builder for creating a AddWechatFriendLog entity.
|
|
|
+type AddWechatFriendLogCreate struct {
|
|
|
+ config
|
|
|
+ mutation *AddWechatFriendLogMutation
|
|
|
+ hooks []Hook
|
|
|
+ conflict []sql.ConflictOption
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxID sets the "owner_wx_id" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetOwnerWxID(s string) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetOwnerWxID(s)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableOwnerWxID sets the "owner_wx_id" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableOwnerWxID(s *string) *AddWechatFriendLogCreate {
|
|
|
+ if s != nil {
|
|
|
+ awflc.SetOwnerWxID(*s)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxType sets the "owner_wx_type" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetOwnerWxType(i int) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetOwnerWxType(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableOwnerWxType sets the "owner_wx_type" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableOwnerWxType(i *int) *AddWechatFriendLogCreate {
|
|
|
+ if i != nil {
|
|
|
+ awflc.SetOwnerWxType(*i)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindContent sets the "find_content" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetFindContent(s string) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetFindContent(s)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableFindContent sets the "find_content" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableFindContent(s *string) *AddWechatFriendLogCreate {
|
|
|
+ if s != nil {
|
|
|
+ awflc.SetFindContent(*s)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetMessage sets the "message" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetMessage(s string) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetMessage(s)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableMessage sets the "message" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableMessage(s *string) *AddWechatFriendLogCreate {
|
|
|
+ if s != nil {
|
|
|
+ awflc.SetMessage(*s)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindRequest sets the "find_request" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetFindRequest(m map[string]interface{}) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetFindRequest(m)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindResult sets the "find_result" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetFindResult(m map[string]interface{}) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetFindResult(m)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetIsCanAdd sets the "is_can_add" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetIsCanAdd(i int) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetIsCanAdd(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableIsCanAdd sets the "is_can_add" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableIsCanAdd(i *int) *AddWechatFriendLogCreate {
|
|
|
+ if i != nil {
|
|
|
+ awflc.SetIsCanAdd(*i)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskCount sets the "task_count" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetTaskCount(i int) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetTaskCount(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableTaskCount sets the "task_count" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableTaskCount(i *int) *AddWechatFriendLogCreate {
|
|
|
+ if i != nil {
|
|
|
+ awflc.SetTaskCount(*i)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskID sets the "task_id" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetTaskID(i int64) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetTaskID(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableTaskID sets the "task_id" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableTaskID(i *int64) *AddWechatFriendLogCreate {
|
|
|
+ if i != nil {
|
|
|
+ awflc.SetTaskID(*i)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddRequest sets the "add_request" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetAddRequest(m map[string]interface{}) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetAddRequest(m)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddResult sets the "add_result" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetAddResult(m map[string]interface{}) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetAddResult(m)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetCreatedAt sets the "created_at" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetCreatedAt(i int64) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetCreatedAt(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableCreatedAt(i *int64) *AddWechatFriendLogCreate {
|
|
|
+ if i != nil {
|
|
|
+ awflc.SetCreatedAt(*i)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetUpdatedAt sets the "updated_at" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetUpdatedAt(i int64) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetUpdatedAt(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetNillableUpdatedAt(i *int64) *AddWechatFriendLogCreate {
|
|
|
+ if i != nil {
|
|
|
+ awflc.SetUpdatedAt(*i)
|
|
|
+ }
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// SetID sets the "id" field.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SetID(i int64) *AddWechatFriendLogCreate {
|
|
|
+ awflc.mutation.SetID(i)
|
|
|
+ return awflc
|
|
|
+}
|
|
|
+
|
|
|
+// Mutation returns the AddWechatFriendLogMutation object of the builder.
|
|
|
+func (awflc *AddWechatFriendLogCreate) Mutation() *AddWechatFriendLogMutation {
|
|
|
+ return awflc.mutation
|
|
|
+}
|
|
|
+
|
|
|
+// Save creates the AddWechatFriendLog in the database.
|
|
|
+func (awflc *AddWechatFriendLogCreate) Save(ctx context.Context) (*AddWechatFriendLog, error) {
|
|
|
+ awflc.defaults()
|
|
|
+ return withHooks(ctx, awflc.sqlSave, awflc.mutation, awflc.hooks)
|
|
|
+}
|
|
|
+
|
|
|
+// SaveX calls Save and panics if Save returns an error.
|
|
|
+func (awflc *AddWechatFriendLogCreate) SaveX(ctx context.Context) *AddWechatFriendLog {
|
|
|
+ v, err := awflc.Save(ctx)
|
|
|
+ if err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+ return v
|
|
|
+}
|
|
|
+
|
|
|
+// Exec executes the query.
|
|
|
+func (awflc *AddWechatFriendLogCreate) Exec(ctx context.Context) error {
|
|
|
+ _, err := awflc.Save(ctx)
|
|
|
+ return err
|
|
|
+}
|
|
|
+
|
|
|
+// ExecX is like Exec, but panics if an error occurs.
|
|
|
+func (awflc *AddWechatFriendLogCreate) ExecX(ctx context.Context) {
|
|
|
+ if err := awflc.Exec(ctx); err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// defaults sets the default values of the builder before save.
|
|
|
+func (awflc *AddWechatFriendLogCreate) defaults() {
|
|
|
+ if _, ok := awflc.mutation.OwnerWxID(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultOwnerWxID
|
|
|
+ awflc.mutation.SetOwnerWxID(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.OwnerWxType(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultOwnerWxType
|
|
|
+ awflc.mutation.SetOwnerWxType(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.FindContent(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultFindContent
|
|
|
+ awflc.mutation.SetFindContent(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.Message(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultMessage
|
|
|
+ awflc.mutation.SetMessage(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.IsCanAdd(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultIsCanAdd
|
|
|
+ awflc.mutation.SetIsCanAdd(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.TaskCount(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultTaskCount
|
|
|
+ awflc.mutation.SetTaskCount(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.TaskID(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultTaskID
|
|
|
+ awflc.mutation.SetTaskID(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.CreatedAt(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultCreatedAt()
|
|
|
+ awflc.mutation.SetCreatedAt(v)
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.UpdatedAt(); !ok {
|
|
|
+ v := addwechatfriendlog.DefaultUpdatedAt()
|
|
|
+ awflc.mutation.SetUpdatedAt(v)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// check runs all checks and user-defined validators on the builder.
|
|
|
+func (awflc *AddWechatFriendLogCreate) check() error {
|
|
|
+ if _, ok := awflc.mutation.OwnerWxID(); !ok {
|
|
|
+ return &ValidationError{Name: "owner_wx_id", err: errors.New(`ent: missing required field "AddWechatFriendLog.owner_wx_id"`)}
|
|
|
+ }
|
|
|
+ if v, ok := awflc.mutation.OwnerWxID(); ok {
|
|
|
+ if err := addwechatfriendlog.OwnerWxIDValidator(v); err != nil {
|
|
|
+ return &ValidationError{Name: "owner_wx_id", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.owner_wx_id": %w`, err)}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.OwnerWxType(); !ok {
|
|
|
+ return &ValidationError{Name: "owner_wx_type", err: errors.New(`ent: missing required field "AddWechatFriendLog.owner_wx_type"`)}
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.FindContent(); !ok {
|
|
|
+ return &ValidationError{Name: "find_content", err: errors.New(`ent: missing required field "AddWechatFriendLog.find_content"`)}
|
|
|
+ }
|
|
|
+ if v, ok := awflc.mutation.FindContent(); ok {
|
|
|
+ if err := addwechatfriendlog.FindContentValidator(v); err != nil {
|
|
|
+ return &ValidationError{Name: "find_content", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.find_content": %w`, err)}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.Message(); !ok {
|
|
|
+ return &ValidationError{Name: "message", err: errors.New(`ent: missing required field "AddWechatFriendLog.message"`)}
|
|
|
+ }
|
|
|
+ if v, ok := awflc.mutation.Message(); ok {
|
|
|
+ if err := addwechatfriendlog.MessageValidator(v); err != nil {
|
|
|
+ return &ValidationError{Name: "message", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.message": %w`, err)}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.IsCanAdd(); !ok {
|
|
|
+ return &ValidationError{Name: "is_can_add", err: errors.New(`ent: missing required field "AddWechatFriendLog.is_can_add"`)}
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.TaskCount(); !ok {
|
|
|
+ return &ValidationError{Name: "task_count", err: errors.New(`ent: missing required field "AddWechatFriendLog.task_count"`)}
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.TaskID(); !ok {
|
|
|
+ return &ValidationError{Name: "task_id", err: errors.New(`ent: missing required field "AddWechatFriendLog.task_id"`)}
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.CreatedAt(); !ok {
|
|
|
+ return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "AddWechatFriendLog.created_at"`)}
|
|
|
+ }
|
|
|
+ if _, ok := awflc.mutation.UpdatedAt(); !ok {
|
|
|
+ return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "AddWechatFriendLog.updated_at"`)}
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+func (awflc *AddWechatFriendLogCreate) sqlSave(ctx context.Context) (*AddWechatFriendLog, error) {
|
|
|
+ if err := awflc.check(); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ _node, _spec := awflc.createSpec()
|
|
|
+ if err := sqlgraph.CreateNode(ctx, awflc.driver, _spec); err != nil {
|
|
|
+ if sqlgraph.IsConstraintError(err) {
|
|
|
+ err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
|
+ }
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if _spec.ID.Value != _node.ID {
|
|
|
+ id := _spec.ID.Value.(int64)
|
|
|
+ _node.ID = int64(id)
|
|
|
+ }
|
|
|
+ awflc.mutation.id = &_node.ID
|
|
|
+ awflc.mutation.done = true
|
|
|
+ return _node, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (awflc *AddWechatFriendLogCreate) createSpec() (*AddWechatFriendLog, *sqlgraph.CreateSpec) {
|
|
|
+ var (
|
|
|
+ _node = &AddWechatFriendLog{config: awflc.config}
|
|
|
+ _spec = sqlgraph.NewCreateSpec(addwechatfriendlog.Table, sqlgraph.NewFieldSpec(addwechatfriendlog.FieldID, field.TypeInt64))
|
|
|
+ )
|
|
|
+ _spec.OnConflict = awflc.conflict
|
|
|
+ if id, ok := awflc.mutation.ID(); ok {
|
|
|
+ _node.ID = id
|
|
|
+ _spec.ID.Value = id
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.OwnerWxID(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldOwnerWxID, field.TypeString, value)
|
|
|
+ _node.OwnerWxID = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.OwnerWxType(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldOwnerWxType, field.TypeInt, value)
|
|
|
+ _node.OwnerWxType = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.FindContent(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldFindContent, field.TypeString, value)
|
|
|
+ _node.FindContent = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.Message(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldMessage, field.TypeString, value)
|
|
|
+ _node.Message = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.FindRequest(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldFindRequest, field.TypeJSON, value)
|
|
|
+ _node.FindRequest = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.FindResult(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldFindResult, field.TypeJSON, value)
|
|
|
+ _node.FindResult = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.IsCanAdd(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldIsCanAdd, field.TypeInt, value)
|
|
|
+ _node.IsCanAdd = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.TaskCount(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldTaskCount, field.TypeInt, value)
|
|
|
+ _node.TaskCount = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.TaskID(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldTaskID, field.TypeInt64, value)
|
|
|
+ _node.TaskID = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.AddRequest(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldAddRequest, field.TypeJSON, value)
|
|
|
+ _node.AddRequest = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.AddResult(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldAddResult, field.TypeJSON, value)
|
|
|
+ _node.AddResult = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.CreatedAt(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldCreatedAt, field.TypeInt64, value)
|
|
|
+ _node.CreatedAt = value
|
|
|
+ }
|
|
|
+ if value, ok := awflc.mutation.UpdatedAt(); ok {
|
|
|
+ _spec.SetField(addwechatfriendlog.FieldUpdatedAt, field.TypeInt64, value)
|
|
|
+ _node.UpdatedAt = value
|
|
|
+ }
|
|
|
+ return _node, _spec
|
|
|
+}
|
|
|
+
|
|
|
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
|
|
|
+// of the `INSERT` statement. For example:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// SetOwnerWxID(v).
|
|
|
+// OnConflict(
|
|
|
+// // Update the row with the new values
|
|
|
+// // the was proposed for insertion.
|
|
|
+// sql.ResolveWithNewValues(),
|
|
|
+// ).
|
|
|
+// // Override some of the fields with custom
|
|
|
+// // update values.
|
|
|
+// Update(func(u *ent.AddWechatFriendLogUpsert) {
|
|
|
+// SetOwnerWxID(v+v).
|
|
|
+// }).
|
|
|
+// Exec(ctx)
|
|
|
+func (awflc *AddWechatFriendLogCreate) OnConflict(opts ...sql.ConflictOption) *AddWechatFriendLogUpsertOne {
|
|
|
+ awflc.conflict = opts
|
|
|
+ return &AddWechatFriendLogUpsertOne{
|
|
|
+ create: awflc,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// OnConflictColumns calls `OnConflict` and configures the columns
|
|
|
+// as conflict target. Using this option is equivalent to using:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// OnConflict(sql.ConflictColumns(columns...)).
|
|
|
+// Exec(ctx)
|
|
|
+func (awflc *AddWechatFriendLogCreate) OnConflictColumns(columns ...string) *AddWechatFriendLogUpsertOne {
|
|
|
+ awflc.conflict = append(awflc.conflict, sql.ConflictColumns(columns...))
|
|
|
+ return &AddWechatFriendLogUpsertOne{
|
|
|
+ create: awflc,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+type (
|
|
|
+ // AddWechatFriendLogUpsertOne is the builder for "upsert"-ing
|
|
|
+ // one AddWechatFriendLog node.
|
|
|
+ AddWechatFriendLogUpsertOne struct {
|
|
|
+ create *AddWechatFriendLogCreate
|
|
|
+ }
|
|
|
+
|
|
|
+ // AddWechatFriendLogUpsert is the "OnConflict" setter.
|
|
|
+ AddWechatFriendLogUpsert struct {
|
|
|
+ *sql.UpdateSet
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
+// SetOwnerWxID sets the "owner_wx_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetOwnerWxID(v string) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldOwnerWxID, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateOwnerWxID sets the "owner_wx_id" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateOwnerWxID() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldOwnerWxID)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxType sets the "owner_wx_type" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetOwnerWxType(v int) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldOwnerWxType, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateOwnerWxType sets the "owner_wx_type" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateOwnerWxType() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldOwnerWxType)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// AddOwnerWxType adds v to the "owner_wx_type" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) AddOwnerWxType(v int) *AddWechatFriendLogUpsert {
|
|
|
+ u.Add(addwechatfriendlog.FieldOwnerWxType, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindContent sets the "find_content" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetFindContent(v string) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldFindContent, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindContent sets the "find_content" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateFindContent() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldFindContent)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetMessage sets the "message" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetMessage(v string) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldMessage, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateMessage sets the "message" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateMessage() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldMessage)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindRequest sets the "find_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetFindRequest(v map[string]interface{}) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldFindRequest, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindRequest sets the "find_request" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateFindRequest() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldFindRequest)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// ClearFindRequest clears the value of the "find_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) ClearFindRequest() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetNull(addwechatfriendlog.FieldFindRequest)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindResult sets the "find_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetFindResult(v map[string]interface{}) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldFindResult, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindResult sets the "find_result" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateFindResult() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldFindResult)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// ClearFindResult clears the value of the "find_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) ClearFindResult() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetNull(addwechatfriendlog.FieldFindResult)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetIsCanAdd sets the "is_can_add" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetIsCanAdd(v int) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldIsCanAdd, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateIsCanAdd sets the "is_can_add" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateIsCanAdd() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldIsCanAdd)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// AddIsCanAdd adds v to the "is_can_add" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) AddIsCanAdd(v int) *AddWechatFriendLogUpsert {
|
|
|
+ u.Add(addwechatfriendlog.FieldIsCanAdd, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskCount sets the "task_count" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetTaskCount(v int) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldTaskCount, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateTaskCount sets the "task_count" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateTaskCount() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldTaskCount)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// AddTaskCount adds v to the "task_count" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) AddTaskCount(v int) *AddWechatFriendLogUpsert {
|
|
|
+ u.Add(addwechatfriendlog.FieldTaskCount, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskID sets the "task_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetTaskID(v int64) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldTaskID, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateTaskID sets the "task_id" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateTaskID() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldTaskID)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// AddTaskID adds v to the "task_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) AddTaskID(v int64) *AddWechatFriendLogUpsert {
|
|
|
+ u.Add(addwechatfriendlog.FieldTaskID, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddRequest sets the "add_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetAddRequest(v map[string]interface{}) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldAddRequest, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateAddRequest sets the "add_request" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateAddRequest() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldAddRequest)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAddRequest clears the value of the "add_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) ClearAddRequest() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetNull(addwechatfriendlog.FieldAddRequest)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddResult sets the "add_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetAddResult(v map[string]interface{}) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldAddResult, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateAddResult sets the "add_result" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateAddResult() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldAddResult)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAddResult clears the value of the "add_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) ClearAddResult() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetNull(addwechatfriendlog.FieldAddResult)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetCreatedAt sets the "created_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetCreatedAt(v int64) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldCreatedAt, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateCreatedAt() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldCreatedAt)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// AddCreatedAt adds v to the "created_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) AddCreatedAt(v int64) *AddWechatFriendLogUpsert {
|
|
|
+ u.Add(addwechatfriendlog.FieldCreatedAt, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetUpdatedAt sets the "updated_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) SetUpdatedAt(v int64) *AddWechatFriendLogUpsert {
|
|
|
+ u.Set(addwechatfriendlog.FieldUpdatedAt, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsert) UpdateUpdatedAt() *AddWechatFriendLogUpsert {
|
|
|
+ u.SetExcluded(addwechatfriendlog.FieldUpdatedAt)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// AddUpdatedAt adds v to the "updated_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsert) AddUpdatedAt(v int64) *AddWechatFriendLogUpsert {
|
|
|
+ u.Add(addwechatfriendlog.FieldUpdatedAt, v)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
|
|
|
+// Using this option is equivalent to using:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// OnConflict(
|
|
|
+// sql.ResolveWithNewValues(),
|
|
|
+// sql.ResolveWith(func(u *sql.UpdateSet) {
|
|
|
+// u.SetIgnore(addwechatfriendlog.FieldID)
|
|
|
+// }),
|
|
|
+// ).
|
|
|
+// Exec(ctx)
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateNewValues() *AddWechatFriendLogUpsertOne {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
|
|
|
+ if _, exists := u.create.mutation.ID(); exists {
|
|
|
+ s.SetIgnore(addwechatfriendlog.FieldID)
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// Ignore sets each column to itself in case of conflict.
|
|
|
+// Using this option is equivalent to using:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// OnConflict(sql.ResolveWithIgnore()).
|
|
|
+// Exec(ctx)
|
|
|
+func (u *AddWechatFriendLogUpsertOne) Ignore() *AddWechatFriendLogUpsertOne {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// DoNothing configures the conflict_action to `DO NOTHING`.
|
|
|
+// Supported only by SQLite and PostgreSQL.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) DoNothing() *AddWechatFriendLogUpsertOne {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.DoNothing())
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// Update allows overriding fields `UPDATE` values. See the AddWechatFriendLogCreate.OnConflict
|
|
|
+// documentation for more info.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) Update(set func(*AddWechatFriendLogUpsert)) *AddWechatFriendLogUpsertOne {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
|
|
|
+ set(&AddWechatFriendLogUpsert{UpdateSet: update})
|
|
|
+ }))
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxID sets the "owner_wx_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetOwnerWxID(v string) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetOwnerWxID(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateOwnerWxID sets the "owner_wx_id" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateOwnerWxID() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateOwnerWxID()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxType sets the "owner_wx_type" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetOwnerWxType(v int) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetOwnerWxType(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddOwnerWxType adds v to the "owner_wx_type" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) AddOwnerWxType(v int) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddOwnerWxType(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateOwnerWxType sets the "owner_wx_type" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateOwnerWxType() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateOwnerWxType()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindContent sets the "find_content" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetFindContent(v string) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetFindContent(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindContent sets the "find_content" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateFindContent() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateFindContent()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetMessage sets the "message" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetMessage(v string) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetMessage(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateMessage sets the "message" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateMessage() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateMessage()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindRequest sets the "find_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetFindRequest(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetFindRequest(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindRequest sets the "find_request" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateFindRequest() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateFindRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearFindRequest clears the value of the "find_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) ClearFindRequest() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearFindRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindResult sets the "find_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetFindResult(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetFindResult(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindResult sets the "find_result" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateFindResult() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateFindResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearFindResult clears the value of the "find_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) ClearFindResult() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearFindResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetIsCanAdd sets the "is_can_add" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetIsCanAdd(v int) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetIsCanAdd(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddIsCanAdd adds v to the "is_can_add" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) AddIsCanAdd(v int) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddIsCanAdd(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateIsCanAdd sets the "is_can_add" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateIsCanAdd() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateIsCanAdd()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskCount sets the "task_count" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetTaskCount(v int) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetTaskCount(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddTaskCount adds v to the "task_count" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) AddTaskCount(v int) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddTaskCount(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateTaskCount sets the "task_count" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateTaskCount() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateTaskCount()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskID sets the "task_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetTaskID(v int64) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetTaskID(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddTaskID adds v to the "task_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) AddTaskID(v int64) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddTaskID(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateTaskID sets the "task_id" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateTaskID() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateTaskID()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddRequest sets the "add_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetAddRequest(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetAddRequest(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateAddRequest sets the "add_request" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateAddRequest() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateAddRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAddRequest clears the value of the "add_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) ClearAddRequest() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearAddRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddResult sets the "add_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetAddResult(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetAddResult(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateAddResult sets the "add_result" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateAddResult() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateAddResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAddResult clears the value of the "add_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) ClearAddResult() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearAddResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetCreatedAt sets the "created_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetCreatedAt(v int64) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetCreatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddCreatedAt adds v to the "created_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) AddCreatedAt(v int64) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddCreatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateCreatedAt() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateCreatedAt()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetUpdatedAt sets the "updated_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) SetUpdatedAt(v int64) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetUpdatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddUpdatedAt adds v to the "updated_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) AddUpdatedAt(v int64) *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddUpdatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) UpdateUpdatedAt() *AddWechatFriendLogUpsertOne {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateUpdatedAt()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// Exec executes the query.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) Exec(ctx context.Context) error {
|
|
|
+ if len(u.create.conflict) == 0 {
|
|
|
+ return errors.New("ent: missing options for AddWechatFriendLogCreate.OnConflict")
|
|
|
+ }
|
|
|
+ return u.create.Exec(ctx)
|
|
|
+}
|
|
|
+
|
|
|
+// ExecX is like Exec, but panics if an error occurs.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) ExecX(ctx context.Context) {
|
|
|
+ if err := u.create.Exec(ctx); err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// Exec executes the UPSERT query and returns the inserted/updated ID.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) ID(ctx context.Context) (id int64, err error) {
|
|
|
+ node, err := u.create.Save(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return id, err
|
|
|
+ }
|
|
|
+ return node.ID, nil
|
|
|
+}
|
|
|
+
|
|
|
+// IDX is like ID, but panics if an error occurs.
|
|
|
+func (u *AddWechatFriendLogUpsertOne) IDX(ctx context.Context) int64 {
|
|
|
+ id, err := u.ID(ctx)
|
|
|
+ if err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+ return id
|
|
|
+}
|
|
|
+
|
|
|
+// AddWechatFriendLogCreateBulk is the builder for creating many AddWechatFriendLog entities in bulk.
|
|
|
+type AddWechatFriendLogCreateBulk struct {
|
|
|
+ config
|
|
|
+ err error
|
|
|
+ builders []*AddWechatFriendLogCreate
|
|
|
+ conflict []sql.ConflictOption
|
|
|
+}
|
|
|
+
|
|
|
+// Save creates the AddWechatFriendLog entities in the database.
|
|
|
+func (awflcb *AddWechatFriendLogCreateBulk) Save(ctx context.Context) ([]*AddWechatFriendLog, error) {
|
|
|
+ if awflcb.err != nil {
|
|
|
+ return nil, awflcb.err
|
|
|
+ }
|
|
|
+ specs := make([]*sqlgraph.CreateSpec, len(awflcb.builders))
|
|
|
+ nodes := make([]*AddWechatFriendLog, len(awflcb.builders))
|
|
|
+ mutators := make([]Mutator, len(awflcb.builders))
|
|
|
+ for i := range awflcb.builders {
|
|
|
+ func(i int, root context.Context) {
|
|
|
+ builder := awflcb.builders[i]
|
|
|
+ builder.defaults()
|
|
|
+ var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
|
|
+ mutation, ok := m.(*AddWechatFriendLogMutation)
|
|
|
+ if !ok {
|
|
|
+ return nil, fmt.Errorf("unexpected mutation type %T", m)
|
|
|
+ }
|
|
|
+ if err := builder.check(); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ builder.mutation = mutation
|
|
|
+ var err error
|
|
|
+ nodes[i], specs[i] = builder.createSpec()
|
|
|
+ if i < len(mutators)-1 {
|
|
|
+ _, err = mutators[i+1].Mutate(root, awflcb.builders[i+1].mutation)
|
|
|
+ } else {
|
|
|
+ spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
|
|
|
+ spec.OnConflict = awflcb.conflict
|
|
|
+ // Invoke the actual operation on the latest mutation in the chain.
|
|
|
+ if err = sqlgraph.BatchCreate(ctx, awflcb.driver, spec); err != nil {
|
|
|
+ if sqlgraph.IsConstraintError(err) {
|
|
|
+ err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ mutation.id = &nodes[i].ID
|
|
|
+ if specs[i].ID.Value != nil && nodes[i].ID == 0 {
|
|
|
+ id := specs[i].ID.Value.(int64)
|
|
|
+ nodes[i].ID = int64(id)
|
|
|
+ }
|
|
|
+ mutation.done = true
|
|
|
+ return nodes[i], nil
|
|
|
+ })
|
|
|
+ for i := len(builder.hooks) - 1; i >= 0; i-- {
|
|
|
+ mut = builder.hooks[i](mut)
|
|
|
+ }
|
|
|
+ mutators[i] = mut
|
|
|
+ }(i, ctx)
|
|
|
+ }
|
|
|
+ if len(mutators) > 0 {
|
|
|
+ if _, err := mutators[0].Mutate(ctx, awflcb.builders[0].mutation); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return nodes, nil
|
|
|
+}
|
|
|
+
|
|
|
+// SaveX is like Save, but panics if an error occurs.
|
|
|
+func (awflcb *AddWechatFriendLogCreateBulk) SaveX(ctx context.Context) []*AddWechatFriendLog {
|
|
|
+ v, err := awflcb.Save(ctx)
|
|
|
+ if err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+ return v
|
|
|
+}
|
|
|
+
|
|
|
+// Exec executes the query.
|
|
|
+func (awflcb *AddWechatFriendLogCreateBulk) Exec(ctx context.Context) error {
|
|
|
+ _, err := awflcb.Save(ctx)
|
|
|
+ return err
|
|
|
+}
|
|
|
+
|
|
|
+// ExecX is like Exec, but panics if an error occurs.
|
|
|
+func (awflcb *AddWechatFriendLogCreateBulk) ExecX(ctx context.Context) {
|
|
|
+ if err := awflcb.Exec(ctx); err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
|
|
|
+// of the `INSERT` statement. For example:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.CreateBulk(builders...).
|
|
|
+// OnConflict(
|
|
|
+// // Update the row with the new values
|
|
|
+// // the was proposed for insertion.
|
|
|
+// sql.ResolveWithNewValues(),
|
|
|
+// ).
|
|
|
+// // Override some of the fields with custom
|
|
|
+// // update values.
|
|
|
+// Update(func(u *ent.AddWechatFriendLogUpsert) {
|
|
|
+// SetOwnerWxID(v+v).
|
|
|
+// }).
|
|
|
+// Exec(ctx)
|
|
|
+func (awflcb *AddWechatFriendLogCreateBulk) OnConflict(opts ...sql.ConflictOption) *AddWechatFriendLogUpsertBulk {
|
|
|
+ awflcb.conflict = opts
|
|
|
+ return &AddWechatFriendLogUpsertBulk{
|
|
|
+ create: awflcb,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// OnConflictColumns calls `OnConflict` and configures the columns
|
|
|
+// as conflict target. Using this option is equivalent to using:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// OnConflict(sql.ConflictColumns(columns...)).
|
|
|
+// Exec(ctx)
|
|
|
+func (awflcb *AddWechatFriendLogCreateBulk) OnConflictColumns(columns ...string) *AddWechatFriendLogUpsertBulk {
|
|
|
+ awflcb.conflict = append(awflcb.conflict, sql.ConflictColumns(columns...))
|
|
|
+ return &AddWechatFriendLogUpsertBulk{
|
|
|
+ create: awflcb,
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddWechatFriendLogUpsertBulk is the builder for "upsert"-ing
|
|
|
+// a bulk of AddWechatFriendLog nodes.
|
|
|
+type AddWechatFriendLogUpsertBulk struct {
|
|
|
+ create *AddWechatFriendLogCreateBulk
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateNewValues updates the mutable fields using the new values that
|
|
|
+// were set on create. Using this option is equivalent to using:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// OnConflict(
|
|
|
+// sql.ResolveWithNewValues(),
|
|
|
+// sql.ResolveWith(func(u *sql.UpdateSet) {
|
|
|
+// u.SetIgnore(addwechatfriendlog.FieldID)
|
|
|
+// }),
|
|
|
+// ).
|
|
|
+// Exec(ctx)
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateNewValues() *AddWechatFriendLogUpsertBulk {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
|
|
|
+ for _, b := range u.create.builders {
|
|
|
+ if _, exists := b.mutation.ID(); exists {
|
|
|
+ s.SetIgnore(addwechatfriendlog.FieldID)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// Ignore sets each column to itself in case of conflict.
|
|
|
+// Using this option is equivalent to using:
|
|
|
+//
|
|
|
+// client.AddWechatFriendLog.Create().
|
|
|
+// OnConflict(sql.ResolveWithIgnore()).
|
|
|
+// Exec(ctx)
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) Ignore() *AddWechatFriendLogUpsertBulk {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// DoNothing configures the conflict_action to `DO NOTHING`.
|
|
|
+// Supported only by SQLite and PostgreSQL.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) DoNothing() *AddWechatFriendLogUpsertBulk {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.DoNothing())
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// Update allows overriding fields `UPDATE` values. See the AddWechatFriendLogCreateBulk.OnConflict
|
|
|
+// documentation for more info.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) Update(set func(*AddWechatFriendLogUpsert)) *AddWechatFriendLogUpsertBulk {
|
|
|
+ u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
|
|
|
+ set(&AddWechatFriendLogUpsert{UpdateSet: update})
|
|
|
+ }))
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxID sets the "owner_wx_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetOwnerWxID(v string) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetOwnerWxID(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateOwnerWxID sets the "owner_wx_id" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateOwnerWxID() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateOwnerWxID()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetOwnerWxType sets the "owner_wx_type" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetOwnerWxType(v int) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetOwnerWxType(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddOwnerWxType adds v to the "owner_wx_type" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) AddOwnerWxType(v int) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddOwnerWxType(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateOwnerWxType sets the "owner_wx_type" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateOwnerWxType() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateOwnerWxType()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindContent sets the "find_content" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetFindContent(v string) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetFindContent(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindContent sets the "find_content" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateFindContent() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateFindContent()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetMessage sets the "message" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetMessage(v string) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetMessage(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateMessage sets the "message" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateMessage() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateMessage()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindRequest sets the "find_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetFindRequest(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetFindRequest(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindRequest sets the "find_request" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateFindRequest() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateFindRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearFindRequest clears the value of the "find_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) ClearFindRequest() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearFindRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetFindResult sets the "find_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetFindResult(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetFindResult(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateFindResult sets the "find_result" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateFindResult() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateFindResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearFindResult clears the value of the "find_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) ClearFindResult() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearFindResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetIsCanAdd sets the "is_can_add" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetIsCanAdd(v int) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetIsCanAdd(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddIsCanAdd adds v to the "is_can_add" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) AddIsCanAdd(v int) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddIsCanAdd(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateIsCanAdd sets the "is_can_add" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateIsCanAdd() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateIsCanAdd()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskCount sets the "task_count" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetTaskCount(v int) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetTaskCount(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddTaskCount adds v to the "task_count" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) AddTaskCount(v int) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddTaskCount(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateTaskCount sets the "task_count" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateTaskCount() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateTaskCount()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetTaskID sets the "task_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetTaskID(v int64) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetTaskID(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddTaskID adds v to the "task_id" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) AddTaskID(v int64) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddTaskID(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateTaskID sets the "task_id" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateTaskID() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateTaskID()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddRequest sets the "add_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetAddRequest(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetAddRequest(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateAddRequest sets the "add_request" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateAddRequest() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateAddRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAddRequest clears the value of the "add_request" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) ClearAddRequest() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearAddRequest()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetAddResult sets the "add_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetAddResult(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetAddResult(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateAddResult sets the "add_result" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateAddResult() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateAddResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAddResult clears the value of the "add_result" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) ClearAddResult() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.ClearAddResult()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetCreatedAt sets the "created_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetCreatedAt(v int64) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetCreatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddCreatedAt adds v to the "created_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) AddCreatedAt(v int64) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddCreatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateCreatedAt() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateCreatedAt()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// SetUpdatedAt sets the "updated_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) SetUpdatedAt(v int64) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.SetUpdatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// AddUpdatedAt adds v to the "updated_at" field.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) AddUpdatedAt(v int64) *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.AddUpdatedAt(v)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) UpdateUpdatedAt() *AddWechatFriendLogUpsertBulk {
|
|
|
+ return u.Update(func(s *AddWechatFriendLogUpsert) {
|
|
|
+ s.UpdateUpdatedAt()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// Exec executes the query.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) Exec(ctx context.Context) error {
|
|
|
+ if u.create.err != nil {
|
|
|
+ return u.create.err
|
|
|
+ }
|
|
|
+ for i, b := range u.create.builders {
|
|
|
+ if len(b.conflict) != 0 {
|
|
|
+ return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the AddWechatFriendLogCreateBulk instead", i)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(u.create.conflict) == 0 {
|
|
|
+ return errors.New("ent: missing options for AddWechatFriendLogCreateBulk.OnConflict")
|
|
|
+ }
|
|
|
+ return u.create.Exec(ctx)
|
|
|
+}
|
|
|
+
|
|
|
+// ExecX is like Exec, but panics if an error occurs.
|
|
|
+func (u *AddWechatFriendLogUpsertBulk) ExecX(ctx context.Context) {
|
|
|
+ if err := u.create.Exec(ctx); err != nil {
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+}
|