第 4 阶段:订单、交接与账务--ok

This commit is contained in:
yml
2026-05-22 16:14:23 +08:00
parent edda1fbc7b
commit 9ebdfab078
17 changed files with 719 additions and 4 deletions
@@ -0,0 +1,27 @@
package wallet
import "errors"
var ErrDependencyUnavailable = errors.New("dependency unavailable")
type Service struct {
repo *Repository
}
func NewService(repo *Repository) *Service {
return &Service{repo: repo}
}
func (s *Service) Account(userID uint64) (*AccountDTO, error) {
if s.repo == nil {
return nil, ErrDependencyUnavailable
}
return s.repo.Account(userID)
}
func (s *Service) Ledger(userID uint64) ([]LedgerDTO, error) {
if s.repo == nil {
return nil, ErrDependencyUnavailable
}
return s.repo.Ledger(userID)
}