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()