feat(service): add interaction to page struct
This commit is contained in:
@@ -24,9 +24,16 @@ type Project struct {
|
||||
|
||||
type ProjectPage struct {
|
||||
ID string `json:"id"`
|
||||
Interactions map[string]PageInteraction `json:"interactions"`
|
||||
Image io.ReadCloser `json:"-"`
|
||||
}
|
||||
|
||||
type PageInteraction struct {
|
||||
URL string `json:"url"`
|
||||
X uint16 `json:"x"`
|
||||
Y uint16 `json:"y"`
|
||||
}
|
||||
|
||||
func (s *Service) AddPage(projectID string, img io.Reader) error {
|
||||
s.assert.NotNil(s.ctx)
|
||||
s.assert.NotNil(s.s3)
|
||||
@@ -96,6 +103,8 @@ func (s *Service) GetPage(projectID string, pageID string) (ProjectPage, error)
|
||||
}
|
||||
|
||||
s.assert.NotNil(res.Body)
|
||||
s.assert.NotNil(page.Interactions)
|
||||
|
||||
page.Image = res.Body
|
||||
|
||||
return page, nil
|
||||
|
||||
@@ -45,7 +45,7 @@ func (s *Service) CreateProject() (Project, error) {
|
||||
p := Project{
|
||||
ID: id,
|
||||
Title: title,
|
||||
Pages: map[string]ProjectPage{},
|
||||
Pages: []ProjectPage{},
|
||||
}
|
||||
|
||||
c, err := json.Marshal(p)
|
||||
|
||||
Reference in New Issue
Block a user