fix: some api bug

This commit is contained in:
wwweww
2026-03-31 22:12:06 +08:00
parent c5ff4f0216
commit e7970ac25f
219 changed files with 16195 additions and 2126 deletions
+11 -6
View File
@@ -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 {