-
Notifications
You must be signed in to change notification settings - Fork 10
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
9 changed files
with
269 additions
and
9 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
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,53 @@ | ||
package logs | ||
|
||
import ( | ||
"github.com/capcom6/sms-gateway/internal/sms-gateway/handlers/base" | ||
"github.com/capcom6/sms-gateway/internal/sms-gateway/models" | ||
"github.com/capcom6/sms-gateway/internal/sms-gateway/modules/auth" | ||
"github.com/go-playground/validator/v10" | ||
"github.com/gofiber/fiber/v2" | ||
"go.uber.org/fx" | ||
"go.uber.org/zap" | ||
) | ||
|
||
type thirdPartyControllerParams struct { | ||
fx.In | ||
|
||
Validator *validator.Validate | ||
Logger *zap.Logger | ||
} | ||
|
||
type ThirdPartyController struct { | ||
base.Handler | ||
} | ||
|
||
// @Summary Get logs | ||
// @Description Retrieve a list of log entries within a specified time range. | ||
// @Security ApiAuth | ||
// @Tags System, Logs | ||
// @Produce json | ||
// @Param from query string false "The start of the time range for the logs to retrieve. Logs created after this timestamp will be included." Format(date-time) | ||
// @Param to query string false "The end of the time range for the logs to retrieve. Logs created before this timestamp will be included." Format(date-time) | ||
// @Success 200 {object} smsgateway.GetLogsResponse "Log entries" | ||
// @Failure 401 {object} smsgateway.ErrorResponse "Unauthorized" | ||
// @Failure 500 {object} smsgateway.ErrorResponse "Internal server error" | ||
// @Failure 501 {object} smsgateway.ErrorResponse "Not implemented" | ||
// @Router /3rdparty/v1/logs [get] | ||
// | ||
// List webhooks | ||
func (h *ThirdPartyController) get(user models.User, c *fiber.Ctx) error { | ||
return fiber.NewError(fiber.StatusNotImplemented, "For privacy reasons, device's logs are not accessible through Cloud server") | ||
} | ||
|
||
func (h *ThirdPartyController) Register(router fiber.Router) { | ||
router.Get("", auth.WithUser(h.get)) | ||
} | ||
|
||
func NewThirdPartyController(params thirdPartyControllerParams) *ThirdPartyController { | ||
return &ThirdPartyController{ | ||
Handler: base.Handler{ | ||
Logger: params.Logger.Named("logs"), | ||
Validator: params.Validator, | ||
}, | ||
} | ||
} |
Oops, something went wrong.