api_func_auth_post.go 482 B

12345678910111213141516171819202122232425
  1. package route
  2. import (
  3. "encoding/json"
  4. "opennamu/route/tool"
  5. )
  6. func Api_func_auth_post(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 := other_set["ip"]
  12. what := other_set["what"]
  13. tool.Do_insert_auth_history(db, ip, what)
  14. new_data := make(map[string]interface{})
  15. new_data["response"] = "ok"
  16. json_data, _ := json.Marshal(new_data)
  17. return string(json_data)
  18. }