123456789101112131415161718192021222324252627 |
- package models
- import (
- "crypto/sha256"
- "fmt"
- )
- type Question struct {
- Meta
- Text string `json:"text"`
- }
- 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)))
- }
|