Student.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.Text;
  6. using System.Text.Json.Serialization;
  7. using TEAMModelOS.SDK.Context.Attributes.Azure;
  8. using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
  9. namespace TEAMModelOS.Service.Models.Core
  10. {
  11. [CosmosDB(RU = 400, Name = "CoreStudent")]
  12. public class Student :ID
  13. {
  14. public int? ttl { get; set; } = -1;
  15. public Student()
  16. {
  17. password = new Password();
  18. productToken = new List<ProductToken>();
  19. oauth = new List<Oauth>();
  20. //classroom = new Classroom();
  21. }
  22. public string id { get; set; }
  23. /// <summary>
  24. /// 0 动态id 透過第三方申請,未認證手機號,TEAMModelId暫時為virtualId但是不顯示在介面上,當使用者驗證手機號後TEAMModelId會變為手機號。
  25. /// 1 动态id 透過手機號申請,TEAMModelId為手機號
  26. /// 2 學生ID,透過學校建立,TEAMModelId格式為 {學校簡碼}#{學號}
  27. /// </summary>
  28. [Required(ErrorMessage = "{0} 必须填写")]
  29. public int type { get; set; }
  30. [Required(ErrorMessage = "{0} 必须填写")]
  31. public string name { get; set; }
  32. public string email { get; set; }
  33. public string cellphone { get; set; }
  34. public string countryCode { get; set; }
  35. public int verifyFlg { get; set; }
  36. public int status { get; set; } = 0;
  37. public long createDate { get; set; }
  38. public Password password { get; set; }
  39. public string exValue { get; set; }
  40. public string product { get; set; }
  41. public List<ProductToken> productToken { get; set; }
  42. /// <summary>
  43. /// 0 1 dynamic 1学校id
  44. /// </summary>
  45. [PartitionKey]
  46. [Required(ErrorMessage = "{0} 必须填写")]
  47. public string schoolCode { get; set; } ///
  48. public string shortCode { get; set; }
  49. public string profilePicture { get; set; }
  50. public string profilePictureUrl { get; set; }
  51. [JsonPropertyName("TEAMModelId")]
  52. [JsonProperty("TEAMModelId")]
  53. public string TEAMModelId { get; set; }
  54. public string loginTime { get; set; }
  55. public string virtualId { get; set; }
  56. public List<Oauth> oauth { get; set; } // 0 1
  57. public string haveDevice { get; set; }//2
  58. //public Classroom classroom { get; set; }
  59. public string classroomCode { get; set; }
  60. public string studentId { get; set; }
  61. public int seatNo { get; set; }
  62. }
  63. }
  64. public class Password {
  65. public string value { get; set; }
  66. public bool isSet { get; set; } = false;
  67. public bool isReset { get; set; } = false;
  68. }
  69. public class ProductToken
  70. {
  71. public string station { get; set; }
  72. public string url { get; set; }
  73. public string licenseStatus { get; set; }
  74. public string exp { get; set; }
  75. public string memberId { get; set; }
  76. }
  77. public class Oauth
  78. {
  79. public string provider { get; set; }
  80. public string openId { get; set; }
  81. }