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 {
|
2023-12-22 15:19:13 +08:00
|
|
|
RandomString(c *gin.Context)
|
2022-09-07 23:34:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
2023-12-22 15:19:13 +08:00
|
|
|
rg.GET("/random", app.RandomString)
|
2022-09-07 23:34:37 +08:00
|
|
|
}
|