Blame view

netcore/src/Infrastructure/NCC/SensitiveDetection/Providers/ISensitiveDetectionProvider.cs 905 Bytes
de2bd2f9   “wangming”   项目初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  using System.Collections.Generic;
  using System.Threading.Tasks;
  
  namespace NCC.SensitiveDetection
  {
      /// <summary>
      /// 脱敏词汇(脱敏)提供器
      /// </summary>
      public interface ISensitiveDetectionProvider
      {
          /// <summary>
          /// 返回所有脱敏词汇
          /// </summary>
          /// <returns></returns>
          Task<IEnumerable<string>> GetWordsAsync();
  
          /// <summary>
          /// 判断脱敏词汇是否有效(支持自定义算法)
          /// </summary>
          /// <param name="text"></param>
          /// <returns></returns>
          Task<bool> VaildedAsync(string text);
  
          /// <summary>
          /// 替换敏感词汇
          /// </summary>
          /// <param name="text"></param>
          /// <param name="transfer"></param>
          /// <returns></returns>
          Task<string> ReplaceAsync(string text, char transfer = '*');
      }
  }