api_w_render.go 495 B

12345678910111213141516171819202122
  1. package route
  2. import (
  3. "encoding/json"
  4. "opennamu/route/tool"
  5. )
  6. func Api_w_render(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. data := tool.Get_render(db, db_set, other_set["doc_name"], other_set["data"], other_set["render_type"])
  14. json_data, _ := json.Marshal(data)
  15. return string(json_data)
  16. }