api_func_ip_menu.go 565 B

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