|
- package main
-
- import (
- "biukop.com/sfm/loan"
- "encoding/json"
- log "github.com/sirupsen/logrus"
- "net/http"
- )
-
- func decodeJsonFullLoanOverview(r *http.Request) (ret loan.FullLoanSummaryQueryInput, e error) {
- decoder := json.NewDecoder(r.Body)
- //decoder.DisallowUnknownFields()
- e = decoder.Decode(&ret)
- if e != nil {
- log.Error("failed decoding json for Filtering full_loan_summary ", e.Error())
- return
- }
- return
- }
- func apiV1GridLoanFullOverview(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
-
- input, e := decodeJsonFullLoanOverview(r)
-
- if e != nil {
- apiV1EmptyResponse(w, r, ss)
- } else {
- data := loan.QFullLLoanSummary(input)
- //send out
- apiV1SendJson(data, w, r, ss)
- }
- }
|