Storm ArtistRepository and PropertyRepository complete.

This commit is contained in:
Deluan
2020-01-10 16:13:07 -05:00
committed by Deluan Quintão
parent aebb960831
commit 0ca691b37f
11 changed files with 92 additions and 27 deletions
+9 -1
View File
@@ -1,6 +1,7 @@
package storm
import (
"github.com/asdine/storm"
"github.com/cloudsonic/sonic-server/domain"
)
@@ -25,7 +26,14 @@ func (r *propertyRepository) Get(id string) (string, error) {
}
func (r *propertyRepository) DefaultGet(id string, defaultValue string) (string, error) {
return defaultValue, nil
value, err := r.Get(id)
if err == storm.ErrNotFound {
return defaultValue, nil
}
if err != nil {
return defaultValue, err
}
return value, nil
}
var _ domain.PropertyRepository = (*propertyRepository)(nil)