mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 02:25:30 +00:00
+general tables
This commit is contained in:
27
dbmodels/data.go
Normal file
27
dbmodels/data.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package dbmodels
|
||||
|
||||
import "github.com/pocketbase/pocketbase/core"
|
||||
|
||||
type Data struct {
|
||||
core.BaseRecordProxy
|
||||
}
|
||||
|
||||
func (d *Data) Key() string {
|
||||
return d.GetString(KEY_FIELD)
|
||||
}
|
||||
|
||||
func (d *Data) SetKey(key string) {
|
||||
d.Set(KEY_FIELD, key)
|
||||
}
|
||||
|
||||
func (d *Data) Value() map[string]interface{} {
|
||||
val := d.Get(VALUE_FIELD)
|
||||
if val == nil {
|
||||
return nil
|
||||
}
|
||||
return val.(map[string]interface{})
|
||||
}
|
||||
|
||||
func (d *Data) SetValue(value map[string]interface{}) {
|
||||
d.Set(VALUE_FIELD, value)
|
||||
}
|
||||
Reference in New Issue
Block a user