♻️ Refactor keybinding service
This commit is contained in:
@@ -22,8 +22,8 @@ const (
|
||||
FieldUpdatedAt = "updated_at"
|
||||
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
|
||||
FieldDeletedAt = "deleted_at"
|
||||
// FieldKey holds the string denoting the key field in the database.
|
||||
FieldKey = "key"
|
||||
// FieldName holds the string denoting the name field in the database.
|
||||
FieldName = "name"
|
||||
// FieldType holds the string denoting the type field in the database.
|
||||
FieldType = "type"
|
||||
// FieldColors holds the string denoting the colors field in the database.
|
||||
@@ -39,7 +39,7 @@ var Columns = []string{
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldDeletedAt,
|
||||
FieldKey,
|
||||
FieldName,
|
||||
FieldType,
|
||||
FieldColors,
|
||||
}
|
||||
@@ -68,8 +68,8 @@ var (
|
||||
DefaultCreatedAt func() string
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() string
|
||||
// KeyValidator is a validator for the "key" field. It is called by the builders before save.
|
||||
KeyValidator func(string) error
|
||||
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
NameValidator func(string) error
|
||||
)
|
||||
|
||||
// Type defines the type for the "type" enum field.
|
||||
@@ -123,9 +123,9 @@ func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByKey orders the results by the key field.
|
||||
func ByKey(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldKey, opts...).ToFunc()
|
||||
// ByName orders the results by the name field.
|
||||
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByType orders the results by the type field.
|
||||
|
||||
@@ -73,9 +73,9 @@ func DeletedAt(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEQ(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// Key applies equality check predicate on the "key" field. It's identical to KeyEQ.
|
||||
func Key(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEQ(FieldKey, v))
|
||||
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
|
||||
func Name(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// UUIDEQ applies the EQ predicate on the "uuid" field.
|
||||
@@ -133,16 +133,6 @@ func UUIDHasSuffix(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldHasSuffix(FieldUUID, v))
|
||||
}
|
||||
|
||||
// UUIDIsNil applies the IsNil predicate on the "uuid" field.
|
||||
func UUIDIsNil() predicate.Theme {
|
||||
return predicate.Theme(sql.FieldIsNull(FieldUUID))
|
||||
}
|
||||
|
||||
// UUIDNotNil applies the NotNil predicate on the "uuid" field.
|
||||
func UUIDNotNil() predicate.Theme {
|
||||
return predicate.Theme(sql.FieldNotNull(FieldUUID))
|
||||
}
|
||||
|
||||
// UUIDEqualFold applies the EqualFold predicate on the "uuid" field.
|
||||
func UUIDEqualFold(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEqualFold(FieldUUID, v))
|
||||
@@ -358,69 +348,69 @@ func DeletedAtContainsFold(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldContainsFold(FieldDeletedAt, v))
|
||||
}
|
||||
|
||||
// KeyEQ applies the EQ predicate on the "key" field.
|
||||
func KeyEQ(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEQ(FieldKey, v))
|
||||
// NameEQ applies the EQ predicate on the "name" field.
|
||||
func NameEQ(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyNEQ applies the NEQ predicate on the "key" field.
|
||||
func KeyNEQ(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldNEQ(FieldKey, v))
|
||||
// NameNEQ applies the NEQ predicate on the "name" field.
|
||||
func NameNEQ(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldNEQ(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyIn applies the In predicate on the "key" field.
|
||||
func KeyIn(vs ...string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldIn(FieldKey, vs...))
|
||||
// NameIn applies the In predicate on the "name" field.
|
||||
func NameIn(vs ...string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// KeyNotIn applies the NotIn predicate on the "key" field.
|
||||
func KeyNotIn(vs ...string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldNotIn(FieldKey, vs...))
|
||||
// NameNotIn applies the NotIn predicate on the "name" field.
|
||||
func NameNotIn(vs ...string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldNotIn(FieldName, vs...))
|
||||
}
|
||||
|
||||
// KeyGT applies the GT predicate on the "key" field.
|
||||
func KeyGT(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldGT(FieldKey, v))
|
||||
// NameGT applies the GT predicate on the "name" field.
|
||||
func NameGT(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldGT(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyGTE applies the GTE predicate on the "key" field.
|
||||
func KeyGTE(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldGTE(FieldKey, v))
|
||||
// NameGTE applies the GTE predicate on the "name" field.
|
||||
func NameGTE(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldGTE(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyLT applies the LT predicate on the "key" field.
|
||||
func KeyLT(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldLT(FieldKey, v))
|
||||
// NameLT applies the LT predicate on the "name" field.
|
||||
func NameLT(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldLT(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyLTE applies the LTE predicate on the "key" field.
|
||||
func KeyLTE(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldLTE(FieldKey, v))
|
||||
// NameLTE applies the LTE predicate on the "name" field.
|
||||
func NameLTE(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldLTE(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyContains applies the Contains predicate on the "key" field.
|
||||
func KeyContains(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldContains(FieldKey, v))
|
||||
// NameContains applies the Contains predicate on the "name" field.
|
||||
func NameContains(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldContains(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyHasPrefix applies the HasPrefix predicate on the "key" field.
|
||||
func KeyHasPrefix(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldHasPrefix(FieldKey, v))
|
||||
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
|
||||
func NameHasPrefix(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldHasPrefix(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyHasSuffix applies the HasSuffix predicate on the "key" field.
|
||||
func KeyHasSuffix(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldHasSuffix(FieldKey, v))
|
||||
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
|
||||
func NameHasSuffix(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldHasSuffix(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyEqualFold applies the EqualFold predicate on the "key" field.
|
||||
func KeyEqualFold(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEqualFold(FieldKey, v))
|
||||
// NameEqualFold applies the EqualFold predicate on the "name" field.
|
||||
func NameEqualFold(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldEqualFold(FieldName, v))
|
||||
}
|
||||
|
||||
// KeyContainsFold applies the ContainsFold predicate on the "key" field.
|
||||
func KeyContainsFold(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldContainsFold(FieldKey, v))
|
||||
// NameContainsFold applies the ContainsFold predicate on the "name" field.
|
||||
func NameContainsFold(v string) predicate.Theme {
|
||||
return predicate.Theme(sql.FieldContainsFold(FieldName, v))
|
||||
}
|
||||
|
||||
// TypeEQ applies the EQ predicate on the "type" field.
|
||||
|
||||
Reference in New Issue
Block a user