probo/models/response.go
2023-12-17 18:56:20 +01:00

29 lines
499 B
Go

package models
import (
"encoding/json"
"fmt"
)
type Response struct {
Meta
Questions map[string]string
}
func (r *Response) String() string {
return fmt.Sprintf("Questions/Answers: %v", r.Questions)
}
func (r *Response) GetHash() string {
// return fmt.Sprintf("%x", sha256.Sum256([]byte(r.QuestionID+r.AnswerID)))
return ""
}
func (r *Response) Marshal() ([]byte, error) {
return json.Marshal(r)
}
func (r *Response) Unmarshal(data []byte) error {
return json.Unmarshal(data, r)
}