package controllers import ( "encoding/json" "hongze/hongze_api/models" "hongze/hongze_api/utils" ) type RunLogController struct { BaseCommonController } // @Title 保存运行日志 // @Description 保存运行日志 // @Param request body models.RunLogReq true "type json string" // @Success Ret=200 // @router /save [post] func (this *RunLogController) Edit() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() var req models.RunLogReq err := json.Unmarshal(this.Ctx.Input.RequestBody, &req) if err != nil { br.Msg = "参数解析异常!" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } utils.FileRunLog.Info("%s", req.RunMsg) br.Ret = 200 br.Success = true br.Msg = "保存成功" }