refactor(config): 统一使用应用服务器时间

- 删除 dao.Now(),不再额外执行 SELECT NOW(3)
- 配置写入、历史记录和增量游标全部使用 time.Now()
- 移除数据库时间获取失败的错误分支
This commit is contained in:
2026-09-21 21:11:34 +08:00
parent 28c727501f
commit 185e458b45
4 changed files with 9 additions and 69 deletions
+1 -7
View File
@@ -4,7 +4,6 @@ import (
"crypto/rand"
"encoding/hex"
"kenaito-conf/server/internal/dao"
"kenaito-conf/server/internal/logger"
"kenaito-conf/server/internal/middleware"
"kenaito-conf/server/internal/model"
"net/http"
@@ -259,12 +258,7 @@ func (h *AppHandler) Delete(c *gin.Context) {
return
}
now, err := dao.Now()
if err != nil {
logger.SugaredLogger.Errorf("[AppHandler.Delete] get database time error: %v", err)
c.JSON(http.StatusInternalServerError, model.WrapperResponse{Code: 500, Msg: "删除失败"})
return
}
now := time.Now()
app.Enabled = false
app.UpdatedBy = userInfo.Name