Files
quyun-v2/backend/app/services/provider.gen.go
Rogee b78f1e1c84 feat(user): implement OTP login, user creation, and profile management
- Added SendOTP method for simulating OTP sending.
- Implemented LoginWithOTP method for user login/registration via OTP, including user creation if not found.
- Added Me method to retrieve current user information.
- Implemented Update method for updating user profile details.
- Added RealName method for real-name verification.
- Implemented GetNotifications method to fetch user notifications.
- Created user_test.go for comprehensive unit tests covering login, profile retrieval, updates, real-name verification, and notifications.
- Updated database models to use appropriate consts for fields like gender, status, and roles.
2025-12-29 10:55:13 +08:00

106 lines
1.9 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() (*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,
order *order,
super *super,
tenant *tenant,
user *user,
wallet *wallet,
) (contracts.Initial, error) {
obj := &services{
common: common,
content: content,
creator: creator,
db: db,
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
}