瀏覽代碼

用户获取ta的主页访客、关注数

wfz 3 年之前
父節點
當前提交
345e506f8d
共有 5 個文件被更改,包括 133 次插入30 次删除
  1. 39 29
      api/user/user.pb.go
  2. 7 0
      api/user/user.proto
  3. 38 0
      api/user/user_grpc.pb.go
  4. 43 0
      api/user/user_http.pb.go
  5. 6 1
      js/api/user/user_http_pb.ts

+ 39 - 29
api/user/user.pb.go

@@ -440,7 +440,7 @@ var file_user_proto_rawDesc = []byte{
 	0x12, 0x0a, 0x04, 0x61, 0x72, 0x65, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61,
 	0x72, 0x65, 0x61, 0x22, 0x1e, 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
 	0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
-	0x6b, 0x65, 0x79, 0x32, 0x97, 0x11, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x7e, 0x0a, 0x15,
+	0x6b, 0x65, 0x79, 0x32, 0x88, 0x12, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x7e, 0x0a, 0x15,
 	0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d,
 	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
 	0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61,
@@ -577,12 +577,19 @@ var file_user_proto_rawDesc = []byte{
 	0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x74, 0x4c,
 	0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d,
 	0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x73, 0x74,
-	0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x6f, 0x76, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x42, 0x3d, 0x0a,
-	0x08, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74,
-	0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76,
-	0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61,
-	0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72,
-	0x6f, 0x74, 0x6f, 0x33,
+	0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x6f, 0x76, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x6f, 0x0a,
+	0x1b, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x4c, 0x69,
+	0x6b, 0x65, 0x64, 0x41, 0x6e, 0x64, 0x4c, 0x6f, 0x6f, 0x6b, 0x65, 0x64, 0x12, 0x17, 0x2e, 0x61,
+	0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,
+	0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x65, 0x64, 0x41, 0x6e, 0x64, 0x4c, 0x69, 0x6b, 0x65,
+	0x64, 0x4e, 0x75, 0x6d, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x61,
+	0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x6e, 0x75, 0x6d, 0x3a, 0x01, 0x2a, 0x42, 0x3d,
+	0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69,
+	0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72,
+	0x76, 0x65, 0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
+	0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -627,6 +634,7 @@ var file_user_proto_goTypes = []interface{}{
 	(*common.WxConfResponse)(nil),                    // 25: api.common.WxConfResponse
 	(*common.TagListReply)(nil),                      // 26: api.common.TagListReply
 	(*common.OnlinePersonListReply)(nil),             // 27: api.common.OnlinePersonListReply
+	(*common.LookedAndLikedNum)(nil),                 // 28: api.common.LookedAndLikedNum
 }
 var file_user_proto_depIdxs = []int32{
 	1,  // 0: api.user.UserFindChatListReply.list:type_name -> api.user.UserChatInfo
@@ -650,28 +658,30 @@ var file_user_proto_depIdxs = []int32{
 	15, // 18: api.user.User.FindOnlineList:input_type -> api.common.ListPage2Request
 	12, // 19: api.user.User.FindWithinSevenDayRoomList:input_type -> api.common.ListPageRequest
 	12, // 20: api.user.User.FindOverSevenDayRoomList:input_type -> api.common.ListPageRequest
-	5,  // 21: api.user.User.UpdateUserInformation:output_type -> google.protobuf.Empty
-	2,  // 22: api.user.User.GetUserInfo:output_type -> api.user.UserInfo
-	16, // 23: api.user.User.GetUserDBMsg:output_type -> api.common.PersonMsg
-	17, // 24: api.user.User.GetUserLookNum:output_type -> api.statistics.LookMessageReply
-	5,  // 25: api.user.User.SendPhoneCode:output_type -> google.protobuf.Empty
-	5,  // 26: api.user.User.CheckPhoneCode:output_type -> google.protobuf.Empty
-	18, // 27: api.user.User.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
-	19, // 28: api.user.User.CreateUserPartnerRoom:output_type -> api.chat.RoomReply
-	20, // 29: api.user.User.GetPartnerCircleInfo:output_type -> api.common.AddFriendMessageInfo
-	21, // 30: api.user.User.UserGetHomeInfo:output_type -> api.common.HomeInfo
-	22, // 31: api.user.User.FindUserDBList:output_type -> api.common.PersonDBReply
-	23, // 32: api.user.User.FindLookList:output_type -> api.statistics.LookAndLikeListReply
-	23, // 33: api.user.User.FindLikeList:output_type -> api.statistics.LookAndLikeListReply
-	23, // 34: api.user.User.FindLikedList:output_type -> api.statistics.LookAndLikeListReply
-	24, // 35: api.user.User.GetLookAndLikeStatisticsMessage:output_type -> api.statistics.LookAndLikeMessageReply
-	25, // 36: api.user.User.WxConf:output_type -> api.common.WxConfResponse
-	26, // 37: api.user.User.FindTagListBySex:output_type -> api.common.TagListReply
-	27, // 38: api.user.User.FindOnlineList:output_type -> api.common.OnlinePersonListReply
-	0,  // 39: api.user.User.FindWithinSevenDayRoomList:output_type -> api.user.UserFindChatListReply
-	0,  // 40: api.user.User.FindOverSevenDayRoomList:output_type -> api.user.UserFindChatListReply
-	21, // [21:41] is the sub-list for method output_type
-	1,  // [1:21] is the sub-list for method input_type
+	10, // 21: api.user.User.UserGetPersonLikedAndLooked:input_type -> api.common.PersonParam
+	5,  // 22: api.user.User.UpdateUserInformation:output_type -> google.protobuf.Empty
+	2,  // 23: api.user.User.GetUserInfo:output_type -> api.user.UserInfo
+	16, // 24: api.user.User.GetUserDBMsg:output_type -> api.common.PersonMsg
+	17, // 25: api.user.User.GetUserLookNum:output_type -> api.statistics.LookMessageReply
+	5,  // 26: api.user.User.SendPhoneCode:output_type -> google.protobuf.Empty
+	5,  // 27: api.user.User.CheckPhoneCode:output_type -> google.protobuf.Empty
+	18, // 28: api.user.User.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
+	19, // 29: api.user.User.CreateUserPartnerRoom:output_type -> api.chat.RoomReply
+	20, // 30: api.user.User.GetPartnerCircleInfo:output_type -> api.common.AddFriendMessageInfo
+	21, // 31: api.user.User.UserGetHomeInfo:output_type -> api.common.HomeInfo
+	22, // 32: api.user.User.FindUserDBList:output_type -> api.common.PersonDBReply
+	23, // 33: api.user.User.FindLookList:output_type -> api.statistics.LookAndLikeListReply
+	23, // 34: api.user.User.FindLikeList:output_type -> api.statistics.LookAndLikeListReply
+	23, // 35: api.user.User.FindLikedList:output_type -> api.statistics.LookAndLikeListReply
+	24, // 36: api.user.User.GetLookAndLikeStatisticsMessage:output_type -> api.statistics.LookAndLikeMessageReply
+	25, // 37: api.user.User.WxConf:output_type -> api.common.WxConfResponse
+	26, // 38: api.user.User.FindTagListBySex:output_type -> api.common.TagListReply
+	27, // 39: api.user.User.FindOnlineList:output_type -> api.common.OnlinePersonListReply
+	0,  // 40: api.user.User.FindWithinSevenDayRoomList:output_type -> api.user.UserFindChatListReply
+	0,  // 41: api.user.User.FindOverSevenDayRoomList:output_type -> api.user.UserFindChatListReply
+	28, // 42: api.user.User.UserGetPersonLikedAndLooked:output_type -> api.common.LookedAndLikedNum
+	22, // [22:43] is the sub-list for method output_type
+	1,  // [1:22] is the sub-list for method input_type
 	1,  // [1:1] is the sub-list for extension type_name
 	1,  // [1:1] is the sub-list for extension extendee
 	0,  // [0:1] is the sub-list for field type_name

+ 7 - 0
api/user/user.proto

@@ -144,6 +144,13 @@ service User {
       body:"*"
     };
   };
+  // 用户获取ta的主页访客、关注数
+  rpc UserGetPersonLikedAndLooked (common.PersonParam) returns (common.LookedAndLikedNum){
+    option (google.api.http) = {
+      post: "/api/user/num",
+      body:"*"
+    };
+  };
 }
 
 message UserFindChatListReply{

+ 38 - 0
api/user/user_grpc.pb.go

@@ -62,6 +62,8 @@ type UserClient interface {
 	FindWithinSevenDayRoomList(ctx context.Context, in *common.ListPageRequest, opts ...grpc.CallOption) (*UserFindChatListReply, error)
 	// 七天外列表(更早的聊天记录)
 	FindOverSevenDayRoomList(ctx context.Context, in *common.ListPageRequest, opts ...grpc.CallOption) (*UserFindChatListReply, error)
+	// 用户获取ta的主页访客、关注数
+	UserGetPersonLikedAndLooked(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*common.LookedAndLikedNum, error)
 }
 
 type userClient struct {
@@ -252,6 +254,15 @@ func (c *userClient) FindOverSevenDayRoomList(ctx context.Context, in *common.Li
 	return out, nil
 }
 
+func (c *userClient) UserGetPersonLikedAndLooked(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*common.LookedAndLikedNum, error) {
+	out := new(common.LookedAndLikedNum)
+	err := c.cc.Invoke(ctx, "/api.user.User/UserGetPersonLikedAndLooked", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // UserServer is the server API for User service.
 // All implementations must embed UnimplementedUserServer
 // for forward compatibility
@@ -296,6 +307,8 @@ type UserServer interface {
 	FindWithinSevenDayRoomList(context.Context, *common.ListPageRequest) (*UserFindChatListReply, error)
 	// 七天外列表(更早的聊天记录)
 	FindOverSevenDayRoomList(context.Context, *common.ListPageRequest) (*UserFindChatListReply, error)
+	// 用户获取ta的主页访客、关注数
+	UserGetPersonLikedAndLooked(context.Context, *common.PersonParam) (*common.LookedAndLikedNum, error)
 	mustEmbedUnimplementedUserServer()
 }
 
@@ -363,6 +376,9 @@ func (UnimplementedUserServer) FindWithinSevenDayRoomList(context.Context, *comm
 func (UnimplementedUserServer) FindOverSevenDayRoomList(context.Context, *common.ListPageRequest) (*UserFindChatListReply, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method FindOverSevenDayRoomList not implemented")
 }
+func (UnimplementedUserServer) UserGetPersonLikedAndLooked(context.Context, *common.PersonParam) (*common.LookedAndLikedNum, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UserGetPersonLikedAndLooked not implemented")
+}
 func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
 
 // UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
@@ -736,6 +752,24 @@ func _User_FindOverSevenDayRoomList_Handler(srv interface{}, ctx context.Context
 	return interceptor(ctx, in, info, handler)
 }
 
+func _User_UserGetPersonLikedAndLooked_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(common.PersonParam)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(UserServer).UserGetPersonLikedAndLooked(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.user.User/UserGetPersonLikedAndLooked",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserServer).UserGetPersonLikedAndLooked(ctx, req.(*common.PersonParam))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // User_ServiceDesc is the grpc.ServiceDesc for User service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -823,6 +857,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "FindOverSevenDayRoomList",
 			Handler:    _User_FindOverSevenDayRoomList_Handler,
 		},
+		{
+			MethodName: "UserGetPersonLikedAndLooked",
+			Handler:    _User_UserGetPersonLikedAndLooked_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "user.proto",

+ 43 - 0
api/user/user_http.pb.go

@@ -47,6 +47,7 @@ type UserHTTPServer interface {
 	SendPhoneCode(context.Context, *common.SendPhoneCodeRequest) (*emptypb.Empty, error)
 	UpdateUserInformation(context.Context, *common.UpdateInformationRequest) (*emptypb.Empty, error)
 	UserGetHomeInfo(context.Context, *common.PersonParam) (*common.HomeInfo, error)
+	UserGetPersonLikedAndLooked(context.Context, *common.PersonParam) (*common.LookedAndLikedNum, error)
 	WxConf(context.Context, *common.WxConfReq) (*common.WxConfResponse, error)
 }
 
@@ -70,6 +71,7 @@ func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer) {
 	r.POST("/api/user/list/online", _User_FindOnlineList0_HTTP_Handler(srv))
 	r.POST("/api/user/list/chat/within", _User_FindWithinSevenDayRoomList0_HTTP_Handler(srv))
 	r.POST("/api/user/list/chat/over", _User_FindOverSevenDayRoomList0_HTTP_Handler(srv))
+	r.POST("/api/user/num", _User_UserGetPersonLikedAndLooked0_HTTP_Handler(srv))
 }
 
 func _User_UpdateUserInformation0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context) error {
@@ -558,6 +560,33 @@ func _User_FindOverSevenDayRoomList0_HTTP_Handler(srv UserHTTPServer) func(ctx h
 	}
 }
 
+func _User_UserGetPersonLikedAndLooked0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context) error {
+	return func(ctx http.Context) error {
+		var in common.PersonParam
+		if err := ctx.Bind(&in); err != nil {
+			return err
+		}
+		if err := ctx.BindQuery(&in); err != nil {
+			return err
+		}
+		http.SetOperation(ctx, "/api.user.User/UserGetPersonLikedAndLooked")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.UserGetPersonLikedAndLooked(ctx, req.(*common.PersonParam))
+		})
+		out, err := h(ctx, &in)
+		if err != nil {
+			return err
+		}
+		success := &reply.SuccessReply{
+			Code: 0,
+		}
+		if out != nil {
+			success.Data = out
+		}
+		return ctx.Result(200, success)
+	}
+}
+
 type UserHTTPClient interface {
 	CheckPhoneCode(ctx context.Context, req *common.CheckPhoneCodeRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	CheckUserPartnerIsRelationship(ctx context.Context, req *common.PartnerIDParam, opts ...http.CallOption) (rsp *chat.CheckUserPartnerIsRelationshipReply, err error)
@@ -576,6 +605,7 @@ type UserHTTPClient interface {
 	SendPhoneCode(ctx context.Context, req *common.SendPhoneCodeRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	UpdateUserInformation(ctx context.Context, req *common.UpdateInformationRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	UserGetHomeInfo(ctx context.Context, req *common.PersonParam, opts ...http.CallOption) (rsp *common.HomeInfo, err error)
+	UserGetPersonLikedAndLooked(ctx context.Context, req *common.PersonParam, opts ...http.CallOption) (rsp *common.LookedAndLikedNum, err error)
 	WxConf(ctx context.Context, req *common.WxConfReq, opts ...http.CallOption) (rsp *common.WxConfResponse, err error)
 }
 
@@ -808,6 +838,19 @@ func (c *UserHTTPClientImpl) UserGetHomeInfo(ctx context.Context, in *common.Per
 	return &out, err
 }
 
+func (c *UserHTTPClientImpl) UserGetPersonLikedAndLooked(ctx context.Context, in *common.PersonParam, opts ...http.CallOption) (*common.LookedAndLikedNum, error) {
+	var out common.LookedAndLikedNum
+	pattern := "/api/user/num"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.user.User/UserGetPersonLikedAndLooked"))
+	opts = append(opts, http.PathTemplate(pattern))
+	err := c.cc.Invoke(ctx, "POST", path, in, &out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return &out, err
+}
+
 func (c *UserHTTPClientImpl) WxConf(ctx context.Context, in *common.WxConfReq, opts ...http.CallOption) (*common.WxConfResponse, error) {
 	var out common.WxConfResponse
 	pattern := "/api/wx/jssdk/config"

+ 6 - 1
js/api/user/user_http_pb.ts

@@ -1,6 +1,6 @@
 // @ts-ignore
 import request from '@/libs/request';
-import {UpdateInformationRequest,PersonIDParam,PersonMsg,SendPhoneCodeRequest,CheckPhoneCodeRequest,PartnerIDParam,AddFriendMessageInfo,PersonParam,HomeInfo,PersonIDList,PersonDBReply,ListPageRequest,WxConfReq,WxConfResponse,SexReq,TagListReply,ListPage2Request,OnlinePersonListReply} from "../common/common_pb";
+import {UpdateInformationRequest,PersonIDParam,PersonMsg,SendPhoneCodeRequest,CheckPhoneCodeRequest,PartnerIDParam,AddFriendMessageInfo,PersonParam,HomeInfo,PersonIDList,PersonDBReply,ListPageRequest,WxConfReq,WxConfResponse,SexReq,TagListReply,ListPage2Request,OnlinePersonListReply,LookedAndLikedNum} from "../common/common_pb";
 import {UserInfo,KeyRequest,UserFindChatListReply} from "./user_pb";
 import {LookMessageReply,LookAndLikeListReply,LookAndLikeMessageReply} from "../statistics/statistics_pb";
 import {CheckUserPartnerIsRelationshipReply,RoomReply} from "../chat/chat_pb";
@@ -96,6 +96,11 @@ const UserService = {
 	const res = await request.post<{ data: UserFindChatListReply, code: string, message: string }>('/api/user/list/chat/over', req);
     return res.data.data;
   },
+  /**  用户获取ta的主页访客、关注数 */
+  UserGetPersonLikedAndLooked: async (req?: PersonParam) => {
+	const res = await request.post<{ data: LookedAndLikedNum, code: string, message: string }>('/api/user/num', req);
+    return res.data.data;
+  },
 
 };