Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

32 lines
705B

  1. package main
  2. import (
  3. "biukop.com/sfm/loan"
  4. "encoding/json"
  5. log "github.com/sirupsen/logrus"
  6. "net/http"
  7. )
  8. func decodeJsonFullLoanOverview(r *http.Request) (ret loan.FullLoanSummaryQueryInput, e error) {
  9. decoder := json.NewDecoder(r.Body)
  10. //decoder.DisallowUnknownFields()
  11. e = decoder.Decode(&ret)
  12. if e != nil {
  13. log.Error("failed decoding json for Filtering full_loan_summary ", e.Error())
  14. return
  15. }
  16. return
  17. }
  18. func apiV1GridLoanFullOverview(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
  19. input, e := decodeJsonFullLoanOverview(r)
  20. if e != nil {
  21. apiV1EmptyResponse(w, r, ss)
  22. } else {
  23. data := loan.QFullLLoanSummary(input)
  24. //send out
  25. apiV1SendJson(data, w, r, ss)
  26. }
  27. }