コード例 #1
0
    def get_one_case_a(self):

        try:
            request = pb2.CurrencyIdRequest(id="5f8e3d112c3795c5ce889915")

            response = self.stub.get(request=request, metadata=self.metadata)

            return MessageToDict(response)
        except grpc.RpcError as e:
            print(e.details())
        except Exception as e:
            print(e.args)
コード例 #2
0
    def get_one_case_c(self):

        try:
            request = pb2.CurrencyIdRequest(id="5f973f93ee05687f6130b9")

            response = self.stub.get(request=request, metadata=self.metadata)

            return MessageToDict(response)
        except grpc.RpcError as e:
            print(e.details())
            return e.details()
        except Exception as e:
            print(e.args)
            return e.args[0]
コード例 #3
0
    def delete_case_b(self):

        try:

            request = pb2.CurrencyIdRequest(id='5f3594a529ab9368240305f8')

            response = self.stub.delete(request=request,
                                        metadata=self.metadata)

            return MessageToDict(response)
        except grpc.RpcError as e:
            print(e.details())
        except Exception as e:
            print(e.args)
コード例 #4
0
    def delete_case_a(self):

        try:

            request = pb2.CurrencyIdRequest(id='5fbda3537e0177f24465d4a2')

            response = self.stub.delete(request=request,
                                        metadata=self.metadata)

            return MessageToDict(response)
        except grpc.RpcError as e:
            print(e.details())
        except Exception as e:
            print(e.args)