fix: some api bug
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package userpreferences
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the userpreferences type in the database.
|
||||
Label = "user_preferences"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldUserID holds the string denoting the user_id field in the database.
|
||||
FieldUserID = "user_id"
|
||||
// FieldNotificationOrder holds the string denoting the notification_order field in the database.
|
||||
FieldNotificationOrder = "notification_order"
|
||||
// FieldNotificationCommunity holds the string denoting the notification_community field in the database.
|
||||
FieldNotificationCommunity = "notification_community"
|
||||
// FieldNotificationSystem holds the string denoting the notification_system field in the database.
|
||||
FieldNotificationSystem = "notification_system"
|
||||
// FieldTheme holds the string denoting the theme field in the database.
|
||||
FieldTheme = "theme"
|
||||
// FieldLanguage holds the string denoting the language field in the database.
|
||||
FieldLanguage = "language"
|
||||
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// Table holds the table name of the userpreferences in the database.
|
||||
Table = "user_preferences"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for userpreferences fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldUserID,
|
||||
FieldNotificationOrder,
|
||||
FieldNotificationCommunity,
|
||||
FieldNotificationSystem,
|
||||
FieldTheme,
|
||||
FieldLanguage,
|
||||
FieldUpdatedAt,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultNotificationOrder holds the default value on creation for the "notification_order" field.
|
||||
DefaultNotificationOrder bool
|
||||
// DefaultNotificationCommunity holds the default value on creation for the "notification_community" field.
|
||||
DefaultNotificationCommunity bool
|
||||
// DefaultNotificationSystem holds the default value on creation for the "notification_system" field.
|
||||
DefaultNotificationSystem bool
|
||||
// DefaultTheme holds the default value on creation for the "theme" field.
|
||||
DefaultTheme string
|
||||
// DefaultLanguage holds the default value on creation for the "language" field.
|
||||
DefaultLanguage string
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() time.Time
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the UserPreferences queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUserID orders the results by the user_id field.
|
||||
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNotificationOrder orders the results by the notification_order field.
|
||||
func ByNotificationOrder(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNotificationOrder, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNotificationCommunity orders the results by the notification_community field.
|
||||
func ByNotificationCommunity(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNotificationCommunity, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNotificationSystem orders the results by the notification_system field.
|
||||
func ByNotificationSystem(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNotificationSystem, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTheme orders the results by the theme field.
|
||||
func ByTheme(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTheme, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByLanguage orders the results by the language field.
|
||||
func ByLanguage(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldLanguage, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdatedAt orders the results by the updated_at field.
|
||||
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package userpreferences
|
||||
|
||||
import (
|
||||
"juwan-backend/app/users/rpc/internal/models/predicate"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
|
||||
func UserID(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// NotificationOrder applies equality check predicate on the "notification_order" field. It's identical to NotificationOrderEQ.
|
||||
func NotificationOrder(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldNotificationOrder, v))
|
||||
}
|
||||
|
||||
// NotificationCommunity applies equality check predicate on the "notification_community" field. It's identical to NotificationCommunityEQ.
|
||||
func NotificationCommunity(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldNotificationCommunity, v))
|
||||
}
|
||||
|
||||
// NotificationSystem applies equality check predicate on the "notification_system" field. It's identical to NotificationSystemEQ.
|
||||
func NotificationSystem(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldNotificationSystem, v))
|
||||
}
|
||||
|
||||
// Theme applies equality check predicate on the "theme" field. It's identical to ThemeEQ.
|
||||
func Theme(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldTheme, v))
|
||||
}
|
||||
|
||||
// Language applies equality check predicate on the "language" field. It's identical to LanguageEQ.
|
||||
func Language(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UserIDEQ applies the EQ predicate on the "user_id" field.
|
||||
func UserIDEQ(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDNEQ applies the NEQ predicate on the "user_id" field.
|
||||
func UserIDNEQ(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDIn applies the In predicate on the "user_id" field.
|
||||
func UserIDIn(vs ...int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldIn(FieldUserID, vs...))
|
||||
}
|
||||
|
||||
// UserIDNotIn applies the NotIn predicate on the "user_id" field.
|
||||
func UserIDNotIn(vs ...int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNotIn(FieldUserID, vs...))
|
||||
}
|
||||
|
||||
// UserIDGT applies the GT predicate on the "user_id" field.
|
||||
func UserIDGT(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGT(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDGTE applies the GTE predicate on the "user_id" field.
|
||||
func UserIDGTE(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGTE(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDLT applies the LT predicate on the "user_id" field.
|
||||
func UserIDLT(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLT(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDLTE applies the LTE predicate on the "user_id" field.
|
||||
func UserIDLTE(v int64) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLTE(FieldUserID, v))
|
||||
}
|
||||
|
||||
// NotificationOrderEQ applies the EQ predicate on the "notification_order" field.
|
||||
func NotificationOrderEQ(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldNotificationOrder, v))
|
||||
}
|
||||
|
||||
// NotificationOrderNEQ applies the NEQ predicate on the "notification_order" field.
|
||||
func NotificationOrderNEQ(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldNotificationOrder, v))
|
||||
}
|
||||
|
||||
// NotificationCommunityEQ applies the EQ predicate on the "notification_community" field.
|
||||
func NotificationCommunityEQ(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldNotificationCommunity, v))
|
||||
}
|
||||
|
||||
// NotificationCommunityNEQ applies the NEQ predicate on the "notification_community" field.
|
||||
func NotificationCommunityNEQ(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldNotificationCommunity, v))
|
||||
}
|
||||
|
||||
// NotificationSystemEQ applies the EQ predicate on the "notification_system" field.
|
||||
func NotificationSystemEQ(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldNotificationSystem, v))
|
||||
}
|
||||
|
||||
// NotificationSystemNEQ applies the NEQ predicate on the "notification_system" field.
|
||||
func NotificationSystemNEQ(v bool) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldNotificationSystem, v))
|
||||
}
|
||||
|
||||
// ThemeEQ applies the EQ predicate on the "theme" field.
|
||||
func ThemeEQ(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeNEQ applies the NEQ predicate on the "theme" field.
|
||||
func ThemeNEQ(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeIn applies the In predicate on the "theme" field.
|
||||
func ThemeIn(vs ...string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldIn(FieldTheme, vs...))
|
||||
}
|
||||
|
||||
// ThemeNotIn applies the NotIn predicate on the "theme" field.
|
||||
func ThemeNotIn(vs ...string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNotIn(FieldTheme, vs...))
|
||||
}
|
||||
|
||||
// ThemeGT applies the GT predicate on the "theme" field.
|
||||
func ThemeGT(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGT(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeGTE applies the GTE predicate on the "theme" field.
|
||||
func ThemeGTE(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGTE(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeLT applies the LT predicate on the "theme" field.
|
||||
func ThemeLT(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLT(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeLTE applies the LTE predicate on the "theme" field.
|
||||
func ThemeLTE(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLTE(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeContains applies the Contains predicate on the "theme" field.
|
||||
func ThemeContains(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldContains(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeHasPrefix applies the HasPrefix predicate on the "theme" field.
|
||||
func ThemeHasPrefix(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldHasPrefix(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeHasSuffix applies the HasSuffix predicate on the "theme" field.
|
||||
func ThemeHasSuffix(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldHasSuffix(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeEqualFold applies the EqualFold predicate on the "theme" field.
|
||||
func ThemeEqualFold(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEqualFold(FieldTheme, v))
|
||||
}
|
||||
|
||||
// ThemeContainsFold applies the ContainsFold predicate on the "theme" field.
|
||||
func ThemeContainsFold(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldContainsFold(FieldTheme, v))
|
||||
}
|
||||
|
||||
// LanguageEQ applies the EQ predicate on the "language" field.
|
||||
func LanguageEQ(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageNEQ applies the NEQ predicate on the "language" field.
|
||||
func LanguageNEQ(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageIn applies the In predicate on the "language" field.
|
||||
func LanguageIn(vs ...string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldIn(FieldLanguage, vs...))
|
||||
}
|
||||
|
||||
// LanguageNotIn applies the NotIn predicate on the "language" field.
|
||||
func LanguageNotIn(vs ...string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNotIn(FieldLanguage, vs...))
|
||||
}
|
||||
|
||||
// LanguageGT applies the GT predicate on the "language" field.
|
||||
func LanguageGT(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGT(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageGTE applies the GTE predicate on the "language" field.
|
||||
func LanguageGTE(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGTE(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageLT applies the LT predicate on the "language" field.
|
||||
func LanguageLT(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLT(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageLTE applies the LTE predicate on the "language" field.
|
||||
func LanguageLTE(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLTE(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageContains applies the Contains predicate on the "language" field.
|
||||
func LanguageContains(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldContains(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageHasPrefix applies the HasPrefix predicate on the "language" field.
|
||||
func LanguageHasPrefix(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldHasPrefix(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageHasSuffix applies the HasSuffix predicate on the "language" field.
|
||||
func LanguageHasSuffix(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldHasSuffix(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageEqualFold applies the EqualFold predicate on the "language" field.
|
||||
func LanguageEqualFold(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEqualFold(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// LanguageContainsFold applies the ContainsFold predicate on the "language" field.
|
||||
func LanguageContainsFold(v string) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldContainsFold(FieldLanguage, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v time.Time) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.UserPreferences) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.UserPreferences) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.UserPreferences) predicate.UserPreferences {
|
||||
return predicate.UserPreferences(sql.NotPredicates(p))
|
||||
}
|
||||
Reference in New Issue
Block a user