ranking
This commit is contained in:
parent
c679ea79af
commit
be43c6bfd0
@ -1,39 +0,0 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.6
|
||||
// Source: ranking.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/logic"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/ranking"
|
||||
)
|
||||
|
||||
type RankingManagementServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
ranking.UnimplementedRankingManagementServer
|
||||
}
|
||||
|
||||
func NewRankingManagementServer(svcCtx *svc.ServiceContext) *RankingManagementServer {
|
||||
return &RankingManagementServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *RankingManagementServer) Ping(ctx context.Context, in *ranking.Request) (*ranking.Response, error) {
|
||||
l := logic.NewPingLogic(ctx, s.svcCtx)
|
||||
return l.Ping(in)
|
||||
}
|
||||
|
||||
func (s *RankingManagementServer) SetUserGameScore(ctx context.Context, in *ranking.SetUserGameScoreRequest) (*ranking.BaseResult, error) {
|
||||
l := logic.NewSetUserGameScoreLogic(ctx, s.svcCtx)
|
||||
return l.SetUserGameScore(in)
|
||||
}
|
||||
|
||||
func (s *RankingManagementServer) GetRankingList(ctx context.Context, in *ranking.GetRankingListRequest) (*ranking.GetRankingListResponse, error) {
|
||||
l := logic.NewGetRankingListLogic(ctx, s.svcCtx)
|
||||
return l.GetRankingList(in)
|
||||
}
|
@ -1,197 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v3.19.4
|
||||
// source: ranking.proto
|
||||
|
||||
package ranking
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
RankingManagement_Ping_FullMethodName = "/ranking.Ranking_management/Ping"
|
||||
RankingManagement_SetUserGameScore_FullMethodName = "/ranking.Ranking_management/SetUserGameScore"
|
||||
RankingManagement_GetRankingList_FullMethodName = "/ranking.Ranking_management/GetRankingList"
|
||||
)
|
||||
|
||||
// RankingManagementClient is the client API for RankingManagement service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type RankingManagementClient interface {
|
||||
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error)
|
||||
GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error)
|
||||
}
|
||||
|
||||
type rankingManagementClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRankingManagementClient(cc grpc.ClientConnInterface) RankingManagementClient {
|
||||
return &rankingManagementClient{cc}
|
||||
}
|
||||
|
||||
func (c *rankingManagementClient) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, RankingManagement_Ping_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rankingManagementClient) SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BaseResult)
|
||||
err := c.cc.Invoke(ctx, RankingManagement_SetUserGameScore_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rankingManagementClient) GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetRankingListResponse)
|
||||
err := c.cc.Invoke(ctx, RankingManagement_GetRankingList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RankingManagementServer is the server API for RankingManagement service.
|
||||
// All implementations must embed UnimplementedRankingManagementServer
|
||||
// for forward compatibility.
|
||||
type RankingManagementServer interface {
|
||||
Ping(context.Context, *Request) (*Response, error)
|
||||
SetUserGameScore(context.Context, *SetUserGameScoreRequest) (*BaseResult, error)
|
||||
GetRankingList(context.Context, *GetRankingListRequest) (*GetRankingListResponse, error)
|
||||
mustEmbedUnimplementedRankingManagementServer()
|
||||
}
|
||||
|
||||
// UnimplementedRankingManagementServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRankingManagementServer struct{}
|
||||
|
||||
func (UnimplementedRankingManagementServer) Ping(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||||
}
|
||||
func (UnimplementedRankingManagementServer) SetUserGameScore(context.Context, *SetUserGameScoreRequest) (*BaseResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetUserGameScore not implemented")
|
||||
}
|
||||
func (UnimplementedRankingManagementServer) GetRankingList(context.Context, *GetRankingListRequest) (*GetRankingListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRankingList not implemented")
|
||||
}
|
||||
func (UnimplementedRankingManagementServer) mustEmbedUnimplementedRankingManagementServer() {}
|
||||
func (UnimplementedRankingManagementServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRankingManagementServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RankingManagementServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRankingManagementServer interface {
|
||||
mustEmbedUnimplementedRankingManagementServer()
|
||||
}
|
||||
|
||||
func RegisterRankingManagementServer(s grpc.ServiceRegistrar, srv RankingManagementServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRankingManagementServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RankingManagement_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RankingManagement_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RankingManagementServer).Ping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RankingManagement_Ping_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RankingManagementServer).Ping(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RankingManagement_SetUserGameScore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetUserGameScoreRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RankingManagementServer).SetUserGameScore(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RankingManagement_SetUserGameScore_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RankingManagementServer).SetUserGameScore(ctx, req.(*SetUserGameScoreRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RankingManagement_GetRankingList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRankingListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RankingManagementServer).GetRankingList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RankingManagement_GetRankingList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RankingManagementServer).GetRankingList(ctx, req.(*GetRankingListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RankingManagement_ServiceDesc is the grpc.ServiceDesc for RankingManagement service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RankingManagement_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ranking.Ranking_management",
|
||||
HandlerType: (*RankingManagementServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Ping",
|
||||
Handler: _RankingManagement_Ping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetUserGameScore",
|
||||
Handler: _RankingManagement_SetUserGameScore_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRankingList",
|
||||
Handler: _RankingManagement_GetRankingList_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ranking.proto",
|
||||
}
|
@ -16,7 +16,7 @@ import (
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/gen/dao/model"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/gen/dao/model"
|
||||
)
|
||||
|
||||
func newGameScore(db *gorm.DB, opts ...gen.DOOption) gameScore {
|
@ -9,7 +9,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/gen/dao/model"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/gen/dao/model"
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
"gorm.io/gorm/clause"
|
@ -3,9 +3,9 @@ package logic
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/logic/rankings"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/logic/rankings"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/user/user"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gorm.io/gorm"
|
@ -2,8 +2,8 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
@ -3,10 +3,10 @@ package logic
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/gen/dao/model"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/logic/rankings"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/gen/dao/model"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/logic/rankings"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
@ -0,0 +1,39 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.6
|
||||
// Source: ranking_service.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/logic"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
||||
)
|
||||
|
||||
type RankingServiceServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
ranking.UnimplementedRankingServiceServer
|
||||
}
|
||||
|
||||
func NewRankingServiceServer(svcCtx *svc.ServiceContext) *RankingServiceServer {
|
||||
return &RankingServiceServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *RankingServiceServer) Ping(ctx context.Context, in *ranking.Request) (*ranking.Response, error) {
|
||||
l := logic.NewPingLogic(ctx, s.svcCtx)
|
||||
return l.Ping(in)
|
||||
}
|
||||
|
||||
func (s *RankingServiceServer) SetUserGameScore(ctx context.Context, in *ranking.SetUserGameScoreRequest) (*ranking.BaseResult, error) {
|
||||
l := logic.NewSetUserGameScoreLogic(ctx, s.svcCtx)
|
||||
return l.SetUserGameScore(in)
|
||||
}
|
||||
|
||||
func (s *RankingServiceServer) GetRankingList(ctx context.Context, in *ranking.GetRankingListRequest) (*ranking.GetRankingListResponse, error) {
|
||||
l := logic.NewGetRankingListLogic(ctx, s.svcCtx)
|
||||
return l.GetRankingList(in)
|
||||
}
|
@ -2,8 +2,8 @@ package svc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/gen/dao/query"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/logic/rankings"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/gen/dao/query"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/logic/rankings"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/user/user"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/user/user_client"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/pkg/config"
|
@ -2,7 +2,7 @@
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.4
|
||||
// protoc v3.19.4
|
||||
// source: ranking.proto
|
||||
// source: ranking_service.proto
|
||||
|
||||
package ranking
|
||||
|
||||
@ -30,7 +30,7 @@ type Request struct {
|
||||
|
||||
func (x *Request) Reset() {
|
||||
*x = Request{}
|
||||
mi := &file_ranking_management_proto_msgTypes[0]
|
||||
mi := &file_ranking_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -42,7 +42,7 @@ func (x *Request) String() string {
|
||||
func (*Request) ProtoMessage() {}
|
||||
|
||||
func (x *Request) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[0]
|
||||
mi := &file_ranking_service_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -55,7 +55,7 @@ func (x *Request) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Request.ProtoReflect.Descriptor instead.
|
||||
func (*Request) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{0}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Request) GetPing() string {
|
||||
@ -74,7 +74,7 @@ type Response struct {
|
||||
|
||||
func (x *Response) Reset() {
|
||||
*x = Response{}
|
||||
mi := &file_ranking_management_proto_msgTypes[1]
|
||||
mi := &file_ranking_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -86,7 +86,7 @@ func (x *Response) String() string {
|
||||
func (*Response) ProtoMessage() {}
|
||||
|
||||
func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[1]
|
||||
mi := &file_ranking_service_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -99,7 +99,7 @@ func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
|
||||
func (*Response) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{1}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Response) GetPong() string {
|
||||
@ -122,7 +122,7 @@ type SetUserGameScoreRequest struct {
|
||||
|
||||
func (x *SetUserGameScoreRequest) Reset() {
|
||||
*x = SetUserGameScoreRequest{}
|
||||
mi := &file_ranking_management_proto_msgTypes[2]
|
||||
mi := &file_ranking_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -134,7 +134,7 @@ func (x *SetUserGameScoreRequest) String() string {
|
||||
func (*SetUserGameScoreRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetUserGameScoreRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[2]
|
||||
mi := &file_ranking_service_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -147,7 +147,7 @@ func (x *SetUserGameScoreRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use SetUserGameScoreRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetUserGameScoreRequest) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{2}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SetUserGameScoreRequest) GetScore() uint32 {
|
||||
@ -193,7 +193,7 @@ type RankingList struct {
|
||||
|
||||
func (x *RankingList) Reset() {
|
||||
*x = RankingList{}
|
||||
mi := &file_ranking_management_proto_msgTypes[3]
|
||||
mi := &file_ranking_service_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -205,7 +205,7 @@ func (x *RankingList) String() string {
|
||||
func (*RankingList) ProtoMessage() {}
|
||||
|
||||
func (x *RankingList) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[3]
|
||||
mi := &file_ranking_service_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -218,7 +218,7 @@ func (x *RankingList) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use RankingList.ProtoReflect.Descriptor instead.
|
||||
func (*RankingList) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{3}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *RankingList) GetNickname() string {
|
||||
@ -272,7 +272,7 @@ type GetRankingListResponse struct {
|
||||
|
||||
func (x *GetRankingListResponse) Reset() {
|
||||
*x = GetRankingListResponse{}
|
||||
mi := &file_ranking_management_proto_msgTypes[4]
|
||||
mi := &file_ranking_service_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -284,7 +284,7 @@ func (x *GetRankingListResponse) String() string {
|
||||
func (*GetRankingListResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetRankingListResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[4]
|
||||
mi := &file_ranking_service_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -297,7 +297,7 @@ func (x *GetRankingListResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetRankingListResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetRankingListResponse) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{4}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetRankingListResponse) GetRankingData() []*RankingList {
|
||||
@ -318,7 +318,7 @@ type GetRankingListRequest struct {
|
||||
|
||||
func (x *GetRankingListRequest) Reset() {
|
||||
*x = GetRankingListRequest{}
|
||||
mi := &file_ranking_management_proto_msgTypes[5]
|
||||
mi := &file_ranking_service_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -330,7 +330,7 @@ func (x *GetRankingListRequest) String() string {
|
||||
func (*GetRankingListRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetRankingListRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[5]
|
||||
mi := &file_ranking_service_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -343,7 +343,7 @@ func (x *GetRankingListRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetRankingListRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetRankingListRequest) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{5}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetRankingListRequest) GetAppId() uint32 {
|
||||
@ -378,7 +378,7 @@ type BaseResult struct {
|
||||
|
||||
func (x *BaseResult) Reset() {
|
||||
*x = BaseResult{}
|
||||
mi := &file_ranking_management_proto_msgTypes[6]
|
||||
mi := &file_ranking_service_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -390,7 +390,7 @@ func (x *BaseResult) String() string {
|
||||
func (*BaseResult) ProtoMessage() {}
|
||||
|
||||
func (x *BaseResult) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ranking_management_proto_msgTypes[6]
|
||||
mi := &file_ranking_service_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -403,7 +403,7 @@ func (x *BaseResult) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use BaseResult.ProtoReflect.Descriptor instead.
|
||||
func (*BaseResult) Descriptor() ([]byte, []int) {
|
||||
return file_ranking_management_proto_rawDescGZIP(), []int{6}
|
||||
return file_ranking_service_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *BaseResult) GetErrorCode() int32 {
|
||||
@ -420,102 +420,99 @@ func (x *BaseResult) GetErrorMsg() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_ranking_management_proto protoreflect.FileDescriptor
|
||||
var File_ranking_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_ranking_management_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x18, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x72, 0x61, 0x6e, 0x6b,
|
||||
0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x1d,
|
||||
0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x69, 0x6e,
|
||||
0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1e, 0x0a,
|
||||
0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x6e,
|
||||
0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x22, 0x71, 0x0a,
|
||||
0x17, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x12,
|
||||
var file_ranking_service_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x15, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67,
|
||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x1d, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x1e, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x22, 0x71, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x55, 0x73,
|
||||
0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73,
|
||||
0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x98, 0x01, 0x0a, 0x0b, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69,
|
||||
0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69,
|
||||
0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73,
|
||||
0x63, 0x6f, 0x72, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6c, 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x04, 0x73, 0x65, 0x6c, 0x66, 0x22, 0x58, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||
0x3e, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x52, 0x0b, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22,
|
||||
0x59, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x74, 0x79,
|
||||
0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
|
||||
0x70, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64,
|
||||
0x22, 0x98, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76,
|
||||
0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73,
|
||||
0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65,
|
||||
0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x0d, 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6c, 0x66, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, 0x65, 0x6c, 0x66, 0x22, 0x5b, 0x0a, 0x16, 0x47,
|
||||
0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67,
|
||||
0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x0b, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x22, 0x59, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
|
||||
0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75,
|
||||
0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65,
|
||||
0x72, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x0a, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c,
|
||||
0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x32, 0xa1, 0x02,
|
||||
0x0a, 0x12, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x2e, 0x72,
|
||||
0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x61, 0x6e, 0x6b,
|
||||
0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x55, 0x73,
|
||||
0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2b, 0x2e, 0x72, 0x61,
|
||||
0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x2e, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x69,
|
||||
0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x42, 0x61,
|
||||
0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x67, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x29, 0x2e, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
|
||||
0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
|
||||
0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61,
|
||||
0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x42, 0x16, 0x5a, 0x14, 0x2e, 0x2f, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6d,
|
||||
0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x0a, 0x42, 0x61,
|
||||
0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f,
|
||||
0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72,
|
||||
0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72,
|
||||
0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f,
|
||||
0x72, 0x4d, 0x73, 0x67, 0x32, 0x8c, 0x02, 0x0a, 0x0f, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67,
|
||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67,
|
||||
0x12, 0x18, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72,
|
||||
0x47, 0x61, 0x6d, 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x28, 0x2e, 0x72, 0x61, 0x6e, 0x6b,
|
||||
0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x55,
|
||||
0x73, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
|
||||
0x12, 0x61, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x12, 0x26, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x72, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x67,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_ranking_management_proto_rawDescOnce sync.Once
|
||||
file_ranking_management_proto_rawDescData []byte
|
||||
file_ranking_service_proto_rawDescOnce sync.Once
|
||||
file_ranking_service_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_ranking_management_proto_rawDescGZIP() []byte {
|
||||
file_ranking_management_proto_rawDescOnce.Do(func() {
|
||||
file_ranking_management_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ranking_management_proto_rawDesc), len(file_ranking_management_proto_rawDesc)))
|
||||
func file_ranking_service_proto_rawDescGZIP() []byte {
|
||||
file_ranking_service_proto_rawDescOnce.Do(func() {
|
||||
file_ranking_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ranking_service_proto_rawDesc), len(file_ranking_service_proto_rawDesc)))
|
||||
})
|
||||
return file_ranking_management_proto_rawDescData
|
||||
return file_ranking_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_ranking_management_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_ranking_management_proto_goTypes = []any{
|
||||
(*Request)(nil), // 0: ranking.Request
|
||||
(*Response)(nil), // 1: ranking.Response
|
||||
(*SetUserGameScoreRequest)(nil), // 2: ranking.SetUserGameScoreRequest
|
||||
(*RankingList)(nil), // 3: ranking.RankingList
|
||||
(*GetRankingListResponse)(nil), // 4: ranking.GetRankingListResponse
|
||||
(*GetRankingListRequest)(nil), // 5: ranking.GetRankingListRequest
|
||||
(*BaseResult)(nil), // 6: ranking.BaseResult
|
||||
var file_ranking_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_ranking_service_proto_goTypes = []any{
|
||||
(*Request)(nil), // 0: ranking_service.Request
|
||||
(*Response)(nil), // 1: ranking_service.Response
|
||||
(*SetUserGameScoreRequest)(nil), // 2: ranking_service.SetUserGameScoreRequest
|
||||
(*RankingList)(nil), // 3: ranking_service.RankingList
|
||||
(*GetRankingListResponse)(nil), // 4: ranking_service.GetRankingListResponse
|
||||
(*GetRankingListRequest)(nil), // 5: ranking_service.GetRankingListRequest
|
||||
(*BaseResult)(nil), // 6: ranking_service.BaseResult
|
||||
}
|
||||
var file_ranking_management_proto_depIdxs = []int32{
|
||||
3, // 0: ranking.GetRankingListResponse.rankingData:type_name -> ranking.RankingList
|
||||
0, // 1: ranking.Ranking_management.Ping:input_type -> ranking.Request
|
||||
2, // 2: ranking.Ranking_management.SetUserGameScore:input_type -> ranking.SetUserGameScoreRequest
|
||||
5, // 3: ranking.Ranking_management.GetRankingList:input_type -> ranking.GetRankingListRequest
|
||||
1, // 4: ranking.Ranking_management.Ping:output_type -> ranking.Response
|
||||
6, // 5: ranking.Ranking_management.SetUserGameScore:output_type -> ranking.BaseResult
|
||||
4, // 6: ranking.Ranking_management.GetRankingList:output_type -> ranking.GetRankingListResponse
|
||||
var file_ranking_service_proto_depIdxs = []int32{
|
||||
3, // 0: ranking_service.GetRankingListResponse.rankingData:type_name -> ranking_service.RankingList
|
||||
0, // 1: ranking_service.ranking_service.Ping:input_type -> ranking_service.Request
|
||||
2, // 2: ranking_service.ranking_service.SetUserGameScore:input_type -> ranking_service.SetUserGameScoreRequest
|
||||
5, // 3: ranking_service.ranking_service.GetRankingList:input_type -> ranking_service.GetRankingListRequest
|
||||
1, // 4: ranking_service.ranking_service.Ping:output_type -> ranking_service.Response
|
||||
6, // 5: ranking_service.ranking_service.SetUserGameScore:output_type -> ranking_service.BaseResult
|
||||
4, // 6: ranking_service.ranking_service.GetRankingList:output_type -> ranking_service.GetRankingListResponse
|
||||
4, // [4:7] is the sub-list for method output_type
|
||||
1, // [1:4] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
@ -523,26 +520,26 @@ var file_ranking_management_proto_depIdxs = []int32{
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_ranking_management_proto_init() }
|
||||
func file_ranking_management_proto_init() {
|
||||
if File_ranking_management_proto != nil {
|
||||
func init() { file_ranking_service_proto_init() }
|
||||
func file_ranking_service_proto_init() {
|
||||
if File_ranking_service_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ranking_management_proto_rawDesc), len(file_ranking_management_proto_rawDesc)),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ranking_service_proto_rawDesc), len(file_ranking_service_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_ranking_management_proto_goTypes,
|
||||
DependencyIndexes: file_ranking_management_proto_depIdxs,
|
||||
MessageInfos: file_ranking_management_proto_msgTypes,
|
||||
GoTypes: file_ranking_service_proto_goTypes,
|
||||
DependencyIndexes: file_ranking_service_proto_depIdxs,
|
||||
MessageInfos: file_ranking_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_ranking_management_proto = out.File
|
||||
file_ranking_management_proto_goTypes = nil
|
||||
file_ranking_management_proto_depIdxs = nil
|
||||
File_ranking_service_proto = out.File
|
||||
file_ranking_service_proto_goTypes = nil
|
||||
file_ranking_service_proto_depIdxs = nil
|
||||
}
|
197
app/ranking_service/ranking/ranking_service_grpc.pb.go
Normal file
197
app/ranking_service/ranking/ranking_service_grpc.pb.go
Normal file
@ -0,0 +1,197 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v3.19.4
|
||||
// source: ranking_service.proto
|
||||
|
||||
package ranking
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
RankingService_Ping_FullMethodName = "/ranking_service.ranking_service/Ping"
|
||||
RankingService_SetUserGameScore_FullMethodName = "/ranking_service.ranking_service/SetUserGameScore"
|
||||
RankingService_GetRankingList_FullMethodName = "/ranking_service.ranking_service/GetRankingList"
|
||||
)
|
||||
|
||||
// RankingServiceClient is the client API for RankingService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type RankingServiceClient interface {
|
||||
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error)
|
||||
GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error)
|
||||
}
|
||||
|
||||
type rankingServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRankingServiceClient(cc grpc.ClientConnInterface) RankingServiceClient {
|
||||
return &rankingServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *rankingServiceClient) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, RankingService_Ping_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rankingServiceClient) SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BaseResult)
|
||||
err := c.cc.Invoke(ctx, RankingService_SetUserGameScore_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rankingServiceClient) GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetRankingListResponse)
|
||||
err := c.cc.Invoke(ctx, RankingService_GetRankingList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RankingServiceServer is the server API for RankingService service.
|
||||
// All implementations must embed UnimplementedRankingServiceServer
|
||||
// for forward compatibility.
|
||||
type RankingServiceServer interface {
|
||||
Ping(context.Context, *Request) (*Response, error)
|
||||
SetUserGameScore(context.Context, *SetUserGameScoreRequest) (*BaseResult, error)
|
||||
GetRankingList(context.Context, *GetRankingListRequest) (*GetRankingListResponse, error)
|
||||
mustEmbedUnimplementedRankingServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRankingServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRankingServiceServer struct{}
|
||||
|
||||
func (UnimplementedRankingServiceServer) Ping(context.Context, *Request) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||||
}
|
||||
func (UnimplementedRankingServiceServer) SetUserGameScore(context.Context, *SetUserGameScoreRequest) (*BaseResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetUserGameScore not implemented")
|
||||
}
|
||||
func (UnimplementedRankingServiceServer) GetRankingList(context.Context, *GetRankingListRequest) (*GetRankingListResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRankingList not implemented")
|
||||
}
|
||||
func (UnimplementedRankingServiceServer) mustEmbedUnimplementedRankingServiceServer() {}
|
||||
func (UnimplementedRankingServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRankingServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RankingServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRankingServiceServer interface {
|
||||
mustEmbedUnimplementedRankingServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRankingServiceServer(s grpc.ServiceRegistrar, srv RankingServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRankingServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RankingService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RankingService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RankingServiceServer).Ping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RankingService_Ping_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RankingServiceServer).Ping(ctx, req.(*Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RankingService_SetUserGameScore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetUserGameScoreRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RankingServiceServer).SetUserGameScore(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RankingService_SetUserGameScore_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RankingServiceServer).SetUserGameScore(ctx, req.(*SetUserGameScoreRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RankingService_GetRankingList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRankingListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RankingServiceServer).GetRankingList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RankingService_GetRankingList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RankingServiceServer).GetRankingList(ctx, req.(*GetRankingListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RankingService_ServiceDesc is the grpc.ServiceDesc for RankingService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RankingService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ranking_service.ranking_service",
|
||||
HandlerType: (*RankingServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Ping",
|
||||
Handler: _RankingService_Ping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetUserGameScore",
|
||||
Handler: _RankingService_SetUserGameScore_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRankingList",
|
||||
Handler: _RankingService_GetRankingList_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ranking_service.proto",
|
||||
}
|
@ -2,9 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/server"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/server"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/internal/svc"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/pkg/config"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
@ -28,7 +28,7 @@ func main() {
|
||||
ctx := svc.NewServiceContext(c)
|
||||
|
||||
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||
ranking.RegisterRankingManagementServer(grpcServer, server.NewRankingManagementServer(ctx))
|
||||
ranking.RegisterRankingServiceServer(grpcServer, server.NewRankingServiceServer(ctx))
|
||||
|
||||
if c.Mode == service.DevMode || c.Mode == service.TestMode {
|
||||
reflection.Register(grpcServer)
|
@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package ranking_management;
|
||||
package ranking_service;
|
||||
option go_package = "./ranking";
|
||||
|
||||
message Request {
|
||||
@ -45,7 +45,7 @@ message BaseResult {
|
||||
string error_msg = 2; // 错误信息
|
||||
}
|
||||
|
||||
service Ranking_management {
|
||||
service ranking_service {
|
||||
rpc Ping(Request) returns(Response);
|
||||
|
||||
rpc SetUserGameScore (SetUserGameScoreRequest) returns (BaseResult);
|
@ -1,13 +1,13 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.6
|
||||
// Source: ranking.proto
|
||||
// Source: ranking_service.proto
|
||||
|
||||
package ranking_client
|
||||
package rankingservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking/ranking"
|
||||
"gitea.youtukeji.com.cn/youtu/youtu_grpc/app/ranking_service/ranking"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
@ -22,34 +22,34 @@ type (
|
||||
Response = ranking.Response
|
||||
SetUserGameScoreRequest = ranking.SetUserGameScoreRequest
|
||||
|
||||
RankingManagement interface {
|
||||
RankingService interface {
|
||||
Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
||||
SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error)
|
||||
GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error)
|
||||
}
|
||||
|
||||
defaultRankingManagement struct {
|
||||
defaultRankingService struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewRankingManagement(cli zrpc.Client) RankingManagement {
|
||||
return &defaultRankingManagement{
|
||||
func NewRankingService(cli zrpc.Client) RankingService {
|
||||
return &defaultRankingService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
func (m *defaultRankingManagement) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := ranking.NewRankingManagementClient(m.cli.Conn())
|
||||
func (m *defaultRankingService) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
||||
client := ranking.NewRankingServiceClient(m.cli.Conn())
|
||||
return client.Ping(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultRankingManagement) SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error) {
|
||||
client := ranking.NewRankingManagementClient(m.cli.Conn())
|
||||
func (m *defaultRankingService) SetUserGameScore(ctx context.Context, in *SetUserGameScoreRequest, opts ...grpc.CallOption) (*BaseResult, error) {
|
||||
client := ranking.NewRankingServiceClient(m.cli.Conn())
|
||||
return client.SetUserGameScore(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultRankingManagement) GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error) {
|
||||
client := ranking.NewRankingManagementClient(m.cli.Conn())
|
||||
func (m *defaultRankingService) GetRankingList(ctx context.Context, in *GetRankingListRequest, opts ...grpc.CallOption) (*GetRankingListResponse, error) {
|
||||
client := ranking.NewRankingServiceClient(m.cli.Conn())
|
||||
return client.GetRankingList(ctx, in, opts...)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user