view_edit_file_upload_post.go 837 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package route
  2. import (
  3. "opennamu/route/tool"
  4. )
  5. func View_edit_file_upload_post(config tool.Config) string {
  6. db := tool.DB_connect()
  7. defer tool.DB_close(db)
  8. other_set := []map[string]string{}
  9. json.Unmarshal([]byte(config.Other_set), &other_set)
  10. resp := []any{}
  11. for _, v := range other_set {
  12. var config_sub tool.Config
  13. b, err := json.Marshal(config)
  14. if err != nil {
  15. continue
  16. }
  17. err = json.Unmarshal(b, &config_sub)
  18. if err != nil {
  19. continue
  20. }
  21. v_str, _ := json.MarshalToString(v)
  22. config_sub.Other_set = v_str
  23. data := Api_file_upload_post(config_sub)
  24. data_sub := map[string]any{}
  25. json.Unmarshal([]byte(data), &data_sub)
  26. resp = append(resp, data_sub["data"])
  27. }
  28. return ""
  29. }