智慧食堂
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 regels
2.2 KiB

  1. package enum
  2. type UserIdentity int32
  3. const (
  4. UserIdentityForCentralKitchenForStudent = 1
  5. UserIdentityForCentralKitchenForTeacher = 2
  6. UserIdentityForCentralKitchenForWorker = 3
  7. UserIdentityForSelfSupportForStudent = 4
  8. UserIdentityForSelfSupportForTeacher = 5
  9. UserIdentityForSelfSupportForWorker = 6
  10. UserIdentityForNursingHome = 7
  11. )
  12. func (gt UserIdentity) String() string {
  13. switch gt {
  14. case UserIdentityForCentralKitchenForStudent:
  15. return "央厨-学生"
  16. case UserIdentityForCentralKitchenForTeacher:
  17. return "央厨-教职员工"
  18. case UserIdentityForCentralKitchenForWorker:
  19. return "央厨-工作人员"
  20. case UserIdentityForSelfSupportForStudent:
  21. return "自营-学生"
  22. case UserIdentityForSelfSupportForTeacher:
  23. return "自营-教职员工"
  24. case UserIdentityForSelfSupportForWorker:
  25. return "自营-工作人员"
  26. case UserIdentityForNursingHome:
  27. return "养老院-普通用户"
  28. default:
  29. return "未知"
  30. }
  31. }
  32. type UserIdentityKind int32
  33. const (
  34. UserIdentityKindForCommon = 1
  35. UserIdentityKindForWorker = 2
  36. )
  37. func (gt UserIdentityKind) String() string {
  38. switch gt {
  39. case UserIdentityKindForCommon:
  40. return "普通用户"
  41. case UserIdentityKindForWorker:
  42. return "工作人员"
  43. default:
  44. return "未知"
  45. }
  46. }
  47. type UserIdentityState int32
  48. const (
  49. UserIdentityStateForNormal = 1
  50. UserIdentityStateForFreeze = 2
  51. )
  52. func (gt UserIdentityState) String() string {
  53. switch gt {
  54. case UserIdentityStateForNormal:
  55. return "正常"
  56. case UserIdentityStateForFreeze:
  57. return "冻结"
  58. default:
  59. return "未知"
  60. }
  61. }
  62. type UserIdentityCertType int32
  63. const (
  64. UserIdentityCertTypeForIdCard = 1
  65. UserIdentityCertTypeForStudentId = 2
  66. UserIdentityCertTypeForPassport = 3
  67. )
  68. func (gt UserIdentityCertType) String() string {
  69. switch gt {
  70. case UserIdentityCertTypeForIdCard:
  71. return "身份证"
  72. case UserIdentityCertTypeForStudentId:
  73. return "学工号"
  74. case UserIdentityCertTypeForPassport:
  75. return "护照"
  76. default:
  77. return "未知"
  78. }
  79. }
  80. func (gt UserIdentityCertType) Format() string {
  81. switch gt {
  82. case UserIdentityCertTypeForIdCard:
  83. return "1"
  84. case UserIdentityCertTypeForStudentId:
  85. return "X"
  86. case UserIdentityCertTypeForPassport:
  87. return "Y"
  88. default:
  89. return ""
  90. }
  91. }