Split up payloads
This commit is contained in:
parent
4f3b4ec4bf
commit
da523e0160
6 changed files with 130 additions and 102 deletions
27
payloads/species.go
Normal file
27
payloads/species.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package payloads
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/thermokarst/bactdb/models"
|
||||
)
|
||||
|
||||
type SpeciesPayload struct {
|
||||
Species *models.Species `json:"species"`
|
||||
Strains *models.Strains `json:"strains"`
|
||||
Meta *models.SpeciesMeta `json:"meta"`
|
||||
}
|
||||
|
||||
type ManySpeciesPayload struct {
|
||||
Species *models.ManySpecies `json:"species"`
|
||||
Strains *models.Strains `json:"strains"`
|
||||
Meta *models.SpeciesMeta `json:"meta"`
|
||||
}
|
||||
|
||||
func (s *SpeciesPayload) Marshal() ([]byte, error) {
|
||||
return json.Marshal(s)
|
||||
}
|
||||
|
||||
func (s *ManySpeciesPayload) Marshal() ([]byte, error) {
|
||||
return json.Marshal(s)
|
||||
}
|
Reference in a new issue