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,116 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.9.2
|
||||
// Source: order.proto
|
||||
|
||||
package orderservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"juwan-backend/app/order/rpc/pb"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
AddOrderStateLogsReq = pb.AddOrderStateLogsReq
|
||||
AddOrderStateLogsResp = pb.AddOrderStateLogsResp
|
||||
AddOrdersReq = pb.AddOrdersReq
|
||||
AddOrdersResp = pb.AddOrdersResp
|
||||
DelOrderStateLogsReq = pb.DelOrderStateLogsReq
|
||||
DelOrderStateLogsResp = pb.DelOrderStateLogsResp
|
||||
DelOrdersReq = pb.DelOrdersReq
|
||||
DelOrdersResp = pb.DelOrdersResp
|
||||
GetOrderStateLogsByIdReq = pb.GetOrderStateLogsByIdReq
|
||||
GetOrderStateLogsByIdResp = pb.GetOrderStateLogsByIdResp
|
||||
GetOrdersByIdReq = pb.GetOrdersByIdReq
|
||||
GetOrdersByIdResp = pb.GetOrdersByIdResp
|
||||
OrderStateLogs = pb.OrderStateLogs
|
||||
Orders = pb.Orders
|
||||
SearchOrderStateLogsReq = pb.SearchOrderStateLogsReq
|
||||
SearchOrderStateLogsResp = pb.SearchOrderStateLogsResp
|
||||
SearchOrdersReq = pb.SearchOrdersReq
|
||||
SearchOrdersResp = pb.SearchOrdersResp
|
||||
UpdateOrderStateLogsReq = pb.UpdateOrderStateLogsReq
|
||||
UpdateOrderStateLogsResp = pb.UpdateOrderStateLogsResp
|
||||
UpdateOrdersReq = pb.UpdateOrdersReq
|
||||
UpdateOrdersResp = pb.UpdateOrdersResp
|
||||
|
||||
OrderService interface {
|
||||
// -----------------------orders-----------------------
|
||||
AddOrders(ctx context.Context, in *AddOrdersReq, opts ...grpc.CallOption) (*AddOrdersResp, error)
|
||||
UpdateOrders(ctx context.Context, in *UpdateOrdersReq, opts ...grpc.CallOption) (*UpdateOrdersResp, error)
|
||||
DelOrders(ctx context.Context, in *DelOrdersReq, opts ...grpc.CallOption) (*DelOrdersResp, error)
|
||||
GetOrdersById(ctx context.Context, in *GetOrdersByIdReq, opts ...grpc.CallOption) (*GetOrdersByIdResp, error)
|
||||
SearchOrders(ctx context.Context, in *SearchOrdersReq, opts ...grpc.CallOption) (*SearchOrdersResp, error)
|
||||
// -----------------------orderStateLogs-----------------------
|
||||
AddOrderStateLogs(ctx context.Context, in *AddOrderStateLogsReq, opts ...grpc.CallOption) (*AddOrderStateLogsResp, error)
|
||||
UpdateOrderStateLogs(ctx context.Context, in *UpdateOrderStateLogsReq, opts ...grpc.CallOption) (*UpdateOrderStateLogsResp, error)
|
||||
DelOrderStateLogs(ctx context.Context, in *DelOrderStateLogsReq, opts ...grpc.CallOption) (*DelOrderStateLogsResp, error)
|
||||
GetOrderStateLogsById(ctx context.Context, in *GetOrderStateLogsByIdReq, opts ...grpc.CallOption) (*GetOrderStateLogsByIdResp, error)
|
||||
SearchOrderStateLogs(ctx context.Context, in *SearchOrderStateLogsReq, opts ...grpc.CallOption) (*SearchOrderStateLogsResp, error)
|
||||
}
|
||||
|
||||
defaultOrderService struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewOrderService(cli zrpc.Client) OrderService {
|
||||
return &defaultOrderService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------orders-----------------------
|
||||
func (m *defaultOrderService) AddOrders(ctx context.Context, in *AddOrdersReq, opts ...grpc.CallOption) (*AddOrdersResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.AddOrders(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) UpdateOrders(ctx context.Context, in *UpdateOrdersReq, opts ...grpc.CallOption) (*UpdateOrdersResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.UpdateOrders(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) DelOrders(ctx context.Context, in *DelOrdersReq, opts ...grpc.CallOption) (*DelOrdersResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.DelOrders(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) GetOrdersById(ctx context.Context, in *GetOrdersByIdReq, opts ...grpc.CallOption) (*GetOrdersByIdResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.GetOrdersById(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) SearchOrders(ctx context.Context, in *SearchOrdersReq, opts ...grpc.CallOption) (*SearchOrdersResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.SearchOrders(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// -----------------------orderStateLogs-----------------------
|
||||
func (m *defaultOrderService) AddOrderStateLogs(ctx context.Context, in *AddOrderStateLogsReq, opts ...grpc.CallOption) (*AddOrderStateLogsResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.AddOrderStateLogs(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) UpdateOrderStateLogs(ctx context.Context, in *UpdateOrderStateLogsReq, opts ...grpc.CallOption) (*UpdateOrderStateLogsResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.UpdateOrderStateLogs(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) DelOrderStateLogs(ctx context.Context, in *DelOrderStateLogsReq, opts ...grpc.CallOption) (*DelOrderStateLogsResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.DelOrderStateLogs(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) GetOrderStateLogsById(ctx context.Context, in *GetOrderStateLogsByIdReq, opts ...grpc.CallOption) (*GetOrderStateLogsByIdResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.GetOrderStateLogsById(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOrderService) SearchOrderStateLogs(ctx context.Context, in *SearchOrderStateLogsReq, opts ...grpc.CallOption) (*SearchOrderStateLogsResp, error) {
|
||||
client := pb.NewOrderServiceClient(m.cli.Conn())
|
||||
return client.SearchOrderStateLogs(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user