@@ -685,14 +685,14 @@ export namespace Calculator {
685
685
num2 : thrift . Int64 ;
686
686
}
687
687
export interface IAddInt64__ArgsArgs {
688
- num1 : number | thrift . Int64 ;
689
- num2 : number | thrift . Int64 ;
688
+ num1 : number | string | thrift . Int64 ;
689
+ num2 : number | string | thrift . Int64 ;
690
690
}
691
691
export const AddInt64__ArgsCodec : thrift . IStructCodec < IAddInt64__ArgsArgs , IAddInt64__Args > = {
692
692
encode ( args : IAddInt64__ArgsArgs , output : thrift . TProtocol ) : void {
693
693
const obj = {
694
- num1 : ( typeof args . num1 === "number" ? new thrift . Int64 ( args . num1 ) : args . num1 ) ,
695
- num2 : ( typeof args . num2 === "number" ? new thrift . Int64 ( args . num2 ) : args . num2 )
694
+ num1 : ( typeof args . num1 === "number" ? new thrift . Int64 ( args . num1 ) : typeof args . num1 === "string" ? thrift . Int64 . fromDecimalString ( args . num1 ) : args . num1 ) ,
695
+ num2 : ( typeof args . num2 === "number" ? new thrift . Int64 ( args . num2 ) : typeof args . num2 === "string" ? thrift . Int64 . fromDecimalString ( args . num2 ) : args . num2 )
696
696
} ;
697
697
output . writeStructBegin ( "AddInt64__Args" ) ;
698
698
if ( obj . num1 != null ) {
@@ -770,14 +770,14 @@ export namespace Calculator {
770
770
constructor ( args : IAddInt64__ArgsArgs ) {
771
771
super ( ) ;
772
772
if ( args . num1 != null ) {
773
- const value_23 : thrift . Int64 = ( typeof args . num1 === "number" ? new thrift . Int64 ( args . num1 ) : args . num1 ) ;
773
+ const value_23 : thrift . Int64 = ( typeof args . num1 === "number" ? new thrift . Int64 ( args . num1 ) : typeof args . num1 === "string" ? thrift . Int64 . fromDecimalString ( args . num1 ) : args . num1 ) ;
774
774
this . num1 = value_23 ;
775
775
}
776
776
else {
777
777
throw new thrift . TProtocolException ( thrift . TProtocolExceptionType . UNKNOWN , "Required field[num1] is unset!" ) ;
778
778
}
779
779
if ( args . num2 != null ) {
780
- const value_24 : thrift . Int64 = ( typeof args . num2 === "number" ? new thrift . Int64 ( args . num2 ) : args . num2 ) ;
780
+ const value_24 : thrift . Int64 = ( typeof args . num2 === "number" ? new thrift . Int64 ( args . num2 ) : typeof args . num2 === "string" ? thrift . Int64 . fromDecimalString ( args . num2 ) : args . num2 ) ;
781
781
this . num2 = value_24 ;
782
782
}
783
783
else {
@@ -1929,12 +1929,12 @@ export namespace Calculator {
1929
1929
success ?: thrift . Int64 ;
1930
1930
}
1931
1931
export interface IAddInt64__ResultArgs {
1932
- success ?: number | thrift . Int64 ;
1932
+ success ?: number | string | thrift . Int64 ;
1933
1933
}
1934
1934
export const AddInt64__ResultCodec : thrift . IStructCodec < IAddInt64__ResultArgs , IAddInt64__Result > = {
1935
1935
encode ( args : IAddInt64__ResultArgs , output : thrift . TProtocol ) : void {
1936
1936
const obj = {
1937
- success : ( typeof args . success === "number" ? new thrift . Int64 ( args . success ) : args . success )
1937
+ success : ( typeof args . success === "number" ? new thrift . Int64 ( args . success ) : typeof args . success === "string" ? thrift . Int64 . fromDecimalString ( args . success ) : args . success )
1938
1938
} ;
1939
1939
output . writeStructBegin ( "AddInt64__Result" ) ;
1940
1940
if ( obj . success != null ) {
@@ -1985,7 +1985,7 @@ export namespace Calculator {
1985
1985
constructor ( args : IAddInt64__ResultArgs = { } ) {
1986
1986
super ( ) ;
1987
1987
if ( args . success != null ) {
1988
- const value_69 : thrift . Int64 = ( typeof args . success === "number" ? new thrift . Int64 ( args . success ) : args . success ) ;
1988
+ const value_69 : thrift . Int64 = ( typeof args . success === "number" ? new thrift . Int64 ( args . success ) : typeof args . success === "string" ? thrift . Int64 . fromDecimalString ( args . success ) : args . success ) ;
1989
1989
this . success = value_69 ;
1990
1990
}
1991
1991
}
@@ -2961,7 +2961,7 @@ export namespace Calculator {
2961
2961
}
2962
2962
} ) ;
2963
2963
}
2964
- public addInt64 ( num1 : number | thrift . Int64 , num2 : number | thrift . Int64 , context ?: Context ) : Promise < thrift . Int64 > {
2964
+ public addInt64 ( num1 : number | string | thrift . Int64 , num2 : number | string | thrift . Int64 , context ?: Context ) : Promise < thrift . Int64 > {
2965
2965
const writer : thrift . TTransport = new this . transport ( ) ;
2966
2966
const output : thrift . TProtocol = new this . protocol ( writer ) ;
2967
2967
output . writeMessageBegin ( "addInt64" , thrift . MessageType . CALL , this . incrementRequestId ( ) ) ;
@@ -3419,7 +3419,7 @@ export namespace Calculator {
3419
3419
export interface ILocalHandler < Context = any > {
3420
3420
ping ( context ?: Context ) : void | Promise < void > ;
3421
3421
add ( num1 : number , num2 : number , context ?: Context ) : number | Promise < number > ;
3422
- addInt64 ( num1 : thrift . Int64 , num2 : thrift . Int64 , context ?: Context ) : ( number | thrift . Int64 ) | Promise < number | thrift . Int64 > ;
3422
+ addInt64 ( num1 : thrift . Int64 , num2 : thrift . Int64 , context ?: Context ) : ( number | string | thrift . Int64 ) | Promise < number | string | thrift . Int64 > ;
3423
3423
addWithContext ( num1 : number , num2 : number , context ?: Context ) : number | Promise < number > ;
3424
3424
calculate ( logid : number , work : IWork , context ?: Context ) : number | Promise < number > ;
3425
3425
echoBinary ( word : Buffer , context ?: Context ) : string | Promise < string > ;
@@ -3592,7 +3592,7 @@ export namespace Calculator {
3592
3592
} ) ;
3593
3593
}
3594
3594
public process_addInt64 ( requestId : number , input : thrift . TProtocol , output : thrift . TProtocol , context : Context ) : Promise < Buffer > {
3595
- return new Promise < number | thrift . Int64 > ( ( resolve , reject ) : void => {
3595
+ return new Promise < number | string | thrift . Int64 > ( ( resolve , reject ) : void => {
3596
3596
try {
3597
3597
const args : IAddInt64__Args = AddInt64__ArgsCodec . decode ( input ) ;
3598
3598
input . readMessageEnd ( ) ;
@@ -3601,7 +3601,7 @@ export namespace Calculator {
3601
3601
catch ( err ) {
3602
3602
reject ( err ) ;
3603
3603
}
3604
- } ) . then ( ( data : number | thrift . Int64 ) : Buffer => {
3604
+ } ) . then ( ( data : number | string | thrift . Int64 ) : Buffer => {
3605
3605
const result : IAddInt64__ResultArgs = { success : data } ;
3606
3606
output . writeMessageBegin ( "addInt64" , thrift . MessageType . REPLY , requestId ) ;
3607
3607
AddInt64__ResultCodec . encode ( result , output ) ;
0 commit comments