Checking ifModifiedSince param
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
type Property interface {
|
||||
Put(id string, value string) error
|
||||
Get(id string) (string, error)
|
||||
DefaultGet(id string, defaultValue string) (string, error)
|
||||
}
|
||||
|
||||
type PropertyImpl struct {
|
||||
@@ -33,3 +34,13 @@ func (r *PropertyImpl) Get(id string) (string, error) {
|
||||
rec, err := r.readEntity(id)
|
||||
return rec.(*models.Property).Value, err
|
||||
}
|
||||
|
||||
func (r* PropertyImpl) DefaultGet(id string, defaultValue string) (string, error) {
|
||||
v, err := r.Get(id)
|
||||
|
||||
if v == "" {
|
||||
v = defaultValue
|
||||
}
|
||||
|
||||
return v, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user