| 123456789101112131415161718192021222324252627 |
- package route
- import (
- "opennamu/route/tool"
- )
- func Api_func_level(config tool.Config) string {
- db := tool.DB_connect()
- defer tool.DB_close(db)
- other_set := map[string]string{}
- json.Unmarshal([]byte(config.Other_set), &other_set)
- ip := config.IP
- if _, exist := other_set["ip"]; exist {
- ip = other_set["ip"]
- }
- level := tool.Get_level(db, ip)
- new_data := make(map[string]any)
- new_data["response"] = "ok"
- new_data["data"] = level
- json_data, _ := json.Marshal(new_data)
- return string(json_data)
- }
|