mirror of
https://github.com/xinliangnote/go-gin-api.git
synced 2024-04-21 12:31:46 +00:00
30 lines
568 B
Go
30 lines
568 B
Go
package index
|
|
|
|
import (
|
|
"github.com/xinliangnote/go-gin-api/internal/pkg/core"
|
|
"github.com/xinliangnote/go-gin-api/internal/repository/mysql"
|
|
"github.com/xinliangnote/go-gin-api/internal/repository/redis"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type handler struct {
|
|
logger *zap.Logger
|
|
cache redis.Repo
|
|
db mysql.Repo
|
|
}
|
|
|
|
func New(logger *zap.Logger, db mysql.Repo, cache redis.Repo) *handler {
|
|
return &handler{
|
|
logger: logger,
|
|
cache: cache,
|
|
db: db,
|
|
}
|
|
}
|
|
|
|
func (h *handler) Index() core.HandlerFunc {
|
|
return func(ctx core.Context) {
|
|
ctx.HTML("index", nil)
|
|
}
|
|
}
|