feat: add admin login
This commit is contained in:
@@ -3,6 +3,7 @@ package admin
|
||||
import (
|
||||
"quyun/providers/ali"
|
||||
"quyun/providers/app"
|
||||
"quyun/providers/jwt"
|
||||
|
||||
"go.ipao.vip/atom"
|
||||
"go.ipao.vip/atom/container"
|
||||
@@ -11,6 +12,17 @@ import (
|
||||
)
|
||||
|
||||
func Provide(opts ...opt.Option) error {
|
||||
if err := container.Container.Provide(func(
|
||||
jwt *jwt.JWT,
|
||||
) (*auth, error) {
|
||||
obj := &auth{
|
||||
jwt: jwt,
|
||||
}
|
||||
|
||||
return obj, nil
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := container.Container.Provide(func() (*medias, error) {
|
||||
obj := &medias{}
|
||||
|
||||
@@ -33,6 +45,7 @@ func Provide(opts ...opt.Option) error {
|
||||
return err
|
||||
}
|
||||
if err := container.Container.Provide(func(
|
||||
auth *auth,
|
||||
medias *medias,
|
||||
orders *orders,
|
||||
posts *posts,
|
||||
@@ -40,6 +53,7 @@ func Provide(opts ...opt.Option) error {
|
||||
users *users,
|
||||
) (contracts.HttpRoute, error) {
|
||||
obj := &Routes{
|
||||
auth: auth,
|
||||
medias: medias,
|
||||
orders: orders,
|
||||
posts: posts,
|
||||
|
||||
Reference in New Issue
Block a user