28 lines
740 B
Go
28 lines
740 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type RatingTargetType string
|
|
|
|
const (
|
|
RatingTargetApp RatingTargetType = "app"
|
|
RatingTargetCourse RatingTargetType = "course"
|
|
RatingTargetSubCourse RatingTargetType = "sub_course"
|
|
)
|
|
|
|
type Rating struct {
|
|
ID int64 `json:"id"`
|
|
UserID int64 `json:"user_id"`
|
|
TargetType RatingTargetType `json:"target_type"`
|
|
TargetID int64 `json:"target_id"`
|
|
Stars int16 `json:"stars"`
|
|
Review *string `json:"review"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type RatingSummary struct {
|
|
TotalCount int64 `json:"total_count"`
|
|
AverageStars float64 `json:"average_stars"`
|
|
}
|