- Introduced TenantLedger model with fields for managing tenant transactions, including ID, TenantID, UserID, OrderID, transaction Type, Amount, and balance details. - Implemented CRUD operations for TenantLedger with methods for Create, Update, Delete, and Reload. - Generated query methods for TenantLedger to facilitate database interactions, including filtering, pagination, and aggregation functions. - Established relationships with Order model for foreign key references.
83 lines
1.6 KiB
Go
Executable File
83 lines
1.6 KiB
Go
Executable File
package tenant
|
|
|
|
import (
|
|
"quyun/v2/app/middlewares"
|
|
|
|
"go.ipao.vip/atom"
|
|
"go.ipao.vip/atom/container"
|
|
"go.ipao.vip/atom/contracts"
|
|
"go.ipao.vip/atom/opt"
|
|
)
|
|
|
|
func Provide(opts ...opt.Option) error {
|
|
if err := container.Container.Provide(func() (*content, error) {
|
|
obj := &content{}
|
|
|
|
return obj, nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
if err := container.Container.Provide(func() (*contentAdmin, error) {
|
|
obj := &contentAdmin{}
|
|
|
|
return obj, nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
if err := container.Container.Provide(func() (*me, error) {
|
|
obj := &me{}
|
|
|
|
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() (*orderAdmin, error) {
|
|
obj := &orderAdmin{}
|
|
|
|
return obj, nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
if err := container.Container.Provide(func() (*orderMe, error) {
|
|
obj := &orderMe{}
|
|
|
|
return obj, nil
|
|
}); err != nil {
|
|
return err
|
|
}
|
|
if err := container.Container.Provide(func(
|
|
content *content,
|
|
contentAdmin *contentAdmin,
|
|
me *me,
|
|
middlewares *middlewares.Middlewares,
|
|
order *order,
|
|
orderAdmin *orderAdmin,
|
|
orderMe *orderMe,
|
|
) (contracts.HttpRoute, error) {
|
|
obj := &Routes{
|
|
content: content,
|
|
contentAdmin: contentAdmin,
|
|
me: me,
|
|
middlewares: middlewares,
|
|
order: order,
|
|
orderAdmin: orderAdmin,
|
|
orderMe: orderMe,
|
|
}
|
|
if err := obj.Prepare(); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return obj, nil
|
|
}, atom.GroupRoutes); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|