ソースを参照

check invalid settlement and ts time

master
sp 4年前
コミット
85fd0fda71
1個のファイルの変更8行の追加0行の削除
  1. +8
    -0
      apiV1PayIn.go

+ 8
- 0
apiV1PayIn.go ファイルの表示

@@ -6,6 +6,7 @@ import (
log "github.com/sirupsen/logrus"
"net/http"
"strconv"
"time"
)

func decodeJsonPayInEdit(r *http.Request) (ret loan.PayIn, e error) {
@@ -28,6 +29,13 @@ func apiV1PayInPost(w http.ResponseWriter, r *http.Request, ss *loan.Session) {
apiV1Client404Error(w, r, ss)
return
} else {
lowerBound, _ := time.Parse("2006-01-02", "1900-01-01")
if input.Settlement.Before(lowerBound) {
input.Settlement = lowerBound
}
if input.Ts.Before(lowerBound) {
input.Ts = time.Now()
}
e = input.Write()
if e != nil {
log.Error("cannot save basic loan", e.Error())

読み込み中…
キャンセル
保存