probo/models/question.go

28 lines
367 B
Go
Raw Normal View History

2022-06-23 11:25:35 +02:00
package models
2023-11-13 21:01:12 +01:00
import (
"crypto/sha256"
"fmt"
)
2022-06-23 11:25:35 +02:00
type Question struct {
2023-10-28 20:50:06 +02:00
Meta
Text string `json:"text"`
2022-06-23 11:25:35 +02:00
}
2023-11-13 21:01:12 +01:00
func (q *Question) String() string {
return q.Text
}
func (q *Question) GetID() string {
return q.ID
}
func (q *Question) SetID(id string) {
q.ID = id
}
func (q *Question) GetHash() string {
return fmt.Sprintf("%x", sha256.Sum256([]byte(q.Text)))
}