User.go 444 B

1234567891011121314151617181920212223242526272829
  1. package Account
  2. import (
  3. userlibs "gogs.baozhida.cn/zoie/ERP_libs/User"
  4. "sync"
  5. )
  6. var User_r *userlibs.User
  7. var AdminMap *sync.Map // 泛型
  8. func init() {
  9. AdminMap = new(sync.Map)
  10. }
  11. func Read_User_All_Map(A []userlibs.User) {
  12. for _, v := range A {
  13. AdminMap.Store(v.T_uuid, v)
  14. }
  15. }
  16. func Read_User_T_name_Get(T_uuid string) string {
  17. v, ok := AdminMap.Load(T_uuid)
  18. if ok {
  19. return v.(userlibs.User).T_name
  20. } else {
  21. return ""
  22. }
  23. }