ActivityTypes.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace JiaZhiQuan.Common
  5. {
  6. /// <summary>
  7. /// 活动分类
  8. /// </summary>
  9. public static class ActivityTypes
  10. {
  11. public static Dictionary<string, string> CodeDescriptionMapping { get; } = new Dictionary<string, string>();
  12. static ActivityTypes()
  13. {
  14. var members = typeof(ActivityTypes).GetFields();
  15. members.ForEach(e =>
  16. {
  17. var attr = Attribute.GetCustomAttribute(e, typeof(DescriptionAttribute)) as DescriptionAttribute;
  18. if (attr != null)
  19. {
  20. CodeDescriptionMapping.Add((string)e.GetRawConstantValue(), attr.Description);
  21. }
  22. });
  23. }
  24. [Description("猜涨跌")]
  25. public const string 猜涨跌 = "czd";
  26. [Description("答题")]
  27. public const string 答题 = "dt";
  28. [Description("晒笔记")]
  29. public const string 晒笔记 = "sbj";
  30. [Description("邀请好友")]
  31. public const string 邀请好友 = "yqhy";
  32. [Description("每日话题")]
  33. public const string 每日话题 = "mrht";
  34. [Description("阅读量大比拼")]
  35. public const string 阅读量大比拼 = "ydldbp";
  36. [Description("打卡")]
  37. public const string 打卡 = "daka";
  38. }
  39. }