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
+39 -40
View File
@@ -1,50 +1,49 @@
syntax = "v1"
import "common.api"
type (
WalletBalance {
Balance float64 `json:"balance"`
FrozenBalance float64 `json:"frozenBalance"`
}
Transaction {
Id int64 `json:"id"`
Type string `json:"type"`
Amount float64 `json:"amount"`
Description string `json:"description"`
OrderId string `json:"orderId,optional"`
CreatedAt string `json:"createdAt"`
}
TransactionListResp {
Items []Transaction `json:"items"`
Meta PageMeta `json:"meta"`
}
TopupReq {
Amount float64 `json:"amount"`
Method string `json:"method"`
}
WalletBalance {
Balance string `json:"balance"`
FrozenBalance string `json:"frozenBalance"`
}
Transaction {
Id int64 `json:"id"`
Type string `json:"type"`
Amount string `json:"amount"`
Description string `json:"description"`
OrderId string `json:"orderId,optional"`
CreatedAt string `json:"createdAt"`
}
TransactionListResp {
Items []Transaction `json:"items"`
Meta PageMeta `json:"meta"`
}
TopupReq {
Amount string `json:"amount"`
Method string `json:"method"`
}
)
@server(
prefix: api/v1/wallet
group: wallet
@server (
prefix: api/v1/wallet
group: wallet
)
service juwan-api {
@doc "获取余额"
@handler GetBalance
get /balance (EmptyResp) returns (WalletBalance)
service wallet-api {
@doc "获取余额"
@handler GetBalance
get /balance (EmptyResp) returns (WalletBalance)
@doc "获取流水"
@handler ListTransactions
get /transactions (PageReq) returns (TransactionListResp)
@doc "获取流水"
@handler ListTransactions
get /transactions (PageReq) returns (TransactionListResp)
@doc "充值"
@handler Topup
post /topup (TopupReq) returns (EmptyResp)
@doc "充值"
@handler Topup
post /topup (TopupReq) returns (EmptyResp)
@doc "提现"
@handler Withdraw
post /withdraw (TopupReq) returns (EmptyResp)
}
@doc "提现"
@handler Withdraw
post /withdraw (TopupReq) returns (EmptyResp)
}