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:
@@ -0,0 +1,45 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
wallet "juwan-backend/app/wallet/api/internal/handler/wallet"
|
||||
"juwan-backend/app/wallet/api/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 获取余额
|
||||
Method: http.MethodGet,
|
||||
Path: "/balance",
|
||||
Handler: wallet.GetBalanceHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 充值
|
||||
Method: http.MethodPost,
|
||||
Path: "/topup",
|
||||
Handler: wallet.TopupHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 获取流水
|
||||
Method: http.MethodGet,
|
||||
Path: "/transactions",
|
||||
Handler: wallet.ListTransactionsHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 提现
|
||||
Method: http.MethodPost,
|
||||
Path: "/withdraw",
|
||||
Handler: wallet.WithdrawHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/v1/wallet"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user