fix: some api bug
This commit is contained in:
@@ -7,12 +7,12 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"juwan-backend/app/shop/rpc/internal/models/predicate"
|
||||
"juwan-backend/app/shop/rpc/internal/models/schema"
|
||||
"juwan-backend/app/shop/rpc/internal/models/shops"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/dialect/sql/sqljson"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
@@ -262,14 +262,16 @@ func (_u *ShopsUpdate) SetNillableDispatchMode(v *string) *ShopsUpdate {
|
||||
}
|
||||
|
||||
// SetAnnouncements sets the "announcements" field.
|
||||
func (_u *ShopsUpdate) SetAnnouncements(v []string) *ShopsUpdate {
|
||||
func (_u *ShopsUpdate) SetAnnouncements(v schema.TextArray) *ShopsUpdate {
|
||||
_u.mutation.SetAnnouncements(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// AppendAnnouncements appends value to the "announcements" field.
|
||||
func (_u *ShopsUpdate) AppendAnnouncements(v []string) *ShopsUpdate {
|
||||
_u.mutation.AppendAnnouncements(v)
|
||||
// SetNillableAnnouncements sets the "announcements" field if the given value is not nil.
|
||||
func (_u *ShopsUpdate) SetNillableAnnouncements(v *schema.TextArray) *ShopsUpdate {
|
||||
if v != nil {
|
||||
_u.SetAnnouncements(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
@@ -437,15 +439,10 @@ func (_u *ShopsUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
||||
_spec.SetField(shops.FieldDispatchMode, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Announcements(); ok {
|
||||
_spec.SetField(shops.FieldAnnouncements, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AppendedAnnouncements(); ok {
|
||||
_spec.AddModifier(func(u *sql.UpdateBuilder) {
|
||||
sqljson.Append(u, shops.FieldAnnouncements, value)
|
||||
})
|
||||
_spec.SetField(shops.FieldAnnouncements, field.TypeOther, value)
|
||||
}
|
||||
if _u.mutation.AnnouncementsCleared() {
|
||||
_spec.ClearField(shops.FieldAnnouncements, field.TypeJSON)
|
||||
_spec.ClearField(shops.FieldAnnouncements, field.TypeOther)
|
||||
}
|
||||
if value, ok := _u.mutation.TemplateConfig(); ok {
|
||||
_spec.SetField(shops.FieldTemplateConfig, field.TypeJSON, value)
|
||||
@@ -708,14 +705,16 @@ func (_u *ShopsUpdateOne) SetNillableDispatchMode(v *string) *ShopsUpdateOne {
|
||||
}
|
||||
|
||||
// SetAnnouncements sets the "announcements" field.
|
||||
func (_u *ShopsUpdateOne) SetAnnouncements(v []string) *ShopsUpdateOne {
|
||||
func (_u *ShopsUpdateOne) SetAnnouncements(v schema.TextArray) *ShopsUpdateOne {
|
||||
_u.mutation.SetAnnouncements(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// AppendAnnouncements appends value to the "announcements" field.
|
||||
func (_u *ShopsUpdateOne) AppendAnnouncements(v []string) *ShopsUpdateOne {
|
||||
_u.mutation.AppendAnnouncements(v)
|
||||
// SetNillableAnnouncements sets the "announcements" field if the given value is not nil.
|
||||
func (_u *ShopsUpdateOne) SetNillableAnnouncements(v *schema.TextArray) *ShopsUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetAnnouncements(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
@@ -913,15 +912,10 @@ func (_u *ShopsUpdateOne) sqlSave(ctx context.Context) (_node *Shops, err error)
|
||||
_spec.SetField(shops.FieldDispatchMode, field.TypeString, value)
|
||||
}
|
||||
if value, ok := _u.mutation.Announcements(); ok {
|
||||
_spec.SetField(shops.FieldAnnouncements, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := _u.mutation.AppendedAnnouncements(); ok {
|
||||
_spec.AddModifier(func(u *sql.UpdateBuilder) {
|
||||
sqljson.Append(u, shops.FieldAnnouncements, value)
|
||||
})
|
||||
_spec.SetField(shops.FieldAnnouncements, field.TypeOther, value)
|
||||
}
|
||||
if _u.mutation.AnnouncementsCleared() {
|
||||
_spec.ClearField(shops.FieldAnnouncements, field.TypeJSON)
|
||||
_spec.ClearField(shops.FieldAnnouncements, field.TypeOther)
|
||||
}
|
||||
if value, ok := _u.mutation.TemplateConfig(); ok {
|
||||
_spec.SetField(shops.FieldTemplateConfig, field.TypeJSON, value)
|
||||
|
||||
Reference in New Issue
Block a user