Преглед изворни кода

type of loans and amount of loans now support filter by broker name.

master
sp пре 4 година
родитељ
комит
8e2cc82157
2 измењених фајлова са 11 додато и 3 уклоњено
  1. +9
    -1
      apiV1ChartTypeOfLoans.go
  2. +2
    -2
      apiv1.go

+ 9
- 1
apiV1ChartTypeOfLoans.go Прегледај датотеку

@@ -12,7 +12,15 @@ type chartTypeOfLoans struct {
}

func apiV1ChartTypeOfLoans(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
data := loan.TypeOfLoan()
peopleId := r.URL.Path[len(apiV1Prefix+"chart/type-of-loans/"):]
data := loan.TypeOfLoan(peopleId)
//send out
apiV1SendJson(data, w, r, ss)
}

func apiV1ChartAmountOfLoans(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
peopleId := r.URL.Path[len(apiV1Prefix+"chart/amount-of-loans/"):]
data := loan.TypeOfLoan(peopleId)
//send out
apiV1SendJson(data, w, r, ss)
}

+ 2
- 2
apiv1.go Прегледај датотеку

@@ -31,7 +31,7 @@ func setupApiV1Handler() []apiV1HandlerMap {
{"POST", "login", apiV1Login},
{"*", "logout", apiV1Logout},
{"GET", "chart/type-of-loans", apiV1ChartTypeOfLoans},
{"GET", "chart/amount-of-loans", apiV1ChartTypeOfLoans},
{"GET", "chart/amount-of-loans", apiV1ChartAmountOfLoans},
{"GET", "chart/past-year-monthly", apiV1ChartPastYearMonthly},
{"GET", "chart/recent-10-loans", apiV1ChartRecent10Loans},
{"GET", "chart/top-broker", apiV1ChartTopBroker},
@@ -117,7 +117,7 @@ func setupApiV1Handler() []apiV1HandlerMap {
{"POST", "login", apiV1Login},
{"*", "logout", apiV1Logout},
{"GET", "chart/type-of-loans", apiV1ChartTypeOfLoans},
{"GET", "chart/amount-of-loans", apiV1ChartTypeOfLoans},
{"GET", "chart/amount-of-loans", apiV1ChartAmountOfLoans},
{"GET", "chart/past-year-monthly", apiV1ChartPastYearMonthly},
{"GET", "chart/recent-10-loans", apiV1ChartRecent10Loans},
{"GET", "chart/top-broker", apiV1ChartTopBroker},

Loading…
Откажи
Сачувај