Student.cs 2.9 KB

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