lib/app/pdf-helpers.go

28 lines
603 B
Go
Raw Permalink Normal View History

2021-01-14 06:36:35 +00:00
package app
import "code.tnxs.net/taxnexus/lib/api/stash/stash_models"
func (obj *PDF) MarshalToDocument() *stash_models.Document {
return &stash_models.Document{
ID: obj.ID,
Filename: obj.Filename,
ParentID: obj.ParentID,
Title: obj.Title,
URI: obj.URI,
}
}
func unMarshalNewPDF(swag *stash_models.NewPDF) *PDF {
return &PDF{
Description: swag.Description,
Filename: swag.Filename,
HTML: []byte(swag.HTML),
ObjectType: swag.ObjectType,
OwnerID: swag.OwnerID,
ParentID: swag.ParentID,
Ref: swag.Ref,
Title: swag.Title,
}
}