api_func_auth_list.go 557 B

123456789101112131415161718192021222324252627
  1. package route
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "opennamu/route/tool"
  6. )
  7. func Api_func_auth_list(call_arg []string) {
  8. db_set := map[string]string{}
  9. json.Unmarshal([]byte(call_arg[0]), &db_set)
  10. other_set := map[string]string{}
  11. json.Unmarshal([]byte(call_arg[1]), &other_set)
  12. db := tool.DB_connect(db_set)
  13. if db == nil {
  14. return
  15. }
  16. defer db.Close()
  17. auth_name := tool.Get_user_auth(db, db_set, other_set["ip"])
  18. auth_info := tool.Get_auth_group_info(db, db_set, auth_name)
  19. json_data, _ := json.Marshal(auth_info)
  20. fmt.Print(string(json_data))
  21. }