name change
This commit is contained in:
@ -4,6 +4,9 @@ package card
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -93,6 +96,80 @@ var (
|
||||
DefaultCp func() int
|
||||
// DefaultURL holds the default value on creation for the "url" field.
|
||||
DefaultURL string
|
||||
// DefaultAuthor holds the default value on creation for the "author" field.
|
||||
DefaultAuthor string
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Card 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()
|
||||
}
|
||||
|
||||
// ByPassword orders the results by the password field.
|
||||
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPassword, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCard orders the results by the card field.
|
||||
func ByCard(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCard, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySkill orders the results by the skill field.
|
||||
func BySkill(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSkill, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByStatus orders the results by the status field.
|
||||
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByToken orders the results by the token field.
|
||||
func ByToken(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldToken, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCp orders the results by the cp field.
|
||||
func ByCp(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCp, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByURL orders the results by the url field.
|
||||
func ByURL(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldURL, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCount orders the results by the count field.
|
||||
func ByCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCount, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAuthor orders the results by the author field.
|
||||
func ByAuthor(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAuthor, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOwnerField orders the results by owner field.
|
||||
func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
func newOwnerStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(OwnerInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
package card
|
||||
|
||||
import (
|
||||
"t/ent/predicate"
|
||||
"api/ent/predicate"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
@ -759,11 +759,7 @@ func HasOwner() predicate.Card {
|
||||
// HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).
|
||||
func HasOwnerWith(preds ...predicate.User) predicate.Card {
|
||||
return predicate.Card(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(OwnerInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
|
||||
)
|
||||
step := newOwnerStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
|
Reference in New Issue
Block a user