wfz 2 жил өмнө
parent
commit
dcec8feff6

+ 11 - 8
api/manager/manager.pb.go

@@ -435,7 +435,7 @@ var file_manager_proto_rawDesc = []byte{
 	0x6e, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72,
 	0x57, 0x6f, 0x6d, 0x61, 0x6e, 0x4e, 0x75, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72,
 	0x4f, 0x74, 0x68, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c,
-	0x75, 0x73, 0x65, 0x72, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x32, 0xfc, 0x24, 0x0a,
+	0x75, 0x73, 0x65, 0x72, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x32, 0xa9, 0x25, 0x0a,
 	0x07, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x13, 0x4d, 0x61, 0x6e,
 	0x61, 0x67, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74,
 	0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x61,
@@ -726,17 +726,20 @@ var file_manager_proto_rawDesc = []byte{
 	0x69, 0x6c, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2b, 0x82, 0xd3,
 	0xe4, 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67,
 	0x65, 0x72, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,
-	0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x50, 0x0a, 0x10, 0x46, 0x69, 0x6e,
+	0x73, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x7d, 0x0a, 0x10, 0x46, 0x69, 0x6e,
 	0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 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, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73,
 	0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65,
-	0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x46, 0x0a, 0x0b, 0x61,
-	0x70, 0x69, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x35, 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, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x6e, 0x61,
-	0x67, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x2b, 0x82, 0xd3, 0xe4,
+	0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65,
+	0x72, 0x2f, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73,
+	0x2f, 0x6c, 0x69, 0x73, 0x74, 0x3a, 0x01, 0x2a, 0x42, 0x46, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x2e,
+	0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x35, 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, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72,
+	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 6 - 1
api/manager/manager.proto

@@ -245,7 +245,12 @@ service Manager {
     };
   };
   // 查询在线人数
-  rpc FindOnlinePerson (google.protobuf.Empty) returns (websocket.FindOnlinePersonReply);
+  rpc FindOnlinePerson (google.protobuf.Empty) returns (websocket.FindOnlinePersonReply){
+    option (google.api.http) = {
+      post: "/api/manager/online/details/list",
+      body:"*"
+    };
+  };;
 }
 
 message ManagerUpdateUserSexRequest{

+ 44 - 0
api/manager/manager_http.pb.go

@@ -9,6 +9,7 @@ import (
 	base "git.ikuban.com/server/base-protobuf/kuban/api/base"
 	reply "git.ikuban.com/server/kratos-utils/http/reply"
 	common "git.ikuban.com/server/pw-protobuf/api/common"
+	websocket "git.ikuban.com/server/pw-protobuf/api/websocket"
 	http "github.com/go-kratos/kratos/v2/transport/http"
 	binding "github.com/go-kratos/kratos/v2/transport/http/binding"
 	emptypb "google.golang.org/protobuf/types/known/emptypb"
@@ -28,6 +29,7 @@ var _ = new(base.Html)
 const _ = http.SupportPackageIsVersion1
 
 type ManagerHTTPServer interface {
+	FindOnlinePerson(context.Context, *emptypb.Empty) (*websocket.FindOnlinePersonReply, error)
 	ManagerDeleteHighQualityUser(context.Context, *common.PersonIDParam) (*emptypb.Empty, error)
 	ManagerDeleteScrip(context.Context, *common.IDParam) (*emptypb.Empty, error)
 	ManagerDeleteScripMore(context.Context, *common.Ids) (*emptypb.Empty, error)
@@ -98,6 +100,7 @@ func RegisterManagerHTTPServer(s *http.Server, srv ManagerHTTPServer) {
 	r.POST("/api/manager/delete/scrip/more", _Manager_ManagerDeleteScripMore0_HTTP_Handler(srv))
 	r.POST("/api/manager/report/list", _Manager_ManagerFindReportList0_HTTP_Handler(srv))
 	r.POST("/api/manager/report/details/list", _Manager_ManagerFindReportDetailsList0_HTTP_Handler(srv))
+	r.POST("/api/manager/online/details/list", _Manager_FindOnlinePerson0_HTTP_Handler(srv))
 }
 
 func _Manager_ManagerFindUserList0_HTTP_Handler(srv ManagerHTTPServer) func(ctx http.Context) error {
@@ -991,7 +994,35 @@ func _Manager_ManagerFindReportDetailsList0_HTTP_Handler(srv ManagerHTTPServer)
 	}
 }
 
+func _Manager_FindOnlinePerson0_HTTP_Handler(srv ManagerHTTPServer) 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.manager.Manager/FindOnlinePerson")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.FindOnlinePerson(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 ManagerHTTPClient interface {
+	FindOnlinePerson(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *websocket.FindOnlinePersonReply, err error)
 	ManagerDeleteHighQualityUser(ctx context.Context, req *common.PersonIDParam, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerDeleteScrip(ctx context.Context, req *common.IDParam, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerDeleteScripMore(ctx context.Context, req *common.Ids, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
@@ -1035,6 +1066,19 @@ func NewManagerHTTPClient(client *http.Client) ManagerHTTPClient {
 	return &ManagerHTTPClientImpl{client}
 }
 
+func (c *ManagerHTTPClientImpl) FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*websocket.FindOnlinePersonReply, error) {
+	var out websocket.FindOnlinePersonReply
+	pattern := "/api/manager/online/details/list"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.manager.Manager/FindOnlinePerson"))
+	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 *ManagerHTTPClientImpl) ManagerDeleteHighQualityUser(ctx context.Context, in *common.PersonIDParam, opts ...http.CallOption) (*emptypb.Empty, error) {
 	var out emptypb.Empty
 	pattern := "/api/manager/quality/user/delete"

+ 5 - 0
js/api/manager/manager_http_pb.ts

@@ -170,6 +170,11 @@ const ManagerService = {
 	const res = await request.post<{ data: ManagerFindReportDetailsListReply, code: string, message: string }>('/api/manager/report/details/list', req);
     return res.data.data;
   },
+  /**  查询在线人数 */
+  FindOnlinePerson: async (req?: undefined) => {
+	const res = await request.post<{ data: FindOnlinePersonReply, code: string, message: string }>('/api/manager/online/details/list', req);
+    return res.data.data;
+  },
 
 };