api_func_ip.go 481 B

123456789101112131415161718192021222324
  1. package route
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "opennamu/route/tool"
  6. )
  7. func Api_func_ip(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. ip_data := tool.IP_parser(db_set, other_set["data"], other_set["ip"])
  13. new_data := map[string]string{}
  14. new_data["data"] = ip_data
  15. json_data, _ := json.Marshal(new_data)
  16. fmt.Print(string(json_data))
  17. }