平安校园
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

46 行
1.1 KiB

  1. using Microsoft.Extensions.Configuration;
  2. using MoYu.ConfigurableOptions;
  3. namespace SafeCampus.Core.Options;
  4. public class TXSmsOptions : IConfigurableOptionsListener<TXSmsOptions>
  5. {
  6. /// <summary>
  7. /// 腾讯云API密钥 SecretId
  8. /// </summary>
  9. public string SecretId { get; set; }
  10. /// <summary>
  11. /// 腾讯云API密钥 SecretKey
  12. /// </summary>
  13. public string SecretKey { get; set; }
  14. /// <summary>
  15. /// 腾讯云短信 Appid
  16. /// </summary>
  17. public string SmsAppId { get; set; }
  18. /// <summary>
  19. /// 腾讯云短信 签名
  20. /// </summary>
  21. public string SmsSn { get; set; }
  22. /// <summary>
  23. /// 验证码模板id
  24. /// </summary>
  25. public string VerificationCodeId { get; set; }
  26. public void PostConfigure(TXSmsOptions options, IConfiguration configuration)
  27. {
  28. }
  29. public void OnListener(TXSmsOptions options, IConfiguration configuration)
  30. {
  31. SecretId=options.SecretId;
  32. SecretKey=options.SecretKey;
  33. SmsAppId=options.SmsAppId;
  34. SmsSn=options.SmsSn;
  35. VerificationCodeId = options.VerificationCodeId;
  36. }
  37. }