wfz 3 rokov pred
rodič
commit
54885a5a40

+ 48 - 40
api/user/user.pb.go

@@ -737,7 +737,7 @@ var file_user_proto_rawDesc = []byte{
 	0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65,
 	0x72, 0x49, 0x64, 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, 0xa5, 0x1a, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x7e, 0x0a, 0x15,
+	0x6b, 0x65, 0x79, 0x32, 0x8c, 0x1b, 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,
@@ -947,12 +947,18 @@ var file_user_proto_rawDesc = []byte{
 	0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
 	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1b,
 	0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65,
-	0x72, 0x2f, 0x75, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 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,
+	0x72, 0x2f, 0x75, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x65, 0x0a, 0x10, 0x55,
+	0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x63, 0x6f, 0x72, 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, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
+	0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75,
+	0x73, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x6f, 0x6b, 0x2f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 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 (
@@ -1042,39 +1048,41 @@ var file_user_proto_depIdxs = []int32{
 	14, // 30: api.user.User.UserGetChatCard:input_type -> api.common.PersonParam
 	14, // 31: api.user.User.UserLike:input_type -> api.common.PersonParam
 	14, // 32: api.user.User.UserUnLike:input_type -> api.common.PersonParam
-	9,  // 33: api.user.User.UpdateUserInformation:output_type -> google.protobuf.Empty
-	5,  // 34: api.user.User.GetUserInfo:output_type -> api.user.UserInfo
-	22, // 35: api.user.User.GetUserDBMsg:output_type -> api.common.PersonMsg
-	9,  // 36: api.user.User.SendPhoneCode:output_type -> google.protobuf.Empty
-	9,  // 37: api.user.User.CheckPhoneCode:output_type -> google.protobuf.Empty
-	23, // 38: api.user.User.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
-	24, // 39: api.user.User.CreateUserPersonRoom:output_type -> api.chat.RoomReply
-	25, // 40: api.user.User.GetPartnerCircleInfo:output_type -> api.common.AddFriendMessageInfo
-	26, // 41: api.user.User.UserGetHomeInfo:output_type -> api.common.HomeInfo
-	27, // 42: api.user.User.FindUserDBList:output_type -> api.common.PersonDBReply
-	28, // 43: api.user.User.FindLookList:output_type -> api.statistics.LookAndLikeListReply
-	28, // 44: api.user.User.FindLikeList:output_type -> api.statistics.LookAndLikeListReply
-	28, // 45: api.user.User.FindLikedList:output_type -> api.statistics.LookAndLikeListReply
-	29, // 46: api.user.User.GetLookAndLikeStatisticsMessage:output_type -> api.statistics.LookAndLikeMessageReply
-	30, // 47: api.user.User.WxConf:output_type -> api.common.WxConfResponse
-	31, // 48: api.user.User.FindTagListBySex:output_type -> api.common.TagListReply
-	32, // 49: api.user.User.FindOnlineList:output_type -> api.common.OnlinePersonListReply
-	3,  // 50: api.user.User.FindWithinSevenDayRoomList:output_type -> api.user.UserFindChatListReply
-	3,  // 51: api.user.User.FindOverSevenDayRoomList:output_type -> api.user.UserFindChatListReply
-	33, // 52: api.user.User.UserGetPersonLikedAndLooked:output_type -> api.common.LookedAndLikedNum
-	2,  // 53: api.user.User.GetUserBalance:output_type -> api.user.UserBalance
-	34, // 54: api.user.User.GetUserLookNum:output_type -> api.statistics.LookMessageReply
-	35, // 55: api.user.User.FindChatRecordList:output_type -> api.common.ChatRecordListReply
-	36, // 56: api.user.User.FindChatRoomMsg:output_type -> api.common.ChatRoomMsg
-	37, // 57: api.user.User.GetUserIsLike:output_type -> api.common.IsLike
-	9,  // 58: api.user.User.UserFinishInformation:output_type -> google.protobuf.Empty
-	1,  // 59: api.user.User.UserInformationStatus:output_type -> api.user.InformationStatus
-	9,  // 60: api.user.User.UserGetInformationAward:output_type -> google.protobuf.Empty
-	0,  // 61: api.user.User.UserGetChatCard:output_type -> api.user.ChatCardInfo
-	9,  // 62: api.user.User.UserLike:output_type -> google.protobuf.Empty
-	9,  // 63: api.user.User.UserUnLike:output_type -> google.protobuf.Empty
-	33, // [33:64] is the sub-list for method output_type
-	2,  // [2:33] is the sub-list for method input_type
+	14, // 33: api.user.User.UnlockLookRecord:input_type -> api.common.PersonParam
+	9,  // 34: api.user.User.UpdateUserInformation:output_type -> google.protobuf.Empty
+	5,  // 35: api.user.User.GetUserInfo:output_type -> api.user.UserInfo
+	22, // 36: api.user.User.GetUserDBMsg:output_type -> api.common.PersonMsg
+	9,  // 37: api.user.User.SendPhoneCode:output_type -> google.protobuf.Empty
+	9,  // 38: api.user.User.CheckPhoneCode:output_type -> google.protobuf.Empty
+	23, // 39: api.user.User.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
+	24, // 40: api.user.User.CreateUserPersonRoom:output_type -> api.chat.RoomReply
+	25, // 41: api.user.User.GetPartnerCircleInfo:output_type -> api.common.AddFriendMessageInfo
+	26, // 42: api.user.User.UserGetHomeInfo:output_type -> api.common.HomeInfo
+	27, // 43: api.user.User.FindUserDBList:output_type -> api.common.PersonDBReply
+	28, // 44: api.user.User.FindLookList:output_type -> api.statistics.LookAndLikeListReply
+	28, // 45: api.user.User.FindLikeList:output_type -> api.statistics.LookAndLikeListReply
+	28, // 46: api.user.User.FindLikedList:output_type -> api.statistics.LookAndLikeListReply
+	29, // 47: api.user.User.GetLookAndLikeStatisticsMessage:output_type -> api.statistics.LookAndLikeMessageReply
+	30, // 48: api.user.User.WxConf:output_type -> api.common.WxConfResponse
+	31, // 49: api.user.User.FindTagListBySex:output_type -> api.common.TagListReply
+	32, // 50: api.user.User.FindOnlineList:output_type -> api.common.OnlinePersonListReply
+	3,  // 51: api.user.User.FindWithinSevenDayRoomList:output_type -> api.user.UserFindChatListReply
+	3,  // 52: api.user.User.FindOverSevenDayRoomList:output_type -> api.user.UserFindChatListReply
+	33, // 53: api.user.User.UserGetPersonLikedAndLooked:output_type -> api.common.LookedAndLikedNum
+	2,  // 54: api.user.User.GetUserBalance:output_type -> api.user.UserBalance
+	34, // 55: api.user.User.GetUserLookNum:output_type -> api.statistics.LookMessageReply
+	35, // 56: api.user.User.FindChatRecordList:output_type -> api.common.ChatRecordListReply
+	36, // 57: api.user.User.FindChatRoomMsg:output_type -> api.common.ChatRoomMsg
+	37, // 58: api.user.User.GetUserIsLike:output_type -> api.common.IsLike
+	9,  // 59: api.user.User.UserFinishInformation:output_type -> google.protobuf.Empty
+	1,  // 60: api.user.User.UserInformationStatus:output_type -> api.user.InformationStatus
+	9,  // 61: api.user.User.UserGetInformationAward:output_type -> google.protobuf.Empty
+	0,  // 62: api.user.User.UserGetChatCard:output_type -> api.user.ChatCardInfo
+	9,  // 63: api.user.User.UserLike:output_type -> google.protobuf.Empty
+	9,  // 64: api.user.User.UserUnLike:output_type -> google.protobuf.Empty
+	9,  // 65: api.user.User.UnlockLookRecord:output_type -> google.protobuf.Empty
+	34, // [34:66] is the sub-list for method output_type
+	2,  // [2:34] is the sub-list for method input_type
 	2,  // [2:2] is the sub-list for extension type_name
 	2,  // [2:2] is the sub-list for extension extendee
 	0,  // [0:2] is the sub-list for field type_name

+ 7 - 0
api/user/user.proto

@@ -221,6 +221,13 @@ service User {
       body:"*"
     };
   };
+  // 解锁"看过我的"的记录
+  rpc UnlockLookRecord (common.PersonParam) returns (google.protobuf.Empty){
+    option (google.api.http) = {
+      post: "/api/user/look/unlock",
+      body:"*"
+    };
+  };
 }
 
 message ChatCardInfo{

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

@@ -84,6 +84,8 @@ type UserClient interface {
 	UserLike(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 用户取关某人
 	UserUnLike(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 解锁"看过我的"的记录
+	UnlockLookRecord(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 }
 
 type userClient struct {
@@ -373,6 +375,15 @@ func (c *userClient) UserUnLike(ctx context.Context, in *common.PersonParam, opt
 	return out, nil
 }
 
+func (c *userClient) UnlockLookRecord(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.user.User/UnlockLookRecord", 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
@@ -439,6 +450,8 @@ type UserServer interface {
 	UserLike(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	// 用户取关某人
 	UserUnLike(context.Context, *common.PersonParam) (*emptypb.Empty, error)
+	// 解锁"看过我的"的记录
+	UnlockLookRecord(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	mustEmbedUnimplementedUserServer()
 }
 
@@ -539,6 +552,9 @@ func (UnimplementedUserServer) UserLike(context.Context, *common.PersonParam) (*
 func (UnimplementedUserServer) UserUnLike(context.Context, *common.PersonParam) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UserUnLike not implemented")
 }
+func (UnimplementedUserServer) UnlockLookRecord(context.Context, *common.PersonParam) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UnlockLookRecord not implemented")
+}
 func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
 
 // UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
@@ -1110,6 +1126,24 @@ func _User_UserUnLike_Handler(srv interface{}, ctx context.Context, dec func(int
 	return interceptor(ctx, in, info, handler)
 }
 
+func _User_UnlockLookRecord_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).UnlockLookRecord(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.user.User/UnlockLookRecord",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserServer).UnlockLookRecord(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)
@@ -1241,6 +1275,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "UserUnLike",
 			Handler:    _User_UserUnLike_Handler,
 		},
+		{
+			MethodName: "UnlockLookRecord",
+			Handler:    _User_UnlockLookRecord_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "user.proto",

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

@@ -49,6 +49,7 @@ type UserHTTPServer interface {
 	GetUserIsLike(context.Context, *common.PersonParam) (*common.IsLike, error)
 	GetUserLookNum(context.Context, *emptypb.Empty) (*statistics.LookMessageReply, error)
 	SendPhoneCode(context.Context, *common.SendPhoneCodeRequest) (*emptypb.Empty, error)
+	UnlockLookRecord(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	UpdateUserInformation(context.Context, *common.UpdateInformationRequest) (*emptypb.Empty, error)
 	UserFinishInformation(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
 	UserGetChatCard(context.Context, *common.PersonParam) (*ChatCardInfo, error)
@@ -92,6 +93,7 @@ func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer) {
 	r.POST("/api/user/chat/card", _User_UserGetChatCard0_HTTP_Handler(srv))
 	r.POST("/api/user/like", _User_UserLike0_HTTP_Handler(srv))
 	r.POST("/api/user/unlike", _User_UserUnLike0_HTTP_Handler(srv))
+	r.POST("/api/user/look/unlock", _User_UnlockLookRecord0_HTTP_Handler(srv))
 }
 
 func _User_UpdateUserInformation0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context) error {
@@ -877,6 +879,33 @@ func _User_UserUnLike0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context) e
 	}
 }
 
+func _User_UnlockLookRecord0_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/UnlockLookRecord")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.UnlockLookRecord(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)
@@ -897,6 +926,7 @@ type UserHTTPClient interface {
 	GetUserIsLike(ctx context.Context, req *common.PersonParam, opts ...http.CallOption) (rsp *common.IsLike, err error)
 	GetUserLookNum(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *statistics.LookMessageReply, err error)
 	SendPhoneCode(ctx context.Context, req *common.SendPhoneCodeRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
+	UnlockLookRecord(ctx context.Context, req *common.PersonParam, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	UpdateUserInformation(ctx context.Context, req *common.UpdateInformationRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	UserFinishInformation(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	UserGetChatCard(ctx context.Context, req *common.PersonParam, opts ...http.CallOption) (rsp *ChatCardInfo, err error)
@@ -1164,6 +1194,19 @@ func (c *UserHTTPClientImpl) SendPhoneCode(ctx context.Context, in *common.SendP
 	return &out, err
 }
 
+func (c *UserHTTPClientImpl) UnlockLookRecord(ctx context.Context, in *common.PersonParam, opts ...http.CallOption) (*emptypb.Empty, error) {
+	var out emptypb.Empty
+	pattern := "/api/user/look/unlock"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.user.User/UnlockLookRecord"))
+	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) UpdateUserInformation(ctx context.Context, in *common.UpdateInformationRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
 	var out emptypb.Empty
 	pattern := "/api/user/update/information"

+ 2 - 2
define/chat.go

@@ -1,8 +1,8 @@
 package define
 
 var (
-	TypeUserNew = "new"
-	TypeUserPay = "pay"
+	TypeUserNew = "new" // 新客
+	TypeUserPay = "pay" // 付费
 )
 
 var (

+ 3 - 3
define/lock.go

@@ -1,7 +1,7 @@
 package define
 
 var (
-	LockPartnerBalance = "partner_balance"
-	LockChatRoom       = "chat_room"
-	LockUserCredit     = "user_credit"
+	LockPartnerBalance = "partner_balance" // 接待员金额锁
+	LockChatRoom       = "chat_room"       // 房间信息锁
+	LockUserCredit     = "user_credit"     // 用户积分锁
 )

+ 1 - 0
errors/user.go

@@ -5,4 +5,5 @@ import "git.ikuban.com/server/kratos-utils/codes"
 var (
 	ErrorUserSelectNotExist       = codes.Error(30001, "用户未经过选择")
 	ErrorUserNotFinishInformation = codes.Error(30002, "用户未完善资料")
+	ErrorUserCreditNotEnough      = codes.Error(30003, "用户余额不足,请及时充值")
 )

+ 5 - 0
js/api/user/user_http_pb.ts

@@ -151,6 +151,11 @@ const UserService = {
 	const res = await request.post('/api/user/unlike', req);
     return res.data.data;
   },
+  /**  解锁"看过我的"的记录 */
+  UnlockLookRecord: async (req?: PersonParam) => {
+	const res = await request.post('/api/user/look/unlock', req);
+    return res.data.data;
+  },
 
 };