genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/models/review.go

29 lines
537 B
Go

package models
import "github.com/genofire/hs_master-kss-monolith/lib/database"
type Review struct {
ID int64
ProductID int64
LocaleLanguage string
FirstName string
LastName string
RatingStars int64
Text string
}
func (r *Review) DisplayName() string {
if len(r.FirstName) > 0 {
if len(r.LastName) > 0 {
last := []byte(r.LastName)
return r.FirstName + " " + string(last[0]) + "."
}
return r.FirstName
}
return "Anonymous"
}
func init() {
database.AddModel(&Review{})
}