diff --git a/apiV1ChartPastYearMonthly.go b/apiV1ChartPastYearMonthly.go new file mode 100644 index 0000000..1c99ffe --- /dev/null +++ b/apiV1ChartPastYearMonthly.go @@ -0,0 +1,12 @@ +package main + +import ( + "biukop.com/sfm/loan" + "net/http" +) + +func apiV1ChartPastYearMonthly(w http.ResponseWriter, r *http.Request, ss *loan.Session) { + data := loan.PastYearMonthly() + //send out + apiV1SendJson(data, w, r, ss) +} diff --git a/chartTypeOfLoans.go b/apiV1ChartTypeOfLoans.go similarity index 100% rename from chartTypeOfLoans.go rename to apiV1ChartTypeOfLoans.go diff --git a/apiv1.go b/apiv1.go index 75d602d..1d130a4 100644 --- a/apiv1.go +++ b/apiv1.go @@ -32,6 +32,7 @@ func setupApiV1Handler() []apiV1HandlerMap { {"*", "logout", apiV1Logout}, {"GET", "chart/type-of-loans", apiV1ChartTypeOfLoans}, {"GET", "chart/amount-of-loans", apiV1ChartTypeOfLoans}, + {"GET", "chart/past-year-monthly", apiV1ChartPastYearMonthly}, {"GET", "login", apiV1DumpRequest}, } } else { //production @@ -40,6 +41,7 @@ func setupApiV1Handler() []apiV1HandlerMap { {"*", "logout", apiV1Logout}, {"GET", "chart/type-of-loans", apiV1ChartTypeOfLoans}, {"GET", "chart/amount-of-loans", apiV1ChartTypeOfLoans}, + {"GET", "chart/past-year-monthly", apiV1ChartPastYearMonthly}, {"GET", "login", apiV1EmptyResponse}, } }