From b957daa97941be81d62f0a6e2414c7cdcfab9cde Mon Sep 17 00:00:00 2001 From: "fuqihao.foliet" Date: Fri, 15 Dec 2023 18:00:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B2=89=E4=B8=9D=E4=B8=8E?= =?UTF-8?q?=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meowchat/core_api/common.proto | 24 ++++++++++++++++++++++++ meowchat/core_api/like.proto | 5 +++-- meowchat/core_api/user.proto | 16 +--------------- 3 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 meowchat/core_api/common.proto diff --git a/meowchat/core_api/common.proto b/meowchat/core_api/common.proto new file mode 100644 index 0000000..a9ebb58 --- /dev/null +++ b/meowchat/core_api/common.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package meowchat.core_api; + +option go_package = "meowchat/core_api"; +option java_package = "com.xhpolaris.idlgen.meowchat.coreapi"; +option java_outer_classname = "CommonProto"; +option java_multiple_files = true; + +import "meowchat/system/common.proto"; + +message User { + string id = 1; + string nickname = 2; + string avatarUrl = 3; + optional string motto = 4; + optional int64 follower = 5; + optional int64 following = 6; + optional int64 article = 7; + optional int64 like = 8; + optional bool isFollowing = 9; + repeated system.Role roles = 10; + optional bool enableDebug = 11; +} \ No newline at end of file diff --git a/meowchat/core_api/like.proto b/meowchat/core_api/like.proto index fc11faf..774088a 100644 --- a/meowchat/core_api/like.proto +++ b/meowchat/core_api/like.proto @@ -13,6 +13,7 @@ import "meowchat/user/common.proto"; import "meowchat/core_api/moment.proto"; import "meowchat/core_api/post.proto"; import "meowchat/core_api/comment.proto"; +import "meowchat/core_api/common.proto"; message DoLikeReq { string targetId = 1; @@ -61,7 +62,7 @@ message GetLikedUsersReq { } message GetLikedUsersResp { - repeated user.UserPreview users = 1; + repeated core_api.User users = 1; } message GetUserLikeContentsReq { @@ -72,7 +73,7 @@ message GetUserLikeContentsReq { message GetUserLikeContentsResp { repeated core_api.Moment moments = 1; - repeated user.UserPreview users = 2; + repeated core_api.User users = 2; repeated core_api.Post posts = 3; repeated core_api.Comment comments = 4; int64 total = 5; diff --git a/meowchat/core_api/user.proto b/meowchat/core_api/user.proto index df81dbd..da4c9c8 100644 --- a/meowchat/core_api/user.proto +++ b/meowchat/core_api/user.proto @@ -10,21 +10,7 @@ option java_multiple_files = true; import "basic/pagination.proto"; import "meowchat/user/common.proto"; -import "meowchat/system/common.proto"; - -message User { - string id = 1; - string nickname = 2; - string avatarUrl = 3; - optional string motto = 4; - optional int64 follower = 5; - optional int64 following = 6; - optional int64 article = 7; - optional int64 like = 8; - optional bool isFollowing = 9; - repeated system.Role roles = 10; - optional bool enableDebug = 11; -} +import "meowchat/core_api/common.proto"; message GetUserInfoReq { optional string userId = 1;