// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2

package svc

import (
	"juwan-backend/app/objectstory/api/internal/config"
	"juwan-backend/app/objectstory/api/internal/middleware"
	"juwan-backend/app/objectstory/rpc/fileservice"

	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config        config.Config
	FileSizeLimit rest.Middleware
	FileRpc       fileservice.FileService
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:        c,
		FileSizeLimit: middleware.NewFileSizeLimitMiddleware().Handle,
		FileRpc:       fileservice.NewFileService(zrpc.MustNewClient(c.FileRpcConf)),
	}
}
