@@ -21,12 +21,12 @@ sealed class HttpApiProxyClass : IEquatable<HttpApiProxyClass>
21
21
/// <summary>
22
22
/// 拦截器变量名
23
23
/// </summary>
24
- private readonly string apiInterceptorFieldName = $ "apiInterceptor_ { ( uint ) Environment . TickCount } ";
24
+ private readonly string apiInterceptorFieldName = "_apiInterceptor ";
25
25
26
26
/// <summary>
27
27
/// action执行器变量名
28
28
/// </summary>
29
- private readonly string actionInvokersFieldName = $ "actionInvokers_ { ( uint ) Environment . TickCount } ";
29
+ private readonly string actionInvokersFieldName = "_actionInvokers ";
30
30
31
31
/// <summary>
32
32
/// 文件名
@@ -41,7 +41,7 @@ sealed class HttpApiProxyClass : IEquatable<HttpApiProxyClass>
41
41
/// <summary>
42
42
/// 类型名
43
43
/// </summary>
44
- public string ClassName => this . httpApi . Name ;
44
+ public string ClassName => this . httpApi . Name + "Class" ;
45
45
46
46
/// <summary>
47
47
/// HttpApi代理类
@@ -89,13 +89,13 @@ public override string ToString()
89
89
builder . AppendLine ( $ "\t [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]") ;
90
90
builder . AppendLine ( $ "\t [global::System.Diagnostics.DebuggerTypeProxy(typeof({ this . httpApiFullName } ))]") ;
91
91
builder . AppendLine ( $ "\t [global::WebApiClientCore.HttpApiProxyClass(typeof({ this . httpApiFullName } ))]") ;
92
- builder . AppendLine ( $ "\t partial class { this . ClassName } : { this . httpApiFullName } ") ;
92
+ builder . AppendLine ( $ "\t partial class { this . ClassName } : { this . httpApiFullName } ") ;
93
93
builder . AppendLine ( "\t {" ) ;
94
94
95
95
builder . AppendLine ( $ "\t \t private readonly global::WebApiClientCore.IHttpApiInterceptor { this . apiInterceptorFieldName } ;") ;
96
96
builder . AppendLine ( $ "\t \t private readonly global::WebApiClientCore.ApiActionInvoker[] { this . actionInvokersFieldName } ;") ;
97
97
98
- builder . AppendLine ( $ "\t \t public { this . httpApi . Name } (global::WebApiClientCore.IHttpApiInterceptor apiInterceptor, global::WebApiClientCore.ApiActionInvoker[] actionInvokers)") ;
98
+ builder . AppendLine ( $ "\t \t public { this . ClassName } (global::WebApiClientCore.IHttpApiInterceptor apiInterceptor, global::WebApiClientCore.ApiActionInvoker[] actionInvokers)") ;
99
99
builder . AppendLine ( "\t \t {" ) ;
100
100
builder . AppendLine ( $ "\t \t \t this.{ this . apiInterceptorFieldName } = apiInterceptor;") ;
101
101
builder . AppendLine ( $ "\t \t \t this.{ this . actionInvokersFieldName } = actionInvokers;") ;
@@ -138,7 +138,7 @@ private string BuildMethod(INamedTypeSymbol interfaceType, IMethodSymbol method,
138
138
: $ "new global::System.Object[] {{ { parameterNamesString } }}";
139
139
140
140
var methodName = $ "\" { interfaceType . ToDisplayString ( ) } .{ method . Name } \" ";
141
- var returnTypeString = GetFullName ( method . ReturnType ) ;
141
+ var returnTypeString = GetFullName ( method . ReturnType ) ;
142
142
builder . AppendLine ( $ "\t \t [global::WebApiClientCore.HttpApiProxyMethod({ index } , { methodName } )]") ;
143
143
builder . AppendLine ( $ "\t \t { returnTypeString } { GetFullName ( interfaceType ) } .{ method . Name } ( { parametersString } )") ;
144
144
builder . AppendLine ( "\t \t {" ) ;
0 commit comments