From 585715adbff55f52429cc2364c34f760941ece12 Mon Sep 17 00:00:00 2001 From: xmcy0011 Date: Mon, 11 Oct 2021 21:51:37 +0800 Subject: [PATCH] add cmd/rpc --- {src/rpc/auth => cmd/rpc/open_im_auth}/Makefile | 0 src/rpc/auth/open_im_auth.go => cmd/rpc/open_im_auth/main.go | 2 +- {src/rpc/friend => cmd/rpc/open_im_friend}/Makefile | 0 .../open_im_friend.go => cmd/rpc/open_im_friend/main.go | 2 +- {src/rpc/group => cmd/rpc/open_im_group}/Makefile | 0 .../group/open_im_group.go => cmd/rpc/open_im_group/main.go | 2 +- {src/rpc/chat => cmd/rpc/open_im_msg}/Makefile | 0 src/rpc/chat/open_im_msg.go => cmd/rpc/open_im_msg/main.go | 2 +- {src/rpc/user => cmd/rpc/open_im_user}/Makefile | 0 src/rpc/user/open_im_user.go => cmd/rpc/open_im_user/main.go | 2 +- internal/push/logic/push_to_client.go | 4 ++-- {src/rpc/auth => internal/rpc}/auth/rpcAuth.go | 2 +- {src/rpc/auth => internal/rpc}/auth/user_register.go | 2 +- {src/rpc/auth => internal/rpc}/auth/user_token.go | 2 +- {src/rpc/chat => internal/rpc}/chat/pull_message.go | 2 +- {src/rpc/chat => internal/rpc}/chat/rpcChat.go | 2 +- {src/rpc/chat => internal/rpc}/chat/send_msg.go | 2 +- {src/rpc/friend => internal/rpc}/friend/add_blacklist.go | 0 {src/rpc/friend => internal/rpc}/friend/add_friend.go | 4 ++-- .../rpc/friend => internal/rpc}/friend/add_friend_response.go | 0 {src/rpc/friend => internal/rpc}/friend/delete_friend.go | 0 {src/rpc/friend => internal/rpc}/friend/get_blacklist.go | 0 {src/rpc/friend => internal/rpc}/friend/get_firends_info.go | 0 .../friend => internal/rpc}/friend/get_friend_apply_list.go | 0 {src/rpc/friend => internal/rpc}/friend/get_friend_list.go | 0 {src/rpc/friend => internal/rpc}/friend/is_friend.go | 0 {src/rpc/friend => internal/rpc}/friend/is_in_blacklist.go | 0 {src/rpc/friend => internal/rpc}/friend/remove_blacklist.go | 0 {src/rpc/friend => internal/rpc}/friend/set_friend_comment.go | 0 {src/rpc/group => internal/rpc}/group/create_group.go | 4 ++-- .../group => internal/rpc}/group/get_group_applicationList.go | 0 {src/rpc/group => internal/rpc}/group/get_groups_info.go | 0 {src/rpc/group => internal/rpc}/group/group.go | 4 ++-- .../rpc}/group/group_application_response.go | 0 {src/rpc/group => internal/rpc}/group/join_group.go | 0 {src/rpc/group => internal/rpc}/group/quit_group.go | 0 {src/rpc/group => internal/rpc}/group/set_group_info.go | 0 {src/rpc/group => internal/rpc}/group/transfer_group_owner.go | 0 {src/rpc/user => internal/rpc}/user/get_user_info.go | 0 .../rpc/user/internal_service/get_user_info_to_client.go | 0 {src/rpc/user => internal/rpc}/user/management_user.go | 0 {src/rpc/user => internal/rpc}/user/update_user_info.go | 2 +- 42 files changed, 20 insertions(+), 20 deletions(-) rename {src/rpc/auth => cmd/rpc/open_im_auth}/Makefile (100%) rename src/rpc/auth/open_im_auth.go => cmd/rpc/open_im_auth/main.go (84%) rename {src/rpc/friend => cmd/rpc/open_im_friend}/Makefile (100%) rename src/rpc/friend/open_im_friend.go => cmd/rpc/open_im_friend/main.go (86%) rename {src/rpc/group => cmd/rpc/open_im_group}/Makefile (100%) rename src/rpc/group/open_im_group.go => cmd/rpc/open_im_group/main.go (87%) rename {src/rpc/chat => cmd/rpc/open_im_msg}/Makefile (100%) rename src/rpc/chat/open_im_msg.go => cmd/rpc/open_im_msg/main.go (86%) rename {src/rpc/user => cmd/rpc/open_im_user}/Makefile (100%) rename src/rpc/user/open_im_user.go => cmd/rpc/open_im_user/main.go (86%) rename {src/rpc/auth => internal/rpc}/auth/rpcAuth.go (98%) rename {src/rpc/auth => internal/rpc}/auth/user_register.go (97%) rename {src/rpc/auth => internal/rpc}/auth/user_token.go (98%) rename {src/rpc/chat => internal/rpc}/chat/pull_message.go (99%) rename {src/rpc/chat => internal/rpc}/chat/rpcChat.go (99%) rename {src/rpc/chat => internal/rpc}/chat/send_msg.go (99%) rename {src/rpc/friend => internal/rpc}/friend/add_blacklist.go (100%) rename {src/rpc/friend => internal/rpc}/friend/add_friend.go (98%) rename {src/rpc/friend => internal/rpc}/friend/add_friend_response.go (100%) rename {src/rpc/friend => internal/rpc}/friend/delete_friend.go (100%) rename {src/rpc/friend => internal/rpc}/friend/get_blacklist.go (100%) rename {src/rpc/friend => internal/rpc}/friend/get_firends_info.go (100%) rename {src/rpc/friend => internal/rpc}/friend/get_friend_apply_list.go (100%) rename {src/rpc/friend => internal/rpc}/friend/get_friend_list.go (100%) rename {src/rpc/friend => internal/rpc}/friend/is_friend.go (100%) rename {src/rpc/friend => internal/rpc}/friend/is_in_blacklist.go (100%) rename {src/rpc/friend => internal/rpc}/friend/remove_blacklist.go (100%) rename {src/rpc/friend => internal/rpc}/friend/set_friend_comment.go (100%) rename {src/rpc/group => internal/rpc}/group/create_group.go (98%) rename {src/rpc/group => internal/rpc}/group/get_group_applicationList.go (100%) rename {src/rpc/group => internal/rpc}/group/get_groups_info.go (100%) rename {src/rpc/group => internal/rpc}/group/group.go (99%) rename {src/rpc/group => internal/rpc}/group/group_application_response.go (100%) rename {src/rpc/group => internal/rpc}/group/join_group.go (100%) rename {src/rpc/group => internal/rpc}/group/quit_group.go (100%) rename {src/rpc/group => internal/rpc}/group/set_group_info.go (100%) rename {src/rpc/group => internal/rpc}/group/transfer_group_owner.go (100%) rename {src/rpc/user => internal/rpc}/user/get_user_info.go (100%) rename {src => internal}/rpc/user/internal_service/get_user_info_to_client.go (100%) rename {src/rpc/user => internal/rpc}/user/management_user.go (100%) rename {src/rpc/user => internal/rpc}/user/update_user_info.go (98%) diff --git a/src/rpc/auth/Makefile b/cmd/rpc/open_im_auth/Makefile similarity index 100% rename from src/rpc/auth/Makefile rename to cmd/rpc/open_im_auth/Makefile diff --git a/src/rpc/auth/open_im_auth.go b/cmd/rpc/open_im_auth/main.go similarity index 84% rename from src/rpc/auth/open_im_auth.go rename to cmd/rpc/open_im_auth/main.go index 765d83264..ed4656d35 100644 --- a/src/rpc/auth/open_im_auth.go +++ b/cmd/rpc/open_im_auth/main.go @@ -1,7 +1,7 @@ package main import ( - rpcAuth "Open_IM/src/rpc/auth/auth" + rpcAuth "Open_IM/internal/rpc/auth" "flag" ) diff --git a/src/rpc/friend/Makefile b/cmd/rpc/open_im_friend/Makefile similarity index 100% rename from src/rpc/friend/Makefile rename to cmd/rpc/open_im_friend/Makefile diff --git a/src/rpc/friend/open_im_friend.go b/cmd/rpc/open_im_friend/main.go similarity index 86% rename from src/rpc/friend/open_im_friend.go rename to cmd/rpc/open_im_friend/main.go index 088f5a7f4..0847699c5 100644 --- a/src/rpc/friend/open_im_friend.go +++ b/cmd/rpc/open_im_friend/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/rpc/friend/friend" + "Open_IM/internal/rpc/friend" "flag" ) diff --git a/src/rpc/group/Makefile b/cmd/rpc/open_im_group/Makefile similarity index 100% rename from src/rpc/group/Makefile rename to cmd/rpc/open_im_group/Makefile diff --git a/src/rpc/group/open_im_group.go b/cmd/rpc/open_im_group/main.go similarity index 87% rename from src/rpc/group/open_im_group.go rename to cmd/rpc/open_im_group/main.go index e5f1df690..8a3f886cb 100644 --- a/src/rpc/group/open_im_group.go +++ b/cmd/rpc/open_im_group/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/rpc/group/group" + "Open_IM/internal/rpc/group" "flag" ) diff --git a/src/rpc/chat/Makefile b/cmd/rpc/open_im_msg/Makefile similarity index 100% rename from src/rpc/chat/Makefile rename to cmd/rpc/open_im_msg/Makefile diff --git a/src/rpc/chat/open_im_msg.go b/cmd/rpc/open_im_msg/main.go similarity index 86% rename from src/rpc/chat/open_im_msg.go rename to cmd/rpc/open_im_msg/main.go index e1a0a11a4..26ca9e669 100644 --- a/src/rpc/chat/open_im_msg.go +++ b/cmd/rpc/open_im_msg/main.go @@ -1,7 +1,7 @@ package main import ( - rpcChat "Open_IM/src/rpc/chat/chat" + rpcChat "Open_IM/internal/rpc/chat" "Open_IM/src/utils" "flag" ) diff --git a/src/rpc/user/Makefile b/cmd/rpc/open_im_user/Makefile similarity index 100% rename from src/rpc/user/Makefile rename to cmd/rpc/open_im_user/Makefile diff --git a/src/rpc/user/open_im_user.go b/cmd/rpc/open_im_user/main.go similarity index 86% rename from src/rpc/user/open_im_user.go rename to cmd/rpc/open_im_user/main.go index 0625b11ee..91b6e55b5 100644 --- a/src/rpc/user/open_im_user.go +++ b/cmd/rpc/open_im_user/main.go @@ -1,7 +1,7 @@ package main import ( - "Open_IM/src/rpc/user/user" + "Open_IM/internal/rpc/user" "flag" ) diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index c52ff0a61..3eaad541d 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -7,6 +7,8 @@ package logic import ( + rpcChat "Open_IM/internal/rpc/chat" + "Open_IM/internal/rpc/user/internal_service" "Open_IM/src/common/config" "Open_IM/src/common/constant" "Open_IM/src/common/log" @@ -15,8 +17,6 @@ import ( pbGroup "Open_IM/src/proto/group" pbRelay "Open_IM/src/proto/relay" pbGetInfo "Open_IM/src/proto/user" - rpcChat "Open_IM/src/rpc/chat/chat" - "Open_IM/src/rpc/user/internal_service" "Open_IM/src/utils" "context" "encoding/json" diff --git a/src/rpc/auth/auth/rpcAuth.go b/internal/rpc/auth/rpcAuth.go similarity index 98% rename from src/rpc/auth/auth/rpcAuth.go rename to internal/rpc/auth/rpcAuth.go index 237fc9bab..6c88aee83 100644 --- a/src/rpc/auth/auth/rpcAuth.go +++ b/internal/rpc/auth/rpcAuth.go @@ -1,4 +1,4 @@ -package rpcAuth +package auth import ( "Open_IM/src/common/config" diff --git a/src/rpc/auth/auth/user_register.go b/internal/rpc/auth/user_register.go similarity index 97% rename from src/rpc/auth/auth/user_register.go rename to internal/rpc/auth/user_register.go index aa2bc40f3..feef389d5 100644 --- a/src/rpc/auth/auth/user_register.go +++ b/internal/rpc/auth/user_register.go @@ -1,4 +1,4 @@ -package rpcAuth +package auth import ( "Open_IM/src/common/db/mysql_model/im_mysql_model" diff --git a/src/rpc/auth/auth/user_token.go b/internal/rpc/auth/user_token.go similarity index 98% rename from src/rpc/auth/auth/user_token.go rename to internal/rpc/auth/user_token.go index 59e91c33b..d180caaad 100644 --- a/src/rpc/auth/auth/user_token.go +++ b/internal/rpc/auth/user_token.go @@ -1,4 +1,4 @@ -package rpcAuth +package auth import ( "Open_IM/src/common/db/mysql_model/im_mysql_model" diff --git a/src/rpc/chat/chat/pull_message.go b/internal/rpc/chat/pull_message.go similarity index 99% rename from src/rpc/chat/chat/pull_message.go rename to internal/rpc/chat/pull_message.go index 744ae1a36..bc172d32b 100644 --- a/src/rpc/chat/chat/pull_message.go +++ b/internal/rpc/chat/pull_message.go @@ -1,4 +1,4 @@ -package rpcChat +package chat import ( "context" diff --git a/src/rpc/chat/chat/rpcChat.go b/internal/rpc/chat/rpcChat.go similarity index 99% rename from src/rpc/chat/chat/rpcChat.go rename to internal/rpc/chat/rpcChat.go index ca5aeefa0..12ddac3e5 100644 --- a/src/rpc/chat/chat/rpcChat.go +++ b/internal/rpc/chat/rpcChat.go @@ -1,4 +1,4 @@ -package rpcChat +package chat import ( "Open_IM/src/common/config" diff --git a/src/rpc/chat/chat/send_msg.go b/internal/rpc/chat/send_msg.go similarity index 99% rename from src/rpc/chat/chat/send_msg.go rename to internal/rpc/chat/send_msg.go index ba5f26c9c..cac39f014 100644 --- a/src/rpc/chat/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -1,4 +1,4 @@ -package rpcChat +package chat import ( "Open_IM/internal/api/group" diff --git a/src/rpc/friend/friend/add_blacklist.go b/internal/rpc/friend/add_blacklist.go similarity index 100% rename from src/rpc/friend/friend/add_blacklist.go rename to internal/rpc/friend/add_blacklist.go diff --git a/src/rpc/friend/friend/add_friend.go b/internal/rpc/friend/add_friend.go similarity index 98% rename from src/rpc/friend/friend/add_friend.go rename to internal/rpc/friend/add_friend.go index 6fd9f4b27..1f20f8d14 100644 --- a/src/rpc/friend/friend/add_friend.go +++ b/internal/rpc/friend/add_friend.go @@ -1,14 +1,14 @@ package friend import ( + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" "Open_IM/src/common/config" "Open_IM/src/common/constant" "Open_IM/src/common/db/mysql_model/im_mysql_model" "Open_IM/src/common/log" pbChat "Open_IM/src/proto/chat" pbFriend "Open_IM/src/proto/friend" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" "Open_IM/src/utils" "context" ) diff --git a/src/rpc/friend/friend/add_friend_response.go b/internal/rpc/friend/add_friend_response.go similarity index 100% rename from src/rpc/friend/friend/add_friend_response.go rename to internal/rpc/friend/add_friend_response.go diff --git a/src/rpc/friend/friend/delete_friend.go b/internal/rpc/friend/delete_friend.go similarity index 100% rename from src/rpc/friend/friend/delete_friend.go rename to internal/rpc/friend/delete_friend.go diff --git a/src/rpc/friend/friend/get_blacklist.go b/internal/rpc/friend/get_blacklist.go similarity index 100% rename from src/rpc/friend/friend/get_blacklist.go rename to internal/rpc/friend/get_blacklist.go diff --git a/src/rpc/friend/friend/get_firends_info.go b/internal/rpc/friend/get_firends_info.go similarity index 100% rename from src/rpc/friend/friend/get_firends_info.go rename to internal/rpc/friend/get_firends_info.go diff --git a/src/rpc/friend/friend/get_friend_apply_list.go b/internal/rpc/friend/get_friend_apply_list.go similarity index 100% rename from src/rpc/friend/friend/get_friend_apply_list.go rename to internal/rpc/friend/get_friend_apply_list.go diff --git a/src/rpc/friend/friend/get_friend_list.go b/internal/rpc/friend/get_friend_list.go similarity index 100% rename from src/rpc/friend/friend/get_friend_list.go rename to internal/rpc/friend/get_friend_list.go diff --git a/src/rpc/friend/friend/is_friend.go b/internal/rpc/friend/is_friend.go similarity index 100% rename from src/rpc/friend/friend/is_friend.go rename to internal/rpc/friend/is_friend.go diff --git a/src/rpc/friend/friend/is_in_blacklist.go b/internal/rpc/friend/is_in_blacklist.go similarity index 100% rename from src/rpc/friend/friend/is_in_blacklist.go rename to internal/rpc/friend/is_in_blacklist.go diff --git a/src/rpc/friend/friend/remove_blacklist.go b/internal/rpc/friend/remove_blacklist.go similarity index 100% rename from src/rpc/friend/friend/remove_blacklist.go rename to internal/rpc/friend/remove_blacklist.go diff --git a/src/rpc/friend/friend/set_friend_comment.go b/internal/rpc/friend/set_friend_comment.go similarity index 100% rename from src/rpc/friend/friend/set_friend_comment.go rename to internal/rpc/friend/set_friend_comment.go diff --git a/src/rpc/group/group/create_group.go b/internal/rpc/group/create_group.go similarity index 98% rename from src/rpc/group/group/create_group.go rename to internal/rpc/group/create_group.go index 4aeb073d7..499522ea4 100644 --- a/src/rpc/group/group/create_group.go +++ b/internal/rpc/group/create_group.go @@ -1,6 +1,8 @@ package group import ( + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" "Open_IM/src/common/config" "Open_IM/src/common/constant" "Open_IM/src/common/db" @@ -9,8 +11,6 @@ import ( "Open_IM/src/grpc-etcdv3/getcdv3" pbChat "Open_IM/src/proto/chat" pbGroup "Open_IM/src/proto/group" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" "Open_IM/src/utils" "context" "google.golang.org/grpc" diff --git a/src/rpc/group/group/get_group_applicationList.go b/internal/rpc/group/get_group_applicationList.go similarity index 100% rename from src/rpc/group/group/get_group_applicationList.go rename to internal/rpc/group/get_group_applicationList.go diff --git a/src/rpc/group/group/get_groups_info.go b/internal/rpc/group/get_groups_info.go similarity index 100% rename from src/rpc/group/group/get_groups_info.go rename to internal/rpc/group/get_groups_info.go diff --git a/src/rpc/group/group/group.go b/internal/rpc/group/group.go similarity index 99% rename from src/rpc/group/group/group.go rename to internal/rpc/group/group.go index e1e1426b1..b90d20726 100644 --- a/src/rpc/group/group/group.go +++ b/internal/rpc/group/group.go @@ -1,12 +1,12 @@ package group import ( + "Open_IM/internal/push/content_struct" + "Open_IM/internal/push/logic" "Open_IM/src/common/config" "Open_IM/src/common/constant" "Open_IM/src/common/db" pbChat "Open_IM/src/proto/chat" - "Open_IM/src/push/content_struct" - "Open_IM/src/push/logic" "encoding/json" imdb "Open_IM/src/common/db/mysql_model/im_mysql_model" diff --git a/src/rpc/group/group/group_application_response.go b/internal/rpc/group/group_application_response.go similarity index 100% rename from src/rpc/group/group/group_application_response.go rename to internal/rpc/group/group_application_response.go diff --git a/src/rpc/group/group/join_group.go b/internal/rpc/group/join_group.go similarity index 100% rename from src/rpc/group/group/join_group.go rename to internal/rpc/group/join_group.go diff --git a/src/rpc/group/group/quit_group.go b/internal/rpc/group/quit_group.go similarity index 100% rename from src/rpc/group/group/quit_group.go rename to internal/rpc/group/quit_group.go diff --git a/src/rpc/group/group/set_group_info.go b/internal/rpc/group/set_group_info.go similarity index 100% rename from src/rpc/group/group/set_group_info.go rename to internal/rpc/group/set_group_info.go diff --git a/src/rpc/group/group/transfer_group_owner.go b/internal/rpc/group/transfer_group_owner.go similarity index 100% rename from src/rpc/group/group/transfer_group_owner.go rename to internal/rpc/group/transfer_group_owner.go diff --git a/src/rpc/user/user/get_user_info.go b/internal/rpc/user/get_user_info.go similarity index 100% rename from src/rpc/user/user/get_user_info.go rename to internal/rpc/user/get_user_info.go diff --git a/src/rpc/user/internal_service/get_user_info_to_client.go b/internal/rpc/user/internal_service/get_user_info_to_client.go similarity index 100% rename from src/rpc/user/internal_service/get_user_info_to_client.go rename to internal/rpc/user/internal_service/get_user_info_to_client.go diff --git a/src/rpc/user/user/management_user.go b/internal/rpc/user/management_user.go similarity index 100% rename from src/rpc/user/user/management_user.go rename to internal/rpc/user/management_user.go diff --git a/src/rpc/user/user/update_user_info.go b/internal/rpc/user/update_user_info.go similarity index 98% rename from src/rpc/user/user/update_user_info.go rename to internal/rpc/user/update_user_info.go index 368c08837..9a1908757 100644 --- a/src/rpc/user/user/update_user_info.go +++ b/internal/rpc/user/update_user_info.go @@ -1,6 +1,7 @@ package user import ( + "Open_IM/internal/push/logic" "Open_IM/src/common/config" "Open_IM/src/common/constant" "Open_IM/src/common/db/mysql_model/im_mysql_model" @@ -9,7 +10,6 @@ import ( pbChat "Open_IM/src/proto/chat" pbFriend "Open_IM/src/proto/friend" pbUser "Open_IM/src/proto/user" - "Open_IM/src/push/logic" "Open_IM/src/utils" "context" "strings"