80 lines
3.0 KiB
Go
80 lines
3.0 KiB
Go
package response
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type EbooksResponse struct {
|
|
ID uint `json:"id"`
|
|
Title string `json:"title"`
|
|
Slug string `json:"slug"`
|
|
Description string `json:"description"`
|
|
Price float64 `json:"price"`
|
|
PdfFilePath *string `json:"pdfFilePath"`
|
|
PdfFileName *string `json:"pdfFileName"`
|
|
PdfFileSize *int64 `json:"pdfFileSize"`
|
|
ThumbnailPath *string `json:"thumbnailPath"`
|
|
ThumbnailName *string `json:"thumbnailName"`
|
|
AuthorId uint `json:"authorId"`
|
|
AuthorName *string `json:"authorName"`
|
|
AuthorEmail *string `json:"authorEmail"`
|
|
Category *string `json:"category"`
|
|
Tags *string `json:"tags"`
|
|
PageCount *int `json:"pageCount"`
|
|
Language *string `json:"language"`
|
|
Isbn *string `json:"isbn"`
|
|
Publisher *string `json:"publisher"`
|
|
PublishedYear *int `json:"publishedYear"`
|
|
DownloadCount *int `json:"downloadCount"`
|
|
PurchaseCount *int `json:"purchaseCount"`
|
|
WishlistCount *int `json:"wishlistCount"`
|
|
Rating *float64 `json:"rating"`
|
|
ReviewCount *int `json:"reviewCount"`
|
|
StatusId *int `json:"statusId"`
|
|
IsActive *bool `json:"isActive"`
|
|
IsPublished *bool `json:"isPublished"`
|
|
PublishedAt *time.Time `json:"publishedAt"`
|
|
CreatedById *uint `json:"createdById"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type EbookWishlistResponse struct {
|
|
ID uint `json:"id"`
|
|
UserId uint `json:"userId"`
|
|
EbookId uint `json:"ebookId"`
|
|
Ebook *EbooksResponse `json:"ebook"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type EbookPurchaseResponse struct {
|
|
ID uint `json:"id"`
|
|
BuyerId uint `json:"buyerId"`
|
|
BuyerName *string `json:"buyerName"`
|
|
BuyerEmail *string `json:"buyerEmail"`
|
|
EbookId uint `json:"ebookId"`
|
|
Ebook *EbooksResponse `json:"ebook"`
|
|
PurchasePrice float64 `json:"purchasePrice"`
|
|
PaymentMethod *string `json:"paymentMethod"`
|
|
PaymentStatus *string `json:"paymentStatus"`
|
|
TransactionId *string `json:"transactionId"`
|
|
PaymentProof *string `json:"paymentProof"`
|
|
PaymentDate *time.Time `json:"paymentDate"`
|
|
DownloadCount *int `json:"downloadCount"`
|
|
LastDownloadAt *time.Time `json:"lastDownloadAt"`
|
|
StatusId *int `json:"statusId"`
|
|
IsActive *bool `json:"isActive"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
type EbookSummaryStats struct {
|
|
TotalEbooks int `json:"totalEbooks"`
|
|
TotalSales int `json:"totalSales"`
|
|
TotalRevenue float64 `json:"totalRevenue"`
|
|
TotalDownloads int `json:"totalDownloads"`
|
|
TotalWishlists int `json:"totalWishlists"`
|
|
AverageRating float64 `json:"averageRating"`
|
|
}
|