fix: some api bug

This commit is contained in:
wwweww
2026-03-31 22:12:06 +08:00
parent c5ff4f0216
commit e7970ac25f
219 changed files with 16195 additions and 2126 deletions
@@ -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()