Skip to content

Commit 7cc8fd2

Browse files
committed
增加aliasParameterName参数的构造器
1 parent 6081981 commit 7cc8fd2

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

WebApiClientCore.Extensions.OAuths/Attributes/OAuthTokenAttribute.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,31 @@ namespace WebApiClientCore.Attributes
1818
public class OAuthTokenAttribute : ApiFilterAttribute
1919
{
2020
/// <summary>
21-
/// 获取或设置指定TokenProvider别名的方法参数名
21+
/// 获取指定TokenProvider别名的方法参数名
2222
/// </summary>
23-
public string? AliasParameterName { get; set; }
23+
public string? AliasParameterName { get; }
2424

2525
/// <summary>
2626
/// 获取或设置token提供者的查找模式
2727
/// </summary>
2828
public TypeMatchMode TokenProviderSearchMode { get; set; } = TypeMatchMode.TypeOrBaseTypes;
2929

30+
/// <summary>
31+
/// token应用特性
32+
/// </summary>
33+
public OAuthTokenAttribute()
34+
{
35+
}
36+
37+
/// <summary>
38+
/// token应用特性
39+
/// </summary>
40+
/// <param name="aliasParameterName">指定TokenProvider别名的方法参数名</param>
41+
public OAuthTokenAttribute(string? aliasParameterName)
42+
{
43+
this.AliasParameterName = aliasParameterName;
44+
}
45+
3046
/// <summary>
3147
/// 请求之前
3248
/// </summary>

0 commit comments

Comments
 (0)