working import

This commit is contained in:
mr
2026-03-17 14:41:22 +01:00
parent 80bb9ffbed
commit 814df7bd13
14 changed files with 582 additions and 278 deletions

View File

@@ -102,6 +102,26 @@ func (o *StorageController) Get() {
o.ServeJSON()
}
// @Title PostPlantUML
// @Description parse plantuml text and return the formed storage resources
// @Param body body string true "PlantUML text content"
// @Success 200 {storage} models.storage
// @Failure 406 {string} string "Bad request"
// @router /plantuml [post]
func (o *StorageController) PostPlantUML() {
user, peerID, groups := oclib.ExtractTokenInfo(*o.Ctx.Request)
body := o.Ctx.Input.CopyBody(1000000)
req := &tools.APIRequest{Username: user, PeerID: peerID, Groups: groups}
wf, err := parsePlantUMLText(body, req)
if err != nil {
o.Data["json"] = map[string]interface{}{"data": nil, "code": 406, "error": err.Error()}
o.ServeJSON()
return
}
o.Data["json"] = map[string]interface{}{"data": wf.StorageResources, "code": 200, "error": nil}
o.ServeJSON()
}
// @Title Delete
// @Description delete the storage
// @Param id path string true "The id you want to delete"