From c0cdb3f7abccc2c2fe2084ce34e0ff3d8d7989f2 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Fri, 17 Mar 2023 04:16:51 +0300 Subject: [PATCH] working personal properties --- .gitattributes | 3 + .../personalPropsRoute/personalPropsRoute.go | 13 +- main.go | 58 ++++++++- resources/EspySansRegular.ttf | 3 + resources/GnuUnifontFull-Pm9P.ttf | 3 + resources/JoganSoft-rgwKy.otf | 3 + resources/Pixel Sans Serif Condensed.ttf | 3 + resources/Pixel Sans Serif.ttf | 3 + resources/SummerPixel22Regular.ttf | 3 + resources/application.js | 5 + .../personal-properies.css | 3 + .../personal-properties.js | 37 ++++++ resources/base.css | 114 +++++++++++++++--- resources/base.html | 4 +- resources/basic-window.html | 17 +++ ...oto-placeholder-profile-picture-vector.jpg | 3 + resources/personal-properties-prop.html | 3 +- resources/personal-properties.html | 35 +++--- resources/personal-properties.js | 5 - resources/wde.js | 74 ++++++++++-- resources/wdeUI.css | 24 ++++ routewde/wde.go | 13 ++ websiteapp/personalprops/personalprops.go | 110 +++++++++++++---- websiteapp/websiteapp.go | 42 ++++++- 24 files changed, 497 insertions(+), 84 deletions(-) create mode 100644 resources/EspySansRegular.ttf create mode 100644 resources/GnuUnifontFull-Pm9P.ttf create mode 100644 resources/JoganSoft-rgwKy.otf create mode 100644 resources/Pixel Sans Serif Condensed.ttf create mode 100644 resources/Pixel Sans Serif.ttf create mode 100644 resources/SummerPixel22Regular.ttf create mode 100644 resources/application.js create mode 100644 resources/applications/personal-properties/personal-properies.css create mode 100644 resources/applications/personal-properties/personal-properties.js create mode 100644 resources/basic-window.html create mode 100644 resources/img/default-avatar-photo-placeholder-profile-picture-vector.jpg delete mode 100644 resources/personal-properties.js create mode 100644 resources/wdeUI.css create mode 100644 routewde/wde.go diff --git a/.gitattributes b/.gitattributes index 24a8e87..2c1a7cc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ *.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.otf filter=lfs diff=lfs merge=lfs -text diff --git a/approutes/personalPropsRoute/personalPropsRoute.go b/approutes/personalPropsRoute/personalPropsRoute.go index 99f8618..38d3ab5 100644 --- a/approutes/personalPropsRoute/personalPropsRoute.go +++ b/approutes/personalPropsRoute/personalPropsRoute.go @@ -1,16 +1,13 @@ package personalpropsroute import ( - "net/http" - "personalwebsite/websiteapp/personalprops" - "github.com/gin-gonic/gin" ) func Route(route *gin.RouterGroup) { - persPropsApp := personalprops.NewPersPropsApp() - route.GET("/test", func(ctx *gin.Context) { - test := persPropsApp.Render() - ctx.HTML(http.StatusOK, "personal-properties.html", gin.H{"books": test}) - }) + + // route.GET("/test", func(ctx *gin.Context) { + // test := persPropsApp.Render() + // ctx.HTML(http.StatusOK, "personal-properties.html", gin.H{"books": test}) + // }) } diff --git a/main.go b/main.go index 8192d61..30f8f82 100644 --- a/main.go +++ b/main.go @@ -4,12 +4,15 @@ import ( "log" "net/http" personalpropsroute "personalwebsite/approutes/personalPropsRoute" + "personalwebsite/routewde" + "personalwebsite/websiteapp" + "personalwebsite/websiteapp/personalprops" "github.com/gin-gonic/gin" ) func main() { - + // hostUrl := "http://192.168.88.10:8080/" router := gin.New() // router.Use(rateLimit, gin.Recovery()) router.LoadHTMLGlob("resources/*.html") @@ -20,10 +23,61 @@ func main() { router.GET("/getmockapp", func(ctx *gin.Context) { }) - apps := router.Group("applications") + persPropsApp := personalprops.NewPersPropsApp() + appsStorage := websiteapp.ApplicationsStorage{ + Apps: map[string]websiteapp.WebDEApplication{}, + } + appsStorage.Apps["personal-properties"] = &persPropsApp + system := router.Group("system") { + wde := system.Group("wde") + { + routewde.Route(wde) + } + apps := system.Group("applications") + { + apps.GET("/:appid/:method", func(ctx *gin.Context) { + appId := ctx.Param("appid") + method := ctx.Param("method") + + app, isExist := appsStorage.Apps[appId] + if !isExist { + ctx.Status(http.StatusNoContent) + return + } + switch method { + case "getmanifest": + ctx.JSON(http.StatusOK, app.GetManifest()) + case "gethtml": + ctx.HTML(http.StatusOK, appId+".html", nil) + case "app.js": + ctx.File("resources/applications/" + appId + "/" + appId + ".js") + case "app.css": + ctx.File("resources/applications/" + appId + "/" + appId + ".css") + default: + ctx.Status(http.StatusBadRequest) + } + }) + } + + websiteapp.Route(apps.Group("/storage"), &appsStorage) personalpropsroute.Route(apps.Group("/personalproperties")) } + + app := router.Group("application") + { + app.GET("test", func(ctx *gin.Context) { + ctx.Status(http.StatusOK) + }) + persPropApp := app.Group("personal-properties") + { + + persPropApp.GET("getcontent", func(ctx *gin.Context) { + ctx.HTML(http.StatusOK, "personal-properties.html", persPropsApp.Render()) + }) + } + + } // router.GET("/room/:roomid", roomGET) // router.POST("/room-post/:roomid", roomPOST) // router.GET("/stream/:roomid", streamRoom) diff --git a/resources/EspySansRegular.ttf b/resources/EspySansRegular.ttf new file mode 100644 index 0000000..cdae33c --- /dev/null +++ b/resources/EspySansRegular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5803f892c50e2f011082f8cf6382b10cf0bbbdf2139c2a16325b3e4184d7a7a3 +size 27336 diff --git a/resources/GnuUnifontFull-Pm9P.ttf b/resources/GnuUnifontFull-Pm9P.ttf new file mode 100644 index 0000000..796af8e --- /dev/null +++ b/resources/GnuUnifontFull-Pm9P.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aec371ce16b0150c39046a6124d4343e98138f09db297ead27808d6748be5aa +size 14767664 diff --git a/resources/JoganSoft-rgwKy.otf b/resources/JoganSoft-rgwKy.otf new file mode 100644 index 0000000..e7c5c29 --- /dev/null +++ b/resources/JoganSoft-rgwKy.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45ab18a7cab6044707d28a1c3bfe4ea245e69d05c3c846d269418d2a0a4b1fa2 +size 73156 diff --git a/resources/Pixel Sans Serif Condensed.ttf b/resources/Pixel Sans Serif Condensed.ttf new file mode 100644 index 0000000..d7e1d3c --- /dev/null +++ b/resources/Pixel Sans Serif Condensed.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9fe72469851f1f8cbae97a15f72b7ef9d4ac75bbf1d4ed5fcf73d16324560ad +size 37520 diff --git a/resources/Pixel Sans Serif.ttf b/resources/Pixel Sans Serif.ttf new file mode 100644 index 0000000..edcc5bd --- /dev/null +++ b/resources/Pixel Sans Serif.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b852728f63d3c26043c6b029ca79d7bb53eaf5c60039d11bf08b341a3259af8f +size 84972 diff --git a/resources/SummerPixel22Regular.ttf b/resources/SummerPixel22Regular.ttf new file mode 100644 index 0000000..ef64f94 --- /dev/null +++ b/resources/SummerPixel22Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18983f62b349d96a882605a2ab2bc0cb38046096e544fb93e3b157d6c93c5695 +size 52597 diff --git a/resources/application.js b/resources/application.js new file mode 100644 index 0000000..5d1f83e --- /dev/null +++ b/resources/application.js @@ -0,0 +1,5 @@ +export class Application{ + Init(){ + + } +} \ No newline at end of file diff --git a/resources/applications/personal-properties/personal-properies.css b/resources/applications/personal-properties/personal-properies.css new file mode 100644 index 0000000..8efa55f --- /dev/null +++ b/resources/applications/personal-properties/personal-properies.css @@ -0,0 +1,3 @@ +.Pizda{ + background-color: red; +} \ No newline at end of file diff --git a/resources/applications/personal-properties/personal-properties.js b/resources/applications/personal-properties/personal-properties.js new file mode 100644 index 0000000..720c2ff --- /dev/null +++ b/resources/applications/personal-properties/personal-properties.js @@ -0,0 +1,37 @@ + + +class PersonalProperties{ + /** + * @param {HTMLElement} appElem + */ + constructor(appElem){ + this.appElem = appElem + + } + + Init(){ + this.appElem.innerHTML = WebDesktopEnvironment.GetBasicWindow() + + let contentFrame = this.appElem.children[0].children[0].children[1] + fetch("http://192.168.88.10:8080/application/personal-properties/getcontent") //TODO Move to wde func + .then((response) => response.text()) + .then((html) => { + contentFrame.innerHTML = html + }) + .catch((error) => { + WebDesktopEnvironment.Alert(error); + }); + + // var link = document.createElement( "link" ); + // link.href = "http://192.168.88.10:8080/system/applications/personal-properties/app.css" + // link.type = "text/css"; + // link.rel = "stylesheet"; + // link.media = "screen,print"; + // document.getElementsByTagName( "head" )[0].appendChild(link); + + } +} + +document.onload = function (params) { + console.log("pizda") +} \ No newline at end of file diff --git a/resources/base.css b/resources/base.css index ed18c99..bb02687 100644 --- a/resources/base.css +++ b/resources/base.css @@ -1,6 +1,24 @@ +@font-face{ + font-family: "Ubuntu-LI"; + src:url("./GnuUnifontFull-Pm9P.ttf") +} + +*{ + font-family:"Ubuntu-LI"; +} + body{ margin: 0px; + /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ } + +/* @font-face { + font-family: "EspySansRegular"; + src: url("res/EspySansRegular.ttf"); + font-weight: normal; + font-style: normal; +} */ + #WindowsLayer { width: 100%; height: 100%; @@ -40,30 +58,19 @@ body{ display: flex; flex-direction: row; align-items: center; + justify-content: space-between; gap: 5px; padding: 0px; } -.WindowFrameTopBarButton -{ - /* box-sizing: border-box; */ - - width: 11px; - height: 11px; - background: #D9D9D9; - border: 1px solid #222222; - box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), inset 1px 1px 0px rgba(0, 0, 0, 0.25), inset -1px -1px 0px #FFFFFF; - /* Inside auto layout */ - - flex: none; - order: 0; - flex-grow: 0; +.WindowFrameTitle{ + white-space: nowrap } .WindowDragArea{ - background-color: antiquewhite; + /* background-color: antiquewhite; */ width: 100%; height: 100%; /* background: repeating-linear-gradient( @@ -100,25 +107,98 @@ body{ flex-grow: 1; } +.Personal-properties-bio{ + width: 100%; + height: auto; + + /* Auto layout */ + display: flex; + flex-direction: row; + align-items: center; + padding: 0px; + gap:15px; +} + +.Personal-properties-textbio{ + /* width: 100%; + height: auto; */ + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: left; + padding: 0px; + gap:1px; +} + + .Personal-properties-prop{ width: 100%; height: auto; border: 1px solid #888888; - box-shadow: 1px 1px 0px #FFFFFF, inset 2px 2px 0px #FFFFFF; + box-shadow: 1px 1px 0px #FFFFFF, inset 1px 1px 0px #FFFFFF; + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + padding: 0px; + gap:1px; } + + .Personal-properties-prop-header{ /* width: 50px; */ - position: relative; + position:relative; display: inline-block; max-width: 100%; background-color: #DDDDDD; left: 12px; top: -10px; margin-left: 2px; + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + padding: 12px; + gap:10px; /* padding: 10px; */ /* border: 1px solid #888888; */ /* box-shadow: 1px 1px 0px #FFFFFF, inset 2px 2px 0px #FFFFFF; */ +} + +.Personal-properties-prop-content{ + width: 100%; + /* top: 0px; */ + /* Auto layout */ + display: flex; + flex-direction: column; + justify-content: center; + padding: 0px; + gap: 3px; +} + +.Personal-properties-prop-row{ + margin-left: 12px; + margin-right: 12px; + /* Auto layout */ + display: flex; + flex-direction: row; + justify-content: center; + padding: 0px; + gap: 1px; +} +.Personal-properties-prop-key{ + text-align: end; + width: 45%; + white-space: nowrap + /* font-weight: bold; */ +} +.Personal-properties-prop-prop{ + width: 55%; + } \ No newline at end of file diff --git a/resources/base.html b/resources/base.html index d6e4309..e67ee1d 100644 --- a/resources/base.html +++ b/resources/base.html @@ -2,10 +2,12 @@ + + - +
diff --git a/resources/basic-window.html b/resources/basic-window.html new file mode 100644 index 0000000..78d213b --- /dev/null +++ b/resources/basic-window.html @@ -0,0 +1,17 @@ + +
+
+
+ +
+
+ Test Title +
+
+ +
+
+
+
+
+ diff --git a/resources/img/default-avatar-photo-placeholder-profile-picture-vector.jpg b/resources/img/default-avatar-photo-placeholder-profile-picture-vector.jpg new file mode 100644 index 0000000..f2c8795 --- /dev/null +++ b/resources/img/default-avatar-photo-placeholder-profile-picture-vector.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83c2d9b4d2fd4356062e648e6ad6834062fd13e6dafbf23665f3dd5e652a54ed +size 1029 diff --git a/resources/personal-properties-prop.html b/resources/personal-properties-prop.html index 395a3df..d48ccf0 100644 --- a/resources/personal-properties-prop.html +++ b/resources/personal-properties-prop.html @@ -4,4 +4,5 @@

{{ .Author }}


{{ end }} - \ No newline at end of file + + diff --git a/resources/personal-properties.html b/resources/personal-properties.html index 65d55bd..138a686 100644 --- a/resources/personal-properties.html +++ b/resources/personal-properties.html @@ -1,17 +1,20 @@ -
-
-
- -
- -
-
- {{ range $book := .books }} -
-
{{ .Title }}
-
{{ .Author }}
-
- {{ end }} -
+
+ +
+
{{ .Name }}
+
{{ .BasicBio }}
-
\ No newline at end of file +
+ +{{ range $props := .allprops }} +
+
+ {{range $prop := $props}} +
+
{{.Key}}:
+
{{ .Prop }}
+
+ {{ end }} +
+
+{{ end }} diff --git a/resources/personal-properties.js b/resources/personal-properties.js deleted file mode 100644 index 07f38b8..0000000 --- a/resources/personal-properties.js +++ /dev/null @@ -1,5 +0,0 @@ -class PersonalProperties { - constructor(){ - console.log("pprops") - } -} \ No newline at end of file diff --git a/resources/wde.js b/resources/wde.js index 7f25ed6..a4844e5 100644 --- a/resources/wde.js +++ b/resources/wde.js @@ -4,28 +4,77 @@ document.addEventListener('DOMContentLoaded', function() { }, false); class WebDesktopEnvironment{ + constructor(){ this.wc = new WindowsCompositor - fetch("http://localhost:8080/applications/personalproperties/test" /*, options */) + //Get basic window ready frame + fetch("http://192.168.88.10:8080/system/wde/getbasicwindow") //TODO Move to wde func .then((response) => response.text()) .then((html) => { - document.getElementById("WindowsLayer").innerHTML = html; + WebDesktopEnvironment.SetBasicWindow(html) + let app = this.loadApp("personal-properties") }) .catch((error) => { - console.warn(error); + WebDesktopEnvironment.Alert(error); }); + } - // var iDiv = document.createElement('div'); - // iDiv.id = 'NewCoolApp'; - // iDiv.className = 'Application'; - // iDiv.style.width = "100px" - // iDiv.style.height = "100px" - // document.getElementById('WindowsLayer').appendChild(iDiv) - // document.getElementById('WindowsLayer')[0].appendChild(iDiv); + /** + * @param {string} appId + * @returns {Application | undefined} + */ + loadApp(appId){ + let newApp = document.createElement("application") + newApp.setAttribute("id", `application-${appId}`) + let appElem = document.getElementById("WindowsLayer").appendChild(newApp) + + let script = document.createElement("script") + script.setAttribute("src", "http://192.168.88.10:8080/system/applications/personal-properties/app.js") + script.setAttribute("async", "false") + appElem.appendChild(script) + script.addEventListener("load", function () { + let newApp = new PersonalProperties(appElem) + newApp.Init() + }, false) + } + + static basicWindow + /** + * + * @param {string} html + */ + static SetBasicWindow(html){ + this.basicWindow = html + } + /** + * + * @returns {string} + */ + static GetBasicWindow(){ + // console.log(this.basicWindow) + return this.basicWindow + } + + static Alert(alertText){ + console.log(alertText) } } +var getJSON = function(url, callback) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'json'; + xhr.onload = function() { + var status = xhr.status; + if (status === 200) { + callback(null, xhr.response); + } else { + callback(status, xhr.response); + } + }; + xhr.send(); +}; class WindowsCompositor{ movingElement = null @@ -53,7 +102,7 @@ class WindowsCompositor{ */ catchClick(event){ switch (true) { - case event.target.className == "WindowDragArea": + case event.target.className == "TestWindowHeader": this.movingElement = event.target.parentElement.parentElement.parentElement break; default: @@ -70,4 +119,5 @@ class WindowsCompositor{ element.style.left = posX + "px"; element.style.top = posY + "px"; } -} \ No newline at end of file +} + diff --git a/resources/wdeUI.css b/resources/wdeUI.css new file mode 100644 index 0000000..924f12a --- /dev/null +++ b/resources/wdeUI.css @@ -0,0 +1,24 @@ +.WindowFrameTopBarButton{ + width: 11px; + height: 11px; + padding: 0%; + + background: #D9D9D9; + border: 1px solid #222222; + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, + -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), + inset 1px 1px 0px #FFFFFF, + inset -1px -1px 0px rgba(0, 0, 0, 0.25); + + /* Inside auto layout */ + + flex: none; + order: 0; + flex-grow: 0; +} + +.WindowFrameTopBarButton:active { + background-color: rgba(0, 0, 0, 0.4); /* Green */ + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, + -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25); +} \ No newline at end of file diff --git a/routewde/wde.go b/routewde/wde.go new file mode 100644 index 0000000..fb8f08b --- /dev/null +++ b/routewde/wde.go @@ -0,0 +1,13 @@ +package routewde + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func Route(route *gin.RouterGroup) { + route.GET("/getbasicwindow", func(ctx *gin.Context) { + ctx.HTML(http.StatusOK, "basic-window.html", nil) + }) +} diff --git a/websiteapp/personalprops/personalprops.go b/websiteapp/personalprops/personalprops.go index c5f02e0..f17d72a 100644 --- a/websiteapp/personalprops/personalprops.go +++ b/websiteapp/personalprops/personalprops.go @@ -1,39 +1,107 @@ package personalprops +import ( + "personalwebsite/websiteapp" + + "github.com/gin-gonic/gin" +) + type PersonalPropertiesApp struct { + manifest websiteapp.ApplicationManifest } func NewPersPropsApp() PersonalPropertiesApp { - newApp := PersonalPropertiesApp{} + newApp := PersonalPropertiesApp{ + manifest: websiteapp.ApplicationManifest{ + AppId: "personal-properties", + WindowName: "About me", + }, + } return newApp } -func (p *PersonalPropertiesApp) Render() []Book { - books := make([]Book, 0) - books = append(books, Book{ - Title: "About person:", - Author: "General information about me", +func (p *PersonalPropertiesApp) GetManifest() websiteapp.ApplicationManifest { + return p.manifest +} +func (p *PersonalPropertiesApp) GetId() string { + return p.manifest.AppId +} + +func (p *PersonalPropertiesApp) Render() gin.H { + // books := make([]Book, 0) + // books = append(books, Book{ + // Title: "Title 1", + // Author: "Author 1", + // }) + // books = append(books, Book{ + // Title: "Title 2", + // Author: "Author 2", + // }) + allProps := make([][]Prop, 0) + + basicInfo := make([]Prop, 0) + + basicInfo = append(basicInfo, Prop{ + Key: "", + Prop: "Greg Brzezinski", }) - books = append(books, Book{ - Title: "Career:", - Author: "Inforamtion about my career", + + basicInfo = append(basicInfo, Prop{ + Key: "", + Prop: "Saint-Petersburg", }) - books = append(books, Book{ - Title: "TEST:", - Author: "QQQQQQQ", + + // careerkeys := make([]Prop, 0) + careerkeys := []Prop{ + { + Key: "VR lab assistant", + Prop: "111", + }, + { + Key: "3d artist", + Prop: "qweqwe", + }, + { + Key: "Jr. Techartist", + Prop: "qweqwaaae", + }, + } + // careerkeys = append(careerkeys, Prop{ + // Key: "VR lab assistant ", + // Prop: "ALSK jlkJls kdfgjasdp jk sdf", + // }) + // careerkeys = append(careerkeys, Prop{ + // Key: "3d artist", + // Prop: "qweqwe", + // }) + // careerkeys = append(careerkeys, Prop{}) + testKeys := []Prop{} + testKeys = append(testKeys, Prop{ + Key: "Urrtt", + Prop: "BakaBaka", }) - books = append(books, Book{ - Title: "TEST:", - Author: "QQQQQQQ", - }) - books = append(books, Book{ - Title: "TEST:", - Author: "QQQQQQQ", - }) - return books + + allProps = append(allProps, careerkeys, testKeys, testKeys, testKeys) + return gin.H{ + "Name": "Greg Brzezinski", + "BasicBio": "Born 27.09.1998 at Saint-Petersburg", + "BasicInfo": basicInfo, + // "books": books, + "career": careerkeys, + "allprops": allProps, + } } type Book struct { Title string Author string } + +type Prop struct { + Key string + Prop string +} + +// func (p *PersonalPropertiesApp) GetContent(ctx *gin.Context) interface{} { + +// } diff --git a/websiteapp/websiteapp.go b/websiteapp/websiteapp.go index 26cb186..1408c71 100644 --- a/websiteapp/websiteapp.go +++ b/websiteapp/websiteapp.go @@ -1,5 +1,45 @@ package websiteapp +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + type WebDEApplication interface { - Render() + // Render() + GetManifest() ApplicationManifest + // GEtHtml() + GetId() string +} + +type ApplicationManifest struct { + AppId string `json:"appid"` + WindowName string `json:"windowname"` +} + +type ApplicationsStorage struct { + Apps map[string]WebDEApplication +} + +// func NewApplicationsStorage() *ApplicationsStorage { +// newStorage := ApplicationsStorage{} + +// return &newStorage +// } + +func Route(route *gin.RouterGroup, aStorage *ApplicationsStorage) { + route.GET("/get", func(ctx *gin.Context) { + appId := ctx.Query("appid") + if appId == "" { + ctx.Status(http.StatusBadRequest) + return + } + app, isExist := aStorage.Apps[appId] + if !isExist { + ctx.Status(http.StatusNoContent) + return + } + ctx.JSON(http.StatusOK, app.GetManifest()) + }) }