Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountRepository ¶
type AccountRepository interface { CreateAccount(info *model.Register) error GetAccountInfoById(userId int64) (*model.Register, error) GetAccountInfo(phone, email string) (*model.Register, error) UpdateAccountInfo(info *model.Register) error CreateUserInfo(user *model.UserInfo) error GetUserInfo(userId int64) (*model.UserInfo, error) UpdateUserInfo(info *model.UserInfo) error }
func NewAccountRepository ¶
func NewAccountRepository(repo *Repository) AccountRepository
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
func (*Repository) DB ¶
func (r *Repository) DB(ctx context.Context) *gorm.DB
DB return tx If you need to create a Transaction, you must call DB(ctx) and Transaction(ctx,fn)
func (*Repository) Transaction ¶
type Transaction ¶
type Transaction interface {
Transaction(ctx context.Context, fn func(ctx context.Context) error) error
}
func NewTransaction ¶
func NewTransaction(r *Repository) Transaction
Click to show internal directories.
Click to hide internal directories.