implement remote call for remote action

This commit is contained in:
mr
2024-08-12 16:11:25 +02:00
parent 4575f9ad3f
commit 2ac24779cd
26 changed files with 312 additions and 144 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"cloud.o-forge.io/core/oc-lib/models/utils"
"cloud.o-forge.io/core/oc-lib/tools"
"github.com/google/uuid"
)
@@ -15,7 +16,7 @@ type AbstractResource struct {
Owner string `json:"owner,omitempty" bson:"owner,omitempty" validate:"required"`
OwnerLogo string `json:"owner_logo,omitempty" bson:"owner_logo,omitempty"`
SourceUrl string `json:"source_url,omitempty" bson:"source_url,omitempty" validate:"required"`
PeerID string `json:"peer_id,omitempty" bson:"peer_id,omitempty" validate:"required"`
PeerID string `json:"peer_id,omitempty" bson:"peer_id,omitempty" validate:"required"`
Price string `json:"price,omitempty" bson:"price,omitempty"`
License string `json:"license,omitempty" bson:"license,omitempty"`
ResourceModel *ResourceModel `json:"resource_model,omitempty" bson:"resource_model,omitempty"`
@@ -83,9 +84,9 @@ func (d *ResourceModel) GetName() string {
return d.UUID
}
func (d *ResourceModel) GetAccessor() utils.Accessor {
func (d *ResourceModel) GetAccessor(caller *tools.HTTPCaller) utils.Accessor {
data := &ResourceModelMongoAccessor{}
data.SetLogger(utils.RESOURCE_MODEL)
data.Init(utils.RESOURCE_MODEL, caller)
return data
}