소스 검색

用户发消息的扣费行为

wfz 3 년 전
부모
커밋
22657a5e4e
9개의 변경된 파일193개의 추가작업 그리고 50개의 파일을 삭제
  1. 90 8
      api/common/common.pb.go
  2. 6 0
      api/common/common.proto
  3. 47 40
      api/user/user.pb.go
  4. 1 0
      api/user/user.proto
  5. 36 0
      api/user/user_grpc.pb.go
  6. 3 2
      errors/chat.go
  7. 1 0
      errors/common.go
  8. 1 0
      errors/user.go
  9. 8 0
      js/api/common/common_pb.ts

+ 90 - 8
api/common/common.pb.go

@@ -2696,6 +2696,69 @@ func (x *IsLike) GetIsLike() bool {
 	return false
 }
 
+type BalanceRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	PersonID   string `protobuf:"bytes,1,opt,name=personID,proto3" json:"personID"`     // 查询目标的ID
+	PersonType string `protobuf:"bytes,2,opt,name=personType,proto3" json:"personType"` // 类型
+	Balance    int64  `protobuf:"varint,3,opt,name=balance,proto3" json:"balance"`      // 充值或者减少的金额
+}
+
+func (x *BalanceRequest) Reset() {
+	*x = BalanceRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_common_proto_msgTypes[38]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *BalanceRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BalanceRequest) ProtoMessage() {}
+
+func (x *BalanceRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_common_proto_msgTypes[38]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead.
+func (*BalanceRequest) Descriptor() ([]byte, []int) {
+	return file_common_proto_rawDescGZIP(), []int{38}
+}
+
+func (x *BalanceRequest) GetPersonID() string {
+	if x != nil {
+		return x.PersonID
+	}
+	return ""
+}
+
+func (x *BalanceRequest) GetPersonType() string {
+	if x != nil {
+		return x.PersonType
+	}
+	return ""
+}
+
+func (x *BalanceRequest) GetBalance() int64 {
+	if x != nil {
+		return x.Balance
+	}
+	return 0
+}
+
 var File_common_proto protoreflect.FileDescriptor
 
 var file_common_proto_rawDesc = []byte{
@@ -3003,12 +3066,18 @@ var file_common_proto_rawDesc = []byte{
 	0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f,
 	0x6d, 0x49, 0x64, 0x22, 0x20, 0x0a, 0x06, 0x49, 0x73, 0x4c, 0x69, 0x6b, 0x65, 0x12, 0x16, 0x0a,
 	0x06, 0x69, 0x73, 0x4c, 0x69, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69,
-	0x73, 0x4c, 0x69, 0x6b, 0x65, 0x42, 0x43, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d,
-	0x6d, 0x6f, 0x6e, 0x50, 0x01, 0x5a, 0x33, 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, 0x63, 0x6f, 0x6d,
-	0x6d, 0x6f, 0x6e, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x33,
+	0x73, 0x4c, 0x69, 0x6b, 0x65, 0x22, 0x66, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
+	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f,
+	0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x65, 0x72, 0x73, 0x6f,
+	0x6e, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x54,
+	0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x43, 0x0a,
+	0x0a, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x01, 0x5a, 0x33, 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, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -3023,7 +3092,7 @@ func file_common_proto_rawDescGZIP() []byte {
 	return file_common_proto_rawDescData
 }
 
-var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 38)
+var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 39)
 var file_common_proto_goTypes = []interface{}{
 	(*UserAndPartnerIdentifyIdParam)(nil), // 0: api.common.UserAndPartnerIdentifyIdParam
 	(*UserAndPartnerParam)(nil),           // 1: api.common.UserAndPartnerParam
@@ -3063,6 +3132,7 @@ var file_common_proto_goTypes = []interface{}{
 	(*FindChatRoomMsgRequest)(nil),        // 35: api.common.FindChatRoomMsgRequest
 	(*FindChatRecordListRequest)(nil),     // 36: api.common.FindChatRecordListRequest
 	(*IsLike)(nil),                        // 37: api.common.IsLike
+	(*BalanceRequest)(nil),                // 38: api.common.BalanceRequest
 }
 var file_common_proto_depIdxs = []int32{
 	24, // 0: api.common.HomeInfo.tagList:type_name -> api.common.TagList
@@ -3542,6 +3612,18 @@ func file_common_proto_init() {
 				return nil
 			}
 		}
+		file_common_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*BalanceRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
 	}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
@@ -3549,7 +3631,7 @@ func file_common_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_common_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   38,
+			NumMessages:   39,
 			NumExtensions: 0,
 			NumServices:   0,
 		},

+ 6 - 0
api/common/common.proto

@@ -275,4 +275,10 @@ message FindChatRecordListRequest{
 
 message IsLike{
   bool isLike = 1;// 是否喜欢(关注)
+}
+
+message BalanceRequest{
+  string personID = 1; // 查询目标的ID
+  string personType = 2; // 类型
+  int64 balance = 3;// 充值或者减少的金额
 }

+ 47 - 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, 0x8c, 0x1b, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x7e, 0x0a, 0x15,
+	0x6b, 0x65, 0x79, 0x32, 0xd4, 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,
@@ -954,11 +954,16 @@ var file_user_proto_rawDesc = []byte{
 	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,
+	0x01, 0x2a, 0x12, 0x46, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x64,
+	0x75, 0x63, 0x65, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 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, 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 (
@@ -1049,40 +1054,42 @@ var file_user_proto_depIdxs = []int32{
 	14, // 31: api.user.User.UserLike:input_type -> api.common.PersonParam
 	14, // 32: api.user.User.UserUnLike:input_type -> api.common.PersonParam
 	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
+	14, // 34: api.user.User.SendMsgReduceCredit:input_type -> api.common.PersonParam
+	9,  // 35: api.user.User.UpdateUserInformation:output_type -> google.protobuf.Empty
+	5,  // 36: api.user.User.GetUserInfo:output_type -> api.user.UserInfo
+	22, // 37: api.user.User.GetUserDBMsg:output_type -> api.common.PersonMsg
+	9,  // 38: api.user.User.SendPhoneCode:output_type -> google.protobuf.Empty
+	9,  // 39: api.user.User.CheckPhoneCode:output_type -> google.protobuf.Empty
+	23, // 40: api.user.User.CheckUserPartnerIsRelationship:output_type -> api.chat.CheckUserPartnerIsRelationshipReply
+	24, // 41: api.user.User.CreateUserPersonRoom:output_type -> api.chat.RoomReply
+	25, // 42: api.user.User.GetPartnerCircleInfo:output_type -> api.common.AddFriendMessageInfo
+	26, // 43: api.user.User.UserGetHomeInfo:output_type -> api.common.HomeInfo
+	27, // 44: api.user.User.FindUserDBList:output_type -> api.common.PersonDBReply
+	28, // 45: api.user.User.FindLookList:output_type -> api.statistics.LookAndLikeListReply
+	28, // 46: api.user.User.FindLikeList:output_type -> api.statistics.LookAndLikeListReply
+	28, // 47: api.user.User.FindLikedList:output_type -> api.statistics.LookAndLikeListReply
+	29, // 48: api.user.User.GetLookAndLikeStatisticsMessage:output_type -> api.statistics.LookAndLikeMessageReply
+	30, // 49: api.user.User.WxConf:output_type -> api.common.WxConfResponse
+	31, // 50: api.user.User.FindTagListBySex:output_type -> api.common.TagListReply
+	32, // 51: api.user.User.FindOnlineList:output_type -> api.common.OnlinePersonListReply
+	3,  // 52: api.user.User.FindWithinSevenDayRoomList:output_type -> api.user.UserFindChatListReply
+	3,  // 53: api.user.User.FindOverSevenDayRoomList:output_type -> api.user.UserFindChatListReply
+	33, // 54: api.user.User.UserGetPersonLikedAndLooked:output_type -> api.common.LookedAndLikedNum
+	2,  // 55: api.user.User.GetUserBalance:output_type -> api.user.UserBalance
+	34, // 56: api.user.User.GetUserLookNum:output_type -> api.statistics.LookMessageReply
+	35, // 57: api.user.User.FindChatRecordList:output_type -> api.common.ChatRecordListReply
+	36, // 58: api.user.User.FindChatRoomMsg:output_type -> api.common.ChatRoomMsg
+	37, // 59: api.user.User.GetUserIsLike:output_type -> api.common.IsLike
+	9,  // 60: api.user.User.UserFinishInformation:output_type -> google.protobuf.Empty
+	1,  // 61: api.user.User.UserInformationStatus:output_type -> api.user.InformationStatus
+	9,  // 62: api.user.User.UserGetInformationAward:output_type -> google.protobuf.Empty
+	0,  // 63: api.user.User.UserGetChatCard:output_type -> api.user.ChatCardInfo
+	9,  // 64: api.user.User.UserLike:output_type -> google.protobuf.Empty
+	9,  // 65: api.user.User.UserUnLike:output_type -> google.protobuf.Empty
+	9,  // 66: api.user.User.UnlockLookRecord:output_type -> google.protobuf.Empty
+	9,  // 67: api.user.User.SendMsgReduceCredit:output_type -> google.protobuf.Empty
+	35, // [35:68] is the sub-list for method output_type
+	2,  // [2:35] 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

+ 1 - 0
api/user/user.proto

@@ -228,6 +228,7 @@ service User {
       body:"*"
     };
   };
+  rpc SendMsgReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
 }
 
 message ChatCardInfo{

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

@@ -86,6 +86,7 @@ type UserClient interface {
 	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)
+	SendMsgReduceCredit(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 }
 
 type userClient struct {
@@ -384,6 +385,15 @@ func (c *userClient) UnlockLookRecord(ctx context.Context, in *common.PersonPara
 	return out, nil
 }
 
+func (c *userClient) SendMsgReduceCredit(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.user.User/SendMsgReduceCredit", 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
@@ -452,6 +462,7 @@ type UserServer interface {
 	UserUnLike(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	// 解锁"看过我的"的记录
 	UnlockLookRecord(context.Context, *common.PersonParam) (*emptypb.Empty, error)
+	SendMsgReduceCredit(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	mustEmbedUnimplementedUserServer()
 }
 
@@ -555,6 +566,9 @@ func (UnimplementedUserServer) UserUnLike(context.Context, *common.PersonParam)
 func (UnimplementedUserServer) UnlockLookRecord(context.Context, *common.PersonParam) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UnlockLookRecord not implemented")
 }
+func (UnimplementedUserServer) SendMsgReduceCredit(context.Context, *common.PersonParam) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method SendMsgReduceCredit not implemented")
+}
 func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
 
 // UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
@@ -1144,6 +1158,24 @@ func _User_UnlockLookRecord_Handler(srv interface{}, ctx context.Context, dec fu
 	return interceptor(ctx, in, info, handler)
 }
 
+func _User_SendMsgReduceCredit_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).SendMsgReduceCredit(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.user.User/SendMsgReduceCredit",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserServer).SendMsgReduceCredit(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)
@@ -1279,6 +1311,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "UnlockLookRecord",
 			Handler:    _User_UnlockLookRecord_Handler,
 		},
+		{
+			MethodName: "SendMsgReduceCredit",
+			Handler:    _User_SendMsgReduceCredit_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "user.proto",

+ 3 - 2
errors/chat.go

@@ -3,6 +3,7 @@ package errors
 import "git.ikuban.com/server/kratos-utils/codes"
 
 var (
-	ErrorRoomNotExist        = codes.Error(40001, "聊天不存在")
-	ErrorRoomNotBelongPerson = codes.Error(40002, "聊天不属于该用户")
+	ErrorRoomNotExist           = codes.Error(40001, "聊天不存在")
+	ErrorRoomNotBelongPerson    = codes.Error(40002, "聊天不属于该用户")
+	ErrorRoomNotMatchSendPerson = codes.Error(40003, "发送者信息与房间不匹配")
 )

+ 1 - 0
errors/common.go

@@ -20,4 +20,5 @@ var (
 	ErrorUserIdentifyChat      = codes.Error(10012, "聊天用户信息错误")
 	ErrorPartnerIdentifyChat   = codes.Error(10013, "聊天对象信息错误")
 	ErrorPersonNotExist        = codes.Error(10014, "未找到该用户")
+	ErrorBalanceNotTrue        = codes.Error(10015, "积分数据不正确")
 )

+ 1 - 0
errors/user.go

@@ -6,4 +6,5 @@ var (
 	ErrorUserSelectNotExist       = codes.Error(30001, "用户未经过选择")
 	ErrorUserNotFinishInformation = codes.Error(30002, "用户未完善资料")
 	ErrorUserCreditNotEnough      = codes.Error(30003, "用户余额不足,请及时充值")
+	ErrorSendMessageUserNotFind   = codes.Error(30004, "发送信息的用户不存在")
 )

+ 8 - 0
js/api/common/common_pb.ts

@@ -340,4 +340,12 @@ export interface IsLike{
     /**  是否喜欢(关注) */
     isLike?:boolean;
 }
+export interface BalanceRequest{
+    /**  查询目标的ID */
+    personID?:string;
+    /**  类型 */
+    personType?:string;
+    /**  充值或者减少的金额 */
+    balance?:number;
+}