now request.UrlData is simply an array instead of map[int]
This commit is contained in:
parent
b0002a034d
commit
2afa4759fc
|
@ -19,7 +19,7 @@ func buildRequest(req *http.Request) (*Request, error) {
|
||||||
Uri: strings.Split(uri, "/"),
|
Uri: strings.Split(uri, "/"),
|
||||||
GetData: FetchGetData(req),
|
GetData: FetchGetData(req),
|
||||||
FormData: FetchFormData(req),
|
FormData: FetchFormData(req),
|
||||||
UrlData: make(map[int]interface{}, 0),
|
UrlData: make([]interface{}, 0),
|
||||||
Data: make(map[string]interface{}, 0),
|
Data: make(map[string]interface{}, 0),
|
||||||
}
|
}
|
||||||
inst.ControllerUri = make([]string, 0, len(inst.Uri))
|
inst.ControllerUri = make([]string, 0, len(inst.Uri))
|
||||||
|
|
|
@ -18,10 +18,6 @@ func (s Server) route(res http.ResponseWriter, req *http.Request) {
|
||||||
log.Fatal(req)
|
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
|
/* (2) Find a controller
|
||||||
---------------------------------------------------------*/
|
---------------------------------------------------------*/
|
||||||
/* (1) Init browsing cursors */
|
/* (1) Init browsing cursors */
|
||||||
|
@ -50,7 +46,7 @@ func (s Server) route(res http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
/* (4) Store them as Data */
|
/* (4) Store them as Data */
|
||||||
for i, data := range uriParams {
|
for i, data := range uriParams {
|
||||||
request.UrlData[i] = data
|
request.UrlData = append(request.UrlData, data)
|
||||||
request.Data[fmt.Sprintf("URL#%d", i)] = data
|
request.Data[fmt.Sprintf("URL#%d", i)] = data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
types.go
2
types.go
|
@ -15,6 +15,6 @@ type Request struct {
|
||||||
ControllerUri []string
|
ControllerUri []string
|
||||||
FormData map[string]interface{}
|
FormData map[string]interface{}
|
||||||
GetData map[string]interface{}
|
GetData map[string]interface{}
|
||||||
UrlData map[int]interface{}
|
UrlData []interface{}
|
||||||
Data map[string]interface{}
|
Data map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue