wfz 3 years ago
parent
commit
e88bef9f24
5 changed files with 33 additions and 33 deletions
  1. 25 26
      api/user/user.pb.go
  2. 1 1
      api/user/user.proto
  3. 5 5
      api/user/user_grpc.pb.go
  4. 1 0
      errors/user.go
  5. 1 1
      js/api/user/user_http_pb.ts

+ 25 - 26
api/user/user.pb.go

@@ -1806,7 +1806,7 @@ var file_user_proto_rawDesc = []byte{
 	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x2a, 0x0a,
 	0x10, 0x50, 0x61, 0x79, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c,
 	0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x0c, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0xf4, 0x39, 0x0a, 0x04, 0x55, 0x73,
+	0x0c, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0xe8, 0x39, 0x0a, 0x04, 0x55, 0x73,
 	0x65, 0x72, 0x12, 0x54, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66,
 	0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e,
@@ -2246,35 +2246,34 @@ var file_user_proto_rawDesc = []byte{
 	0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x72,
 	0x73, 0x6f, 0x6e, 0x49, 0x44, 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, 0x00, 0x12, 0x52, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52,
+	0x74, 0x79, 0x22, 0x00, 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, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
-	0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, 0x43, 0x72, 0x65,
-	0x64, 0x69, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4c, 0x0a, 0x19, 0x4c, 0x6f, 0x6f, 0x6b,
-	0x42, 0x61, 0x63, 0x6b, 0x53, 0x63, 0x72, 0x69, 0x70, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, 0x43,
+	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, 0x12, 0x4c, 0x0a, 0x19,
+	0x4c, 0x6f, 0x6f, 0x6b, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x63, 0x72, 0x69, 0x70, 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, 0x12, 0x4a, 0x0a, 0x17, 0x43, 0x72,
+	0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x72, 0x69, 0x70, 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, 0x12, 0x4a, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
-	0x53, 0x63, 0x72, 0x69, 0x70, 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, 0x12, 0x49, 0x0a, 0x16, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x63, 0x72, 0x69, 0x70,
-	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, 0x12, 0x41, 0x0a,
-	0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 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,
+	0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x16, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x53,
+	0x63, 0x72, 0x69, 0x70, 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, 0x12, 0x41, 0x0a, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 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 (
@@ -2512,7 +2511,7 @@ var file_user_proto_depIdxs = []int32{
 	26, // 137: api.user.User.UpdateLastScripIDDB:output_type -> google.protobuf.Empty
 	78, // 138: api.user.User.FindRecommendUserDBList:output_type -> api.common.PersonDBReply
 	26, // 139: api.user.User.UpdateUserLastLoginTime:output_type -> google.protobuf.Empty
-	0,  // 140: api.user.User.SendMsgReduceCredit:output_type -> api.user.SendMsgReduceCreditReply
+	26, // 140: api.user.User.SendMsgReduceCredit:output_type -> google.protobuf.Empty
 	26, // 141: api.user.User.LookBackScripReduceCredit:output_type -> google.protobuf.Empty
 	26, // 142: api.user.User.CreateScripReduceCredit:output_type -> google.protobuf.Empty
 	26, // 143: api.user.User.ReplyScripReduceCredit:output_type -> google.protobuf.Empty

+ 1 - 1
api/user/user.proto

@@ -454,7 +454,7 @@ service User {
   rpc UpdateUserLastLoginTime (common.PersonIDParam) returns (google.protobuf.Empty){};
 
   // 发送消息扣费
-  rpc SendMsgReduceCredit (common.PersonParam) returns (SendMsgReduceCreditReply);
+  rpc SendMsgReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
   // 回看纸条扣费
   rpc LookBackScripReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
   // 发纸条扣费

+ 5 - 5
api/user/user_grpc.pb.go

@@ -156,7 +156,7 @@ type UserClient interface {
 	// 5、更新上次登录时间
 	UpdateUserLastLoginTime(ctx context.Context, in *common.PersonIDParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 发送消息扣费
-	SendMsgReduceCredit(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*SendMsgReduceCreditReply, error)
+	SendMsgReduceCredit(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 回看纸条扣费
 	LookBackScripReduceCredit(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 发纸条扣费
@@ -760,8 +760,8 @@ func (c *userClient) UpdateUserLastLoginTime(ctx context.Context, in *common.Per
 	return out, nil
 }
 
-func (c *userClient) SendMsgReduceCredit(ctx context.Context, in *common.PersonParam, opts ...grpc.CallOption) (*SendMsgReduceCreditReply, error) {
-	out := new(SendMsgReduceCreditReply)
+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
@@ -943,7 +943,7 @@ type UserServer interface {
 	// 5、更新上次登录时间
 	UpdateUserLastLoginTime(context.Context, *common.PersonIDParam) (*emptypb.Empty, error)
 	// 发送消息扣费
-	SendMsgReduceCredit(context.Context, *common.PersonParam) (*SendMsgReduceCreditReply, error)
+	SendMsgReduceCredit(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	// 回看纸条扣费
 	LookBackScripReduceCredit(context.Context, *common.PersonParam) (*emptypb.Empty, error)
 	// 发纸条扣费
@@ -1154,7 +1154,7 @@ func (UnimplementedUserServer) FindRecommendUserDBList(context.Context, *common.
 func (UnimplementedUserServer) UpdateUserLastLoginTime(context.Context, *common.PersonIDParam) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method UpdateUserLastLoginTime not implemented")
 }
-func (UnimplementedUserServer) SendMsgReduceCredit(context.Context, *common.PersonParam) (*SendMsgReduceCreditReply, error) {
+func (UnimplementedUserServer) SendMsgReduceCredit(context.Context, *common.PersonParam) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method SendMsgReduceCredit not implemented")
 }
 func (UnimplementedUserServer) LookBackScripReduceCredit(context.Context, *common.PersonParam) (*emptypb.Empty, error) {

+ 1 - 0
errors/user.go

@@ -8,4 +8,5 @@ var (
 	ErrorUserCreditNotEnough      = codes.Error(30003, "用户余额不足,请及时充值")
 	ErrorSendMessageUserNotFind   = codes.Error(30004, "发送信息的用户不存在")
 	ErrorRechargeNotFind          = codes.Error(30005, "充值套餐不存在")
+	ErrorFreeNumNotEnough         = codes.Error(30006, "免费消息数已用完")
 )

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

@@ -1,6 +1,6 @@
 // @ts-ignore
 import request from '@/libs/request';
-import {UserInfo,UserBalance,UserFindChatListReply,CreateScripRequest,DeleteScripRequest,UserFindScripRequest,PersonLookScripRequest,ReplyScripRequest,KeyRequest,InformationStatus,UserRechargeRequest,PayInfo,RechargeList,FindPayOrderListRequest,PayOrderList,FindRecommendPersonListRequest,FindMatchingAvatarAndNumReply,UserFreeNum,SendMsgReduceCreditReply} from "./user_pb";
+import {UserInfo,UserBalance,UserFindChatListReply,CreateScripRequest,DeleteScripRequest,UserFindScripRequest,PersonLookScripRequest,ReplyScripRequest,KeyRequest,InformationStatus,UserRechargeRequest,PayInfo,RechargeList,FindPayOrderListRequest,PayOrderList,FindRecommendPersonListRequest,FindMatchingAvatarAndNumReply,UserFreeNum} from "./user_pb";
 import {SendPhoneCodeRequest,CheckPhoneCodeRequest,UpdateInformationRequest,CreateChatRoomParam,PersonParam,HomeInfo,LookedAndLikedNum,ListPageRequest,WxConfReq,WxConfResponse,SexReq,TagListReply,ListPage2Request,RecommendPersonListReply,FindChatRecordListRequest,ChatRecordListReply,FindChatRoomMsgRequest,ChatRoomMsg,IsLike,MemeRequest,MemeList,FindChatTopicRequest,ChatTopicList,RandomNum,CommonTextList,RandomNumAndSex,MemeTitleList,ChatCardInfo,ReportChatRequest,FindOverSevenDayAvatarReply,UpdateLastScripIDRequest,ScripID,ScripReply,FindScripRequest,ScripInfo,ChatRecordInfo,RoomIDRequest,PartnerIDParam,AddFriendMessageInfo,PersonIDParam,PersonMsg,PersonIDList,PersonDBReply,UpdateLastScripIDDBRequest,FindRecommendRequest} from "../common/common_pb";
 import {RoomReply,CheckUserPartnerIsRelationshipReply,WindowInfo,GetRandomMatchingReply} from "../chat/chat_pb";
 import {LookAndLikeListReply,LookAndLikeMessageReply,LookMessageReply} from "../statistics/statistics_pb";