智慧食堂
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

enum_user_identity.go 2.2 KiB

1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. }