api_w_render.go 485 B

12345678910111213141516171819202122
  1. package route
  2. import (
  3. "opennamu/route/tool"
  4. jsoniter "github.com/json-iterator/go"
  5. )
  6. func Api_w_render(call_arg []string) string {
  7. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  8. other_set := map[string]string{}
  9. json.Unmarshal([]byte(call_arg[0]), &other_set)
  10. db := tool.DB_connect()
  11. defer db.Close()
  12. data := tool.Get_render(db, other_set["doc_name"], other_set["data"], other_set["render_type"])
  13. json_data, _ := json.Marshal(data)
  14. return string(json_data)
  15. }