Skip to content

Commit f5b00c0

Browse files
committed
公开代理类
1 parent 5bbf029 commit f5b00c0

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

WebApiClientCore.Analyzers.SourceGenerator/HttpApiCodeBuilder.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ public IEnumerable<string> Usings
5858
/// <summary>
5959
/// 类名
6060
/// </summary>
61-
public string ClassName => "_" + this.httpApi.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
61+
public string ClassName => this.httpApi.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
6262

6363
/// <summary>
6464
/// 构造器名
6565
/// </summary>
66-
public string CtorName => "_" + this.httpApi.Name;
66+
public string CtorName => this.httpApi.Name;
6767

6868
/// <summary>
6969
/// HttpApi代码构建器
@@ -98,13 +98,10 @@ public override string ToString()
9898
builder.AppendLine($"namespace {this.Namespace}");
9999
builder.AppendLine("{");
100100
builder.AppendLine($"\t[HttpApiProxyClass(typeof({this.HttpApiTypeName}))]");
101-
builder.AppendLine($"\tclass {this.ClassName}:{this.BaseInterfaceName}");
101+
builder.AppendLine($"\tpublic class {this.ClassName}:{this.BaseInterfaceName}");
102102
builder.AppendLine("\t{");
103103

104-
builder.AppendLine("\t\t[DebuggerBrowsable(DebuggerBrowsableState.Never)]");
105104
builder.AppendLine($"\t\tprivate readonly IHttpApiInterceptor {this.apiInterceptorFieldName};");
106-
107-
builder.AppendLine("\t\t[DebuggerBrowsable(DebuggerBrowsableState.Never)]");
108105
builder.AppendLine($"\t\tprivate readonly ApiActionInvoker[] {this.actionInvokersFieldName};");
109106

110107
builder.AppendLine($"\t\tpublic {this.CtorName}(IHttpApiInterceptor apiInterceptor,ApiActionInvoker[] actionInvokers)");

WebApiClientCore.Extensions.SourceGenerator/Implementations/SourceGeneratorHttpApiActivator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ orderby methodAttr.Index
8585

8686
foreach (var proxyType in interfaceType.Assembly.GetTypes())
8787
{
88-
if (proxyType.IsVisible || proxyType.IsClass == false)
88+
if (proxyType.IsClass == false)
8989
{
9090
continue;
9191
}

0 commit comments

Comments
 (0)