12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187 |
- // Code generated by ent, DO NOT EDIT.
- package ent
- import (
- "context"
- "errors"
- "fmt"
- "time"
- "wechat-api/ent/aliyunavatar"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- "entgo.io/ent/schema/field"
- )
- // AliyunAvatarCreate is the builder for creating a AliyunAvatar entity.
- type AliyunAvatarCreate struct {
- config
- mutation *AliyunAvatarMutation
- hooks []Hook
- conflict []sql.ConflictOption
- }
- // SetCreatedAt sets the "created_at" field.
- func (aac *AliyunAvatarCreate) SetCreatedAt(t time.Time) *AliyunAvatarCreate {
- aac.mutation.SetCreatedAt(t)
- return aac
- }
- // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
- func (aac *AliyunAvatarCreate) SetNillableCreatedAt(t *time.Time) *AliyunAvatarCreate {
- if t != nil {
- aac.SetCreatedAt(*t)
- }
- return aac
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (aac *AliyunAvatarCreate) SetUpdatedAt(t time.Time) *AliyunAvatarCreate {
- aac.mutation.SetUpdatedAt(t)
- return aac
- }
- // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
- func (aac *AliyunAvatarCreate) SetNillableUpdatedAt(t *time.Time) *AliyunAvatarCreate {
- if t != nil {
- aac.SetUpdatedAt(*t)
- }
- return aac
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (aac *AliyunAvatarCreate) SetDeletedAt(t time.Time) *AliyunAvatarCreate {
- aac.mutation.SetDeletedAt(t)
- return aac
- }
- // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
- func (aac *AliyunAvatarCreate) SetNillableDeletedAt(t *time.Time) *AliyunAvatarCreate {
- if t != nil {
- aac.SetDeletedAt(*t)
- }
- return aac
- }
- // SetUserID sets the "user_id" field.
- func (aac *AliyunAvatarCreate) SetUserID(u uint64) *AliyunAvatarCreate {
- aac.mutation.SetUserID(u)
- return aac
- }
- // SetBizID sets the "biz_id" field.
- func (aac *AliyunAvatarCreate) SetBizID(s string) *AliyunAvatarCreate {
- aac.mutation.SetBizID(s)
- return aac
- }
- // SetAccessKeyID sets the "access_key_id" field.
- func (aac *AliyunAvatarCreate) SetAccessKeyID(s string) *AliyunAvatarCreate {
- aac.mutation.SetAccessKeyID(s)
- return aac
- }
- // SetAccessKeySecret sets the "access_key_secret" field.
- func (aac *AliyunAvatarCreate) SetAccessKeySecret(s string) *AliyunAvatarCreate {
- aac.mutation.SetAccessKeySecret(s)
- return aac
- }
- // SetAppID sets the "app_id" field.
- func (aac *AliyunAvatarCreate) SetAppID(s string) *AliyunAvatarCreate {
- aac.mutation.SetAppID(s)
- return aac
- }
- // SetNillableAppID sets the "app_id" field if the given value is not nil.
- func (aac *AliyunAvatarCreate) SetNillableAppID(s *string) *AliyunAvatarCreate {
- if s != nil {
- aac.SetAppID(*s)
- }
- return aac
- }
- // SetTenantID sets the "tenant_id" field.
- func (aac *AliyunAvatarCreate) SetTenantID(u uint64) *AliyunAvatarCreate {
- aac.mutation.SetTenantID(u)
- return aac
- }
- // SetResponse sets the "response" field.
- func (aac *AliyunAvatarCreate) SetResponse(s string) *AliyunAvatarCreate {
- aac.mutation.SetResponse(s)
- return aac
- }
- // SetToken sets the "token" field.
- func (aac *AliyunAvatarCreate) SetToken(s string) *AliyunAvatarCreate {
- aac.mutation.SetToken(s)
- return aac
- }
- // SetNillableToken sets the "token" field if the given value is not nil.
- func (aac *AliyunAvatarCreate) SetNillableToken(s *string) *AliyunAvatarCreate {
- if s != nil {
- aac.SetToken(*s)
- }
- return aac
- }
- // SetSessionID sets the "session_id" field.
- func (aac *AliyunAvatarCreate) SetSessionID(s string) *AliyunAvatarCreate {
- aac.mutation.SetSessionID(s)
- return aac
- }
- // SetNillableSessionID sets the "session_id" field if the given value is not nil.
- func (aac *AliyunAvatarCreate) SetNillableSessionID(s *string) *AliyunAvatarCreate {
- if s != nil {
- aac.SetSessionID(*s)
- }
- return aac
- }
- // SetID sets the "id" field.
- func (aac *AliyunAvatarCreate) SetID(u uint64) *AliyunAvatarCreate {
- aac.mutation.SetID(u)
- return aac
- }
- // Mutation returns the AliyunAvatarMutation object of the builder.
- func (aac *AliyunAvatarCreate) Mutation() *AliyunAvatarMutation {
- return aac.mutation
- }
- // Save creates the AliyunAvatar in the database.
- func (aac *AliyunAvatarCreate) Save(ctx context.Context) (*AliyunAvatar, error) {
- if err := aac.defaults(); err != nil {
- return nil, err
- }
- return withHooks(ctx, aac.sqlSave, aac.mutation, aac.hooks)
- }
- // SaveX calls Save and panics if Save returns an error.
- func (aac *AliyunAvatarCreate) SaveX(ctx context.Context) *AliyunAvatar {
- v, err := aac.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (aac *AliyunAvatarCreate) Exec(ctx context.Context) error {
- _, err := aac.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (aac *AliyunAvatarCreate) ExecX(ctx context.Context) {
- if err := aac.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // defaults sets the default values of the builder before save.
- func (aac *AliyunAvatarCreate) defaults() error {
- if _, ok := aac.mutation.CreatedAt(); !ok {
- if aliyunavatar.DefaultCreatedAt == nil {
- return fmt.Errorf("ent: uninitialized aliyunavatar.DefaultCreatedAt (forgotten import ent/runtime?)")
- }
- v := aliyunavatar.DefaultCreatedAt()
- aac.mutation.SetCreatedAt(v)
- }
- if _, ok := aac.mutation.UpdatedAt(); !ok {
- if aliyunavatar.DefaultUpdatedAt == nil {
- return fmt.Errorf("ent: uninitialized aliyunavatar.DefaultUpdatedAt (forgotten import ent/runtime?)")
- }
- v := aliyunavatar.DefaultUpdatedAt()
- aac.mutation.SetUpdatedAt(v)
- }
- if _, ok := aac.mutation.Token(); !ok {
- v := aliyunavatar.DefaultToken
- aac.mutation.SetToken(v)
- }
- if _, ok := aac.mutation.SessionID(); !ok {
- v := aliyunavatar.DefaultSessionID
- aac.mutation.SetSessionID(v)
- }
- return nil
- }
- // check runs all checks and user-defined validators on the builder.
- func (aac *AliyunAvatarCreate) check() error {
- if _, ok := aac.mutation.CreatedAt(); !ok {
- return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "AliyunAvatar.created_at"`)}
- }
- if _, ok := aac.mutation.UpdatedAt(); !ok {
- return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "AliyunAvatar.updated_at"`)}
- }
- if _, ok := aac.mutation.UserID(); !ok {
- return &ValidationError{Name: "user_id", err: errors.New(`ent: missing required field "AliyunAvatar.user_id"`)}
- }
- if _, ok := aac.mutation.BizID(); !ok {
- return &ValidationError{Name: "biz_id", err: errors.New(`ent: missing required field "AliyunAvatar.biz_id"`)}
- }
- if _, ok := aac.mutation.AccessKeyID(); !ok {
- return &ValidationError{Name: "access_key_id", err: errors.New(`ent: missing required field "AliyunAvatar.access_key_id"`)}
- }
- if _, ok := aac.mutation.AccessKeySecret(); !ok {
- return &ValidationError{Name: "access_key_secret", err: errors.New(`ent: missing required field "AliyunAvatar.access_key_secret"`)}
- }
- if _, ok := aac.mutation.TenantID(); !ok {
- return &ValidationError{Name: "tenant_id", err: errors.New(`ent: missing required field "AliyunAvatar.tenant_id"`)}
- }
- if _, ok := aac.mutation.Response(); !ok {
- return &ValidationError{Name: "response", err: errors.New(`ent: missing required field "AliyunAvatar.response"`)}
- }
- if _, ok := aac.mutation.Token(); !ok {
- return &ValidationError{Name: "token", err: errors.New(`ent: missing required field "AliyunAvatar.token"`)}
- }
- if _, ok := aac.mutation.SessionID(); !ok {
- return &ValidationError{Name: "session_id", err: errors.New(`ent: missing required field "AliyunAvatar.session_id"`)}
- }
- return nil
- }
- func (aac *AliyunAvatarCreate) sqlSave(ctx context.Context) (*AliyunAvatar, error) {
- if err := aac.check(); err != nil {
- return nil, err
- }
- _node, _spec := aac.createSpec()
- if err := sqlgraph.CreateNode(ctx, aac.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 = uint64(id)
- }
- aac.mutation.id = &_node.ID
- aac.mutation.done = true
- return _node, nil
- }
- func (aac *AliyunAvatarCreate) createSpec() (*AliyunAvatar, *sqlgraph.CreateSpec) {
- var (
- _node = &AliyunAvatar{config: aac.config}
- _spec = sqlgraph.NewCreateSpec(aliyunavatar.Table, sqlgraph.NewFieldSpec(aliyunavatar.FieldID, field.TypeUint64))
- )
- _spec.OnConflict = aac.conflict
- if id, ok := aac.mutation.ID(); ok {
- _node.ID = id
- _spec.ID.Value = id
- }
- if value, ok := aac.mutation.CreatedAt(); ok {
- _spec.SetField(aliyunavatar.FieldCreatedAt, field.TypeTime, value)
- _node.CreatedAt = value
- }
- if value, ok := aac.mutation.UpdatedAt(); ok {
- _spec.SetField(aliyunavatar.FieldUpdatedAt, field.TypeTime, value)
- _node.UpdatedAt = value
- }
- if value, ok := aac.mutation.DeletedAt(); ok {
- _spec.SetField(aliyunavatar.FieldDeletedAt, field.TypeTime, value)
- _node.DeletedAt = value
- }
- if value, ok := aac.mutation.UserID(); ok {
- _spec.SetField(aliyunavatar.FieldUserID, field.TypeUint64, value)
- _node.UserID = value
- }
- if value, ok := aac.mutation.BizID(); ok {
- _spec.SetField(aliyunavatar.FieldBizID, field.TypeString, value)
- _node.BizID = value
- }
- if value, ok := aac.mutation.AccessKeyID(); ok {
- _spec.SetField(aliyunavatar.FieldAccessKeyID, field.TypeString, value)
- _node.AccessKeyID = value
- }
- if value, ok := aac.mutation.AccessKeySecret(); ok {
- _spec.SetField(aliyunavatar.FieldAccessKeySecret, field.TypeString, value)
- _node.AccessKeySecret = value
- }
- if value, ok := aac.mutation.AppID(); ok {
- _spec.SetField(aliyunavatar.FieldAppID, field.TypeString, value)
- _node.AppID = value
- }
- if value, ok := aac.mutation.TenantID(); ok {
- _spec.SetField(aliyunavatar.FieldTenantID, field.TypeUint64, value)
- _node.TenantID = value
- }
- if value, ok := aac.mutation.Response(); ok {
- _spec.SetField(aliyunavatar.FieldResponse, field.TypeString, value)
- _node.Response = value
- }
- if value, ok := aac.mutation.Token(); ok {
- _spec.SetField(aliyunavatar.FieldToken, field.TypeString, value)
- _node.Token = value
- }
- if value, ok := aac.mutation.SessionID(); ok {
- _spec.SetField(aliyunavatar.FieldSessionID, field.TypeString, value)
- _node.SessionID = value
- }
- return _node, _spec
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.AliyunAvatar.Create().
- // SetCreatedAt(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.AliyunAvatarUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (aac *AliyunAvatarCreate) OnConflict(opts ...sql.ConflictOption) *AliyunAvatarUpsertOne {
- aac.conflict = opts
- return &AliyunAvatarUpsertOne{
- create: aac,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.AliyunAvatar.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (aac *AliyunAvatarCreate) OnConflictColumns(columns ...string) *AliyunAvatarUpsertOne {
- aac.conflict = append(aac.conflict, sql.ConflictColumns(columns...))
- return &AliyunAvatarUpsertOne{
- create: aac,
- }
- }
- type (
- // AliyunAvatarUpsertOne is the builder for "upsert"-ing
- // one AliyunAvatar node.
- AliyunAvatarUpsertOne struct {
- create *AliyunAvatarCreate
- }
- // AliyunAvatarUpsert is the "OnConflict" setter.
- AliyunAvatarUpsert struct {
- *sql.UpdateSet
- }
- )
- // SetUpdatedAt sets the "updated_at" field.
- func (u *AliyunAvatarUpsert) SetUpdatedAt(v time.Time) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldUpdatedAt, v)
- return u
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateUpdatedAt() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldUpdatedAt)
- return u
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *AliyunAvatarUpsert) SetDeletedAt(v time.Time) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldDeletedAt, v)
- return u
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateDeletedAt() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldDeletedAt)
- return u
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *AliyunAvatarUpsert) ClearDeletedAt() *AliyunAvatarUpsert {
- u.SetNull(aliyunavatar.FieldDeletedAt)
- return u
- }
- // SetUserID sets the "user_id" field.
- func (u *AliyunAvatarUpsert) SetUserID(v uint64) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldUserID, v)
- return u
- }
- // UpdateUserID sets the "user_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateUserID() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldUserID)
- return u
- }
- // AddUserID adds v to the "user_id" field.
- func (u *AliyunAvatarUpsert) AddUserID(v uint64) *AliyunAvatarUpsert {
- u.Add(aliyunavatar.FieldUserID, v)
- return u
- }
- // SetBizID sets the "biz_id" field.
- func (u *AliyunAvatarUpsert) SetBizID(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldBizID, v)
- return u
- }
- // UpdateBizID sets the "biz_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateBizID() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldBizID)
- return u
- }
- // SetAccessKeyID sets the "access_key_id" field.
- func (u *AliyunAvatarUpsert) SetAccessKeyID(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldAccessKeyID, v)
- return u
- }
- // UpdateAccessKeyID sets the "access_key_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateAccessKeyID() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldAccessKeyID)
- return u
- }
- // SetAccessKeySecret sets the "access_key_secret" field.
- func (u *AliyunAvatarUpsert) SetAccessKeySecret(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldAccessKeySecret, v)
- return u
- }
- // UpdateAccessKeySecret sets the "access_key_secret" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateAccessKeySecret() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldAccessKeySecret)
- return u
- }
- // SetAppID sets the "app_id" field.
- func (u *AliyunAvatarUpsert) SetAppID(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldAppID, v)
- return u
- }
- // UpdateAppID sets the "app_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateAppID() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldAppID)
- return u
- }
- // ClearAppID clears the value of the "app_id" field.
- func (u *AliyunAvatarUpsert) ClearAppID() *AliyunAvatarUpsert {
- u.SetNull(aliyunavatar.FieldAppID)
- return u
- }
- // SetTenantID sets the "tenant_id" field.
- func (u *AliyunAvatarUpsert) SetTenantID(v uint64) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldTenantID, v)
- return u
- }
- // UpdateTenantID sets the "tenant_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateTenantID() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldTenantID)
- return u
- }
- // AddTenantID adds v to the "tenant_id" field.
- func (u *AliyunAvatarUpsert) AddTenantID(v uint64) *AliyunAvatarUpsert {
- u.Add(aliyunavatar.FieldTenantID, v)
- return u
- }
- // SetResponse sets the "response" field.
- func (u *AliyunAvatarUpsert) SetResponse(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldResponse, v)
- return u
- }
- // UpdateResponse sets the "response" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateResponse() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldResponse)
- return u
- }
- // SetToken sets the "token" field.
- func (u *AliyunAvatarUpsert) SetToken(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldToken, v)
- return u
- }
- // UpdateToken sets the "token" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateToken() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldToken)
- return u
- }
- // SetSessionID sets the "session_id" field.
- func (u *AliyunAvatarUpsert) SetSessionID(v string) *AliyunAvatarUpsert {
- u.Set(aliyunavatar.FieldSessionID, v)
- return u
- }
- // UpdateSessionID sets the "session_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsert) UpdateSessionID() *AliyunAvatarUpsert {
- u.SetExcluded(aliyunavatar.FieldSessionID)
- 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.AliyunAvatar.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // sql.ResolveWith(func(u *sql.UpdateSet) {
- // u.SetIgnore(aliyunavatar.FieldID)
- // }),
- // ).
- // Exec(ctx)
- func (u *AliyunAvatarUpsertOne) UpdateNewValues() *AliyunAvatarUpsertOne {
- 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(aliyunavatar.FieldID)
- }
- if _, exists := u.create.mutation.CreatedAt(); exists {
- s.SetIgnore(aliyunavatar.FieldCreatedAt)
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.AliyunAvatar.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *AliyunAvatarUpsertOne) Ignore() *AliyunAvatarUpsertOne {
- 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 *AliyunAvatarUpsertOne) DoNothing() *AliyunAvatarUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the AliyunAvatarCreate.OnConflict
- // documentation for more info.
- func (u *AliyunAvatarUpsertOne) Update(set func(*AliyunAvatarUpsert)) *AliyunAvatarUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&AliyunAvatarUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *AliyunAvatarUpsertOne) SetUpdatedAt(v time.Time) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateUpdatedAt() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *AliyunAvatarUpsertOne) SetDeletedAt(v time.Time) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetDeletedAt(v)
- })
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateDeletedAt() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateDeletedAt()
- })
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *AliyunAvatarUpsertOne) ClearDeletedAt() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.ClearDeletedAt()
- })
- }
- // SetUserID sets the "user_id" field.
- func (u *AliyunAvatarUpsertOne) SetUserID(v uint64) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetUserID(v)
- })
- }
- // AddUserID adds v to the "user_id" field.
- func (u *AliyunAvatarUpsertOne) AddUserID(v uint64) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.AddUserID(v)
- })
- }
- // UpdateUserID sets the "user_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateUserID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateUserID()
- })
- }
- // SetBizID sets the "biz_id" field.
- func (u *AliyunAvatarUpsertOne) SetBizID(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetBizID(v)
- })
- }
- // UpdateBizID sets the "biz_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateBizID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateBizID()
- })
- }
- // SetAccessKeyID sets the "access_key_id" field.
- func (u *AliyunAvatarUpsertOne) SetAccessKeyID(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetAccessKeyID(v)
- })
- }
- // UpdateAccessKeyID sets the "access_key_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateAccessKeyID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateAccessKeyID()
- })
- }
- // SetAccessKeySecret sets the "access_key_secret" field.
- func (u *AliyunAvatarUpsertOne) SetAccessKeySecret(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetAccessKeySecret(v)
- })
- }
- // UpdateAccessKeySecret sets the "access_key_secret" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateAccessKeySecret() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateAccessKeySecret()
- })
- }
- // SetAppID sets the "app_id" field.
- func (u *AliyunAvatarUpsertOne) SetAppID(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetAppID(v)
- })
- }
- // UpdateAppID sets the "app_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateAppID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateAppID()
- })
- }
- // ClearAppID clears the value of the "app_id" field.
- func (u *AliyunAvatarUpsertOne) ClearAppID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.ClearAppID()
- })
- }
- // SetTenantID sets the "tenant_id" field.
- func (u *AliyunAvatarUpsertOne) SetTenantID(v uint64) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetTenantID(v)
- })
- }
- // AddTenantID adds v to the "tenant_id" field.
- func (u *AliyunAvatarUpsertOne) AddTenantID(v uint64) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.AddTenantID(v)
- })
- }
- // UpdateTenantID sets the "tenant_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateTenantID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateTenantID()
- })
- }
- // SetResponse sets the "response" field.
- func (u *AliyunAvatarUpsertOne) SetResponse(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetResponse(v)
- })
- }
- // UpdateResponse sets the "response" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateResponse() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateResponse()
- })
- }
- // SetToken sets the "token" field.
- func (u *AliyunAvatarUpsertOne) SetToken(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetToken(v)
- })
- }
- // UpdateToken sets the "token" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateToken() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateToken()
- })
- }
- // SetSessionID sets the "session_id" field.
- func (u *AliyunAvatarUpsertOne) SetSessionID(v string) *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetSessionID(v)
- })
- }
- // UpdateSessionID sets the "session_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertOne) UpdateSessionID() *AliyunAvatarUpsertOne {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateSessionID()
- })
- }
- // Exec executes the query.
- func (u *AliyunAvatarUpsertOne) Exec(ctx context.Context) error {
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for AliyunAvatarCreate.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *AliyunAvatarUpsertOne) 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 *AliyunAvatarUpsertOne) ID(ctx context.Context) (id uint64, 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 *AliyunAvatarUpsertOne) IDX(ctx context.Context) uint64 {
- id, err := u.ID(ctx)
- if err != nil {
- panic(err)
- }
- return id
- }
- // AliyunAvatarCreateBulk is the builder for creating many AliyunAvatar entities in bulk.
- type AliyunAvatarCreateBulk struct {
- config
- err error
- builders []*AliyunAvatarCreate
- conflict []sql.ConflictOption
- }
- // Save creates the AliyunAvatar entities in the database.
- func (aacb *AliyunAvatarCreateBulk) Save(ctx context.Context) ([]*AliyunAvatar, error) {
- if aacb.err != nil {
- return nil, aacb.err
- }
- specs := make([]*sqlgraph.CreateSpec, len(aacb.builders))
- nodes := make([]*AliyunAvatar, len(aacb.builders))
- mutators := make([]Mutator, len(aacb.builders))
- for i := range aacb.builders {
- func(i int, root context.Context) {
- builder := aacb.builders[i]
- builder.defaults()
- var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
- mutation, ok := m.(*AliyunAvatarMutation)
- 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, aacb.builders[i+1].mutation)
- } else {
- spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
- spec.OnConflict = aacb.conflict
- // Invoke the actual operation on the latest mutation in the chain.
- if err = sqlgraph.BatchCreate(ctx, aacb.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 = uint64(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, aacb.builders[0].mutation); err != nil {
- return nil, err
- }
- }
- return nodes, nil
- }
- // SaveX is like Save, but panics if an error occurs.
- func (aacb *AliyunAvatarCreateBulk) SaveX(ctx context.Context) []*AliyunAvatar {
- v, err := aacb.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (aacb *AliyunAvatarCreateBulk) Exec(ctx context.Context) error {
- _, err := aacb.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (aacb *AliyunAvatarCreateBulk) ExecX(ctx context.Context) {
- if err := aacb.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.AliyunAvatar.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.AliyunAvatarUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (aacb *AliyunAvatarCreateBulk) OnConflict(opts ...sql.ConflictOption) *AliyunAvatarUpsertBulk {
- aacb.conflict = opts
- return &AliyunAvatarUpsertBulk{
- create: aacb,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.AliyunAvatar.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (aacb *AliyunAvatarCreateBulk) OnConflictColumns(columns ...string) *AliyunAvatarUpsertBulk {
- aacb.conflict = append(aacb.conflict, sql.ConflictColumns(columns...))
- return &AliyunAvatarUpsertBulk{
- create: aacb,
- }
- }
- // AliyunAvatarUpsertBulk is the builder for "upsert"-ing
- // a bulk of AliyunAvatar nodes.
- type AliyunAvatarUpsertBulk struct {
- create *AliyunAvatarCreateBulk
- }
- // UpdateNewValues updates the mutable fields using the new values that
- // were set on create. Using this option is equivalent to using:
- //
- // client.AliyunAvatar.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // sql.ResolveWith(func(u *sql.UpdateSet) {
- // u.SetIgnore(aliyunavatar.FieldID)
- // }),
- // ).
- // Exec(ctx)
- func (u *AliyunAvatarUpsertBulk) UpdateNewValues() *AliyunAvatarUpsertBulk {
- 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(aliyunavatar.FieldID)
- }
- if _, exists := b.mutation.CreatedAt(); exists {
- s.SetIgnore(aliyunavatar.FieldCreatedAt)
- }
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.AliyunAvatar.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *AliyunAvatarUpsertBulk) Ignore() *AliyunAvatarUpsertBulk {
- 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 *AliyunAvatarUpsertBulk) DoNothing() *AliyunAvatarUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the AliyunAvatarCreateBulk.OnConflict
- // documentation for more info.
- func (u *AliyunAvatarUpsertBulk) Update(set func(*AliyunAvatarUpsert)) *AliyunAvatarUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&AliyunAvatarUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *AliyunAvatarUpsertBulk) SetUpdatedAt(v time.Time) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateUpdatedAt() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *AliyunAvatarUpsertBulk) SetDeletedAt(v time.Time) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetDeletedAt(v)
- })
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateDeletedAt() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateDeletedAt()
- })
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *AliyunAvatarUpsertBulk) ClearDeletedAt() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.ClearDeletedAt()
- })
- }
- // SetUserID sets the "user_id" field.
- func (u *AliyunAvatarUpsertBulk) SetUserID(v uint64) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetUserID(v)
- })
- }
- // AddUserID adds v to the "user_id" field.
- func (u *AliyunAvatarUpsertBulk) AddUserID(v uint64) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.AddUserID(v)
- })
- }
- // UpdateUserID sets the "user_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateUserID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateUserID()
- })
- }
- // SetBizID sets the "biz_id" field.
- func (u *AliyunAvatarUpsertBulk) SetBizID(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetBizID(v)
- })
- }
- // UpdateBizID sets the "biz_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateBizID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateBizID()
- })
- }
- // SetAccessKeyID sets the "access_key_id" field.
- func (u *AliyunAvatarUpsertBulk) SetAccessKeyID(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetAccessKeyID(v)
- })
- }
- // UpdateAccessKeyID sets the "access_key_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateAccessKeyID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateAccessKeyID()
- })
- }
- // SetAccessKeySecret sets the "access_key_secret" field.
- func (u *AliyunAvatarUpsertBulk) SetAccessKeySecret(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetAccessKeySecret(v)
- })
- }
- // UpdateAccessKeySecret sets the "access_key_secret" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateAccessKeySecret() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateAccessKeySecret()
- })
- }
- // SetAppID sets the "app_id" field.
- func (u *AliyunAvatarUpsertBulk) SetAppID(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetAppID(v)
- })
- }
- // UpdateAppID sets the "app_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateAppID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateAppID()
- })
- }
- // ClearAppID clears the value of the "app_id" field.
- func (u *AliyunAvatarUpsertBulk) ClearAppID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.ClearAppID()
- })
- }
- // SetTenantID sets the "tenant_id" field.
- func (u *AliyunAvatarUpsertBulk) SetTenantID(v uint64) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetTenantID(v)
- })
- }
- // AddTenantID adds v to the "tenant_id" field.
- func (u *AliyunAvatarUpsertBulk) AddTenantID(v uint64) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.AddTenantID(v)
- })
- }
- // UpdateTenantID sets the "tenant_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateTenantID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateTenantID()
- })
- }
- // SetResponse sets the "response" field.
- func (u *AliyunAvatarUpsertBulk) SetResponse(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetResponse(v)
- })
- }
- // UpdateResponse sets the "response" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateResponse() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateResponse()
- })
- }
- // SetToken sets the "token" field.
- func (u *AliyunAvatarUpsertBulk) SetToken(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetToken(v)
- })
- }
- // UpdateToken sets the "token" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateToken() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateToken()
- })
- }
- // SetSessionID sets the "session_id" field.
- func (u *AliyunAvatarUpsertBulk) SetSessionID(v string) *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.SetSessionID(v)
- })
- }
- // UpdateSessionID sets the "session_id" field to the value that was provided on create.
- func (u *AliyunAvatarUpsertBulk) UpdateSessionID() *AliyunAvatarUpsertBulk {
- return u.Update(func(s *AliyunAvatarUpsert) {
- s.UpdateSessionID()
- })
- }
- // Exec executes the query.
- func (u *AliyunAvatarUpsertBulk) 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 AliyunAvatarCreateBulk instead", i)
- }
- }
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for AliyunAvatarCreateBulk.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *AliyunAvatarUpsertBulk) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
|