From e87b04d7f9d6b25c858d421432bed5443f91b9df Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期一, 16 九月 2019 11:10:34 +0800 Subject: [PATCH] update goffmpeg and capture --- controllers/dbtablesCon.go | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go index 9746d1d..9ebfd35 100644 --- a/controllers/dbtablesCon.go +++ b/controllers/dbtablesCon.go @@ -10,7 +10,7 @@ "webserver/extend/code" "webserver/extend/config" "webserver/extend/esutil" - "webserver/extend/logger" + "basic.com/valib/logger.git" "webserver/extend/util" "webserver/models" ) @@ -129,7 +129,35 @@ util.ResponseFormat(c,code.RequestParamError,"鍙傛暟鏈夎") return } + var dtApi dbapi.DbTableApi + dts, err := dtApi.DbtablesById([]string{ds.Id}) + if err !=nil || dts == nil { + util.ResponseFormat(c,code.RequestParamError,"搴曞簱涓嶅瓨鍦�") + return + } + if ds.Enable == 1 { + str := dts[0].StartTime + etr := dts[0].EndTime + ct := time.Now() + st, _ := time.ParseInLocation("2006-01-02 15:04:05", str, time.Local) + b := false + if etr != "" { + et,_ := time.ParseInLocation("2006-01-02 15:04:05", etr, time.Local) + if et.After(ct) && st.Before(ct) { + b = true + } + } else { + if st.Before(ct) { + b = true + } + } + //b 涓簍rue鎵嶅厑璁稿紑鍚� + if !b { + util.ResponseFormat(c,code.UpdateFail,"褰撳墠涓嶅厑璁稿惎鐢�") + return + } + } b,_ := dtApi.UpdateDbTableStatus(ds.Id, ds.Enable) if b { -- Gitblit v1.8.0