now request.UrlData is simply an array instead of map[int]

This commit is contained in:
Adrien Marquès 2018-05-22 19:01:39 +02:00
parent b0002a034d
commit 2afa4759fc
3 changed files with 3 additions and 7 deletions

View File

@ -19,7 +19,7 @@ func buildRequest(req *http.Request) (*Request, error) {
Uri: strings.Split(uri, "/"),
GetData: FetchGetData(req),
FormData: FetchFormData(req),
UrlData: make(map[int]interface{}, 0),
UrlData: make([]interface{}, 0),
Data: make(map[string]interface{}, 0),
}
inst.ControllerUri = make([]string, 0, len(inst.Uri))

View File

@ -18,10 +18,6 @@ func (s Server) route(res http.ResponseWriter, req *http.Request) {
log.Fatal(req)
}
// fmt.Printf("Uri: %v\n", request.Uri)
// fmt.Printf("GET: %v\n", request.GetData)
// fmt.Printf("POST: %v\n", request.FormData)
/* (2) Find a controller
---------------------------------------------------------*/
/* (1) Init browsing cursors */
@ -50,7 +46,7 @@ func (s Server) route(res http.ResponseWriter, req *http.Request) {
/* (4) Store them as Data */
for i, data := range uriParams {
request.UrlData[i] = data
request.UrlData = append(request.UrlData, data)
request.Data[fmt.Sprintf("URL#%d", i)] = data
}

View File

@ -15,6 +15,6 @@ type Request struct {
ControllerUri []string
FormData map[string]interface{}
GetData map[string]interface{}
UrlData map[int]interface{}
UrlData []interface{}
Data map[string]interface{}
}