44 lines
1.5 KiB
Go
44 lines
1.5 KiB
Go
package response
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type EbookRatingsResponse struct {
|
|
ID uint `json:"id"`
|
|
UserId uint `json:"userId"`
|
|
UserName *string `json:"userName"`
|
|
UserEmail *string `json:"userEmail"`
|
|
EbookId uint `json:"ebookId"`
|
|
EbookTitle *string `json:"ebookTitle"`
|
|
PurchaseId uint `json:"purchaseId"`
|
|
Rating int `json:"rating"`
|
|
Review *string `json:"review"`
|
|
IsAnonymous *bool `json:"isAnonymous"`
|
|
IsVerified *bool `json:"isVerified"`
|
|
StatusId *int `json:"statusId"`
|
|
IsActive *bool `json:"isActive"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type EbookRatingSummaryResponse struct {
|
|
EbookId uint `json:"ebookId"`
|
|
EbookTitle string `json:"ebookTitle"`
|
|
AverageRating float64 `json:"averageRating"`
|
|
TotalRatings int `json:"totalRatings"`
|
|
RatingCounts map[int]int `json:"ratingCounts"`
|
|
RecentReviews []EbookRatingsResponse `json:"recentReviews"`
|
|
}
|
|
|
|
type EbookRatingStatsResponse struct {
|
|
TotalRatings int `json:"totalRatings"`
|
|
AverageRating float64 `json:"averageRating"`
|
|
RatingCounts map[int]int `json:"ratingCounts"`
|
|
FiveStarCount int `json:"fiveStarCount"`
|
|
FourStarCount int `json:"fourStarCount"`
|
|
ThreeStarCount int `json:"threeStarCount"`
|
|
TwoStarCount int `json:"twoStarCount"`
|
|
OneStarCount int `json:"oneStarCount"`
|
|
}
|