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,73 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
// Source: game.proto
|
||||
|
||||
package gameservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"juwan-backend/app/game/rpc/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
AddGamesReq = pb.AddGamesReq
|
||||
AddGamesResp = pb.AddGamesResp
|
||||
DelGamesReq = pb.DelGamesReq
|
||||
DelGamesResp = pb.DelGamesResp
|
||||
Games = pb.Games
|
||||
GetGamesByIdReq = pb.GetGamesByIdReq
|
||||
GetGamesByIdResp = pb.GetGamesByIdResp
|
||||
SearchGamesReq = pb.SearchGamesReq
|
||||
SearchGamesResp = pb.SearchGamesResp
|
||||
UpdateGamesReq = pb.UpdateGamesReq
|
||||
UpdateGamesResp = pb.UpdateGamesResp
|
||||
|
||||
GameService interface {
|
||||
// -----------------------games-----------------------
|
||||
AddGames(ctx context.Context, in *AddGamesReq, opts ...grpc.CallOption) (*AddGamesResp, error)
|
||||
UpdateGames(ctx context.Context, in *UpdateGamesReq, opts ...grpc.CallOption) (*UpdateGamesResp, error)
|
||||
DelGames(ctx context.Context, in *DelGamesReq, opts ...grpc.CallOption) (*DelGamesResp, error)
|
||||
GetGamesById(ctx context.Context, in *GetGamesByIdReq, opts ...grpc.CallOption) (*GetGamesByIdResp, error)
|
||||
SearchGames(ctx context.Context, in *SearchGamesReq, opts ...grpc.CallOption) (*SearchGamesResp, error)
|
||||
}
|
||||
|
||||
defaultGameService struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewGameService(cli zrpc.Client) GameService {
|
||||
return &defaultGameService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------games-----------------------
|
||||
func (m *defaultGameService) AddGames(ctx context.Context, in *AddGamesReq, opts ...grpc.CallOption) (*AddGamesResp, error) {
|
||||
client := pb.NewGameServiceClient(m.cli.Conn())
|
||||
return client.AddGames(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultGameService) UpdateGames(ctx context.Context, in *UpdateGamesReq, opts ...grpc.CallOption) (*UpdateGamesResp, error) {
|
||||
client := pb.NewGameServiceClient(m.cli.Conn())
|
||||
return client.UpdateGames(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultGameService) DelGames(ctx context.Context, in *DelGamesReq, opts ...grpc.CallOption) (*DelGamesResp, error) {
|
||||
client := pb.NewGameServiceClient(m.cli.Conn())
|
||||
return client.DelGames(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultGameService) GetGamesById(ctx context.Context, in *GetGamesByIdReq, opts ...grpc.CallOption) (*GetGamesByIdResp, error) {
|
||||
client := pb.NewGameServiceClient(m.cli.Conn())
|
||||
return client.GetGamesById(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultGameService) SearchGames(ctx context.Context, in *SearchGamesReq, opts ...grpc.CallOption) (*SearchGamesResp, error) {
|
||||
client := pb.NewGameServiceClient(m.cli.Conn())
|
||||
return client.SearchGames(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user