-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
414 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package log | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/CloudDetail/apo/backend/pkg/code" | ||
"github.com/CloudDetail/apo/backend/pkg/core" | ||
"github.com/CloudDetail/apo/backend/pkg/model/request" | ||
) | ||
|
||
// QueryLogContext 获取日志上下文 | ||
// @Summary 获取日志上下文 | ||
// @Description 获取日志上下文 | ||
// @Tags API.log | ||
// @Accept json | ||
// @Produce json | ||
// @Param Request body request.LogQueryContextRequest true "请求信息" | ||
// @Success 200 {object} response.LogQueryContextResponse | ||
// @Failure 400 {object} code.Failure | ||
// @Router /api/log/context [post] | ||
func (h *handler) QueryLogContext() core.HandlerFunc { | ||
return func(c core.Context) { | ||
req := new(request.LogQueryContextRequest) | ||
if err := c.ShouldBindJSON(req); err != nil { | ||
c.AbortWithError(core.Error( | ||
http.StatusBadRequest, | ||
code.ParamBindError, | ||
code.Text(code.ParamBindError)).WithError(err), | ||
) | ||
return | ||
} | ||
resp, err := h.logService.QueryLogContext(req) | ||
if err != nil { | ||
c.AbortWithError(core.Error( | ||
http.StatusBadRequest, | ||
code.QueryLogContextError, | ||
code.Text(code.QueryLogContextError)).WithError(err), | ||
) | ||
return | ||
} | ||
c.Payload(resp) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.