personal-website/websiteapp/personalprops/personalprops.go

108 lines
2.0 KiB
Go
Raw Normal View History

2023-03-15 12:32:41 +00:00
package personalprops
2023-03-17 01:16:51 +00:00
import (
"personalwebsite/websiteapp"
"github.com/gin-gonic/gin"
)
2023-03-15 12:32:41 +00:00
type PersonalPropertiesApp struct {
2023-03-17 01:16:51 +00:00
manifest websiteapp.ApplicationManifest
2023-03-15 12:32:41 +00:00
}
func NewPersPropsApp() PersonalPropertiesApp {
2023-03-17 01:16:51 +00:00
newApp := PersonalPropertiesApp{
manifest: websiteapp.ApplicationManifest{
AppId: "personal-properties",
WindowName: "About me",
},
}
2023-03-15 12:32:41 +00:00
return newApp
}
2023-03-17 01:16:51 +00:00
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",
2023-03-15 12:32:41 +00:00
})
2023-03-17 01:16:51 +00:00
basicInfo = append(basicInfo, Prop{
Key: "",
Prop: "Saint-Petersburg",
2023-03-15 12:32:41 +00:00
})
2023-03-17 01:16:51 +00:00
// 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",
2023-03-15 12:32:41 +00:00
})
2023-03-17 01:16:51 +00:00
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,
}
2023-03-15 12:32:41 +00:00
}
type Book struct {
Title string
Author string
}
2023-03-17 01:16:51 +00:00
type Prop struct {
Key string
Prop string
}
// func (p *PersonalPropertiesApp) GetContent(ctx *gin.Context) interface{} {
// }