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
+5 -2
View File
@@ -102,8 +102,6 @@ var (
DefaultDispatchMode string
// DispatchModeValidator is a validator for the "dispatch_mode" field. It is called by the builders before save.
DispatchModeValidator func(string) error
// DefaultAnnouncements holds the default value on creation for the "announcements" field.
DefaultAnnouncements []string
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
@@ -180,6 +178,11 @@ func ByDispatchMode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDispatchMode, opts...).ToFunc()
}
// ByAnnouncements orders the results by the announcements field.
func ByAnnouncements(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAnnouncements, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
@@ -4,6 +4,7 @@ package shops
import (
"juwan-backend/app/shop/rpc/internal/models/predicate"
"juwan-backend/app/shop/rpc/internal/models/schema"
"time"
"entgo.io/ent/dialect/sql"
@@ -115,6 +116,11 @@ func DispatchMode(v string) predicate.Shops {
return predicate.Shops(sql.FieldEQ(FieldDispatchMode, v))
}
// Announcements applies equality check predicate on the "announcements" field. It's identical to AnnouncementsEQ.
func Announcements(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldEQ(FieldAnnouncements, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Shops {
return predicate.Shops(sql.FieldEQ(FieldCreatedAt, v))
@@ -740,6 +746,46 @@ func DispatchModeContainsFold(v string) predicate.Shops {
return predicate.Shops(sql.FieldContainsFold(FieldDispatchMode, v))
}
// AnnouncementsEQ applies the EQ predicate on the "announcements" field.
func AnnouncementsEQ(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldEQ(FieldAnnouncements, v))
}
// AnnouncementsNEQ applies the NEQ predicate on the "announcements" field.
func AnnouncementsNEQ(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldNEQ(FieldAnnouncements, v))
}
// AnnouncementsIn applies the In predicate on the "announcements" field.
func AnnouncementsIn(vs ...schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldIn(FieldAnnouncements, vs...))
}
// AnnouncementsNotIn applies the NotIn predicate on the "announcements" field.
func AnnouncementsNotIn(vs ...schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldNotIn(FieldAnnouncements, vs...))
}
// AnnouncementsGT applies the GT predicate on the "announcements" field.
func AnnouncementsGT(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldGT(FieldAnnouncements, v))
}
// AnnouncementsGTE applies the GTE predicate on the "announcements" field.
func AnnouncementsGTE(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldGTE(FieldAnnouncements, v))
}
// AnnouncementsLT applies the LT predicate on the "announcements" field.
func AnnouncementsLT(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldLT(FieldAnnouncements, v))
}
// AnnouncementsLTE applies the LTE predicate on the "announcements" field.
func AnnouncementsLTE(v schema.TextArray) predicate.Shops {
return predicate.Shops(sql.FieldLTE(FieldAnnouncements, v))
}
// AnnouncementsIsNil applies the IsNil predicate on the "announcements" field.
func AnnouncementsIsNil() predicate.Shops {
return predicate.Shops(sql.FieldIsNull(FieldAnnouncements))