fix: resolve empty configs logging
This commit is contained in:
@@ -21,36 +21,12 @@ func NewActivityLogController(as *service.ActivityLogService, routeGroups *commo
|
||||
errorHandler: error_handler.NewControllerErrorHandler(),
|
||||
}
|
||||
|
||||
// Per-server activity log: GET /server/:id/activity-log
|
||||
routeGroups.ActivityLog.Use(auth.Authenticate)
|
||||
routeGroups.ActivityLog.Get("/", ac.GetServerLogs)
|
||||
|
||||
// Global activity log: GET /activity-log (admin use)
|
||||
routeGroups.Groups.Group("/activity-log").Use(auth.Authenticate).Get("/", ac.GetAllLogs)
|
||||
|
||||
return ac
|
||||
}
|
||||
|
||||
// GetServerLogs returns activity logs for a specific server.
|
||||
//
|
||||
// @Summary Return activity logs for a server
|
||||
// @Tags ActivityLog
|
||||
// @Success 200 {array} model.ActivityLog
|
||||
// @Router /server/{id}/activity-log [get]
|
||||
func (ac *ActivityLogController) GetServerLogs(c *fiber.Ctx) error {
|
||||
var filter model.ActivityLogFilter
|
||||
if err := common.ParseQueryFilter(c, &filter); err != nil {
|
||||
return ac.errorHandler.HandleValidationError(c, err, "query_filter")
|
||||
}
|
||||
|
||||
result, err := ac.service.GetAll(c.UserContext(), &filter)
|
||||
if err != nil {
|
||||
return ac.errorHandler.HandleServiceError(c, err)
|
||||
}
|
||||
|
||||
return c.JSON(result)
|
||||
}
|
||||
|
||||
// GetAllLogs returns activity logs across all servers (admin).
|
||||
//
|
||||
// @Summary Return all activity logs
|
||||
|
||||
@@ -29,6 +29,7 @@ func NewServiceControlController(as *service.ServiceControlService, routeGroups
|
||||
}
|
||||
|
||||
serviceRoutes := routeGroups.Server.Group("/:id/service")
|
||||
serviceRoutes.Use(auth.Authenticate)
|
||||
serviceRoutes.Get("/:service", ac.getStatus)
|
||||
serviceRoutes.Post("/start", ac.startServer)
|
||||
serviceRoutes.Post("/stop", ac.stopServer)
|
||||
|
||||
Reference in New Issue
Block a user