初次提交

This commit is contained in:
liuzhihang1
2024-06-26 20:45:23 +08:00
parent 4b388a5be1
commit 831ea9889f
57 changed files with 3945 additions and 0 deletions

20
api/log.go Normal file
View File

@@ -0,0 +1,20 @@
package api
import (
"msm/config"
"msm/model"
"msm/service/es"
"github.com/gin-gonic/gin"
)
type logApi struct{}
var LogApi = new(logApi)
func (a *logApi) GetLog(ctx *gin.Context) {
req := model.GetLogReq{}
errCheck(ctx, !config.CF.EsEnable, "elasticsearch未启用或账号密码错误")
errCheck(ctx, ctx.ShouldBindJSON(&req) != nil, "请求体格式错误")
rOk(ctx, "查询成功", es.EsService.Search(req))
}