test
This commit is contained in:
@@ -33,17 +33,17 @@ func New[T ResourceInterface](t tools.DataType, peerID string, groups []string,
|
||||
*/
|
||||
|
||||
func (dca *resourceMongoAccessor[T]) DeleteOne(id string) (utils.DBObject, int, error) {
|
||||
return dca.GenericDeleteOne(id, dca)
|
||||
return utils.GenericDeleteOne(id, dca)
|
||||
}
|
||||
|
||||
func (dca *resourceMongoAccessor[T]) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||
set.(T).SetResourceModel(nil)
|
||||
return dca.GenericUpdateOne(set.(T).Trim(), id, dca, dca.generateData()) // TODO CHANGE
|
||||
return utils.GenericUpdateOne(set.(T).Trim(), id, dca, dca.generateData()) // TODO CHANGE
|
||||
}
|
||||
|
||||
func (dca *resourceMongoAccessor[T]) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
data.(T).SetResourceModel(nil)
|
||||
return dca.GenericStoreOne(data.(T).Trim(), dca)
|
||||
return utils.GenericStoreOne(data.(T).Trim(), dca)
|
||||
}
|
||||
|
||||
func (dca *resourceMongoAccessor[T]) CopyOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
|
||||
@@ -38,6 +38,10 @@ type AbstractResource struct {
|
||||
Currency string `json:"currency,omitempty" bson:"currency,omitempty"` // Currency is the currency of the price
|
||||
}
|
||||
|
||||
func (ao *AbstractResource) GetAccessor(peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (abs *AbstractResource) SetResourceModel(model *ResourceModel) {
|
||||
abs.ResourceModel = model
|
||||
}
|
||||
|
||||
@@ -25,19 +25,19 @@ func New() *ResourceModelMongoAccessor {
|
||||
}
|
||||
|
||||
func (wfa *ResourceModelMongoAccessor) DeleteOne(id string) (utils.DBObject, int, error) {
|
||||
return wfa.GenericDeleteOne(id, wfa)
|
||||
return utils.GenericDeleteOne(id, wfa)
|
||||
}
|
||||
|
||||
func (wfa *ResourceModelMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||
return wfa.GenericUpdateOne(set, id, wfa, &ResourceModel{})
|
||||
return utils.GenericUpdateOne(set, id, wfa, &ResourceModel{})
|
||||
}
|
||||
|
||||
func (wfa *ResourceModelMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
return wfa.GenericStoreOne(data, wfa)
|
||||
return utils.GenericStoreOne(data, wfa)
|
||||
}
|
||||
|
||||
func (wfa *ResourceModelMongoAccessor) CopyOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
return wfa.GenericStoreOne(data, wfa)
|
||||
return utils.GenericStoreOne(data, wfa)
|
||||
}
|
||||
|
||||
func (a *ResourceModelMongoAccessor) LoadOne(id string) (utils.DBObject, int, error) {
|
||||
|
||||
Reference in New Issue
Block a user