api_func_ip.go 439 B

1234567891011121314151617181920212223
  1. package route
  2. import (
  3. "encoding/json"
  4. "opennamu/route/tool"
  5. )
  6. func Api_func_ip(call_arg []string) string {
  7. other_set := map[string]string{}
  8. json.Unmarshal([]byte(call_arg[0]), &other_set)
  9. db := tool.DB_connect()
  10. defer db.Close()
  11. ip_data := tool.IP_parser(db, other_set["data"], other_set["ip"])
  12. new_data := map[string]string{}
  13. new_data["data"] = ip_data
  14. json_data, _ := json.Marshal(new_data)
  15. return string(json_data)
  16. }