mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-11 16:24:11 +01:00
26 lines
732 B
Go
26 lines
732 B
Go
package form
|
|
|
|
import "github.com/ulule/deepcopier"
|
|
|
|
// Feedback represents support requests / customer feedback.
|
|
type Feedback struct {
|
|
Category string `json:"Category"`
|
|
Message string `json:"Message"`
|
|
UserName string `json:"UserName"`
|
|
UserEmail string `json:"UserEmail"`
|
|
UserAgent string `json:"UserAgent"`
|
|
UserLocales string `json:"UserLocales"`
|
|
}
|
|
|
|
// Empty reports whether the feedback form lacks required content.
|
|
func (f Feedback) Empty() bool {
|
|
return len(f.Category) < 1 || len(f.Message) < 3 || len(f.UserEmail) < 5
|
|
}
|
|
|
|
// NewFeedback copies values from an arbitrary model into a Feedback form.
|
|
func NewFeedback(m interface{}) (f Feedback, err error) {
|
|
err = deepcopier.Copy(m).To(&f)
|
|
|
|
return f, err
|
|
}
|