textualize/core/Document/Document.go
Yehoshua Sandler c49f8e4d07
refact: generalized back end structs (#1)
* refact: generalized back end structs

* refact: fixed front end type, removed dead code

* removed test image folder

* refact: removed dead structs
2023-05-26 19:23:35 -05:00

25 lines
391 B
Go

package document
import (
"textualize/entities"
)
type Entity entities.Document
type Area entities.Area
func (e *Entity) AddArea(a entities.Area) {
e.Areas = append(e.Areas, a)
}
func (e *Entity) GetAreaById(areaId string) *entities.Area {
var foundArea *entities.Area
for index, a := range e.Areas {
if a.Id == areaId {
foundArea = &e.Areas[index]
}
}
return foundArea
}