fix: some api bug
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"juwan-backend/app/shop/rpc/internal/models/schema"
|
||||
"juwan-backend/app/shop/rpc/internal/models/shops"
|
||||
"time"
|
||||
|
||||
@@ -166,11 +167,19 @@ func (_c *ShopsCreate) SetNillableDispatchMode(v *string) *ShopsCreate {
|
||||
}
|
||||
|
||||
// SetAnnouncements sets the "announcements" field.
|
||||
func (_c *ShopsCreate) SetAnnouncements(v []string) *ShopsCreate {
|
||||
func (_c *ShopsCreate) SetAnnouncements(v schema.TextArray) *ShopsCreate {
|
||||
_c.mutation.SetAnnouncements(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableAnnouncements sets the "announcements" field if the given value is not nil.
|
||||
func (_c *ShopsCreate) SetNillableAnnouncements(v *schema.TextArray) *ShopsCreate {
|
||||
if v != nil {
|
||||
_c.SetAnnouncements(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetTemplateConfig sets the "template_config" field.
|
||||
func (_c *ShopsCreate) SetTemplateConfig(v map[string]interface{}) *ShopsCreate {
|
||||
_c.mutation.SetTemplateConfig(v)
|
||||
@@ -274,10 +283,6 @@ func (_c *ShopsCreate) defaults() {
|
||||
v := shops.DefaultDispatchMode
|
||||
_c.mutation.SetDispatchMode(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Announcements(); !ok {
|
||||
v := shops.DefaultAnnouncements
|
||||
_c.mutation.SetAnnouncements(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
v := shops.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -407,7 +412,7 @@ func (_c *ShopsCreate) createSpec() (*Shops, *sqlgraph.CreateSpec) {
|
||||
_node.DispatchMode = value
|
||||
}
|
||||
if value, ok := _c.mutation.Announcements(); ok {
|
||||
_spec.SetField(shops.FieldAnnouncements, field.TypeJSON, value)
|
||||
_spec.SetField(shops.FieldAnnouncements, field.TypeOther, value)
|
||||
_node.Announcements = value
|
||||
}
|
||||
if value, ok := _c.mutation.TemplateConfig(); ok {
|
||||
|
||||
Reference in New Issue
Block a user