From bff8d04ddd82ebacefc68f1e599bd5709a058b26 Mon Sep 17 00:00:00 2001 From: xiabin Date: Fri, 7 Feb 2025 15:18:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth_service}/auth_service.go | 9 ++--- .../auth_service}/auth_service.proto | 0 .../auth_service/auth_service.pb.go | 0 .../auth_service/auth_service_grpc.pb.go | 0 .../auth_service_client/auth_service.go | 21 +++++----- .../auth_service}/etc/auth_service.yaml | 0 .../auth_service}/internal/config/config.go | 0 .../internal/logic/code2_session_logic.go | 5 +-- .../internal/logic/get_access_token_logic.go | 5 +-- .../internal/logic/ping_logic.go | 5 +-- .../internal/server/auth_service_server.go | 38 ++++++++++++++++++ .../internal/svc/service_context.go | 16 ++++---- {auth_service => app/auth_service}/pkg/cli.go | 0 .../auth_service}/pkg/douyin.go | 2 +- .../pkg/douyin/access-token/access_token.go | 0 .../pkg/douyin/douyin_openapi.go | 0 .../pkg/douyin/douyin_openapi_test.go | 0 .../auth_service}/pkg/wechat.go | 0 .../douyin_ecpm_calculation_service.go | 9 ++--- .../douyin_ecpm_calculation_service.proto | 0 .../douyin_ecpm_calculation_service.pb.go | 0 ...douyin_ecpm_calculation_service_grpc.pb.go | 0 .../douyin_ecpm_calculation_service.go | 15 ++++--- .../etc/douyin_ecpm_calculation_service.yaml | 0 .../internal/config/config.go | 0 .../internal/logic/get_ecpm_logic.go | 7 ++-- .../internal/logic/ping_logic.go | 5 +-- .../douyin_ecpm_calculation_service_server.go | 33 ++++++++++++++++ .../internal/svc/ecpm_config.go | 0 .../internal/svc/service_context.go | 4 +- .../etc/ranking_management.yaml | 0 .../internal/config/config.go | 0 .../internal/logic/get_ranking_list_logic.go | 7 ++-- .../internal/logic/ping_logic.go | 5 +-- .../logic/set_user_game_score_logic.go | 5 +-- .../server/ranking_management_server.go | 38 ++++++++++++++++++ .../internal/svc/service_context.go | 4 +- .../ranking_management}/ranking_management.go | 9 ++--- .../ranking_management.proto | 0 .../ranking_management.pb.go | 0 .../ranking_management_grpc.pb.go | 0 .../ranking_management.go | 25 ++++++------ .../user_management}/etc/user_management.yaml | 0 .../internal/config/config.go | 0 .../internal/logic/ping_logic.go | 5 +-- .../internal/logic/set_app_account_logic.go | 5 +-- .../internal/server/user_management_server.go | 33 ++++++++++++++++ .../internal/svc/service_context.go | 4 +- .../user_management}/user_management.go | 9 ++--- .../user_management}/user_management.proto | 0 .../user_management/user_management.pb.go | 0 .../user_management_grpc.pb.go | 0 .../user_management_client/user_management.go | 13 +++---- .../internal/server/auth_service_server.go | 39 ------------------- .../douyin_ecpm_calculation_service_server.go | 34 ---------------- .../server/ranking_management_server.go | 39 ------------------- .../internal/server/user_management_server.go | 34 ---------------- 57 files changed, 232 insertions(+), 250 deletions(-) rename {auth_service => app/auth_service}/auth_service.go (72%) rename {auth_service => app/auth_service}/auth_service.proto (100%) rename {auth_service => app/auth_service}/auth_service/auth_service.pb.go (100%) rename {auth_service => app/auth_service}/auth_service/auth_service_grpc.pb.go (100%) rename {auth_service => app/auth_service}/auth_service_client/auth_service.go (67%) rename {auth_service => app/auth_service}/etc/auth_service.yaml (100%) rename {auth_service => app/auth_service}/internal/config/config.go (100%) rename {auth_service => app/auth_service}/internal/logic/code2_session_logic.go (84%) rename {auth_service => app/auth_service}/internal/logic/get_access_token_logic.go (83%) rename {auth_service => app/auth_service}/internal/logic/ping_logic.go (76%) create mode 100644 app/auth_service/internal/server/auth_service_server.go rename {auth_service => app/auth_service}/internal/svc/service_context.go (60%) rename {auth_service => app/auth_service}/pkg/cli.go (100%) rename {auth_service => app/auth_service}/pkg/douyin.go (92%) rename {auth_service => app/auth_service}/pkg/douyin/access-token/access_token.go (100%) rename {auth_service => app/auth_service}/pkg/douyin/douyin_openapi.go (100%) rename {auth_service => app/auth_service}/pkg/douyin/douyin_openapi_test.go (100%) rename {auth_service => app/auth_service}/pkg/wechat.go (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/douyin_ecpm_calculation_service.go (68%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/douyin_ecpm_calculation_service.proto (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.pb.go (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_grpc.pb.go (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go (64%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/etc/douyin_ecpm_calculation_service.yaml (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/internal/config/config.go (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/internal/logic/get_ecpm_logic.go (94%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/internal/logic/ping_logic.go (72%) create mode 100644 app/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/internal/svc/ecpm_config.go (100%) rename {douyin_ecpm_calculation_service => app/douyin_ecpm_calculation_service}/internal/svc/service_context.go (91%) rename {ranking_management => app/ranking_management}/etc/ranking_management.yaml (100%) rename {ranking_management => app/ranking_management}/internal/config/config.go (100%) rename {ranking_management => app/ranking_management}/internal/logic/get_ranking_list_logic.go (64%) rename {ranking_management => app/ranking_management}/internal/logic/ping_logic.go (76%) rename {ranking_management => app/ranking_management}/internal/logic/set_user_game_score_logic.go (79%) create mode 100644 app/ranking_management/internal/server/ranking_management_server.go rename {user_management => app/ranking_management}/internal/svc/service_context.go (64%) rename {ranking_management => app/ranking_management}/ranking_management.go (70%) rename {ranking_management => app/ranking_management}/ranking_management.proto (100%) rename {ranking_management => app/ranking_management}/ranking_management/ranking_management.pb.go (100%) rename {ranking_management => app/ranking_management}/ranking_management/ranking_management_grpc.pb.go (100%) rename {ranking_management => app/ranking_management}/ranking_management_client/ranking_management.go (60%) rename {user_management => app/user_management}/etc/user_management.yaml (100%) rename {user_management => app/user_management}/internal/config/config.go (100%) rename {user_management => app/user_management}/internal/logic/ping_logic.go (77%) rename {user_management => app/user_management}/internal/logic/set_app_account_logic.go (79%) create mode 100644 app/user_management/internal/server/user_management_server.go rename {ranking_management => app/user_management}/internal/svc/service_context.go (65%) rename {user_management => app/user_management}/user_management.go (71%) rename {user_management => app/user_management}/user_management.proto (100%) rename {user_management => app/user_management}/user_management/user_management.pb.go (100%) rename {user_management => app/user_management}/user_management/user_management_grpc.pb.go (100%) rename {user_management => app/user_management}/user_management_client/user_management.go (71%) delete mode 100644 auth_service/internal/server/auth_service_server.go delete mode 100644 douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go delete mode 100644 ranking_management/internal/server/ranking_management_server.go delete mode 100644 user_management/internal/server/user_management_server.go diff --git a/auth_service/auth_service.go b/app/auth_service/auth_service.go similarity index 72% rename from auth_service/auth_service.go rename to app/auth_service/auth_service.go index 7532f3b..0021b33 100644 --- a/auth_service/auth_service.go +++ b/app/auth_service/auth_service.go @@ -3,11 +3,10 @@ package main import ( "flag" "fmt" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/config" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/server" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/config" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/server" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/svc" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/service" diff --git a/auth_service/auth_service.proto b/app/auth_service/auth_service.proto similarity index 100% rename from auth_service/auth_service.proto rename to app/auth_service/auth_service.proto diff --git a/auth_service/auth_service/auth_service.pb.go b/app/auth_service/auth_service/auth_service.pb.go similarity index 100% rename from auth_service/auth_service/auth_service.pb.go rename to app/auth_service/auth_service/auth_service.pb.go diff --git a/auth_service/auth_service/auth_service_grpc.pb.go b/app/auth_service/auth_service/auth_service_grpc.pb.go similarity index 100% rename from auth_service/auth_service/auth_service_grpc.pb.go rename to app/auth_service/auth_service/auth_service_grpc.pb.go diff --git a/auth_service/auth_service_client/auth_service.go b/app/auth_service/auth_service_client/auth_service.go similarity index 67% rename from auth_service/auth_service_client/auth_service.go rename to app/auth_service/auth_service_client/auth_service.go index 77a5e38..378009a 100644 --- a/auth_service/auth_service_client/auth_service.go +++ b/app/auth_service/auth_service_client/auth_service.go @@ -6,20 +6,19 @@ package auth_service_client import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" + auth_service2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" ) type ( - Code2SessionRequest = auth_service.Code2SessionRequest - Code2SessionResponse = auth_service.Code2SessionResponse - GetAccessTokenRequest = auth_service.GetAccessTokenRequest - GetAccessTokenResponse = auth_service.GetAccessTokenResponse - Request = auth_service.Request - Response = auth_service.Response + Code2SessionRequest = auth_service2.Code2SessionRequest + Code2SessionResponse = auth_service2.Code2SessionResponse + GetAccessTokenRequest = auth_service2.GetAccessTokenRequest + GetAccessTokenResponse = auth_service2.GetAccessTokenResponse + Request = auth_service2.Request + Response = auth_service2.Response AuthService interface { Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) @@ -39,16 +38,16 @@ func NewAuthService(cli zrpc.Client) AuthService { } func (m *defaultAuthService) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - client := auth_service.NewAuthServiceClient(m.cli.Conn()) + client := auth_service2.NewAuthServiceClient(m.cli.Conn()) return client.Ping(ctx, in, opts...) } func (m *defaultAuthService) Code2Session(ctx context.Context, in *Code2SessionRequest, opts ...grpc.CallOption) (*Code2SessionResponse, error) { - client := auth_service.NewAuthServiceClient(m.cli.Conn()) + client := auth_service2.NewAuthServiceClient(m.cli.Conn()) return client.Code2Session(ctx, in, opts...) } func (m *defaultAuthService) GetAccessToken(ctx context.Context, in *GetAccessTokenRequest, opts ...grpc.CallOption) (*GetAccessTokenResponse, error) { - client := auth_service.NewAuthServiceClient(m.cli.Conn()) + client := auth_service2.NewAuthServiceClient(m.cli.Conn()) return client.GetAccessToken(ctx, in, opts...) } diff --git a/auth_service/etc/auth_service.yaml b/app/auth_service/etc/auth_service.yaml similarity index 100% rename from auth_service/etc/auth_service.yaml rename to app/auth_service/etc/auth_service.yaml diff --git a/auth_service/internal/config/config.go b/app/auth_service/internal/config/config.go similarity index 100% rename from auth_service/internal/config/config.go rename to app/auth_service/internal/config/config.go diff --git a/auth_service/internal/logic/code2_session_logic.go b/app/auth_service/internal/logic/code2_session_logic.go similarity index 84% rename from auth_service/internal/logic/code2_session_logic.go rename to app/auth_service/internal/logic/code2_session_logic.go index df81ebd..b492b9a 100644 --- a/auth_service/internal/logic/code2_session_logic.go +++ b/app/auth_service/internal/logic/code2_session_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/auth_service/internal/logic/get_access_token_logic.go b/app/auth_service/internal/logic/get_access_token_logic.go similarity index 83% rename from auth_service/internal/logic/get_access_token_logic.go rename to app/auth_service/internal/logic/get_access_token_logic.go index b1b5c0d..83491a3 100644 --- a/auth_service/internal/logic/get_access_token_logic.go +++ b/app/auth_service/internal/logic/get_access_token_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/auth_service/internal/logic/ping_logic.go b/app/auth_service/internal/logic/ping_logic.go similarity index 76% rename from auth_service/internal/logic/ping_logic.go rename to app/auth_service/internal/logic/ping_logic.go index e610309..14611ec 100644 --- a/auth_service/internal/logic/ping_logic.go +++ b/app/auth_service/internal/logic/ping_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/app/auth_service/internal/server/auth_service_server.go b/app/auth_service/internal/server/auth_service_server.go new file mode 100644 index 0000000..07fe9f0 --- /dev/null +++ b/app/auth_service/internal/server/auth_service_server.go @@ -0,0 +1,38 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.7.6 +// Source: auth_service.proto + +package server + +import ( + "context" + auth_service2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + logic2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/logic" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/svc" +) + +type AuthServiceServer struct { + svcCtx *svc.ServiceContext + auth_service2.UnimplementedAuthServiceServer +} + +func NewAuthServiceServer(svcCtx *svc.ServiceContext) *AuthServiceServer { + return &AuthServiceServer{ + svcCtx: svcCtx, + } +} + +func (s *AuthServiceServer) Ping(ctx context.Context, in *auth_service2.Request) (*auth_service2.Response, error) { + l := logic2.NewPingLogic(ctx, s.svcCtx) + return l.Ping(in) +} + +func (s *AuthServiceServer) Code2Session(ctx context.Context, in *auth_service2.Code2SessionRequest) (*auth_service2.Code2SessionResponse, error) { + l := logic2.NewCode2SessionLogic(ctx, s.svcCtx) + return l.Code2Session(in) +} + +func (s *AuthServiceServer) GetAccessToken(ctx context.Context, in *auth_service2.GetAccessTokenRequest) (*auth_service2.GetAccessTokenResponse, error) { + l := logic2.NewGetAccessTokenLogic(ctx, s.svcCtx) + return l.GetAccessToken(in) +} diff --git a/auth_service/internal/svc/service_context.go b/app/auth_service/internal/svc/service_context.go similarity index 60% rename from auth_service/internal/svc/service_context.go rename to app/auth_service/internal/svc/service_context.go index b365f67..6a0534b 100644 --- a/auth_service/internal/svc/service_context.go +++ b/app/auth_service/internal/svc/service_context.go @@ -2,14 +2,14 @@ package svc import ( "context" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/config" - cli "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/pkg" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/internal/config" + cli2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/pkg" redisCache "github.com/silenceper/wechat/v2/cache" ) type ServiceContext struct { Config config.Config - Cli cli.Helper + Cli cli2.Helper } func NewServiceContext(c config.Config) *ServiceContext { @@ -24,12 +24,12 @@ func (svc *ServiceContext) InitClient(c config.Config) { //配置小程序cli(抖音&微信) for _, v := range c.AppData { - var c cli.DWClient + var c cli2.DWClient switch v.Type { - case cli.DouyinClientType: - c = cli.NewDouYinApi(v.AppId, v.AppSecret, dwCache) - case cli.WechatClientType: - c = cli.NewWechatApi(v.AppId, v.AppSecret, dwCache) + case cli2.DouyinClientType: + c = cli2.NewDouYinApi(v.AppId, v.AppSecret, dwCache) + case cli2.WechatClientType: + c = cli2.NewWechatApi(v.AppId, v.AppSecret, dwCache) default: continue } diff --git a/auth_service/pkg/cli.go b/app/auth_service/pkg/cli.go similarity index 100% rename from auth_service/pkg/cli.go rename to app/auth_service/pkg/cli.go diff --git a/auth_service/pkg/douyin.go b/app/auth_service/pkg/douyin.go similarity index 92% rename from auth_service/pkg/douyin.go rename to app/auth_service/pkg/douyin.go index 7662c37..fb35a20 100644 --- a/auth_service/pkg/douyin.go +++ b/app/auth_service/pkg/douyin.go @@ -3,7 +3,7 @@ package cli import ( "context" "errors" - access_token "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/pkg/douyin/access-token" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/pkg/douyin/access-token" douyinopenapi "gitea.youtukeji.com.cn/youtu/openapi-helper/douyin" "github.com/silenceper/wechat/v2/cache" ) diff --git a/auth_service/pkg/douyin/access-token/access_token.go b/app/auth_service/pkg/douyin/access-token/access_token.go similarity index 100% rename from auth_service/pkg/douyin/access-token/access_token.go rename to app/auth_service/pkg/douyin/access-token/access_token.go diff --git a/auth_service/pkg/douyin/douyin_openapi.go b/app/auth_service/pkg/douyin/douyin_openapi.go similarity index 100% rename from auth_service/pkg/douyin/douyin_openapi.go rename to app/auth_service/pkg/douyin/douyin_openapi.go diff --git a/auth_service/pkg/douyin/douyin_openapi_test.go b/app/auth_service/pkg/douyin/douyin_openapi_test.go similarity index 100% rename from auth_service/pkg/douyin/douyin_openapi_test.go rename to app/auth_service/pkg/douyin/douyin_openapi_test.go diff --git a/auth_service/pkg/wechat.go b/app/auth_service/pkg/wechat.go similarity index 100% rename from auth_service/pkg/wechat.go rename to app/auth_service/pkg/wechat.go diff --git a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.go b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.go similarity index 68% rename from douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.go rename to app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.go index 6c66465..702b704 100644 --- a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.go +++ b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.go @@ -3,11 +3,10 @@ package main import ( "flag" "fmt" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/config" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/server" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/config" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/server" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/svc" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/service" diff --git a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.proto b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.proto similarity index 100% rename from douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.proto rename to app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.proto diff --git a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.pb.go b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.pb.go similarity index 100% rename from douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.pb.go rename to app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service.pb.go diff --git a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_grpc.pb.go b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_grpc.pb.go similarity index 100% rename from douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_grpc.pb.go rename to app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_grpc.pb.go diff --git a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go similarity index 64% rename from douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go rename to app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go index fe04068..435e196 100644 --- a/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go +++ b/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service_client/douyin_ecpm_calculation_service.go @@ -6,18 +6,17 @@ package douyin_ecpm_calculation_service_client import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" + douyin_ecpm_calculation_service2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" ) type ( - GetEcpmRequest = douyin_ecpm_calculation_service.GetEcpmRequest - GetEcpmResponse = douyin_ecpm_calculation_service.GetEcpmResponse - Request = douyin_ecpm_calculation_service.Request - Response = douyin_ecpm_calculation_service.Response + GetEcpmRequest = douyin_ecpm_calculation_service2.GetEcpmRequest + GetEcpmResponse = douyin_ecpm_calculation_service2.GetEcpmResponse + Request = douyin_ecpm_calculation_service2.Request + Response = douyin_ecpm_calculation_service2.Response DouyinEcpmCalculationService interface { Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) @@ -36,11 +35,11 @@ func NewDouyinEcpmCalculationService(cli zrpc.Client) DouyinEcpmCalculationServi } func (m *defaultDouyinEcpmCalculationService) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - client := douyin_ecpm_calculation_service.NewDouyinEcpmCalculationServiceClient(m.cli.Conn()) + client := douyin_ecpm_calculation_service2.NewDouyinEcpmCalculationServiceClient(m.cli.Conn()) return client.Ping(ctx, in, opts...) } func (m *defaultDouyinEcpmCalculationService) GetEcpm(ctx context.Context, in *GetEcpmRequest, opts ...grpc.CallOption) (*GetEcpmResponse, error) { - client := douyin_ecpm_calculation_service.NewDouyinEcpmCalculationServiceClient(m.cli.Conn()) + client := douyin_ecpm_calculation_service2.NewDouyinEcpmCalculationServiceClient(m.cli.Conn()) return client.GetEcpm(ctx, in, opts...) } diff --git a/douyin_ecpm_calculation_service/etc/douyin_ecpm_calculation_service.yaml b/app/douyin_ecpm_calculation_service/etc/douyin_ecpm_calculation_service.yaml similarity index 100% rename from douyin_ecpm_calculation_service/etc/douyin_ecpm_calculation_service.yaml rename to app/douyin_ecpm_calculation_service/etc/douyin_ecpm_calculation_service.yaml diff --git a/douyin_ecpm_calculation_service/internal/config/config.go b/app/douyin_ecpm_calculation_service/internal/config/config.go similarity index 100% rename from douyin_ecpm_calculation_service/internal/config/config.go rename to app/douyin_ecpm_calculation_service/internal/config/config.go diff --git a/douyin_ecpm_calculation_service/internal/logic/get_ecpm_logic.go b/app/douyin_ecpm_calculation_service/internal/logic/get_ecpm_logic.go similarity index 94% rename from douyin_ecpm_calculation_service/internal/logic/get_ecpm_logic.go rename to app/douyin_ecpm_calculation_service/internal/logic/get_ecpm_logic.go index 3d218fd..b96009e 100644 --- a/douyin_ecpm_calculation_service/internal/logic/get_ecpm_logic.go +++ b/app/douyin_ecpm_calculation_service/internal/logic/get_ecpm_logic.go @@ -5,15 +5,14 @@ import ( "encoding/json" "errors" "fmt" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/svc" "io" "net/http" "strconv" "time" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/svc" - "github.com/zeromicro/go-zero/core/logx" ) diff --git a/douyin_ecpm_calculation_service/internal/logic/ping_logic.go b/app/douyin_ecpm_calculation_service/internal/logic/ping_logic.go similarity index 72% rename from douyin_ecpm_calculation_service/internal/logic/ping_logic.go rename to app/douyin_ecpm_calculation_service/internal/logic/ping_logic.go index 89e9fb8..2b09812 100644 --- a/douyin_ecpm_calculation_service/internal/logic/ping_logic.go +++ b/app/douyin_ecpm_calculation_service/internal/logic/ping_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/svc" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/app/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go b/app/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go new file mode 100644 index 0000000..9fc93dc --- /dev/null +++ b/app/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go @@ -0,0 +1,33 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.7.6 +// Source: douyin_ecpm_calculation_service.proto + +package server + +import ( + "context" + douyin_ecpm_calculation_service2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" + logic2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/logic" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/svc" +) + +type DouyinEcpmCalculationServiceServer struct { + svcCtx *svc.ServiceContext + douyin_ecpm_calculation_service2.UnimplementedDouyinEcpmCalculationServiceServer +} + +func NewDouyinEcpmCalculationServiceServer(svcCtx *svc.ServiceContext) *DouyinEcpmCalculationServiceServer { + return &DouyinEcpmCalculationServiceServer{ + svcCtx: svcCtx, + } +} + +func (s *DouyinEcpmCalculationServiceServer) Ping(ctx context.Context, in *douyin_ecpm_calculation_service2.Request) (*douyin_ecpm_calculation_service2.Response, error) { + l := logic2.NewPingLogic(ctx, s.svcCtx) + return l.Ping(in) +} + +func (s *DouyinEcpmCalculationServiceServer) GetEcpm(ctx context.Context, in *douyin_ecpm_calculation_service2.GetEcpmRequest) (*douyin_ecpm_calculation_service2.GetEcpmResponse, error) { + l := logic2.NewGetEcpmLogic(ctx, s.svcCtx) + return l.GetEcpm(in) +} diff --git a/douyin_ecpm_calculation_service/internal/svc/ecpm_config.go b/app/douyin_ecpm_calculation_service/internal/svc/ecpm_config.go similarity index 100% rename from douyin_ecpm_calculation_service/internal/svc/ecpm_config.go rename to app/douyin_ecpm_calculation_service/internal/svc/ecpm_config.go diff --git a/douyin_ecpm_calculation_service/internal/svc/service_context.go b/app/douyin_ecpm_calculation_service/internal/svc/service_context.go similarity index 91% rename from douyin_ecpm_calculation_service/internal/svc/service_context.go rename to app/douyin_ecpm_calculation_service/internal/svc/service_context.go index bb660ed..5ab2785 100644 --- a/douyin_ecpm_calculation_service/internal/svc/service_context.go +++ b/app/douyin_ecpm_calculation_service/internal/svc/service_context.go @@ -2,8 +2,8 @@ package svc import ( "context" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/config" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/auth_service/auth_service" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/douyin_ecpm_calculation_service/internal/config" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/discov" "github.com/zeromicro/go-zero/zrpc" diff --git a/ranking_management/etc/ranking_management.yaml b/app/ranking_management/etc/ranking_management.yaml similarity index 100% rename from ranking_management/etc/ranking_management.yaml rename to app/ranking_management/etc/ranking_management.yaml diff --git a/ranking_management/internal/config/config.go b/app/ranking_management/internal/config/config.go similarity index 100% rename from ranking_management/internal/config/config.go rename to app/ranking_management/internal/config/config.go diff --git a/ranking_management/internal/logic/get_ranking_list_logic.go b/app/ranking_management/internal/logic/get_ranking_list_logic.go similarity index 64% rename from ranking_management/internal/logic/get_ranking_list_logic.go rename to app/ranking_management/internal/logic/get_ranking_list_logic.go index 6d26379..6696d2a 100644 --- a/ranking_management/internal/logic/get_ranking_list_logic.go +++ b/app/ranking_management/internal/logic/get_ranking_list_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/ranking_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/svc" + ranking_management2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/ranking_management" "github.com/zeromicro/go-zero/core/logx" ) @@ -23,7 +22,7 @@ func NewGetRankingListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -func (l *GetRankingListLogic) GetRankingList(in *ranking_management.PageRequest, stream ranking_management.RankingManagement_GetRankingListServer) error { +func (l *GetRankingListLogic) GetRankingList(in *ranking_management2.PageRequest, stream ranking_management2.RankingManagement_GetRankingListServer) error { // todo: add your logic here and delete this line return nil diff --git a/ranking_management/internal/logic/ping_logic.go b/app/ranking_management/internal/logic/ping_logic.go similarity index 76% rename from ranking_management/internal/logic/ping_logic.go rename to app/ranking_management/internal/logic/ping_logic.go index 92bbc1a..467602a 100644 --- a/ranking_management/internal/logic/ping_logic.go +++ b/app/ranking_management/internal/logic/ping_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/ranking_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/ranking_management" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/ranking_management/internal/logic/set_user_game_score_logic.go b/app/ranking_management/internal/logic/set_user_game_score_logic.go similarity index 79% rename from ranking_management/internal/logic/set_user_game_score_logic.go rename to app/ranking_management/internal/logic/set_user_game_score_logic.go index e1cd4be..bc4437f 100644 --- a/ranking_management/internal/logic/set_user_game_score_logic.go +++ b/app/ranking_management/internal/logic/set_user_game_score_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/ranking_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/ranking_management" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/app/ranking_management/internal/server/ranking_management_server.go b/app/ranking_management/internal/server/ranking_management_server.go new file mode 100644 index 0000000..6e78ca2 --- /dev/null +++ b/app/ranking_management/internal/server/ranking_management_server.go @@ -0,0 +1,38 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.7.6 +// Source: ranking_management.proto + +package server + +import ( + "context" + logic2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/logic" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/svc" + ranking_management2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/ranking_management" +) + +type RankingManagementServer struct { + svcCtx *svc.ServiceContext + ranking_management2.UnimplementedRankingManagementServer +} + +func NewRankingManagementServer(svcCtx *svc.ServiceContext) *RankingManagementServer { + return &RankingManagementServer{ + svcCtx: svcCtx, + } +} + +func (s *RankingManagementServer) Ping(ctx context.Context, in *ranking_management2.Request) (*ranking_management2.Response, error) { + l := logic2.NewPingLogic(ctx, s.svcCtx) + return l.Ping(in) +} + +func (s *RankingManagementServer) SetUserGameScore(ctx context.Context, in *ranking_management2.SetUserGameScoreRequest) (*ranking_management2.BaseResult, error) { + l := logic2.NewSetUserGameScoreLogic(ctx, s.svcCtx) + return l.SetUserGameScore(in) +} + +func (s *RankingManagementServer) GetRankingList(in *ranking_management2.PageRequest, stream ranking_management2.RankingManagement_GetRankingListServer) error { + l := logic2.NewGetRankingListLogic(stream.Context(), s.svcCtx) + return l.GetRankingList(in, stream) +} diff --git a/user_management/internal/svc/service_context.go b/app/ranking_management/internal/svc/service_context.go similarity index 64% rename from user_management/internal/svc/service_context.go rename to app/ranking_management/internal/svc/service_context.go index 761e2f9..e2f641c 100644 --- a/user_management/internal/svc/service_context.go +++ b/app/ranking_management/internal/svc/service_context.go @@ -1,6 +1,8 @@ package svc -import "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/config" +import ( + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/config" +) type ServiceContext struct { Config config.Config diff --git a/ranking_management/ranking_management.go b/app/ranking_management/ranking_management.go similarity index 70% rename from ranking_management/ranking_management.go rename to app/ranking_management/ranking_management.go index 57a1403..bbbc2b3 100644 --- a/ranking_management/ranking_management.go +++ b/app/ranking_management/ranking_management.go @@ -3,11 +3,10 @@ package main import ( "flag" "fmt" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/config" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/server" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/ranking_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/config" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/server" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/ranking_management" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/service" diff --git a/ranking_management/ranking_management.proto b/app/ranking_management/ranking_management.proto similarity index 100% rename from ranking_management/ranking_management.proto rename to app/ranking_management/ranking_management.proto diff --git a/ranking_management/ranking_management/ranking_management.pb.go b/app/ranking_management/ranking_management/ranking_management.pb.go similarity index 100% rename from ranking_management/ranking_management/ranking_management.pb.go rename to app/ranking_management/ranking_management/ranking_management.pb.go diff --git a/ranking_management/ranking_management/ranking_management_grpc.pb.go b/app/ranking_management/ranking_management/ranking_management_grpc.pb.go similarity index 100% rename from ranking_management/ranking_management/ranking_management_grpc.pb.go rename to app/ranking_management/ranking_management/ranking_management_grpc.pb.go diff --git a/ranking_management/ranking_management_client/ranking_management.go b/app/ranking_management/ranking_management_client/ranking_management.go similarity index 60% rename from ranking_management/ranking_management_client/ranking_management.go rename to app/ranking_management/ranking_management_client/ranking_management.go index 48c5684..3685c5e 100644 --- a/ranking_management/ranking_management_client/ranking_management.go +++ b/app/ranking_management/ranking_management_client/ranking_management.go @@ -6,25 +6,24 @@ package ranking_management_client import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/ranking_management" + ranking_management2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/ranking_management/ranking_management" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" ) type ( - BaseResult = ranking_management.BaseResult - PageRequest = ranking_management.PageRequest - RankingData = ranking_management.RankingData - Request = ranking_management.Request - Response = ranking_management.Response - SetUserGameScoreRequest = ranking_management.SetUserGameScoreRequest + BaseResult = ranking_management2.BaseResult + PageRequest = ranking_management2.PageRequest + RankingData = ranking_management2.RankingData + Request = ranking_management2.Request + Response = ranking_management2.Response + SetUserGameScoreRequest = ranking_management2.SetUserGameScoreRequest RankingManagement 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 *PageRequest, opts ...grpc.CallOption) (ranking_management.RankingManagement_GetRankingListClient, error) + GetRankingList(ctx context.Context, in *PageRequest, opts ...grpc.CallOption) (ranking_management2.RankingManagement_GetRankingListClient, error) } defaultRankingManagement struct { @@ -39,16 +38,16 @@ func NewRankingManagement(cli zrpc.Client) RankingManagement { } func (m *defaultRankingManagement) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - client := ranking_management.NewRankingManagementClient(m.cli.Conn()) + client := ranking_management2.NewRankingManagementClient(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_management.NewRankingManagementClient(m.cli.Conn()) + client := ranking_management2.NewRankingManagementClient(m.cli.Conn()) return client.SetUserGameScore(ctx, in, opts...) } -func (m *defaultRankingManagement) GetRankingList(ctx context.Context, in *PageRequest, opts ...grpc.CallOption) (ranking_management.RankingManagement_GetRankingListClient, error) { - client := ranking_management.NewRankingManagementClient(m.cli.Conn()) +func (m *defaultRankingManagement) GetRankingList(ctx context.Context, in *PageRequest, opts ...grpc.CallOption) (ranking_management2.RankingManagement_GetRankingListClient, error) { + client := ranking_management2.NewRankingManagementClient(m.cli.Conn()) return client.GetRankingList(ctx, in, opts...) } diff --git a/user_management/etc/user_management.yaml b/app/user_management/etc/user_management.yaml similarity index 100% rename from user_management/etc/user_management.yaml rename to app/user_management/etc/user_management.yaml diff --git a/user_management/internal/config/config.go b/app/user_management/internal/config/config.go similarity index 100% rename from user_management/internal/config/config.go rename to app/user_management/internal/config/config.go diff --git a/user_management/internal/logic/ping_logic.go b/app/user_management/internal/logic/ping_logic.go similarity index 77% rename from user_management/internal/logic/ping_logic.go rename to app/user_management/internal/logic/ping_logic.go index 1233db8..406f1a8 100644 --- a/user_management/internal/logic/ping_logic.go +++ b/app/user_management/internal/logic/ping_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/user_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/user_management" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/user_management/internal/logic/set_app_account_logic.go b/app/user_management/internal/logic/set_app_account_logic.go similarity index 79% rename from user_management/internal/logic/set_app_account_logic.go rename to app/user_management/internal/logic/set_app_account_logic.go index a93684d..1b6e6a9 100644 --- a/user_management/internal/logic/set_app_account_logic.go +++ b/app/user_management/internal/logic/set_app_account_logic.go @@ -2,9 +2,8 @@ package logic import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/user_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/user_management" "github.com/zeromicro/go-zero/core/logx" ) diff --git a/app/user_management/internal/server/user_management_server.go b/app/user_management/internal/server/user_management_server.go new file mode 100644 index 0000000..3d8215a --- /dev/null +++ b/app/user_management/internal/server/user_management_server.go @@ -0,0 +1,33 @@ +// Code generated by goctl. DO NOT EDIT. +// goctl 1.7.6 +// Source: user_management.proto + +package server + +import ( + "context" + logic2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/logic" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/svc" + user_management2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/user_management" +) + +type UserManagementServer struct { + svcCtx *svc.ServiceContext + user_management2.UnimplementedUserManagementServer +} + +func NewUserManagementServer(svcCtx *svc.ServiceContext) *UserManagementServer { + return &UserManagementServer{ + svcCtx: svcCtx, + } +} + +func (s *UserManagementServer) Ping(ctx context.Context, in *user_management2.Request) (*user_management2.Response, error) { + l := logic2.NewPingLogic(ctx, s.svcCtx) + return l.Ping(in) +} + +func (s *UserManagementServer) SetAppAccount(ctx context.Context, in *user_management2.SetAppUserRequest) (*user_management2.Response, error) { + l := logic2.NewSetAppAccountLogic(ctx, s.svcCtx) + return l.SetAppAccount(in) +} diff --git a/ranking_management/internal/svc/service_context.go b/app/user_management/internal/svc/service_context.go similarity index 65% rename from ranking_management/internal/svc/service_context.go rename to app/user_management/internal/svc/service_context.go index 16e0417..824d223 100644 --- a/ranking_management/internal/svc/service_context.go +++ b/app/user_management/internal/svc/service_context.go @@ -1,6 +1,8 @@ package svc -import "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/config" +import ( + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/config" +) type ServiceContext struct { Config config.Config diff --git a/user_management/user_management.go b/app/user_management/user_management.go similarity index 71% rename from user_management/user_management.go rename to app/user_management/user_management.go index 9f6ac0e..c5bcb84 100644 --- a/user_management/user_management.go +++ b/app/user_management/user_management.go @@ -3,11 +3,10 @@ package main import ( "flag" "fmt" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/config" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/server" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/user_management" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/config" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/server" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/internal/svc" + "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/user_management" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/core/service" diff --git a/user_management/user_management.proto b/app/user_management/user_management.proto similarity index 100% rename from user_management/user_management.proto rename to app/user_management/user_management.proto diff --git a/user_management/user_management/user_management.pb.go b/app/user_management/user_management/user_management.pb.go similarity index 100% rename from user_management/user_management/user_management.pb.go rename to app/user_management/user_management/user_management.pb.go diff --git a/user_management/user_management/user_management_grpc.pb.go b/app/user_management/user_management/user_management_grpc.pb.go similarity index 100% rename from user_management/user_management/user_management_grpc.pb.go rename to app/user_management/user_management/user_management_grpc.pb.go diff --git a/user_management/user_management_client/user_management.go b/app/user_management/user_management_client/user_management.go similarity index 71% rename from user_management/user_management_client/user_management.go rename to app/user_management/user_management_client/user_management.go index 871c6b4..863d13a 100644 --- a/user_management/user_management_client/user_management.go +++ b/app/user_management/user_management_client/user_management.go @@ -6,17 +6,16 @@ package user_management_client import ( "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/user_management" + user_management2 "gitea.youtukeji.com.cn/xiabin/youtu_grpc/app/user_management/user_management" "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" ) type ( - Request = user_management.Request - Response = user_management.Response - SetAppUserRequest = user_management.SetAppUserRequest + Request = user_management2.Request + Response = user_management2.Response + SetAppUserRequest = user_management2.SetAppUserRequest UserManagement interface { Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) @@ -35,11 +34,11 @@ func NewUserManagement(cli zrpc.Client) UserManagement { } func (m *defaultUserManagement) Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { - client := user_management.NewUserManagementClient(m.cli.Conn()) + client := user_management2.NewUserManagementClient(m.cli.Conn()) return client.Ping(ctx, in, opts...) } func (m *defaultUserManagement) SetAppAccount(ctx context.Context, in *SetAppUserRequest, opts ...grpc.CallOption) (*Response, error) { - client := user_management.NewUserManagementClient(m.cli.Conn()) + client := user_management2.NewUserManagementClient(m.cli.Conn()) return client.SetAppAccount(ctx, in, opts...) } diff --git a/auth_service/internal/server/auth_service_server.go b/auth_service/internal/server/auth_service_server.go deleted file mode 100644 index 7173606..0000000 --- a/auth_service/internal/server/auth_service_server.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by goctl. DO NOT EDIT. -// goctl 1.7.6 -// Source: auth_service.proto - -package server - -import ( - "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/auth_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/logic" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/auth_service/internal/svc" -) - -type AuthServiceServer struct { - svcCtx *svc.ServiceContext - auth_service.UnimplementedAuthServiceServer -} - -func NewAuthServiceServer(svcCtx *svc.ServiceContext) *AuthServiceServer { - return &AuthServiceServer{ - svcCtx: svcCtx, - } -} - -func (s *AuthServiceServer) Ping(ctx context.Context, in *auth_service.Request) (*auth_service.Response, error) { - l := logic.NewPingLogic(ctx, s.svcCtx) - return l.Ping(in) -} - -func (s *AuthServiceServer) Code2Session(ctx context.Context, in *auth_service.Code2SessionRequest) (*auth_service.Code2SessionResponse, error) { - l := logic.NewCode2SessionLogic(ctx, s.svcCtx) - return l.Code2Session(in) -} - -func (s *AuthServiceServer) GetAccessToken(ctx context.Context, in *auth_service.GetAccessTokenRequest) (*auth_service.GetAccessTokenResponse, error) { - l := logic.NewGetAccessTokenLogic(ctx, s.svcCtx) - return l.GetAccessToken(in) -} diff --git a/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go b/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go deleted file mode 100644 index 074731f..0000000 --- a/douyin_ecpm_calculation_service/internal/server/douyin_ecpm_calculation_service_server.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by goctl. DO NOT EDIT. -// goctl 1.7.6 -// Source: douyin_ecpm_calculation_service.proto - -package server - -import ( - "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/douyin_ecpm_calculation_service" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/logic" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/douyin_ecpm_calculation_service/internal/svc" -) - -type DouyinEcpmCalculationServiceServer struct { - svcCtx *svc.ServiceContext - douyin_ecpm_calculation_service.UnimplementedDouyinEcpmCalculationServiceServer -} - -func NewDouyinEcpmCalculationServiceServer(svcCtx *svc.ServiceContext) *DouyinEcpmCalculationServiceServer { - return &DouyinEcpmCalculationServiceServer{ - svcCtx: svcCtx, - } -} - -func (s *DouyinEcpmCalculationServiceServer) Ping(ctx context.Context, in *douyin_ecpm_calculation_service.Request) (*douyin_ecpm_calculation_service.Response, error) { - l := logic.NewPingLogic(ctx, s.svcCtx) - return l.Ping(in) -} - -func (s *DouyinEcpmCalculationServiceServer) GetEcpm(ctx context.Context, in *douyin_ecpm_calculation_service.GetEcpmRequest) (*douyin_ecpm_calculation_service.GetEcpmResponse, error) { - l := logic.NewGetEcpmLogic(ctx, s.svcCtx) - return l.GetEcpm(in) -} diff --git a/ranking_management/internal/server/ranking_management_server.go b/ranking_management/internal/server/ranking_management_server.go deleted file mode 100644 index 3e60d06..0000000 --- a/ranking_management/internal/server/ranking_management_server.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by goctl. DO NOT EDIT. -// goctl 1.7.6 -// Source: ranking_management.proto - -package server - -import ( - "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/logic" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/ranking_management/ranking_management" -) - -type RankingManagementServer struct { - svcCtx *svc.ServiceContext - ranking_management.UnimplementedRankingManagementServer -} - -func NewRankingManagementServer(svcCtx *svc.ServiceContext) *RankingManagementServer { - return &RankingManagementServer{ - svcCtx: svcCtx, - } -} - -func (s *RankingManagementServer) Ping(ctx context.Context, in *ranking_management.Request) (*ranking_management.Response, error) { - l := logic.NewPingLogic(ctx, s.svcCtx) - return l.Ping(in) -} - -func (s *RankingManagementServer) SetUserGameScore(ctx context.Context, in *ranking_management.SetUserGameScoreRequest) (*ranking_management.BaseResult, error) { - l := logic.NewSetUserGameScoreLogic(ctx, s.svcCtx) - return l.SetUserGameScore(in) -} - -func (s *RankingManagementServer) GetRankingList(in *ranking_management.PageRequest, stream ranking_management.RankingManagement_GetRankingListServer) error { - l := logic.NewGetRankingListLogic(stream.Context(), s.svcCtx) - return l.GetRankingList(in, stream) -} diff --git a/user_management/internal/server/user_management_server.go b/user_management/internal/server/user_management_server.go deleted file mode 100644 index 0ae13df..0000000 --- a/user_management/internal/server/user_management_server.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by goctl. DO NOT EDIT. -// goctl 1.7.6 -// Source: user_management.proto - -package server - -import ( - "context" - - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/logic" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/internal/svc" - "gitea.youtukeji.com.cn/xiabin/youtu_grpc/user_management/user_management" -) - -type UserManagementServer struct { - svcCtx *svc.ServiceContext - user_management.UnimplementedUserManagementServer -} - -func NewUserManagementServer(svcCtx *svc.ServiceContext) *UserManagementServer { - return &UserManagementServer{ - svcCtx: svcCtx, - } -} - -func (s *UserManagementServer) Ping(ctx context.Context, in *user_management.Request) (*user_management.Response, error) { - l := logic.NewPingLogic(ctx, s.svcCtx) - return l.Ping(in) -} - -func (s *UserManagementServer) SetAppAccount(ctx context.Context, in *user_management.SetAppUserRequest) (*user_management.Response, error) { - l := logic.NewSetAppAccountLogic(ctx, s.svcCtx) - return l.SetAppAccount(in) -}