lib/app/domain-helpers.go

24 lines
562 B
Go
Raw Permalink Normal View History

2021-01-14 06:36:35 +00:00
package app
import "code.tnxs.net/taxnexus/lib/api/geo/geo_models"
2021-01-18 03:13:54 +00:00
// UnMarshalDomain decodes swagger to first class object
2021-01-17 21:49:00 +00:00
func UnMarshalDomain(swag *geo_models.Domain) *Domain {
2021-01-14 06:36:35 +00:00
return &Domain{
Description: swag.Description,
Active: swag.Active,
ID: swag.ID,
Name: swag.Name,
}
}
2021-01-18 03:13:54 +00:00
// MarshalToSwagger encodes first class object
2021-01-17 21:49:00 +00:00
func (obj *Domain) MarshalToSwagger() *geo_models.Domain {
2021-01-14 06:36:35 +00:00
return &geo_models.Domain{
ID: obj.ID,
Active: obj.Active,
Description: obj.Description,
Name: obj.Name,
}
}