Init V4 community edition (#2265)

* Init V4 community edition

* Init V4 community edition
This commit is contained in:
AaronLiu
2025-04-20 17:31:25 +08:00
committed by GitHub
parent da4e44b77a
commit 21d158db07
597 changed files with 119415 additions and 41692 deletions

185
ent/share/share.go Normal file
View File

@@ -0,0 +1,185 @@
// Code generated by ent, DO NOT EDIT.
package share
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the share type in the database.
Label = "share"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldPassword holds the string denoting the password field in the database.
FieldPassword = "password"
// FieldViews holds the string denoting the views field in the database.
FieldViews = "views"
// FieldDownloads holds the string denoting the downloads field in the database.
FieldDownloads = "downloads"
// FieldExpires holds the string denoting the expires field in the database.
FieldExpires = "expires"
// FieldRemainDownloads holds the string denoting the remain_downloads field in the database.
FieldRemainDownloads = "remain_downloads"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeFile holds the string denoting the file edge name in mutations.
EdgeFile = "file"
// Table holds the table name of the share in the database.
Table = "shares"
// UserTable is the table that holds the user relation/edge.
UserTable = "shares"
// UserInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "users"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_shares"
// FileTable is the table that holds the file relation/edge.
FileTable = "shares"
// FileInverseTable is the table name for the File entity.
// It exists in this package in order to avoid circular dependency with the "file" package.
FileInverseTable = "files"
// FileColumn is the table column denoting the file relation/edge.
FileColumn = "file_shares"
)
// Columns holds all SQL columns for share fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldDeletedAt,
FieldPassword,
FieldViews,
FieldDownloads,
FieldExpires,
FieldRemainDownloads,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "shares"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"file_shares",
"user_shares",
}
// 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
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
// import _ "github.com/cloudreve/Cloudreve/v4/ent/runtime"
var (
Hooks [1]ent.Hook
Interceptors [1]ent.Interceptor
// 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.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
UpdateDefaultUpdatedAt func() time.Time
// DefaultViews holds the default value on creation for the "views" field.
DefaultViews int
// DefaultDownloads holds the default value on creation for the "downloads" field.
DefaultDownloads int
)
// OrderOption defines the ordering options for the Share 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()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByPassword orders the results by the password field.
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPassword, opts...).ToFunc()
}
// ByViews orders the results by the views field.
func ByViews(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldViews, opts...).ToFunc()
}
// ByDownloads orders the results by the downloads field.
func ByDownloads(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDownloads, opts...).ToFunc()
}
// ByExpires orders the results by the expires field.
func ByExpires(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldExpires, opts...).ToFunc()
}
// ByRemainDownloads orders the results by the remain_downloads field.
func ByRemainDownloads(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemainDownloads, opts...).ToFunc()
}
// ByUserField orders the results by user field.
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
}
}
// ByFileField orders the results by file field.
func ByFileField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newFileStep(), sql.OrderByField(field, opts...))
}
}
func newUserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
}
func newFileStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(FileInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, FileTable, FileColumn),
)
}

542
ent/share/where.go Normal file
View File

@@ -0,0 +1,542 @@
// Code generated by ent, DO NOT EDIT.
package share
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/cloudreve/Cloudreve/v4/ent/predicate"
)
// ID filters vertices based on their ID field.
func ID(id int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.Share {
return predicate.Share(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.Share {
return predicate.Share(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.Share {
return predicate.Share(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldID, id))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldUpdatedAt, v))
}
// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.
func DeletedAt(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldDeletedAt, v))
}
// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
func Password(v string) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldPassword, v))
}
// Views applies equality check predicate on the "views" field. It's identical to ViewsEQ.
func Views(v int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldViews, v))
}
// Downloads applies equality check predicate on the "downloads" field. It's identical to DownloadsEQ.
func Downloads(v int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldDownloads, v))
}
// Expires applies equality check predicate on the "expires" field. It's identical to ExpiresEQ.
func Expires(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldExpires, v))
}
// RemainDownloads applies equality check predicate on the "remain_downloads" field. It's identical to RemainDownloadsEQ.
func RemainDownloads(v int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldRemainDownloads, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldUpdatedAt, v))
}
// DeletedAtEQ applies the EQ predicate on the "deleted_at" field.
func DeletedAtEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldDeletedAt, v))
}
// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.
func DeletedAtNEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldDeletedAt, v))
}
// DeletedAtIn applies the In predicate on the "deleted_at" field.
func DeletedAtIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldIn(FieldDeletedAt, vs...))
}
// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.
func DeletedAtNotIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldDeletedAt, vs...))
}
// DeletedAtGT applies the GT predicate on the "deleted_at" field.
func DeletedAtGT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGT(FieldDeletedAt, v))
}
// DeletedAtGTE applies the GTE predicate on the "deleted_at" field.
func DeletedAtGTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldDeletedAt, v))
}
// DeletedAtLT applies the LT predicate on the "deleted_at" field.
func DeletedAtLT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLT(FieldDeletedAt, v))
}
// DeletedAtLTE applies the LTE predicate on the "deleted_at" field.
func DeletedAtLTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldDeletedAt, v))
}
// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.
func DeletedAtIsNil() predicate.Share {
return predicate.Share(sql.FieldIsNull(FieldDeletedAt))
}
// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.
func DeletedAtNotNil() predicate.Share {
return predicate.Share(sql.FieldNotNull(FieldDeletedAt))
}
// PasswordEQ applies the EQ predicate on the "password" field.
func PasswordEQ(v string) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldPassword, v))
}
// PasswordNEQ applies the NEQ predicate on the "password" field.
func PasswordNEQ(v string) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldPassword, v))
}
// PasswordIn applies the In predicate on the "password" field.
func PasswordIn(vs ...string) predicate.Share {
return predicate.Share(sql.FieldIn(FieldPassword, vs...))
}
// PasswordNotIn applies the NotIn predicate on the "password" field.
func PasswordNotIn(vs ...string) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldPassword, vs...))
}
// PasswordGT applies the GT predicate on the "password" field.
func PasswordGT(v string) predicate.Share {
return predicate.Share(sql.FieldGT(FieldPassword, v))
}
// PasswordGTE applies the GTE predicate on the "password" field.
func PasswordGTE(v string) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldPassword, v))
}
// PasswordLT applies the LT predicate on the "password" field.
func PasswordLT(v string) predicate.Share {
return predicate.Share(sql.FieldLT(FieldPassword, v))
}
// PasswordLTE applies the LTE predicate on the "password" field.
func PasswordLTE(v string) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldPassword, v))
}
// PasswordContains applies the Contains predicate on the "password" field.
func PasswordContains(v string) predicate.Share {
return predicate.Share(sql.FieldContains(FieldPassword, v))
}
// PasswordHasPrefix applies the HasPrefix predicate on the "password" field.
func PasswordHasPrefix(v string) predicate.Share {
return predicate.Share(sql.FieldHasPrefix(FieldPassword, v))
}
// PasswordHasSuffix applies the HasSuffix predicate on the "password" field.
func PasswordHasSuffix(v string) predicate.Share {
return predicate.Share(sql.FieldHasSuffix(FieldPassword, v))
}
// PasswordIsNil applies the IsNil predicate on the "password" field.
func PasswordIsNil() predicate.Share {
return predicate.Share(sql.FieldIsNull(FieldPassword))
}
// PasswordNotNil applies the NotNil predicate on the "password" field.
func PasswordNotNil() predicate.Share {
return predicate.Share(sql.FieldNotNull(FieldPassword))
}
// PasswordEqualFold applies the EqualFold predicate on the "password" field.
func PasswordEqualFold(v string) predicate.Share {
return predicate.Share(sql.FieldEqualFold(FieldPassword, v))
}
// PasswordContainsFold applies the ContainsFold predicate on the "password" field.
func PasswordContainsFold(v string) predicate.Share {
return predicate.Share(sql.FieldContainsFold(FieldPassword, v))
}
// ViewsEQ applies the EQ predicate on the "views" field.
func ViewsEQ(v int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldViews, v))
}
// ViewsNEQ applies the NEQ predicate on the "views" field.
func ViewsNEQ(v int) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldViews, v))
}
// ViewsIn applies the In predicate on the "views" field.
func ViewsIn(vs ...int) predicate.Share {
return predicate.Share(sql.FieldIn(FieldViews, vs...))
}
// ViewsNotIn applies the NotIn predicate on the "views" field.
func ViewsNotIn(vs ...int) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldViews, vs...))
}
// ViewsGT applies the GT predicate on the "views" field.
func ViewsGT(v int) predicate.Share {
return predicate.Share(sql.FieldGT(FieldViews, v))
}
// ViewsGTE applies the GTE predicate on the "views" field.
func ViewsGTE(v int) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldViews, v))
}
// ViewsLT applies the LT predicate on the "views" field.
func ViewsLT(v int) predicate.Share {
return predicate.Share(sql.FieldLT(FieldViews, v))
}
// ViewsLTE applies the LTE predicate on the "views" field.
func ViewsLTE(v int) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldViews, v))
}
// DownloadsEQ applies the EQ predicate on the "downloads" field.
func DownloadsEQ(v int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldDownloads, v))
}
// DownloadsNEQ applies the NEQ predicate on the "downloads" field.
func DownloadsNEQ(v int) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldDownloads, v))
}
// DownloadsIn applies the In predicate on the "downloads" field.
func DownloadsIn(vs ...int) predicate.Share {
return predicate.Share(sql.FieldIn(FieldDownloads, vs...))
}
// DownloadsNotIn applies the NotIn predicate on the "downloads" field.
func DownloadsNotIn(vs ...int) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldDownloads, vs...))
}
// DownloadsGT applies the GT predicate on the "downloads" field.
func DownloadsGT(v int) predicate.Share {
return predicate.Share(sql.FieldGT(FieldDownloads, v))
}
// DownloadsGTE applies the GTE predicate on the "downloads" field.
func DownloadsGTE(v int) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldDownloads, v))
}
// DownloadsLT applies the LT predicate on the "downloads" field.
func DownloadsLT(v int) predicate.Share {
return predicate.Share(sql.FieldLT(FieldDownloads, v))
}
// DownloadsLTE applies the LTE predicate on the "downloads" field.
func DownloadsLTE(v int) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldDownloads, v))
}
// ExpiresEQ applies the EQ predicate on the "expires" field.
func ExpiresEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldExpires, v))
}
// ExpiresNEQ applies the NEQ predicate on the "expires" field.
func ExpiresNEQ(v time.Time) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldExpires, v))
}
// ExpiresIn applies the In predicate on the "expires" field.
func ExpiresIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldIn(FieldExpires, vs...))
}
// ExpiresNotIn applies the NotIn predicate on the "expires" field.
func ExpiresNotIn(vs ...time.Time) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldExpires, vs...))
}
// ExpiresGT applies the GT predicate on the "expires" field.
func ExpiresGT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGT(FieldExpires, v))
}
// ExpiresGTE applies the GTE predicate on the "expires" field.
func ExpiresGTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldExpires, v))
}
// ExpiresLT applies the LT predicate on the "expires" field.
func ExpiresLT(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLT(FieldExpires, v))
}
// ExpiresLTE applies the LTE predicate on the "expires" field.
func ExpiresLTE(v time.Time) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldExpires, v))
}
// ExpiresIsNil applies the IsNil predicate on the "expires" field.
func ExpiresIsNil() predicate.Share {
return predicate.Share(sql.FieldIsNull(FieldExpires))
}
// ExpiresNotNil applies the NotNil predicate on the "expires" field.
func ExpiresNotNil() predicate.Share {
return predicate.Share(sql.FieldNotNull(FieldExpires))
}
// RemainDownloadsEQ applies the EQ predicate on the "remain_downloads" field.
func RemainDownloadsEQ(v int) predicate.Share {
return predicate.Share(sql.FieldEQ(FieldRemainDownloads, v))
}
// RemainDownloadsNEQ applies the NEQ predicate on the "remain_downloads" field.
func RemainDownloadsNEQ(v int) predicate.Share {
return predicate.Share(sql.FieldNEQ(FieldRemainDownloads, v))
}
// RemainDownloadsIn applies the In predicate on the "remain_downloads" field.
func RemainDownloadsIn(vs ...int) predicate.Share {
return predicate.Share(sql.FieldIn(FieldRemainDownloads, vs...))
}
// RemainDownloadsNotIn applies the NotIn predicate on the "remain_downloads" field.
func RemainDownloadsNotIn(vs ...int) predicate.Share {
return predicate.Share(sql.FieldNotIn(FieldRemainDownloads, vs...))
}
// RemainDownloadsGT applies the GT predicate on the "remain_downloads" field.
func RemainDownloadsGT(v int) predicate.Share {
return predicate.Share(sql.FieldGT(FieldRemainDownloads, v))
}
// RemainDownloadsGTE applies the GTE predicate on the "remain_downloads" field.
func RemainDownloadsGTE(v int) predicate.Share {
return predicate.Share(sql.FieldGTE(FieldRemainDownloads, v))
}
// RemainDownloadsLT applies the LT predicate on the "remain_downloads" field.
func RemainDownloadsLT(v int) predicate.Share {
return predicate.Share(sql.FieldLT(FieldRemainDownloads, v))
}
// RemainDownloadsLTE applies the LTE predicate on the "remain_downloads" field.
func RemainDownloadsLTE(v int) predicate.Share {
return predicate.Share(sql.FieldLTE(FieldRemainDownloads, v))
}
// RemainDownloadsIsNil applies the IsNil predicate on the "remain_downloads" field.
func RemainDownloadsIsNil() predicate.Share {
return predicate.Share(sql.FieldIsNull(FieldRemainDownloads))
}
// RemainDownloadsNotNil applies the NotNil predicate on the "remain_downloads" field.
func RemainDownloadsNotNil() predicate.Share {
return predicate.Share(sql.FieldNotNull(FieldRemainDownloads))
}
// HasUser applies the HasEdge predicate on the "user" edge.
func HasUser() predicate.Share {
return predicate.Share(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func HasUserWith(preds ...predicate.User) predicate.Share {
return predicate.Share(func(s *sql.Selector) {
step := newUserStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasFile applies the HasEdge predicate on the "file" edge.
func HasFile() predicate.Share {
return predicate.Share(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, FileTable, FileColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasFileWith applies the HasEdge predicate on the "file" edge with a given conditions (other predicates).
func HasFileWith(preds ...predicate.File) predicate.Share {
return predicate.Share(func(s *sql.Selector) {
step := newFileStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.Share) predicate.Share {
return predicate.Share(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Share) predicate.Share {
return predicate.Share(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Share) predicate.Share {
return predicate.Share(sql.NotPredicates(p))
}