wfz 3 лет назад
Родитель
Сommit
d76394c47a
6 измененных файлов с 811 добавлено и 627 удалено
  1. 703 626
      api/user/user.pb.go
  2. 13 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
  6. 8 0
      js/api/user/user_pb.ts

Разница между файлами не показана из-за своего большого размера
+ 703 - 626
api/user/user.pb.go


+ 13 - 0
api/user/user.proto

@@ -410,6 +410,19 @@ service User {
       body:"*"
     };
   };
+  // 用户的每日免费数
+  rpc GetUserFreeNum (google.protobuf.Empty) returns (UserFreeNum){
+    option (google.api.http) = {
+      post: "/api/user/free/num",
+      body:"*"
+    };
+  };
+}
+
+message UserFreeNum{
+   int64 replyScripNum = 1;// 今日可免费回复纸条的次数
+   int64 createScripNum = 2;// 今日免费创建纸条的次数
+   int64 matchingNum = 3;// 今日免费匹配数
 }
 
 message ReplyScripRequest {

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

@@ -146,6 +146,8 @@ type UserClient interface {
 	UpdateLastScripID(ctx context.Context, in *common.UpdateLastScripIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 获取假弹窗
 	GetWindowInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*chat.WindowInfo, error)
+	// 用户的每日免费数
+	GetUserFreeNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserFreeNum, error)
 }
 
 type userClient struct {
@@ -714,6 +716,15 @@ func (c *userClient) GetWindowInfo(ctx context.Context, in *emptypb.Empty, opts
 	return out, nil
 }
 
+func (c *userClient) GetUserFreeNum(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserFreeNum, error) {
+	out := new(UserFreeNum)
+	err := c.cc.Invoke(ctx, "/api.user.User/GetUserFreeNum", 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
@@ -842,6 +853,8 @@ type UserServer interface {
 	UpdateLastScripID(context.Context, *common.UpdateLastScripIDRequest) (*emptypb.Empty, error)
 	// 获取假弹窗
 	GetWindowInfo(context.Context, *emptypb.Empty) (*chat.WindowInfo, error)
+	// 用户的每日免费数
+	GetUserFreeNum(context.Context, *emptypb.Empty) (*UserFreeNum, error)
 	mustEmbedUnimplementedUserServer()
 }
 
@@ -1035,6 +1048,9 @@ func (UnimplementedUserServer) UpdateLastScripID(context.Context, *common.Update
 func (UnimplementedUserServer) GetWindowInfo(context.Context, *emptypb.Empty) (*chat.WindowInfo, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method GetWindowInfo not implemented")
 }
+func (UnimplementedUserServer) GetUserFreeNum(context.Context, *emptypb.Empty) (*UserFreeNum, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetUserFreeNum not implemented")
+}
 func (UnimplementedUserServer) mustEmbedUnimplementedUserServer() {}
 
 // UnsafeUserServer may be embedded to opt out of forward compatibility for this service.
@@ -2164,6 +2180,24 @@ func _User_GetWindowInfo_Handler(srv interface{}, ctx context.Context, dec func(
 	return interceptor(ctx, in, info, handler)
 }
 
+func _User_GetUserFreeNum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(emptypb.Empty)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(UserServer).GetUserFreeNum(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.user.User/GetUserFreeNum",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(UserServer).GetUserFreeNum(ctx, req.(*emptypb.Empty))
+	}
+	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)
@@ -2419,6 +2453,10 @@ var User_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "GetWindowInfo",
 			Handler:    _User_GetWindowInfo_Handler,
 		},
+		{
+			MethodName: "GetUserFreeNum",
+			Handler:    _User_GetUserFreeNum_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "user.proto",

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

@@ -59,6 +59,7 @@ type UserHTTPServer interface {
 	GetLookAndLikeStatisticsMessage(context.Context, *emptypb.Empty) (*statistics.LookAndLikeMessageReply, error)
 	GetPartnerCircleInfo(context.Context, *KeyRequest) (*common.AddFriendMessageInfo, error)
 	GetUserBalance(context.Context, *emptypb.Empty) (*UserBalance, error)
+	GetUserFreeNum(context.Context, *emptypb.Empty) (*UserFreeNum, error)
 	GetUserInfo(context.Context, *emptypb.Empty) (*UserInfo, error)
 	GetUserIsLike(context.Context, *common.PersonParam) (*common.IsLike, error)
 	GetUserLookNum(context.Context, *emptypb.Empty) (*statistics.LookMessageReply, error)
@@ -142,6 +143,7 @@ func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer) {
 	r.POST("/api/user/scrip/look/back", _User_PersonClickLookBack0_HTTP_Handler(srv))
 	r.POST("/api/user/scrip/reply", _User_PersonReplyScrip0_HTTP_Handler(srv))
 	r.POST("/api/user/chat/window/get", _User_GetWindowInfo0_HTTP_Handler(srv))
+	r.POST("/api/user/free/num", _User_GetUserFreeNum0_HTTP_Handler(srv))
 }
 
 func _User_UpdateUserInformation0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context) error {
@@ -1602,6 +1604,33 @@ func _User_GetWindowInfo0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context
 	}
 }
 
+func _User_GetUserFreeNum0_HTTP_Handler(srv UserHTTPServer) func(ctx http.Context) error {
+	return func(ctx http.Context) error {
+		var in emptypb.Empty
+		if err := ctx.Bind(&in); err != nil {
+			return err
+		}
+		if err := ctx.BindQuery(&in); err != nil {
+			return err
+		}
+		http.SetOperation(ctx, "/api.user.User/GetUserFreeNum")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.GetUserFreeNum(ctx, req.(*emptypb.Empty))
+		})
+		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)
@@ -1632,6 +1661,7 @@ type UserHTTPClient interface {
 	GetLookAndLikeStatisticsMessage(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *statistics.LookAndLikeMessageReply, err error)
 	GetPartnerCircleInfo(ctx context.Context, req *KeyRequest, opts ...http.CallOption) (rsp *common.AddFriendMessageInfo, err error)
 	GetUserBalance(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *UserBalance, err error)
+	GetUserFreeNum(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *UserFreeNum, err error)
 	GetUserInfo(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *UserInfo, err error)
 	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)
@@ -2044,6 +2074,19 @@ func (c *UserHTTPClientImpl) GetUserBalance(ctx context.Context, in *emptypb.Emp
 	return &out, err
 }
 
+func (c *UserHTTPClientImpl) GetUserFreeNum(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*UserFreeNum, error) {
+	var out UserFreeNum
+	pattern := "/api/user/free/num"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.user.User/GetUserFreeNum"))
+	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) GetUserInfo(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*UserInfo, error) {
 	var out UserInfo
 	pattern := "/api/user/info"

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

@@ -1,7 +1,7 @@
 // @ts-ignore
 import request from '@/libs/request';
 import {UpdateInformationRequest,PersonIDParam,PersonMsg,SendPhoneCodeRequest,CheckPhoneCodeRequest,PartnerIDParam,CreateChatRoomParam,AddFriendMessageInfo,PersonParam,HomeInfo,PersonIDList,PersonDBReply,ListPageRequest,WxConfReq,WxConfResponse,SexReq,TagListReply,ListPage2Request,RecommendPersonListReply,LookedAndLikedNum,FindChatRecordListRequest,ChatRecordListReply,FindChatRoomMsgRequest,ChatRoomMsg,IsLike,ChatCardInfo,MemeRequest,MemeList,FindChatTopicRequest,ChatTopicList,RandomNum,CommonTextList,RandomNumAndSex,MemeTitleList,RoomIDRequest,ReportChatRequest,FindRecommendRequest,FindOverSevenDayAvatarReply,ScripID,ScripReply,FindScripRequest,ScripInfo,ChatRecordInfo,UpdateLastScripIDRequest} from "../common/common_pb";
-import {UserInfo,KeyRequest,UserFindChatListReply,UserBalance,InformationStatus,UserRechargeRequest,PayInfo,RechargeList,FindPayOrderListRequest,PayOrderList,FindRecommendPersonListRequest,FindMatchingAvatarAndNumReply,CreateScripRequest,DeleteScripRequest,UserFindScripRequest,PersonLookScripRequest,ReplyScripRequest} from "./user_pb";
+import {UserInfo,KeyRequest,UserFindChatListReply,UserBalance,InformationStatus,UserRechargeRequest,PayInfo,RechargeList,FindPayOrderListRequest,PayOrderList,FindRecommendPersonListRequest,FindMatchingAvatarAndNumReply,CreateScripRequest,DeleteScripRequest,UserFindScripRequest,PersonLookScripRequest,ReplyScripRequest,UserFreeNum} from "./user_pb";
 import {CheckUserPartnerIsRelationshipReply,RoomReply,WindowInfo} from "../chat/chat_pb";
 import {LookAndLikeListReply,LookAndLikeMessageReply,LookMessageReply} from "../statistics/statistics_pb";
 
@@ -276,6 +276,11 @@ const UserService = {
 	const res = await request.post<{ data: WindowInfo, code: string, message: string }>('/api/user/chat/window/get', req);
     return res.data.data;
   },
+  /**  用户的每日免费数 */
+  GetUserFreeNum: async (req?: undefined) => {
+	const res = await request.post<{ data: UserFreeNum, code: string, message: string }>('/api/user/free/num', req);
+    return res.data.data;
+  },
 
 };
 

+ 8 - 0
js/api/user/user_pb.ts

@@ -1,5 +1,13 @@
 import {Message} from "../common/common_pb";
 
+export interface UserFreeNum{
+    /**  今日可免费回复纸条的次数 */
+    replyScripNum?:number;
+    /**  今日免费创建纸条的次数 */
+    createScripNum?:number;
+    /**  今日免费匹配数 */
+    matchingNum?:number;
+}
 export interface ReplyScripRequest{
     /**  小纸条ID */
     scripId?:number;

Некоторые файлы не были показаны из-за большого количества измененных файлов