update
This commit is contained in:
@@ -5,22 +5,30 @@ import (
|
||||
"database/sql"
|
||||
|
||||
"git.cialloo.com/CiallooWeb/Blog/app/internal/config"
|
||||
"git.cialloo.com/CiallooWeb/Blog/app/internal/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsconfig "github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/credentials"
|
||||
"github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
Config config.Config
|
||||
|
||||
SuperAdminAuthMiddleware rest.Middleware
|
||||
|
||||
S3Client *s3.Client
|
||||
DB *sql.DB
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
Config: c,
|
||||
|
||||
SuperAdminAuthMiddleware: middleware.NewSuperAdminAuthMiddleware(c).Handle,
|
||||
|
||||
S3Client: initS3Client(c.S3),
|
||||
DB: initDatabase(c.Database),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user