Refactor: Remove deprecated gRPC service files and implement new API structure

- Deleted old gRPC service definitions in `game_grpc.pb.go` and `public.go`.
- Added new API server implementations for objectstory, player, and shop services.
- Introduced configuration files for new APIs in `etc/*.yaml`.
- Created main entry points for each service in `objectstory.go`, `player.go`, and `shop.go`.
- Removed unused user update handler and user API files.
- Added utility functions for context management and HTTP header parsing.
- Introduced PostgreSQL backup configuration in `backup/postgreSql.yaml`.
This commit is contained in:
wwweww
2026-02-28 18:35:56 +08:00
parent d2f33b4b96
commit 19cc7a778c
349 changed files with 42548 additions and 1453 deletions
@@ -0,0 +1,89 @@
// Code generated by ent, DO NOT EDIT.
package wallet
import (
"entgo.io/ent/dialect/sql"
"github.com/shopspring/decimal"
)
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"
// 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.
FieldFrozenBalance = "frozen_balance"
// FieldVersion holds the string denoting the version field in the database.
FieldVersion = "version"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// Table holds the table name of the wallet in the database.
Table = "wallets"
)
// Columns holds all SQL columns for wallet fields.
var Columns = []string{
FieldID,
FieldUserID,
FieldBalance,
FieldFrozenBalance,
FieldVersion,
FieldUpdatedAt,
}
// 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
}
var (
// DefaultBalance holds the default value on creation for the "balance" field.
DefaultBalance decimal.Decimal
// DefaultFrozenBalance holds the default value on creation for the "frozen_balance" field.
DefaultFrozenBalance decimal.Decimal
// DefaultVersion holds the default value on creation for the "version" field.
DefaultVersion int
)
// OrderOption defines the ordering options for the Wallet 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()
}
// 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()
}
// ByFrozenBalance orders the results by the frozen_balance field.
func ByFrozenBalance(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFrozenBalance, opts...).ToFunc()
}
// ByVersion orders the results by the version field.
func ByVersion(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVersion, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
@@ -0,0 +1,296 @@
// Code generated by ent, DO NOT EDIT.
package wallet
import (
"juwan-backend/app/wallet/rpc/internal/models/predicate"
"time"
"entgo.io/ent/dialect/sql"
"github.com/shopspring/decimal"
)
// ID filters vertices based on their ID field.
func ID(id int) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.Wallet {
return predicate.Wallet(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.Wallet {
return predicate.Wallet(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.Wallet {
return predicate.Wallet(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.Wallet {
return predicate.Wallet(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.Wallet {
return predicate.Wallet(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.Wallet {
return predicate.Wallet(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) 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))
}
// FrozenBalance applies equality check predicate on the "frozen_balance" field. It's identical to FrozenBalanceEQ.
func FrozenBalance(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldFrozenBalance, v))
}
// Version applies equality check predicate on the "version" field. It's identical to VersionEQ.
func Version(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldVersion, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
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))
}
// BalanceNEQ applies the NEQ predicate on the "balance" field.
func BalanceNEQ(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldNEQ(FieldBalance, v))
}
// BalanceIn applies the In predicate on the "balance" field.
func BalanceIn(vs ...decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldIn(FieldBalance, vs...))
}
// BalanceNotIn applies the NotIn predicate on the "balance" field.
func BalanceNotIn(vs ...decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldNotIn(FieldBalance, vs...))
}
// BalanceGT applies the GT predicate on the "balance" field.
func BalanceGT(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldGT(FieldBalance, v))
}
// BalanceGTE applies the GTE predicate on the "balance" field.
func BalanceGTE(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldGTE(FieldBalance, v))
}
// BalanceLT applies the LT predicate on the "balance" field.
func BalanceLT(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldLT(FieldBalance, v))
}
// BalanceLTE applies the LTE predicate on the "balance" field.
func BalanceLTE(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldLTE(FieldBalance, v))
}
// FrozenBalanceEQ applies the EQ predicate on the "frozen_balance" field.
func FrozenBalanceEQ(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldFrozenBalance, v))
}
// FrozenBalanceNEQ applies the NEQ predicate on the "frozen_balance" field.
func FrozenBalanceNEQ(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldNEQ(FieldFrozenBalance, v))
}
// FrozenBalanceIn applies the In predicate on the "frozen_balance" field.
func FrozenBalanceIn(vs ...decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldIn(FieldFrozenBalance, vs...))
}
// FrozenBalanceNotIn applies the NotIn predicate on the "frozen_balance" field.
func FrozenBalanceNotIn(vs ...decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldNotIn(FieldFrozenBalance, vs...))
}
// FrozenBalanceGT applies the GT predicate on the "frozen_balance" field.
func FrozenBalanceGT(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldGT(FieldFrozenBalance, v))
}
// FrozenBalanceGTE applies the GTE predicate on the "frozen_balance" field.
func FrozenBalanceGTE(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldGTE(FieldFrozenBalance, v))
}
// FrozenBalanceLT applies the LT predicate on the "frozen_balance" field.
func FrozenBalanceLT(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldLT(FieldFrozenBalance, v))
}
// FrozenBalanceLTE applies the LTE predicate on the "frozen_balance" field.
func FrozenBalanceLTE(v decimal.Decimal) predicate.Wallet {
return predicate.Wallet(sql.FieldLTE(FieldFrozenBalance, v))
}
// VersionEQ applies the EQ predicate on the "version" field.
func VersionEQ(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldVersion, v))
}
// VersionNEQ applies the NEQ predicate on the "version" field.
func VersionNEQ(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldNEQ(FieldVersion, v))
}
// VersionIn applies the In predicate on the "version" field.
func VersionIn(vs ...int) predicate.Wallet {
return predicate.Wallet(sql.FieldIn(FieldVersion, vs...))
}
// VersionNotIn applies the NotIn predicate on the "version" field.
func VersionNotIn(vs ...int) predicate.Wallet {
return predicate.Wallet(sql.FieldNotIn(FieldVersion, vs...))
}
// VersionGT applies the GT predicate on the "version" field.
func VersionGT(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldGT(FieldVersion, v))
}
// VersionGTE applies the GTE predicate on the "version" field.
func VersionGTE(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldGTE(FieldVersion, v))
}
// VersionLT applies the LT predicate on the "version" field.
func VersionLT(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldLT(FieldVersion, v))
}
// VersionLTE applies the LTE predicate on the "version" field.
func VersionLTE(v int) predicate.Wallet {
return predicate.Wallet(sql.FieldLTE(FieldVersion, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.Wallet {
return predicate.Wallet(sql.FieldLTE(FieldUpdatedAt, v))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.Wallet) predicate.Wallet {
return predicate.Wallet(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Wallet) predicate.Wallet {
return predicate.Wallet(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Wallet) predicate.Wallet {
return predicate.Wallet(sql.NotPredicates(p))
}