woj-server/internal/api/debug/handler.go

26 lines
461 B
Go
Raw Normal View History

2022-09-07 23:34:37 +08:00
package debug
import (
2023-07-15 16:19:49 +08:00
"git.0x7f.app/WOJ/woj-server/internal/misc/log"
2022-09-07 23:34:37 +08:00
"github.com/gin-gonic/gin"
2023-07-15 16:19:49 +08:00
"github.com/samber/do"
2022-09-07 23:34:37 +08:00
"go.uber.org/zap"
)
var _ Handler = (*handler)(nil)
type Handler interface {
randomString(c *gin.Context)
}
type handler struct {
log *zap.Logger
}
2023-07-15 16:19:49 +08:00
func RouteRegister(rg *gin.RouterGroup, i *do.Injector) {
app := &handler{}
app.log = do.MustInvoke[log.Service](i).GetLogger("api.debug")
rg.GET("/random", app.randomString)
2022-09-07 23:34:37 +08:00
}