Files
juwan-backend/app/users/rpc/internal/models/userfollows/userfollows.go
T
2026-03-31 22:12:06 +08:00

64 lines
1.9 KiB
Go

// Code generated by ent, DO NOT EDIT.
package userfollows
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the userfollows type in the database.
Label = "user_follows"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldFollowerID holds the string denoting the follower_id field in the database.
FieldFollowerID = "follower_id"
// FieldFolloweeID holds the string denoting the followee_id field in the database.
FieldFolloweeID = "followee_id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the userfollows in the database.
Table = "user_follows"
)
// Columns holds all SQL columns for userfollows fields.
var Columns = []string{
FieldID,
FieldFollowerID,
FieldFolloweeID,
FieldCreatedAt,
}
// 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
}
// OrderOption defines the ordering options for the UserFollows 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()
}
// ByFollowerID orders the results by the follower_id field.
func ByFollowerID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFollowerID, opts...).ToFunc()
}
// ByFolloweeID orders the results by the followee_id field.
func ByFolloweeID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFolloweeID, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}