wfz 3 vuotta sitten
vanhempi
commit
35779b45d2

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 373 - 266
api/account/account.pb.go


+ 10 - 0
api/account/account.proto

@@ -70,6 +70,16 @@ service Account {
   rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){};
   // 随机打招呼
   rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){};
+  // 检查文本-百度云
+  rpc CheckText (CheckTextRequest) returns (CheckTextReply){}
+}
+
+message CheckTextRequest{
+  string text = 1;// 待审核的文本
+}
+
+message CheckTextReply{
+  bool isPass = 1;// 是否通过
 }
 
 message MediaID{

+ 38 - 0
api/account/account_grpc.pb.go

@@ -46,6 +46,8 @@ type AccountClient interface {
 	RandomMeme(ctx context.Context, in *common.RandomNum, opts ...grpc.CallOption) (*common.CommonTextList, error)
 	// 随机打招呼
 	RandomSwiftMessage(ctx context.Context, in *common.RandomNumAndSex, opts ...grpc.CallOption) (*common.CommonTextList, error)
+	// 检查文本-百度云
+	CheckText(ctx context.Context, in *CheckTextRequest, opts ...grpc.CallOption) (*CheckTextReply, error)
 }
 
 type accountClient struct {
@@ -200,6 +202,15 @@ func (c *accountClient) RandomSwiftMessage(ctx context.Context, in *common.Rando
 	return out, nil
 }
 
+func (c *accountClient) CheckText(ctx context.Context, in *CheckTextRequest, opts ...grpc.CallOption) (*CheckTextReply, error) {
+	out := new(CheckTextReply)
+	err := c.cc.Invoke(ctx, "/api.account.Account/CheckText", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // AccountServer is the server API for Account service.
 // All implementations must embed UnimplementedAccountServer
 // for forward compatibility
@@ -231,6 +242,8 @@ type AccountServer interface {
 	RandomMeme(context.Context, *common.RandomNum) (*common.CommonTextList, error)
 	// 随机打招呼
 	RandomSwiftMessage(context.Context, *common.RandomNumAndSex) (*common.CommonTextList, error)
+	// 检查文本-百度云
+	CheckText(context.Context, *CheckTextRequest) (*CheckTextReply, error)
 	mustEmbedUnimplementedAccountServer()
 }
 
@@ -286,6 +299,9 @@ func (UnimplementedAccountServer) RandomMeme(context.Context, *common.RandomNum)
 func (UnimplementedAccountServer) RandomSwiftMessage(context.Context, *common.RandomNumAndSex) (*common.CommonTextList, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method RandomSwiftMessage not implemented")
 }
+func (UnimplementedAccountServer) CheckText(context.Context, *CheckTextRequest) (*CheckTextReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method CheckText not implemented")
+}
 func (UnimplementedAccountServer) mustEmbedUnimplementedAccountServer() {}
 
 // UnsafeAccountServer may be embedded to opt out of forward compatibility for this service.
@@ -587,6 +603,24 @@ func _Account_RandomSwiftMessage_Handler(srv interface{}, ctx context.Context, d
 	return interceptor(ctx, in, info, handler)
 }
 
+func _Account_CheckText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(CheckTextRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(AccountServer).CheckText(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.account.Account/CheckText",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(AccountServer).CheckText(ctx, req.(*CheckTextRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // Account_ServiceDesc is the grpc.ServiceDesc for Account service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -658,6 +692,10 @@ var Account_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "RandomSwiftMessage",
 			Handler:    _Account_RandomSwiftMessage_Handler,
 		},
+		{
+			MethodName: "CheckText",
+			Handler:    _Account_CheckText_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "account.proto",

+ 1 - 1
js/api/account/account_http_pb.ts

@@ -1,6 +1,6 @@
 // @ts-ignore
 import request from '@/libs/request';
-import {DebugLoginRequest,TokenReply,AuthorizationRequest,RandomNicknameReply,RandomAvatarReply,RandomAvatarListReply,OpenIDAndAppIDRequest,IdentityInfo,MediaID,MaterialLink} from "./account_pb";
+import {DebugLoginRequest,TokenReply,AuthorizationRequest,RandomNicknameReply,RandomAvatarReply,RandomAvatarListReply,OpenIDAndAppIDRequest,IdentityInfo,MediaID,MaterialLink,CheckTextRequest,CheckTextReply} from "./account_pb";
 import {SexReq,PersonParam,TagListReply,Ids,RandomIntroduceReply,MemeRequest,MemeList,FindChatTopicRequest,ChatTopicList,RandomNum,CommonTextList,RandomNumAndSex} from "../common/common_pb";
 
 const AccountService = {

+ 8 - 0
js/api/account/account_pb.ts

@@ -1,3 +1,11 @@
+export interface CheckTextRequest{
+    /**  待审核的文本 */
+    text?:string;
+}
+export interface CheckTextReply{
+    /**  是否通过 */
+    isPass?:boolean;
+}
 export interface MediaID{
     mediaId?:string;
 }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä