mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
docs(swagger): update API documentation for log endpoints
Add new response types and parameters for logs API: - Add GroupedStatsItem and GroupedStatsResponse definitions - Add ListLogsResponse and LogView definitions for detailed log records - Add group_by enum parameter (model/day/month) to stats endpoint - Update endpoint descriptions to clarify response types and request_body inclusion - Update response schema references to use correct types
This commit is contained in:
@@ -155,7 +155,7 @@ func (h *MasterHandler) masterLogBase(masterID uint) (*gorm.DB, error) {
|
||||
|
||||
// ListLogs godoc
|
||||
// @Summary List logs (admin)
|
||||
// @Description List request logs with basic filtering/pagination
|
||||
// @Description List request logs with basic filtering/pagination. Returns full log records including request_body.
|
||||
// @Tags admin
|
||||
// @Produce json
|
||||
// @Security AdminAuth
|
||||
@@ -167,7 +167,7 @@ func (h *MasterHandler) masterLogBase(masterID uint) (*gorm.DB, error) {
|
||||
// @Param group query string false "route group"
|
||||
// @Param model query string false "model"
|
||||
// @Param status_code query int false "status code"
|
||||
// @Success 200 {object} ListMasterLogsResponse
|
||||
// @Success 200 {object} ListLogsResponse
|
||||
// @Failure 500 {object} gin.H
|
||||
// @Router /admin/logs [get]
|
||||
func (h *Handler) ListLogs(c *gin.Context) {
|
||||
@@ -346,14 +346,15 @@ func (h *Handler) deleteLogsBefore(cutoff time.Time, keyID uint, modelName strin
|
||||
|
||||
// LogStats godoc
|
||||
// @Summary Log stats (admin)
|
||||
// @Description Aggregate log stats with basic filtering. Use group_by param for grouped statistics.
|
||||
// @Description Aggregate log stats with basic filtering. Use group_by param for grouped statistics (model/day/month). Without group_by returns LogStatsResponse; with group_by returns GroupedStatsResponse.
|
||||
// @Tags admin
|
||||
// @Produce json
|
||||
// @Security AdminAuth
|
||||
// @Param since query int false "unix seconds"
|
||||
// @Param until query int false "unix seconds"
|
||||
// @Param group_by query string false "group by dimension: model, day, month"
|
||||
// @Success 200 {object} LogStatsResponse
|
||||
// @Param group_by query string false "group by dimension: model, day, month. Returns GroupedStatsResponse when specified." Enums(model, day, month)
|
||||
// @Success 200 {object} LogStatsResponse "Default aggregated stats (when group_by is not specified)"
|
||||
// @Success 200 {object} GroupedStatsResponse "Grouped stats (when group_by is specified)"
|
||||
// @Failure 500 {object} gin.H
|
||||
// @Router /admin/logs/stats [get]
|
||||
func (h *Handler) LogStats(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user