From 0131427b9e3460b72adf7c55fe192dc6b4274389 Mon Sep 17 00:00:00 2001 From: sp Date: Thu, 4 Mar 2021 21:02:04 +1100 Subject: [PATCH] past year monthly value chart waterflow is ready. --- apiV1ChartPastYearMonthly.go | 12 ++++++++++++ chartTypeOfLoans.go => apiV1ChartTypeOfLoans.go | 0 apiv1.go | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 apiV1ChartPastYearMonthly.go rename chartTypeOfLoans.go => apiV1ChartTypeOfLoans.go (100%) 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}, } }