feat: 代码优化、机器计划任务完善

This commit is contained in:
meilin.huang
2023-07-21 17:07:04 +08:00
parent 7b51705f4e
commit 7f9e972828
56 changed files with 376 additions and 235 deletions

View File

@@ -5,7 +5,7 @@ import (
"mayfly-go/pkg/biz"
"mayfly-go/pkg/global"
"mayfly-go/pkg/model"
"mayfly-go/pkg/utils"
"mayfly-go/pkg/utils/structx"
"net/http"
"runtime/debug"
"strconv"
@@ -25,7 +25,7 @@ func BindJsonAndValid[T any](g *gin.Context, data T) T {
// 绑定请求体中的json至form结构体并拷贝至另一结构体
func BindJsonAndCopyTo[T any](g *gin.Context, form any, toStruct T) T {
BindJsonAndValid(g, form)
utils.Copy(toStruct, form)
structx.Copy(toStruct, form)
return toStruct
}