test copy
This commit is contained in:
@@ -30,10 +30,6 @@ type LibData struct {
|
||||
Err string `bson:"error" json:"error"`
|
||||
}
|
||||
|
||||
func (lb LibData) BindID(id string) {
|
||||
lb.DataResource.BindID(id)
|
||||
}
|
||||
|
||||
func Init(appName string) {
|
||||
logs.SetAppName(appName)
|
||||
logs.SetLogger(logs.CreateLogger("main", ""))
|
||||
@@ -61,6 +57,12 @@ func DeleteOne(collection LibDataEnum, id string) LibData {
|
||||
return LibData{DataResource: d, Code: code, Err: err.Error()}
|
||||
}
|
||||
|
||||
func CopyOne(collection LibDataEnum, object map[string]interface{}) LibData {
|
||||
model := models.Model(collection.EnumIndex())
|
||||
d, code, err := model.GetAccessor().CopyOne(model.Deserialize(object))
|
||||
return LibData{DataResource: d, Code: code, Err: err.Error()}
|
||||
}
|
||||
|
||||
func StoreOne(collection LibDataEnum, object map[string]interface{}) LibData {
|
||||
model := models.Model(collection.EnumIndex())
|
||||
d, code, err := model.GetAccessor().StoreOne(model.Deserialize(object))
|
||||
|
||||
Reference in New Issue
Block a user