mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-07-21 04:33:06 +08:00
first commit
This commit is contained in:
25
server/internal/httpapi/system_handler.go
Normal file
25
server/internal/httpapi/system_handler.go
Normal file
@@ -0,0 +1,25 @@
|
||||
//go:build ignore
|
||||
|
||||
package httpapi
|
||||
|
||||
import (
|
||||
"backupx/server/internal/service"
|
||||
"backupx/server/pkg/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type systemHandler struct {
|
||||
service *service.SystemService
|
||||
}
|
||||
|
||||
func newSystemHandler(service *service.SystemService) *systemHandler {
|
||||
return &systemHandler{service: service}
|
||||
}
|
||||
|
||||
func (h *systemHandler) registerRoutes(protected gin.IRouter) {
|
||||
protected.GET("/system/info", h.info)
|
||||
}
|
||||
|
||||
func (h *systemHandler) info(c *gin.Context) {
|
||||
response.Success(c, h.service.GetInfo())
|
||||
}
|
||||
Reference in New Issue
Block a user