瀏覽代碼

更新用户性别的接口

wfz 2 年之前
父節點
當前提交
237af9789a

文件差異過大導致無法顯示
+ 488 - 417
api/manager/manager.pb.go


+ 12 - 0
api/manager/manager.proto

@@ -96,6 +96,13 @@ service Manager {
       body:"*"
     };
   };
+  // 管理员更新用户性别
+  rpc ManagerUpdateUserSex (ManagerUpdateUserSexRequest) returns (google.protobuf.Empty){
+    option (google.api.http) = {
+      post: "/api/manager/user/sex/update",
+      body:"*"
+    };
+  };
   // 管理员更新用户语音
   rpc ManagerUpdateUserVoice (common.ManagerUpdatePersonVoiceRequest) returns (google.protobuf.Empty){
     option (google.api.http) = {
@@ -231,6 +238,11 @@ service Manager {
   };
 }
 
+message ManagerUpdateUserSexRequest{
+  int64 userId = 1;
+  int64 sex = 2;
+}
+
 message ManagerFindIsCheckQualityUserListRequest{
   int64 page = 1;
   int64 pageSize = 2;

+ 38 - 0
api/manager/manager_grpc.pb.go

@@ -44,6 +44,8 @@ type ManagerClient interface {
 	ManagerSetUserBlack(ctx context.Context, in *common.PersonIDList, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 管理员取消标记优质用户
 	ManagerDeleteHighQualityUser(ctx context.Context, in *common.PersonIDParam, opts ...grpc.CallOption) (*emptypb.Empty, error)
+	// 管理员更新用户性别
+	ManagerUpdateUserSex(ctx context.Context, in *ManagerUpdateUserSexRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 管理员更新用户语音
 	ManagerUpdateUserVoice(ctx context.Context, in *common.ManagerUpdatePersonVoiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
 	// 管理员更新用户相册
@@ -200,6 +202,15 @@ func (c *managerClient) ManagerDeleteHighQualityUser(ctx context.Context, in *co
 	return out, nil
 }
 
+func (c *managerClient) ManagerUpdateUserSex(ctx context.Context, in *ManagerUpdateUserSexRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+	out := new(emptypb.Empty)
+	err := c.cc.Invoke(ctx, "/api.manager.Manager/ManagerUpdateUserSex", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 func (c *managerClient) ManagerUpdateUserVoice(ctx context.Context, in *common.ManagerUpdatePersonVoiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
 	out := new(emptypb.Empty)
 	err := c.cc.Invoke(ctx, "/api.manager.Manager/ManagerUpdateUserVoice", in, out, opts...)
@@ -399,6 +410,8 @@ type ManagerServer interface {
 	ManagerSetUserBlack(context.Context, *common.PersonIDList) (*emptypb.Empty, error)
 	// 管理员取消标记优质用户
 	ManagerDeleteHighQualityUser(context.Context, *common.PersonIDParam) (*emptypb.Empty, error)
+	// 管理员更新用户性别
+	ManagerUpdateUserSex(context.Context, *ManagerUpdateUserSexRequest) (*emptypb.Empty, error)
 	// 管理员更新用户语音
 	ManagerUpdateUserVoice(context.Context, *common.ManagerUpdatePersonVoiceRequest) (*emptypb.Empty, error)
 	// 管理员更新用户相册
@@ -480,6 +493,9 @@ func (UnimplementedManagerServer) ManagerSetUserBlack(context.Context, *common.P
 func (UnimplementedManagerServer) ManagerDeleteHighQualityUser(context.Context, *common.PersonIDParam) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ManagerDeleteHighQualityUser not implemented")
 }
+func (UnimplementedManagerServer) ManagerUpdateUserSex(context.Context, *ManagerUpdateUserSexRequest) (*emptypb.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method ManagerUpdateUserSex not implemented")
+}
 func (UnimplementedManagerServer) ManagerUpdateUserVoice(context.Context, *common.ManagerUpdatePersonVoiceRequest) (*emptypb.Empty, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ManagerUpdateUserVoice not implemented")
 }
@@ -766,6 +782,24 @@ func _Manager_ManagerDeleteHighQualityUser_Handler(srv interface{}, ctx context.
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Manager_ManagerUpdateUserSex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(ManagerUpdateUserSexRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(ManagerServer).ManagerUpdateUserSex(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.manager.Manager/ManagerUpdateUserSex",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(ManagerServer).ManagerUpdateUserSex(ctx, req.(*ManagerUpdateUserSexRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 func _Manager_ManagerUpdateUserVoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(common.ManagerUpdatePersonVoiceRequest)
 	if err := dec(in); err != nil {
@@ -1163,6 +1197,10 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "ManagerDeleteHighQualityUser",
 			Handler:    _Manager_ManagerDeleteHighQualityUser_Handler,
 		},
+		{
+			MethodName: "ManagerUpdateUserSex",
+			Handler:    _Manager_ManagerUpdateUserSex_Handler,
+		},
 		{
 			MethodName: "ManagerUpdateUserVoice",
 			Handler:    _Manager_ManagerUpdateUserVoice_Handler,

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

@@ -55,6 +55,7 @@ type ManagerHTTPServer interface {
 	ManagerUpdateUserIsBlack(context.Context, *common.ManagerUpdatePersonIsBlackRequest) (*emptypb.Empty, error)
 	ManagerUpdateUserName(context.Context, *common.ManagerUpdatePersonNameRequest) (*emptypb.Empty, error)
 	ManagerUpdateUserPictures(context.Context, *common.ManagerUpdatePersonPicturesRequest) (*emptypb.Empty, error)
+	ManagerUpdateUserSex(context.Context, *ManagerUpdateUserSexRequest) (*emptypb.Empty, error)
 	ManagerUpdateUserSignature(context.Context, *common.ManagerUpdatePersonSignatureRequest) (*emptypb.Empty, error)
 	ManagerUpdateUserVoice(context.Context, *common.ManagerUpdatePersonVoiceRequest) (*emptypb.Empty, error)
 	ManagerUpdateUserWeight(context.Context, *common.ManagerUpdatePersonWeightRequest) (*emptypb.Empty, error)
@@ -75,6 +76,7 @@ func RegisterManagerHTTPServer(s *http.Server, srv ManagerHTTPServer) {
 	r.POST("/api/manager/quality/user/set/one", _Manager_ManagerMarkHighQualityUserOne0_HTTP_Handler(srv))
 	r.POST("/api/manager/black/user/more", _Manager_ManagerSetUserBlack0_HTTP_Handler(srv))
 	r.POST("/api/manager/quality/user/delete", _Manager_ManagerDeleteHighQualityUser0_HTTP_Handler(srv))
+	r.POST("/api/manager/user/sex/update", _Manager_ManagerUpdateUserSex0_HTTP_Handler(srv))
 	r.POST("/api/manager/user/Voice/update", _Manager_ManagerUpdateUserVoice0_HTTP_Handler(srv))
 	r.POST("/api/manager/user/pictures/update", _Manager_ManagerUpdateUserPictures0_HTTP_Handler(srv))
 	r.POST("/api/manager/user/signature/update", _Manager_ManagerUpdateUserSignature0_HTTP_Handler(srv))
@@ -420,6 +422,33 @@ func _Manager_ManagerDeleteHighQualityUser0_HTTP_Handler(srv ManagerHTTPServer)
 	}
 }
 
+func _Manager_ManagerUpdateUserSex0_HTTP_Handler(srv ManagerHTTPServer) func(ctx http.Context) error {
+	return func(ctx http.Context) error {
+		var in ManagerUpdateUserSexRequest
+		if err := ctx.Bind(&in); err != nil {
+			return err
+		}
+		if err := ctx.BindQuery(&in); err != nil {
+			return err
+		}
+		http.SetOperation(ctx, "/api.manager.Manager/ManagerUpdateUserSex")
+		h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
+			return srv.ManagerUpdateUserSex(ctx, req.(*ManagerUpdateUserSexRequest))
+		})
+		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)
+	}
+}
+
 func _Manager_ManagerUpdateUserVoice0_HTTP_Handler(srv ManagerHTTPServer) func(ctx http.Context) error {
 	return func(ctx http.Context) error {
 		var in common.ManagerUpdatePersonVoiceRequest
@@ -961,6 +990,7 @@ type ManagerHTTPClient interface {
 	ManagerUpdateUserIsBlack(ctx context.Context, req *common.ManagerUpdatePersonIsBlackRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerUpdateUserName(ctx context.Context, req *common.ManagerUpdatePersonNameRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerUpdateUserPictures(ctx context.Context, req *common.ManagerUpdatePersonPicturesRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
+	ManagerUpdateUserSex(ctx context.Context, req *ManagerUpdateUserSexRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerUpdateUserSignature(ctx context.Context, req *common.ManagerUpdatePersonSignatureRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerUpdateUserVoice(ctx context.Context, req *common.ManagerUpdatePersonVoiceRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
 	ManagerUpdateUserWeight(ctx context.Context, req *common.ManagerUpdatePersonWeightRequest, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
@@ -1326,6 +1356,19 @@ func (c *ManagerHTTPClientImpl) ManagerUpdateUserPictures(ctx context.Context, i
 	return &out, err
 }
 
+func (c *ManagerHTTPClientImpl) ManagerUpdateUserSex(ctx context.Context, in *ManagerUpdateUserSexRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
+	var out emptypb.Empty
+	pattern := "/api/manager/user/sex/update"
+	path := binding.EncodeURL(pattern, in, false)
+	opts = append(opts, http.Operation("/api.manager.Manager/ManagerUpdateUserSex"))
+	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) ManagerUpdateUserSignature(ctx context.Context, in *common.ManagerUpdatePersonSignatureRequest, opts ...http.CallOption) (*emptypb.Empty, error) {
 	var out emptypb.Empty
 	pattern := "/api/manager/user/signature/update"

+ 6 - 1
js/api/manager/manager_http_pb.ts

@@ -1,7 +1,7 @@
 // @ts-ignore
 import request from '@/libs/request';
 import {ManagerFindPersonListRequest,ManagerFindPersonListReply,ManagerFindPersonListReply2,ManagerFindCanHandpickUserListRequest,ManagerFindCanHandpickUserListReply,ManagerSetHandpickUserRequest,ManagerSetHandpickUserOneRequest,PersonIDParam,PersonIDList,ManagerUpdatePersonVoiceRequest,ManagerUpdatePersonPicturesRequest,ManagerUpdatePersonSignatureRequest,ManagerUpdatePersonAvatarRequest,ManagerUpdatePersonNameRequest,ManagerUpdatePersonWeightRequest,ManagerUpdatePersonIsBlackRequest,ManagerLoginRequest,LoginToken,ManagerFindRoomListRequest,ManagerFindRoomListReply,ManagerFindChatRecordListRequest,ChatRecordListReply,ManagerFindScripListRequest,ManagerScripReply,ManagerUpdateScripTextRequest,ManagerUpdateScripPictureRequest,IDParam,Ids,ManagerFindReportListRequest,ManagerFindReportListReply,ManagerFindReportDetailsListRequest,ManagerFindReportDetailsListReply} from "../common/common_pb";
-import {ManagerFindIsCheckQualityUserListRequest,ManagerMarkHighQualityUserRequest,ManagerReMarkHighQualityUserRequest,ManagerUpdateUserCreditRequest,OnlinePersonReply} from "./manager_pb";
+import {ManagerFindIsCheckQualityUserListRequest,ManagerMarkHighQualityUserRequest,ManagerReMarkHighQualityUserRequest,ManagerUpdateUserSexRequest,ManagerUpdateUserCreditRequest,OnlinePersonReply} from "./manager_pb";
 
 const ManagerService = {
   /**  管理员查询用户列表 */
@@ -64,6 +64,11 @@ const ManagerService = {
 	const res = await request.post('/api/manager/quality/user/delete', req);
     return res.data.data;
   },
+  /**  管理员更新用户性别 */
+  ManagerUpdateUserSex: async (req?: ManagerUpdateUserSexRequest) => {
+	const res = await request.post('/api/manager/user/sex/update', req);
+    return res.data.data;
+  },
   /**  管理员更新用户语音 */
   ManagerUpdateUserVoice: async (req?: ManagerUpdatePersonVoiceRequest) => {
 	const res = await request.post('/api/manager/user/Voice/update', req);

+ 4 - 0
js/api/manager/manager_pb.ts

@@ -1,3 +1,7 @@
+export interface ManagerUpdateUserSexRequest{
+    userId?:number;
+    sex?:number;
+}
 export interface ManagerFindIsCheckQualityUserListRequest{
     page?:number;
     pageSize?:number;

部分文件因文件數量過多而無法顯示