Compare commits

...

4 Commits

Author SHA1 Message Date
mr
5b709abd0e Merge branch 'master' of https://cloud.o-forge.io/core/oc-catalog 2025-02-13 10:27:30 +01:00
mr
4ef16b4195 neo oc-lib 2025-02-06 08:57:09 +01:00
mr
7ea8075b39 neo oc-lib 2025-02-05 08:42:29 +01:00
mr
99b42f6d02 working oc-catalog + enum ref 2025-01-17 17:03:32 +01:00
40 changed files with 1204 additions and 395 deletions

0
Dockerfile Normal file → Executable file
View File

0
LICENSE.md Normal file → Executable file
View File

0
Makefile Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
catalog.json Normal file → Executable file
View File

0
conf/app.conf Normal file → Executable file
View File

24
controllers/compute.go Normal file → Executable file
View File

@ -12,6 +12,8 @@ type ComputeController struct {
beego.Controller
}
var comp_collection = oclib.LibDataEnum(oclib.COMPUTE_RESOURCE)
// @Title Update
// @Description create computes
// @Param id path string true "the compute id you want to get"
@ -19,11 +21,12 @@ type ComputeController struct {
// @Success 200 {compute} models.compute
// @router /:id [put]
func (o *ComputeController) Put() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
// store and return Id or post with UUID
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), res, id)
o.Data["json"] = oclib.NewRequest(comp_collection, user, peerID, groups, nil).UpdateOne(res, id)
o.ServeJSON()
}
@ -33,29 +36,36 @@ func (o *ComputeController) Put() {
// @Success 200 {compute} models.compute
// @router / [post]
func (o *ComputeController) Post() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), res)
o.Data["json"] = oclib.NewRequest(comp_collection, user, peerID, groups, nil).StoreOne(res)
o.ServeJSON()
}
// @Title GetAll
// @Description find compute by id
// @Param is_draft query string false "draft wished"
// @Success 200 {compute} models.compute
// @router / [get]
func (o *ComputeController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE))
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(comp_collection, user, peerID, groups, nil).LoadAll(isDraft == "true")
o.ServeJSON()
}
// @Title Get
// @Description find compute by key word
// @Param search path string true "the search you want to get"
// @Param is_draft query string false "draft wished"
// @Success 200 {compute} models.compute
// @router /search/:search [get]
func (o *ComputeController) Search() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
isDraft := o.Ctx.Input.Query("is_draft")
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.COMPUTE_RESOURCE))
o.Data["json"] = oclib.NewRequest(comp_collection, user, peerID, groups, nil).Search(nil, search, isDraft == "true")
o.ServeJSON()
}
@ -65,8 +75,9 @@ func (o *ComputeController) Search() {
// @Success 200 {compute} models.compute
// @router /:id [get]
func (o *ComputeController) Get() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(comp_collection, user, peerID, groups, nil).LoadOne(id)
o.ServeJSON()
}
@ -76,7 +87,8 @@ func (o *ComputeController) Get() {
// @Success 200 {compute} delete success!
// @router /:id [delete]
func (o *ComputeController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.COMPUTE_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(comp_collection, user, peerID, groups, nil).DeleteOne(id)
o.ServeJSON()
}

25
controllers/data.go Normal file → Executable file
View File

@ -12,6 +12,8 @@ type DataController struct {
beego.Controller
}
var data_collection = oclib.LibDataEnum(oclib.DATA_RESOURCE)
// @Title Update
// @Description create datas
// @Param id path string true "the data id you want to get"
@ -20,10 +22,11 @@ type DataController struct {
// @router /:id [put]
func (o *DataController) Put() {
// store and return Id or post with UUID
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.DATA_RESOURCE), res, id)
o.Data["json"] = oclib.NewRequest(data_collection, user, peerID, groups, nil).UpdateOne(res, id)
o.ServeJSON()
}
@ -33,29 +36,37 @@ func (o *DataController) Put() {
// @Success 200 {data} models.data
// @router / [post]
func (o *DataController) Post() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.DATA_RESOURCE), res)
o.Data["json"] = oclib.NewRequest(data_collection, user, peerID, groups, nil).StoreOne(res)
o.ServeJSON()
}
// @Title GetAll
// @Description find data by id
// @Param is_draft query string false "draft wished"
// @Success 200 {data} models.data
// @router / [get]
func (o *DataController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.DATA_RESOURCE))
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(data_collection, user, peerID, groups, nil).LoadAll(isDraft == "true")
o.ServeJSON()
}
// @Title Get
// @Description find data by key word
// @Param search path string true "the search you want to get"
// @Param is_draft query string false "draft wished"
// @Success 200 {data} models.data
// @router /search/:search [get]
func (o *DataController) Search() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.DATA_RESOURCE))
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(data_collection, user, peerID, groups, nil).Search(nil, search, isDraft == "true")
o.ServeJSON()
}
@ -65,8 +76,9 @@ func (o *DataController) Search() {
// @Success 200 {data} models.data
// @router /:id [get]
func (o *DataController) Get() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.DATA_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(data_collection, user, peerID, groups, nil).LoadOne(id)
o.ServeJSON()
}
@ -76,7 +88,8 @@ func (o *DataController) Get() {
// @Success 200 {data} delete success!
// @router /:id [delete]
func (o *DataController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.DATA_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(data_collection, user, peerID, groups, nil).DeleteOne(id)
o.ServeJSON()
}

183
controllers/enum.go Executable file
View File

@ -0,0 +1,183 @@
package controllers
import (
"cloud.o-forge.io/core/oc-lib/models/common/enum"
"cloud.o-forge.io/core/oc-lib/models/common/pricing"
"cloud.o-forge.io/core/oc-lib/models/resources"
"cloud.o-forge.io/core/oc-lib/tools"
beego "github.com/beego/beego/v2/server/web"
)
// Operations about resource
type EnumController struct {
beego.Controller
}
// @Title EnumStorageType
// @Description get list of StorageType
// @Success 200 {resource} models.resource
// @router /storage/type [get]
func (o *EnumController) EnumStorageType() {
enumMap := map[int]string{}
for _, d := range enum.TypeList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStorageSize
// @Description get list of StorageSize
// @Success 200 {resource} models.resource
// @router /storage/size [get]
func (o *EnumController) EnumStorageSize() {
enumMap := map[int]string{}
for _, d := range enum.SizeList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumInfrastructure
// @Description get list of Infrastructure
// @Success 200 {resource} models.resource
// @router /infrastructure [get]
func (o *EnumController) EnumInfrastructure() {
enumMap := map[int]string{}
for _, d := range enum.InfrastructureList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title BookingStatus
// @Description get list of Infrastructure
// @Success 200 {resource} models.resource
// @router /booking/status [get]
func (o *EnumController) EnumBookingStatus() {
enumMap := map[int]string{}
for _, d := range enum.StatusList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStatus
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /status [get]
func (o *EnumController) EnumStatus() {
enumMap := map[int]string{}
for _, d := range enum.StatusList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStrategyBuy
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/strategy/buy [get]
func (o *EnumController) EnumStrategyBuy() {
enumMap := map[int]string{}
for _, d := range pricing.BuyingStrategyList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStrategyTime
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/strategy/time [get]
func (o *EnumController) EnumStrategyTime() {
enumMap := map[int]string{}
for _, d := range pricing.TimePricingStrategyList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStrategyPrivilege
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/strategy/privilege [get]
func (o *EnumController) EnumStrategyPrivilege() {
enumMap := map[int]string{}
for _, d := range pricing.ExploitPrivilegeStrategyList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumRefundType
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/refund/type [get]
func (o *EnumController) EnumRefundType() {
enumMap := map[int]string{}
for _, d := range pricing.RefundTypeList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStrategyPrivilegeStorage
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/strategy/privilege/storage [get]
func (o *EnumController) EnumStrategyPrivilegeStorage() {
enumMap := map[int]string{}
for _, d := range resources.PrivilegeStoragePricingStrategyList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStrategyStorage
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/strategy/storage [get]
func (o *EnumController) EnumStrategyStorage() {
enumMap := map[int]string{}
for _, d := range resources.StorageResourcePricingStrategyList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumStrategyData
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /pricing/strategy/data [get]
func (o *EnumController) EnumStrategyData() {
enumMap := map[int]string{}
for _, d := range resources.DataResourcePricingStrategyList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}
// @Title EnumResourceType
// @Description get list of status
// @Success 200 {resource} models.resource
// @router /resource/type [get]
func (o *EnumController) EnumResourceType() {
enumMap := map[int]string{}
for _, d := range tools.DataTypeList() {
enumMap[int(d)] = d.String()
}
o.Data["json"] = map[string]interface{}{"data": enumMap, "code": 200, "error": ""}
o.ServeJSON()
}

24
controllers/processing.go Normal file → Executable file
View File

@ -12,6 +12,8 @@ type ProcessingController struct {
beego.Controller
}
var processing_collection = oclib.LibDataEnum(oclib.PROCESSING_RESOURCE)
// @Title Update
// @Description create processings
// @Param id path string true "the processing id you want to get"
@ -20,10 +22,11 @@ type ProcessingController struct {
// @router /:id [put]
func (o *ProcessingController) Put() {
// store and return Id or post with UUID
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), res, id)
o.Data["json"] = oclib.NewRequest(processing_collection, user, peerID, groups, nil).UpdateOne(res, id)
o.ServeJSON()
}
@ -33,29 +36,36 @@ func (o *ProcessingController) Put() {
// @Success 200 {processing} models.processing
// @router / [post]
func (o *ProcessingController) Post() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), res)
o.Data["json"] = oclib.NewRequest(processing_collection, user, peerID, groups, nil).StoreOne(res)
o.ServeJSON()
}
// @Title GetAll
// @Description find processing by id
// @Param is_draft query string false "draft wished"
// @Success 200 {processing} models.processing
// @router / [get]
func (o *ProcessingController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.PROCESSING_RESOURCE))
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(processing_collection, user, peerID, groups, nil).LoadAll(isDraft == "true")
o.ServeJSON()
}
// @Title Get
// @Description find processing by key word
// @Param search path string true "the search you want to get"
// @Param is_draft query string false "draft wished"
// @Success 200 {processing} models.processing
// @router /search/:search [get]
func (o *ProcessingController) Search() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.PROCESSING_RESOURCE))
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(processing_collection, user, peerID, groups, nil).Search(nil, search, isDraft == "true")
o.ServeJSON()
}
@ -65,8 +75,9 @@ func (o *ProcessingController) Search() {
// @Success 200 {processing} models.processing
// @router /:id [get]
func (o *ProcessingController) Get() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(processing_collection, user, peerID, groups, nil).LoadOne(id)
o.ServeJSON()
}
@ -76,7 +87,8 @@ func (o *ProcessingController) Get() {
// @Success 200 {processing} delete success!
// @router /:id [delete]
func (o *ProcessingController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.PROCESSING_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(processing_collection, user, peerID, groups, nil).DeleteOne(id)
o.ServeJSON()
}

48
controllers/resource.go Normal file → Executable file
View File

@ -1,6 +1,8 @@
package controllers
import (
"fmt"
oclib "cloud.o-forge.io/core/oc-lib"
beego "github.com/beego/beego/v2/server/web"
)
@ -12,17 +14,17 @@ type ResourceController struct {
// @Title GetAll
// @Description find resource by id
// @Param is_draft query string false "draft wished"
// @Success 200 {resource} models.resource
// @router / [get]
func (o *ResourceController) GetAll() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
results := map[string]interface{}{}
isDraft := o.Ctx.Input.Query("is_draft")
for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
d := oclib.LoadAll(resource)
data_collection, comp_collection, storage_collection,
processing_collection, workflow_collection} {
d := oclib.NewRequest(resource, user, peerID, groups, nil).LoadAll(isDraft == "true")
if d.Code != 200 || len(d.Data) == 0 {
results[resource.String()] = []interface{}{}
} else {
@ -36,18 +38,19 @@ func (o *ResourceController) GetAll() {
// @Title Get
// @Description find resource by key word
// @Param search path string true "the search you want to get"
// @Param is_draft query string false "draft wished"
// @Success 200 {resource} models.resource
// @router /search/:search [get]
func (o *ResourceController) Search() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
search := o.Ctx.Input.Param(":search")
isDraft := o.Ctx.Input.Query("is_draft")
results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
d := oclib.Search(nil, search, resource)
data_collection, comp_collection, storage_collection,
processing_collection, workflow_collection} {
fmt.Println("search", search)
d := oclib.NewRequest(resource, user, peerID, groups, nil).Search(nil, search, isDraft == "true")
if d.Code != 200 || len(d.Data) == 0 {
results[resource.String()] = []interface{}{}
} else {
@ -64,15 +67,13 @@ func (o *ResourceController) Search() {
// @Success 200 {resource} models.resource
// @router /:id [get]
func (o *ResourceController) Get() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
d := oclib.LoadOne(resource, id)
data_collection, comp_collection, storage_collection,
processing_collection, workflow_collection} {
d := oclib.NewRequest(resource, user, peerID, groups, nil).LoadOne(id)
if d.Code != 200 {
results[resource.String()] = nil
} else {
@ -89,15 +90,14 @@ func (o *ResourceController) Get() {
// @Success 200 {resource} delete success!
// @router /:id [delete]
func (o *ResourceController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
results := map[string]interface{}{}
for _, resource := range []oclib.LibDataEnum{
oclib.LibDataEnum(oclib.DATA_RESOURCE),
oclib.LibDataEnum(oclib.COMPUTE_RESOURCE),
oclib.LibDataEnum(oclib.STORAGE_RESOURCE),
oclib.LibDataEnum(oclib.PROCESSING_RESOURCE),
oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)} {
d := oclib.DeleteOne(resource, id)
data_collection, comp_collection, storage_collection,
processing_collection, workflow_collection,
} {
d := oclib.NewRequest(resource, user, peerID, groups, nil).DeleteOne(id)
if d.Code != 200 {
results[resource.String()] = nil
} else {

44
controllers/storage.go Normal file → Executable file
View File

@ -12,6 +12,8 @@ type StorageController struct {
beego.Controller
}
var storage_collection = oclib.LibDataEnum(oclib.STORAGE_RESOURCE)
// @Title Update
// @Description create storages
// @Param id path string true "the storage id you want to get"
@ -20,21 +22,11 @@ type StorageController struct {
// @router /:id [put]
func (o *StorageController) Put() {
// store and return Id or post with UUID
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.STORAGE_RESOURCE), res, id)
o.ServeJSON()
}
// @Title Get
// @Description find storage by key word
// @Param search path string true "the search you want to get"
// @Success 200 {storage} models.storage
// @router /search/:search [get]
func (o *StorageController) Search() {
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.STORAGE_RESOURCE))
o.Data["json"] = oclib.NewRequest(storage_collection, user, peerID, groups, nil).UpdateOne(res, id)
o.ServeJSON()
}
@ -44,18 +36,36 @@ func (o *StorageController) Search() {
// @Success 200 {storage} models.storage
// @router / [post]
func (o *StorageController) Post() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.STORAGE_RESOURCE), res)
o.Data["json"] = oclib.NewRequest(storage_collection, user, peerID, groups, nil).StoreOne(res)
o.ServeJSON()
}
// @Title GetAll
// @Description find storage by id
// @Param is_draft query string false "draft wished"
// @Success 200 {storage} models.storage
// @router / [get]
func (o *StorageController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.STORAGE_RESOURCE))
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(storage_collection, user, peerID, groups, nil).LoadAll(isDraft == "true")
o.ServeJSON()
}
// @Title Get
// @Description find storage by key word
// @Param search path string true "the search you want to get"
// @Param is_draft query string false "draft wished"
// @Success 200 {storage} models.storage
// @router /search/:search [get]
func (o *StorageController) Search() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
search := o.Ctx.Input.Param(":search")
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(storage_collection, user, peerID, groups, nil).Search(nil, search, isDraft == "true")
o.ServeJSON()
}
@ -65,8 +75,9 @@ func (o *StorageController) GetAll() {
// @Success 200 {storage} models.storage
// @router /:id [get]
func (o *StorageController) Get() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.STORAGE_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(storage_collection, user, peerID, groups, nil).LoadOne(id)
o.ServeJSON()
}
@ -76,7 +87,8 @@ func (o *StorageController) Get() {
// @Success 200 {storage} delete success!
// @router /:id [delete]
func (o *StorageController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.STORAGE_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(storage_collection, user, peerID, groups, nil).DeleteOne(id)
o.ServeJSON()
}

0
controllers/version.go Normal file → Executable file
View File

44
controllers/workflow.go Normal file → Executable file
View File

@ -12,6 +12,8 @@ type WorkflowController struct {
beego.Controller
}
var workflow_collection = oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE)
// @Title Update
// @Description create workflows
// @Param id path string true "the workflow id you want to get"
@ -20,21 +22,11 @@ type WorkflowController struct {
// @router /:id [put]
func (o *WorkflowController) Put() {
// store and return Id or post with UUID
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
id := o.Ctx.Input.Param(":id")
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.UpdateOne(oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE), res, id)
o.ServeJSON()
}
// @Title Get
// @Description find workflow by key word
// @Param search path string true "the search you want to get"
// @Success 200 {workflow} models.workflow
// @router /search/:search [get]
func (o *WorkflowController) Search() {
search := o.Ctx.Input.Param(":search")
o.Data["json"] = oclib.Search(nil, search, oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE))
o.Data["json"] = oclib.NewRequest(workflow_collection, user, peerID, groups, nil).UpdateOne(res, id)
o.ServeJSON()
}
@ -44,18 +36,36 @@ func (o *WorkflowController) Search() {
// @Success 200 {workflow} models.workflow
// @router / [post]
func (o *WorkflowController) Post() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
var res map[string]interface{}
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res)
o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE), res)
o.Data["json"] = oclib.NewRequest(workflow_collection, user, peerID, groups, nil).StoreOne(res)
o.ServeJSON()
}
// @Title GetAll
// @Description find workflow by id
// @Param is_draft query string false "draft wished"
// @Success 200 {workflow} models.workflow
// @router / [get]
func (o *WorkflowController) GetAll() {
o.Data["json"] = oclib.LoadAll(oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE))
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(workflow_collection, user, peerID, groups, nil).LoadAll(isDraft == "true")
o.ServeJSON()
}
// @Title Get
// @Description find workflow by key word
// @Param search path string true "the search you want to get"
// @Param is_draft query string false "draft wished"
// @Success 200 {workflow} models.workflow
// @router /search/:search [get]
func (o *WorkflowController) Search() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
search := o.Ctx.Input.Param(":search")
isDraft := o.Ctx.Input.Query("is_draft")
o.Data["json"] = oclib.NewRequest(workflow_collection, user, peerID, groups, nil).Search(nil, search, isDraft == "true")
o.ServeJSON()
}
@ -65,8 +75,9 @@ func (o *WorkflowController) GetAll() {
// @Success 200 {workflow} models.workflow
// @router /:id [get]
func (o *WorkflowController) Get() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.LoadOne(oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(workflow_collection, user, peerID, groups, nil).LoadOne(id)
o.ServeJSON()
}
@ -76,7 +87,8 @@ func (o *WorkflowController) Get() {
// @Success 200 {workflow} delete success!
// @router /:id [delete]
func (o *WorkflowController) Delete() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
id := o.Ctx.Input.Param(":id")
o.Data["json"] = oclib.DeleteOne(oclib.LibDataEnum(oclib.WORKFLOW_RESOURCE), id)
o.Data["json"] = oclib.NewRequest(workflow_collection, user, peerID, groups, nil).DeleteOne(id)
o.ServeJSON()
}

0
demo.json Normal file → Executable file
View File

0
docker-compose.base.yml Normal file → Executable file
View File

0
docker-compose.yml Normal file → Executable file
View File

0
docker_catalog.json Normal file → Executable file
View File

33
go.mod
View File

@ -5,19 +5,20 @@ go 1.22.0
toolchain go1.22.4
require (
cloud.o-forge.io/core/oc-lib v0.0.0-20250110163958-fd1c579ec418
github.com/beego/beego/v2 v2.3.1
cloud.o-forge.io/core/oc-lib v0.0.0-20250205160221-88b7cfe2fd0f
github.com/beego/beego/v2 v2.3.4
github.com/smartystreets/goconvey v1.7.2
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/biter777/countries v1.7.5 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/gabriel-vasile/mimetype v1.4.6 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.1 // indirect
github.com/go-playground/validator/v10 v10.24.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
@ -27,20 +28,20 @@ require (
github.com/klauspost/compress v1.17.11 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nats-io/nats.go v1.37.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nats.go v1.38.0 // indirect
github.com/nats-io/nkeys v0.4.9 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/robfig/cron v1.2.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 // indirect
@ -49,12 +50,12 @@ require (
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect
go.mongodb.org/mongo-driver v1.17.2 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

69
go.sum
View File

@ -1,10 +1,12 @@
cloud.o-forge.io/core/oc-lib v0.0.0-20250110163958-fd1c579ec418 h1:24nc5qA6AkV6pIbJJeRASeUZmWuGkl+FO/r2oXazJ8w=
cloud.o-forge.io/core/oc-lib v0.0.0-20250110163958-fd1c579ec418/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
cloud.o-forge.io/core/oc-lib v0.0.0-20250205160221-88b7cfe2fd0f h1:6V+Z81ywYoDYSVMnM4PVaJYXFgCN3xSG3ddiUPn4jL8=
cloud.o-forge.io/core/oc-lib v0.0.0-20250205160221-88b7cfe2fd0f/go.mod h1:2roQbUpv3a6mTIr5oU1ux31WbN8YucyyQvCQ0FqwbcE=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/beego/beego/v2 v2.3.1 h1:7MUKMpJYzOXtCUsTEoXOxsDV/UcHw6CPbaWMlthVNsc=
github.com/beego/beego/v2 v2.3.1/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4=
github.com/beego/beego/v2 v2.3.4 h1:HurQEOGIEhLlPFCTR6ZDuQkybrUl2Ag2i6CdVD2rGiI=
github.com/beego/beego/v2 v2.3.4/go.mod h1:5cqHsOHJIxkq44tBpRvtDe59GuVRVv/9/tyVDxd5ce4=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/biter777/countries v1.7.5 h1:MJ+n3+rSxWQdqVJU8eBy9RqcdH6ePPn4PJHocVWUa+Q=
github.com/biter777/countries v1.7.5/go.mod h1:1HSpZ526mYqKJcpT5Ti1kcGQ0L0SrXWIaptUWjFfv2E=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
@ -19,16 +21,16 @@ github.com/elazarl/go-bindata-assetfs v1.0.1 h1:m0kkaHRKEu7tUIUFVwhGGGYClXvyl4RE
github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/etcd-io/etcd v3.3.17+incompatible/go.mod h1:cdZ77EstHBwVtD6iTgzgvogwcjo9m4iOqoijouPJ4bs=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc=
github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc=
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-playground/validator/v10 v10.24.0 h1:KHQckvo8G6hlWnrPX4NJJ+aBfWNAE/HH+qdL2cBpCmg=
github.com/go-playground/validator/v10 v10.24.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@ -58,8 +60,9 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
@ -75,10 +78,10 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/nats-io/nats.go v1.37.0 h1:07rauXbVnnJvv1gfIyghFEo6lUcYRY0WXc3x7x0vUxE=
github.com/nats-io/nats.go v1.37.0/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=
github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc=
github.com/nats-io/nats.go v1.38.0 h1:A7P+g7Wjp4/NWqDOOP/K6hfhr54DvdDQUznt5JFg9XA=
github.com/nats-io/nats.go v1.38.0/go.mod h1:IGUM++TwokGnXPs82/wCuiHS02/aKrdYUQkU8If6yjw=
github.com/nats-io/nkeys v0.4.9 h1:qe9Faq2Gxwi6RZnZMXfmGMZkg3afLLOtrU+gDZJ35b0=
github.com/nats-io/nkeys v0.4.9/go.mod h1:jcMqs+FLG+W5YO36OX6wFIFcmpdAns+w1Wm6D3I/evE=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/ogier/pflag v0.0.1/go.mod h1:zkFki7tvTa0tafRvTBIZTvzYyAu6kQhPZFnshFFPE+g=
@ -91,12 +94,12 @@ github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
@ -113,8 +116,8 @@ github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hg
github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
@ -124,25 +127,25 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM=
go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -153,23 +156,23 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU=
google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0
main.go Normal file → Executable file
View File

179
routers/commentsRouter.go Normal file → Executable file
View File

@ -7,6 +7,60 @@ import (
func init() {
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "Post",
Router: `/`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "GetAll",
Router: `/`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "Put",
Router: `/:id`,
AllowHTTPMethods: []string{"put"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "Get",
Router: `/:id`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "Delete",
Router: `/:id`,
AllowHTTPMethods: []string{"delete"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "Search",
Router: `/search/:search`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:DataController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:DataController"],
beego.ControllerComments{
Method: "Post",
@ -61,55 +115,118 @@ func init() {
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "Post",
Router: `/`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "GetAll",
Router: `/`,
Method: "EnumBookingStatus",
Router: `/booking/status`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "Put",
Router: `/:id`,
AllowHTTPMethods: []string{"put"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.ControllerComments{
Method: "Get",
Router: `/:id`,
Method: "EnumInfrastructure",
Router: `/infrastructure`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "Delete",
Router: `/:id`,
AllowHTTPMethods: []string{"delete"},
Method: "EnumRefundType",
Router: `/pricing/refund/type`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:ComputeController"],
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "Search",
Router: `/search/:search`,
Method: "EnumStrategyBuy",
Router: `/pricing/strategy/buy`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStrategyData",
Router: `/pricing/strategy/data`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStrategyPrivilege",
Router: `/pricing/strategy/privilege`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStrategyPrivilegeStorage",
Router: `/pricing/strategy/privilege/storage`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStrategyStorage",
Router: `/pricing/strategy/storage`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStrategyTime",
Router: `/pricing/strategy/time`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumResourceType",
Router: `/resource/type`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStatus",
Router: `/status`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStorageSize",
Router: `/storage/size`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"] = append(beego.GlobalControllerRouter["oc-catalog/controllers:EnumController"],
beego.ControllerComments{
Method: "EnumStorageType",
Router: `/storage/type`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,

5
routers/router.go Normal file → Executable file
View File

@ -45,6 +45,11 @@ func init() {
&controllers.WorkflowController{},
),
),
beego.NSNamespace("/enum",
beego.NSInclude(
&controllers.EnumController{},
),
),
beego.NSNamespace("/version",
beego.NSInclude(
&controllers.VersionController{},

0
swagger/favicon-16x16.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

0
swagger/favicon-32x32.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

0
swagger/index.html Normal file → Executable file
View File

0
swagger/oauth2-redirect.html Normal file → Executable file
View File

0
swagger/swagger-ui-bundle.js Normal file → Executable file
View File

0
swagger/swagger-ui-bundle.js.map Normal file → Executable file
View File

0
swagger/swagger-ui-es-bundle-core.js Normal file → Executable file
View File

0
swagger/swagger-ui-es-bundle.js Normal file → Executable file
View File

0
swagger/swagger-ui-standalone-preset.js Normal file → Executable file
View File

0
swagger/swagger-ui-standalone-preset.js.map Normal file → Executable file
View File

0
swagger/swagger-ui.css Normal file → Executable file
View File

0
swagger/swagger-ui.css.map Normal file → Executable file
View File

0
swagger/swagger-ui.js Normal file → Executable file
View File

0
swagger/swagger-ui.js.map Normal file → Executable file
View File

529
swagger/swagger.json Normal file → Executable file
View File

@ -15,140 +15,6 @@
},
"basePath": "/oc/",
"paths": {
"/data/": {
"get": {
"tags": [
"data"
],
"description": "find data by id\n\u003cbr\u003e",
"operationId": "DataController.GetAll",
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"post": {
"tags": [
"data"
],
"description": "create data\n\u003cbr\u003e",
"operationId": "DataController.Create",
"parameters": [
{
"in": "body",
"name": "data",
"description": "body for data content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
}
},
"/data/search/{search}": {
"get": {
"tags": [
"data"
],
"description": "find data by key word\n\u003cbr\u003e",
"operationId": "DataController.Get",
"parameters": [
{
"in": "path",
"name": "search",
"description": "the search you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
}
},
"/data/{id}": {
"get": {
"tags": [
"data"
],
"description": "find data by id\n\u003cbr\u003e",
"operationId": "DataController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"put": {
"tags": [
"data"
],
"description": "create datas\n\u003cbr\u003e",
"operationId": "DataController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the data id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The data content",
"required": true,
"schema": {
"$ref": "#/definitions/models.data"
}
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"delete": {
"tags": [
"data"
],
"description": "delete the data\n\u003cbr\u003e",
"operationId": "DataController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} delete success!"
}
}
}
},
"/compute/": {
"get": {
"tags": [
@ -156,6 +22,14 @@
],
"description": "find compute by id\n\u003cbr\u003e",
"operationId": "ComputeController.GetAll",
"parameters": [
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
"200": {
"description": "{compute} models.compute"
@ -200,6 +74,12 @@
"description": "the search you want to get",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
@ -283,6 +163,319 @@
}
}
},
"/data/": {
"get": {
"tags": [
"data"
],
"description": "find data by id\n\u003cbr\u003e",
"operationId": "DataController.GetAll",
"parameters": [
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"post": {
"tags": [
"data"
],
"description": "create data\n\u003cbr\u003e",
"operationId": "DataController.Create",
"parameters": [
{
"in": "body",
"name": "data",
"description": "body for data content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
}
},
"/data/search/{search}": {
"get": {
"tags": [
"data"
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
}
},
"/data/{id}": {
"get": {
"tags": [
"data"
],
"description": "find data by id\n\u003cbr\u003e",
"operationId": "DataController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"put": {
"tags": [
"data"
],
"description": "create datas\n\u003cbr\u003e",
"operationId": "DataController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the data id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The data content",
"required": true,
"schema": {
"$ref": "#/definitions/models.data"
}
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"delete": {
"tags": [
"data"
],
"description": "delete the data\n\u003cbr\u003e",
"operationId": "DataController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} delete success!"
}
}
}
},
"/enum/booking/status": {
"get": {
"tags": [
"enum"
],
"description": "get list of Infrastructure\n\u003cbr\u003e",
"operationId": "EnumController.BookingStatus",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/infrastructure": {
"get": {
"tags": [
"enum"
],
"description": "get list of Infrastructure\n\u003cbr\u003e",
"operationId": "EnumController.EnumInfrastructure",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/refund/type": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumRefundType",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/strategy/buy": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStrategyBuy",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/strategy/data": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStrategyData",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/strategy/privilege": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStrategyPrivilege",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/strategy/privilege/storage": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStrategyPrivilegeStorage",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/strategy/storage": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStrategyStorage",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/pricing/strategy/time": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStrategyTime",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/resource/type": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumResourceType",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/status": {
"get": {
"tags": [
"enum"
],
"description": "get list of status\n\u003cbr\u003e",
"operationId": "EnumController.EnumStatus",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/storage/size": {
"get": {
"tags": [
"enum"
],
"description": "get list of StorageSize\n\u003cbr\u003e",
"operationId": "EnumController.EnumStorageSize",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/enum/storage/type": {
"get": {
"tags": [
"enum"
],
"description": "get list of StorageType\n\u003cbr\u003e",
"operationId": "EnumController.EnumStorageType",
"responses": {
"200": {
"description": "{resource} models.resource"
}
}
}
},
"/processing/": {
"get": {
"tags": [
@ -290,6 +483,14 @@
],
"description": "find processing by id\n\u003cbr\u003e",
"operationId": "ProcessingController.GetAll",
"parameters": [
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
"200": {
"description": "{processing} models.processing"
@ -334,6 +535,12 @@
"description": "the search you want to get",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
@ -424,6 +631,14 @@
],
"description": "find resource by id\n\u003cbr\u003e",
"operationId": "ResourceController.GetAll",
"parameters": [
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
"200": {
"description": "{resource} models.resource"
@ -445,6 +660,12 @@
"description": "the search you want to get",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
@ -505,6 +726,14 @@
],
"description": "find storage by id\n\u003cbr\u003e",
"operationId": "StorageController.GetAll",
"parameters": [
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
"200": {
"description": "{storage} models.storage"
@ -549,6 +778,12 @@
"description": "the search you want to get",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
@ -667,6 +902,14 @@
],
"description": "find workflow by id\n\u003cbr\u003e",
"operationId": "WorkflowController.GetAll",
"parameters": [
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
"200": {
"description": "{workflow} models.workflow"
@ -711,6 +954,12 @@
"description": "the search you want to get",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "is_draft",
"description": "draft wished",
"type": "string"
}
],
"responses": {
@ -800,14 +1049,14 @@
"title": "json",
"type": "object"
},
"models.data": {
"title": "data",
"type": "object"
},
"models.compute": {
"title": "compute",
"type": "object"
},
"models.data": {
"title": "data",
"type": "object"
},
"models.processing": {
"title": "processing",
"type": "object"
@ -846,6 +1095,10 @@
"name": "workflow",
"description": "Operations about workflow\n"
},
{
"name": "enum",
"description": "Operations about resource\n"
},
{
"name": "version",
"description": "VersionController operations for Version\n"

392
swagger/swagger.yml Normal file → Executable file
View File

@ -12,106 +12,6 @@ info:
url: https://www.gnu.org/licenses/agpl-3.0.html
basePath: /oc/
paths:
/data/:
get:
tags:
- data
description: |-
find data by id
<br>
operationId: DataController.GetAll
responses:
"200":
description: '{data} models.data'
post:
tags:
- data
description: |-
create data
<br>
operationId: DataController.Create
parameters:
- in: body
name: data
description: body for data content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{data} models.data'
/data/{id}:
get:
tags:
- data
description: |-
find data by id
<br>
operationId: DataController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{data} models.data'
put:
tags:
- data
description: |-
create datas
<br>
operationId: DataController.Update
parameters:
- in: path
name: id
description: the data id you want to get
required: true
type: string
- in: body
name: body
description: The data content
required: true
schema:
$ref: '#/definitions/models.data'
responses:
"200":
description: '{data} models.data'
delete:
tags:
- data
description: |-
delete the data
<br>
operationId: DataController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{data} delete success!'
/data/search/{search}:
get:
tags:
- data
description: |-
find data by key word
<br>
operationId: DataController.Get
parameters:
- in: path
name: search
description: the search you want to get
required: true
type: string
responses:
"200":
description: '{data} models.data'
/compute/:
get:
tags:
@ -120,6 +20,11 @@ paths:
find compute by id
<br>
operationId: ComputeController.GetAll
parameters:
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{compute} models.compute'
@ -209,9 +114,251 @@ paths:
description: the search you want to get
required: true
type: string
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{compute} models.compute'
/data/:
get:
tags:
- data
description: |-
find data by id
<br>
operationId: DataController.GetAll
parameters:
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{data} models.data'
post:
tags:
- data
description: |-
create data
<br>
operationId: DataController.Create
parameters:
- in: body
name: data
description: body for data content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{data} models.data'
/data/{id}:
get:
tags:
- data
description: |-
find data by id
<br>
operationId: DataController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{data} models.data'
put:
tags:
- data
description: |-
create datas
<br>
operationId: DataController.Update
parameters:
- in: path
name: id
description: the data id you want to get
required: true
type: string
- in: body
name: body
description: The data content
required: true
schema:
$ref: '#/definitions/models.data'
responses:
"200":
description: '{data} models.data'
delete:
tags:
- data
description: |-
delete the data
<br>
operationId: DataController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{data} delete success!'
/data/search/{search}:
get:
tags:
- data
responses:
"200":
description: '{data} models.data'
/enum/booking/status:
get:
tags:
- enum
description: |-
get list of Infrastructure
<br>
operationId: EnumController.BookingStatus
responses:
"200":
description: '{resource} models.resource'
/enum/infrastructure:
get:
tags:
- enum
description: |-
get list of Infrastructure
<br>
operationId: EnumController.EnumInfrastructure
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/refund/type:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumRefundType
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/strategy/buy:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStrategyBuy
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/strategy/data:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStrategyData
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/strategy/privilege:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStrategyPrivilege
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/strategy/privilege/storage:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStrategyPrivilegeStorage
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/strategy/storage:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStrategyStorage
responses:
"200":
description: '{resource} models.resource'
/enum/pricing/strategy/time:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStrategyTime
responses:
"200":
description: '{resource} models.resource'
/enum/resource/type:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumResourceType
responses:
"200":
description: '{resource} models.resource'
/enum/status:
get:
tags:
- enum
description: |-
get list of status
<br>
operationId: EnumController.EnumStatus
responses:
"200":
description: '{resource} models.resource'
/enum/storage/size:
get:
tags:
- enum
description: |-
get list of StorageSize
<br>
operationId: EnumController.EnumStorageSize
responses:
"200":
description: '{resource} models.resource'
/enum/storage/type:
get:
tags:
- enum
description: |-
get list of StorageType
<br>
operationId: EnumController.EnumStorageType
responses:
"200":
description: '{resource} models.resource'
/processing/:
get:
tags:
@ -220,6 +367,11 @@ paths:
find processing by id
<br>
operationId: ProcessingController.GetAll
parameters:
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{processing} models.processing'
@ -309,6 +461,10 @@ paths:
description: the search you want to get
required: true
type: string
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{processing} models.processing'
@ -320,6 +476,11 @@ paths:
find resource by id
<br>
operationId: ResourceController.GetAll
parameters:
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{resource} models.resource'
@ -370,6 +531,10 @@ paths:
description: the search you want to get
required: true
type: string
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{resource} models.resource'
@ -381,6 +546,11 @@ paths:
find storage by id
<br>
operationId: StorageController.GetAll
parameters:
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{storage} models.storage'
@ -470,6 +640,10 @@ paths:
description: the search you want to get
required: true
type: string
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{storage} models.storage'
@ -503,6 +677,11 @@ paths:
find workflow by id
<br>
operationId: WorkflowController.GetAll
parameters:
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{workflow} models.workflow'
@ -592,6 +771,10 @@ paths:
description: the search you want to get
required: true
type: string
- in: query
name: is_draft
description: draft wished
type: string
responses:
"200":
description: '{workflow} models.workflow'
@ -599,12 +782,12 @@ definitions:
json:
title: json
type: object
models.data:
title: data
type: object
models.compute:
title: compute
type: object
models.data:
title: data
type: object
models.processing:
title: processing
type: object
@ -633,6 +816,9 @@ tags:
- name: workflow
description: |
Operations about workflow
- name: enum
description: |
Operations about resource
- name: version
description: |
VersionController operations for Version

0
tests/default_test.go Normal file → Executable file
View File