智慧食堂
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

enum_user_identity.go 2.3 KiB

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