fix: some api bug
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
package wallet
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
@@ -11,9 +13,7 @@ const (
|
||||
// Label holds the string label denoting the wallet type in the database.
|
||||
Label = "wallet"
|
||||
// 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"
|
||||
FieldID = "user_id"
|
||||
// FieldBalance holds the string denoting the balance field in the database.
|
||||
FieldBalance = "balance"
|
||||
// FieldFrozenBalance holds the string denoting the frozen_balance field in the database.
|
||||
@@ -29,7 +29,6 @@ const (
|
||||
// Columns holds all SQL columns for wallet fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldUserID,
|
||||
FieldBalance,
|
||||
FieldFrozenBalance,
|
||||
FieldVersion,
|
||||
@@ -53,6 +52,8 @@ var (
|
||||
DefaultFrozenBalance decimal.Decimal
|
||||
// DefaultVersion holds the default value on creation for the "version" field.
|
||||
DefaultVersion int
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
DefaultUpdatedAt func() time.Time
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the Wallet queries.
|
||||
@@ -63,11 +64,6 @@ 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()
|
||||
}
|
||||
|
||||
// ByBalance orders the results by the balance field.
|
||||
func ByBalance(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldBalance, opts...).ToFunc()
|
||||
|
||||
@@ -11,55 +11,50 @@ import (
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Wallet {
|
||||
func ID(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Wallet {
|
||||
func IDEQ(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Wallet {
|
||||
func IDNEQ(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Wallet {
|
||||
func IDIn(ids ...int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Wallet {
|
||||
func IDNotIn(ids ...int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Wallet {
|
||||
func IDGT(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Wallet {
|
||||
func IDGTE(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Wallet {
|
||||
func IDLT(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Wallet {
|
||||
func IDLTE(id int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
|
||||
func UserID(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// Balance applies equality check predicate on the "balance" field. It's identical to BalanceEQ.
|
||||
func Balance(v decimal.Decimal) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldBalance, v))
|
||||
@@ -80,46 +75,6 @@ func UpdatedAt(v time.Time) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UserIDEQ applies the EQ predicate on the "user_id" field.
|
||||
func UserIDEQ(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDNEQ applies the NEQ predicate on the "user_id" field.
|
||||
func UserIDNEQ(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldNEQ(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDIn applies the In predicate on the "user_id" field.
|
||||
func UserIDIn(vs ...int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldIn(FieldUserID, vs...))
|
||||
}
|
||||
|
||||
// UserIDNotIn applies the NotIn predicate on the "user_id" field.
|
||||
func UserIDNotIn(vs ...int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldNotIn(FieldUserID, vs...))
|
||||
}
|
||||
|
||||
// UserIDGT applies the GT predicate on the "user_id" field.
|
||||
func UserIDGT(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldGT(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDGTE applies the GTE predicate on the "user_id" field.
|
||||
func UserIDGTE(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldGTE(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDLT applies the LT predicate on the "user_id" field.
|
||||
func UserIDLT(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldLT(FieldUserID, v))
|
||||
}
|
||||
|
||||
// UserIDLTE applies the LTE predicate on the "user_id" field.
|
||||
func UserIDLTE(v int64) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldLTE(FieldUserID, v))
|
||||
}
|
||||
|
||||
// BalanceEQ applies the EQ predicate on the "balance" field.
|
||||
func BalanceEQ(v decimal.Decimal) predicate.Wallet {
|
||||
return predicate.Wallet(sql.FieldEQ(FieldBalance, v))
|
||||
|
||||
Reference in New Issue
Block a user