31 lines
729 B
Go
31 lines
729 B
Go
package repositoryimp
|
|
|
|
import (
|
|
"dddexample/pkg/domain/entity"
|
|
"dddexample/pkg/infrastructure/model"
|
|
)
|
|
|
|
type UserRepositoryImp struct {
|
|
}
|
|
|
|
func (l *UserRepositoryImp) SelectByID(id int) *entity.AccountEntity {
|
|
var accountObj model.Account
|
|
|
|
model.DB.Model(&model.Account{}).Find(&accountObj, id)
|
|
|
|
return &entity.AccountEntity{Account: accountObj.Account}
|
|
}
|
|
|
|
func (l *UserRepositoryImp) SelectByAccountNumber(account string) *entity.AccountEntity {
|
|
var accountObj model.Account
|
|
|
|
model.DB.Model(&model.Account{}).Where(&model.Account{Account: account}).Find(&accountObj)
|
|
|
|
return &entity.AccountEntity{Account: accountObj.Account}
|
|
}
|
|
|
|
//更新
|
|
func (l *UserRepositoryImp) UpdateAccountMoney(*entity.AccountEntity) {
|
|
return
|
|
}
|