Files
quyun-v2/backend/app/services/provider.gen.go
Rogee 5cf2295f91 feat: Implement notification service and integrate with user interactions
- Added notification service to handle sending and listing notifications.
- Integrated notification sending on user follow and order payment events.
- Updated user service to include fetching followed tenants.
- Enhanced content service to manage access control for content assets.
- Implemented logic for listing content topics based on genre.
- Updated creator service to manage content updates and pricing.
- Improved order service to include detailed order information and notifications.
- Added tests for notification CRUD operations and order details.
2025-12-30 09:57:12 +08:00

115 lines
2.1 KiB
Go
Executable File

package services
import (
"quyun/v2/providers/jwt"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"go.ipao.vip/atom/contracts"
"go.ipao.vip/atom/opt"
"gorm.io/gorm"
)
func Provide(opts ...opt.Option) error {
if err := container.Container.Provide(func() (*common, error) {
obj := &common{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*content, error) {
obj := &content{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*creator, error) {
obj := &creator{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*notification, error) {
obj := &notification{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*order, error) {
obj := &order{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func(
common *common,
content *content,
creator *creator,
db *gorm.DB,
notification *notification,
order *order,
super *super,
tenant *tenant,
user *user,
wallet *wallet,
) (contracts.Initial, error) {
obj := &services{
common: common,
content: content,
creator: creator,
db: db,
notification: notification,
order: order,
super: super,
tenant: tenant,
user: user,
wallet: wallet,
}
if err := obj.Prepare(); err != nil {
return nil, err
}
return obj, nil
}, atom.GroupInitial); err != nil {
return err
}
if err := container.Container.Provide(func() (*super, error) {
obj := &super{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*tenant, error) {
obj := &tenant{}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func(
jwt *jwt.JWT,
) (*user, error) {
obj := &user{
jwt: jwt,
}
return obj, nil
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*wallet, error) {
obj := &wallet{}
return obj, nil
}); err != nil {
return err
}
return nil
}