feat: support controller's cache
This commit is contained in:
@@ -33,6 +33,7 @@ type Repo interface {
|
||||
type Controller struct {
|
||||
param Param
|
||||
Repo Repo
|
||||
Cache *Cache
|
||||
}
|
||||
|
||||
type Param struct {
|
||||
@@ -74,6 +75,7 @@ func (c *Controller) ExecuteGame(consumer func(Repo, *game.Game)) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Cache = NewCache(g)
|
||||
consumer(c.Repo, g)
|
||||
return c.Repo.Release()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user