Created
April 26, 2021 11:58
-
-
Save dipeshhkc/34d71ce8cc68510651eb724b4b706b6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WithTrx enables service with repository containing of transaction | |
func (u userService) WithTrx(trxHandle *gorm.DB) userService { | |
u.userRepository = u.userRepository.WithTrx(trxHandle) | |
return u | |
} | |
func (u userService) IncrementMoney(receiver uint, amount float64) error { | |
return u.userRepository.IncrementMoney(receiver, amount) | |
} | |
func (u userService) DecrementMoney(giver uint, amount float64) error { | |
return u.userRepository.DecrementMoney(giver, amount) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment