Documentation
¶
Index ¶
- type AddToWaitlist
- type BookChapterCreateSchema
- type BookCompletionStatusResponseSchema
- type BookCompletionStatusSchema
- type BookCreateSchema
- type BookDetailResponseSchema
- type BookDetailSchema
- type BookReadingProgressResponseSchema
- type BookReadingProgressSchema
- type BookReportSchema
- type BookResponseSchema
- type BookRetentionStatsResponseSchema
- type BookSchema
- type BookSubSectionSchema
- type BookWithOrder
- type BookWithStats
- type BooksResponseDataSchema
- type BooksResponseSchema
- type BuyCoinSchema
- type ChapterCreateSchema
- type ChapterDetailSchema
- type ChapterListSchema
- type ChapterResponseSchema
- type ChaptersResponseDataSchema
- type ChaptersResponseSchema
- type CoinSchema
- type CoinsResponseSchema
- type CommentSchema
- type ContractCreateSchema
- type ContractResponseSchema
- type ContractSchema
- type ContractSchema2
- type ContractsResponseDataSchema
- type ContractsResponseSchema
- type CreateICPWallet
- type CreateSubscriptionSchema
- type DashboardResponseDataSchema
- type DashboardResponseSchema
- type EmailRequestSchema
- type FeaturedContentBookSchema
- type FeaturedContentEntrySchema
- type FeaturedContentResponseSchema
- type FeaturedContentSchema
- type FeaturedContentsResponseSchema
- type FollowerData
- type GenreSchema
- type GenreWithoutTagSchema
- type GenresResponseSchema
- type GiftSchema
- type GiftsResponseSchema
- type ICPTransferResponseSchema
- type ICPWalletResponseSchema
- type InviteAdminSchema
- type LoginResponseSchema
- type LoginSchema
- type NotificationBookSchema
- type NotificationSchema
- type NotificationsResponseDataSchema
- type NotificationsResponseSchema
- type PaginatedResponseDataSchema
- type ParagraphCommentAddSchema
- type ParagraphCommentResponseDataSchema
- type ParagraphCommentResponseSchema
- type ParagraphCommentsResponseDataSchema
- type ParagraphCommentsResponseSchema
- type ParagraphSchema
- type PaymentResponseSchema
- type ReadNotificationSchema
- type RefreshTokenSchema
- type RegisterResponseSchema
- type RegisterUser
- type RepliesResponseDataSchema
- type RepliesResponseSchema
- type ReplyEditSchema
- type ReplyResponseSchema
- type ReplyReviewOrCommentSchema
- type ReplySchema
- type ResponseSchema
- type RetentionStatsSchema
- type ReviewBookSchema
- type ReviewResponseSchema
- type ReviewSchema
- type ReviewsResponseDataSchema
- type SectionSchema
- type SectionWithSubsectionsSchema
- type SectionsResponseSchema
- type SectionsWithSubSectionsSchema
- type SentGiftResponseSchema
- type SentGiftSchema
- type SentGiftsResponseDataSchema
- type SentGiftsResponseSchema
- type SetNewPasswordSchema
- type SiteDetailResponseSchema
- type SocialLoginSchema
- type SubSectionBookResponseSchema
- type SubSectionBookSchema
- type SubSectionSchema
- type SubSectionWithBooksResponseSchema
- type SubSectionWithBooksSchema
- type SubSectionsResponseSchema
- type SubscriberResponseSchema
- type SubscriptionPlanResponseSchema
- type SubscriptionPlanSchema
- type SubscriptionPlansAndPercentages
- type SubscriptionPlansResponseSchema
- type TagSchema
- type TagsAddSchema
- type TagsResponseSchema
- type TokensResponseSchema
- type TransactionSchema
- type TransactionsResponseDataSchema
- type TransactionsResponseSchema
- type UpdatePasswordSchema
- type UpdateUserProfileSchema
- type UpdateUserRoleSchema
- type UserDataSchema
- type UserGrowthData
- type UserProfile
- type UserProfileResponseSchema
- type UserProfilesResponseDataSchema
- type UserProfilesResponseSchema
- type VerifyEmailRequestSchema
- type WaitlistListResponseSchema
- type WaitlistResponse
- type WaitlistResponseDataSchema
- type WaitlistResponseSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddToWaitlist ¶
type BookChapterCreateSchema ¶
type BookCompletionStatusResponseSchema ¶
type BookCompletionStatusResponseSchema struct {
ResponseSchema
Data BookCompletionStatusSchema `json:"data"`
}
type BookCompletionStatusSchema ¶
type BookCompletionStatusSchema struct {
Completed bool `json:"completed"`
}
type BookCreateSchema ¶
type BookCreateSchema struct {
Title string `form:"title" validate:"required,wordcount_max=50,wordcount_min=1"`
Blurb string `form:"blurb" validate:"required,wordcount_max=1000,wordcount_min=100"`
GenreSlug string `form:"genre_slug" validate:"required"`
TagSlugs []string `form:"tag_slugs" validate:"required"`
AgeDiscretion choices.AgeType `form:"age_discretion" validate:"required,age_discretion_validator"`
}
type BookDetailResponseSchema ¶
type BookDetailResponseSchema struct {
ResponseSchema
Data BookDetailSchema `json:"data"`
}
type BookDetailSchema ¶
type BookDetailSchema struct {
BookSchema
WordCount int `json:"word_count"`
LibraryCount int `json:"library_count"`
Reviews ReviewsResponseDataSchema `json:"reviews"`
}
func (BookDetailSchema) Init ¶
func (b BookDetailSchema) Init(book models.Book, reviewsPaginatedData PaginatedResponseDataSchema, reviews []models.Comment) BookDetailSchema
type BookReadingProgressResponseSchema ¶
type BookReadingProgressResponseSchema struct {
ResponseSchema
Data []BookReadingProgressSchema `json:"data"`
}
type BookReportSchema ¶
type BookResponseSchema ¶
type BookResponseSchema struct {
ResponseSchema
Data BookSchema `json:"data"`
}
type BookRetentionStatsResponseSchema ¶
type BookRetentionStatsResponseSchema struct {
ResponseSchema
Data RetentionStatsSchema `json:"data"`
}
type BookSchema ¶
type BookSchema struct {
Author UserDataSchema `json:"author"`
Title string `json:"title"`
Slug string `json:"slug"`
Blurb string `json:"blurb"`
AgeDiscretion choices.AgeType `json:"age_discretion"`
Genre GenreWithoutTagSchema `json:"genre"`
SubSections []BookSubSectionSchema `json:"sub_sections"`
Tags []TagSchema `json:"tags"`
ChaptersCount int `json:"chapters_count"`
PartialViewChapter *ChapterListSchema `json:"partial_view_chapter"`
CoverImage string `json:"cover_image"`
FullPrice *int `json:"full_price"`
ChapterPrice int `json:"chapter_price"`
Completed bool `json:"completed"`
Votes int `json:"votes"`
Reads int `json:"reads"`
AvgRating float64 `json:"avg_rating"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
UpdatedAt time.Time `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (BookSchema) Init ¶
func (b BookSchema) Init(book models.Book) BookSchema
type BookSubSectionSchema ¶
type BookSubSectionSchema struct {
Name string `json:"name"`
Slug string `json:"slug"`
Section SectionSchema `json:"section"`
}
func (BookSubSectionSchema) Init ¶
func (s BookSubSectionSchema) Init(subSection *models.SubSection) BookSubSectionSchema
type BookWithOrder ¶
type BookWithStats ¶
type BookWithStats struct {
Slug string `json:"slug"`
Title string `json:"title"`
CoverImage string `json:"cover_image"`
AuthorName string `json:"author_name"`
AvgRating float64 `json:"avg_rating"`
VotesCount int `json:"votes_count"`
ReadsCount int `json:"reads_count"`
GenreName string `json:"genre_name"`
GenreSlug string `json:"genre_slug"`
}
type BooksResponseDataSchema ¶
type BooksResponseDataSchema struct {
PaginatedResponseDataSchema
Items []BookSchema `json:"books"`
}
Book Responses
func (BooksResponseDataSchema) Init ¶
func (b BooksResponseDataSchema) Init(books []models.Book) BooksResponseDataSchema
type BooksResponseSchema ¶
type BooksResponseSchema struct {
ResponseSchema
Data BooksResponseDataSchema `json:"data"`
}
type BuyCoinSchema ¶
type BuyCoinSchema struct {
// PaymentType choices.PaymentType `json:"payment_type" validate:"required,payment_type_validator" example:"STRIPE"` // This should be stripe by default
Quantity int `json:"quantity" validate:"required" example:"2"`
CoinID uuid.UUID `json:"coin_id" validate:"required" example:"19e8bd22-fab1-4bb4-ba82-77c41bea6b99"`
}
type ChapterCreateSchema ¶
type ChapterDetailSchema ¶
type ChapterDetailSchema struct {
ChapterListSchema
Paragraphs []ParagraphSchema `json:"paragraphs"`
}
func (ChapterDetailSchema) Init ¶
func (c ChapterDetailSchema) Init(chapter models.Chapter) ChapterDetailSchema
type ChapterListSchema ¶
type ChapterListSchema struct {
Title string `json:"title"`
Slug string `json:"slug"`
IsLast bool `json:"is_last"`
}
func (ChapterListSchema) Init ¶
func (c ChapterListSchema) Init(chapter models.Chapter) ChapterListSchema
type ChapterResponseSchema ¶
type ChapterResponseSchema struct {
ResponseSchema
Data ChapterDetailSchema `json:"data"`
}
type ChaptersResponseDataSchema ¶
type ChaptersResponseDataSchema struct {
PaginatedResponseDataSchema
Items []ChapterListSchema `json:"chapters"`
}
func (ChaptersResponseDataSchema) Init ¶
func (c ChaptersResponseDataSchema) Init(chapters []models.Chapter) ChaptersResponseDataSchema
type ChaptersResponseSchema ¶
type ChaptersResponseSchema struct {
ResponseSchema
Data ChaptersResponseDataSchema `json:"data"`
}
type CoinSchema ¶
type CoinSchema struct {
ID uuid.UUID `json:"id" example:"19e8bd22-fab1-4bb4-ba82-77c41bea6b99"`
Amount int `json:"amount" example:"5"`
Price decimal.Decimal `json:"price" example:"10.45"`
}
func (CoinSchema) Init ¶
func (c CoinSchema) Init(coin models.Coin) CoinSchema
type CoinsResponseSchema ¶
type CoinsResponseSchema struct {
ResponseSchema
Data []CoinSchema `json:"data"`
}
RESPONSE SCHEMAS
func (CoinsResponseSchema) Init ¶
func (c CoinsResponseSchema) Init(coins []models.Coin) CoinsResponseSchema
type CommentSchema ¶
type CommentSchema struct {
ParagraphCommentAddSchema
ID uuid.UUID `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
User UserDataSchema `json:"user"`
LikesCount int `json:"likes_count"`
RepliesCount int `json:"replies_count"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
UpdatedAt time.Time `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (CommentSchema) Init ¶
func (p CommentSchema) Init(paragraphComment models.Comment) CommentSchema
type ContractCreateSchema ¶
type ContractCreateSchema struct {
FullName string `form:"full_name" validate:"required,max=1000"`
Email string `form:"email" validate:"required,email"`
PenName string `form:"pen_name" validate:"required,max=1000"`
Age uint `form:"age" validate:"required"`
Country string `form:"country" validate:"required,max=1000"`
Address string `form:"address" validate:"required,max=1000"`
City string `form:"city" validate:"required,max=1000"`
State string `form:"state" validate:"required,max=1000"`
PostalCode string `form:"postal_code" validate:"required"`
TelephoneNumber string `form:"telephone_number" validate:"required,max=20"`
IDType choices.ContractIDTypeChoice `form:"id_type" validate:"required,contract_id_type_validator"`
BookAvailabilityLink *string `form:"book_availability_link"`
PlannedLength uint `form:"planned_length" validate:"required"`
AverageChapter uint `form:"average_chapter" validate:"required"`
UpdateRate uint `form:"update_rate" validate:"required"`
IntendedContract choices.ContractTypeChoice `form:"intended_contract" validate:"required,contract_type_validator"`
FullPurchaseMode bool `form:"full_purchase_mode"`
}
type ContractResponseSchema ¶
type ContractResponseSchema struct {
ResponseSchema
Data ContractSchema `json:"data"`
}
type ContractSchema ¶
type ContractSchema struct {
FullName string `json:"full_name"`
Email string `json:"email"`
PenName string `json:"pen_name"`
Age uint `json:"age"`
Country string `json:"country"`
Address string `json:"address"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postal_code"`
TelephoneNumber string `json:"telephone_number"`
IDType choices.ContractIDTypeChoice `json:"id_type"`
IDFrontImage string `json:"id_front_image"`
IDBackImage string `json:"id_back_image"`
BookAvailabilityLink *string `json:"book_availability_link"`
PlannedLength uint `json:"planned_length"`
AverageChapter uint `json:"average_chapter"`
UpdateRate uint `json:"update_rate"`
IntendedContract choices.ContractTypeChoice `json:"intended_contract"`
FullPurchaseMode bool `json:"full_purchase_mode"`
ContractStatus choices.ContractStatusChoice `json:"contract_status"`
FullPrice *int `json:"full_price"`
ChapterPrice int `json:"chapter_price"`
}
func (ContractSchema) Init ¶
func (c ContractSchema) Init(book models.Book) ContractSchema
type ContractSchema2 ¶
type ContractSchema2 struct {
FullName string `json:"full_name"`
Email string `json:"email"`
PenName string `json:"pen_name"`
Age uint `json:"age"`
Country string `json:"country"`
Address string `json:"address"`
City string `json:"city"`
State string `json:"state"`
PostalCode uint `json:"postal_code"`
TelephoneNumber string `json:"telephone_number"`
IDType choices.ContractIDTypeChoice `json:"id_type"`
IDFrontImage string `json:"id_front_image"`
IDBackImage string `json:"id_back_image"`
BookAvailabilityLink *string `json:"book_availability_link"`
PlannedLength uint `json:"planned_length"`
AverageChapter uint `json:"average_chapter"`
UpdateRate uint `json:"update_rate"`
IntendedContract choices.ContractTypeChoice `json:"intended_contract"`
FullPrice *int `json:"full_price"`
ChapterPrice int `json:"chapter_price"`
FullPurchaseMode bool `json:"full_purchase_mode"`
ContractStatus choices.ContractStatusChoice `json:"contract_status"`
}
type ContractsResponseDataSchema ¶
type ContractsResponseDataSchema struct {
PaginatedResponseDataSchema
Items []ContractSchema `json:"contracts"`
}
func (ContractsResponseDataSchema) Init ¶
func (c ContractsResponseDataSchema) Init(contracts []models.Book) ContractsResponseDataSchema
type ContractsResponseSchema ¶
type ContractsResponseSchema struct {
ResponseSchema
Data ContractsResponseDataSchema `json:"data"`
}
type CreateICPWallet ¶
type CreateICPWallet struct {
Username string `json:"username" validate:"required,max=1000" example:"john-doe"`
}
type CreateSubscriptionSchema ¶
type CreateSubscriptionSchema struct {
SubType choices.SubscriptionTypeChoice `json:"subtype" validate:"required,subscription_type_validator"`
PaymentMethodToken string `json:"payment_method_token" validate:"required"`
}
type DashboardResponseDataSchema ¶
type DashboardResponseDataSchema struct {
Username string `json:"username"`
Avatar string `json:"avatar"`
TotalUsers int64 `json:"total_users"`
ActiveSubscribers int64 `json:"active_subscribers"`
SubscriptionRevenue float64 `json:"subscription_revenue"`
UserSubscriptionPlanPercentages SubscriptionPlansAndPercentages `json:"user_subscription_plan_percentages"`
UserGrowthData []UserGrowthData `json:"user_growth_data"`
Books []BookWithStats `json:"books"`
}
type DashboardResponseSchema ¶
type DashboardResponseSchema struct {
ResponseSchema
Data DashboardResponseDataSchema `json:"data"`
}
type EmailRequestSchema ¶
type EmailRequestSchema struct {
Email string `json:"email" validate:"required,min=5,email" example:"johndoe@email.com"`
}
type FeaturedContentEntrySchema ¶
type FeaturedContentEntrySchema struct {
Location choices.FeaturedContentLocationChoice `json:"location" validate:"featured_content_location_choice_validator"`
BookSlug string `json:"book_slug" validate:"required"`
Desc string `json:"desc" validate:"required"`
}
type FeaturedContentResponseSchema ¶
type FeaturedContentResponseSchema struct {
ResponseSchema
Data FeaturedContentSchema `json:"data"`
}
type FeaturedContentSchema ¶
type FeaturedContentSchema struct {
ID uuid.UUID `json:"id"`
Location choices.FeaturedContentLocationChoice `json:"location"`
Desc string `json:"desc"`
Book FeaturedContentBookSchema `json:"book"`
IsActive bool `json:"is_active"`
}
func (FeaturedContentSchema) Init ¶
func (f FeaturedContentSchema) Init(featuredContent models.FeaturedContent) FeaturedContentSchema
type FeaturedContentsResponseSchema ¶
type FeaturedContentsResponseSchema struct {
ResponseSchema
Data []FeaturedContentSchema `json:"data"`
}
func (FeaturedContentsResponseSchema) Init ¶
func (f FeaturedContentsResponseSchema) Init(featuredContents []models.FeaturedContent) FeaturedContentsResponseSchema
type FollowerData ¶
type FollowerData struct {
Name *string `json:"name"`
Username string `json:"username"`
AccountType choices.AccType `json:"account_type"`
Avatar *string `json:"avatar"`
FollowersCount int `json:"followers_count"`
StoriesCount int `json:"stories_count"`
}
func (FollowerData) FromModel ¶
func (dto FollowerData) FromModel(user models.User) FollowerData
type GenreSchema ¶
type GenreSchema struct {
GenreWithoutTagSchema
Tags []TagSchema `json:"tags"`
}
func (GenreSchema) Init ¶
func (g GenreSchema) Init(genre models.Genre) GenreSchema
type GenreWithoutTagSchema ¶
func (GenreWithoutTagSchema) Init ¶
func (g GenreWithoutTagSchema) Init(genre models.Genre) GenreWithoutTagSchema
type GenresResponseSchema ¶
type GenresResponseSchema struct {
ResponseSchema
Data []GenreSchema `json:"data"`
}
func (GenresResponseSchema) Init ¶
func (g GenresResponseSchema) Init(genres []models.Genre) GenresResponseSchema
type GiftSchema ¶
type GiftsResponseSchema ¶
type GiftsResponseSchema struct {
ResponseSchema
Data []GiftSchema `json:"data"`
}
func (GiftsResponseSchema) Init ¶
func (g GiftsResponseSchema) Init(gifts []models.Gift) GiftsResponseSchema
type ICPWalletResponseSchema ¶
type InviteAdminSchema ¶
type LoginResponseSchema ¶
type LoginResponseSchema struct {
ResponseSchema
Data TokensResponseSchema `json:"data"`
}
type LoginSchema ¶
type NotificationBookSchema ¶
type NotificationBookSchema struct {
Title string `json:"title"`
Slug string `json:"slug"`
CoverImage string `json:"cover_image"`
}
NOTIFICATIONS
type NotificationSchema ¶
type NotificationSchema struct {
ID uuid.UUID `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
Sender UserDataSchema `json:"sender"`
ReceiverID *uuid.UUID `json:"receiver_id,omitempty"`
Ntype choices.NotificationTypeChoice `json:"ntype"`
Text string `json:"text"`
Book *NotificationBookSchema `json:"book"` // Bought book, vote, comment and reply
CommentID *uuid.UUID `json:"comment_id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"` // reviewed, reply, like
SentGiftID *uuid.UUID `json:"sent_gift_id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"` // If someone sent you a gift
IsRead bool `json:"is_read"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (NotificationSchema) Init ¶
func (n NotificationSchema) Init(notification models.Notification, showReceiver ...bool) NotificationSchema
type NotificationsResponseDataSchema ¶
type NotificationsResponseDataSchema struct {
PaginatedResponseDataSchema
Items []NotificationSchema `json:"notifications"`
}
func (NotificationsResponseDataSchema) Init ¶
func (n NotificationsResponseDataSchema) Init(notifications []models.Notification) NotificationsResponseDataSchema
type NotificationsResponseSchema ¶
type NotificationsResponseSchema struct {
ResponseSchema
Data NotificationsResponseDataSchema `json:"data"`
}
type ParagraphCommentAddSchema ¶
type ParagraphCommentAddSchema struct {
Text string `json:"text" validate:"required,max=10000"`
}
type ParagraphCommentResponseDataSchema ¶
type ParagraphCommentResponseDataSchema struct {
PaginatedResponseDataSchema
Items []CommentSchema `json:"items"`
}
type ParagraphCommentResponseSchema ¶
type ParagraphCommentResponseSchema struct {
ResponseSchema
Data CommentSchema `json:"data"`
}
type ParagraphCommentsResponseDataSchema ¶
type ParagraphCommentsResponseDataSchema struct {
PaginatedResponseDataSchema
Items []CommentSchema `json:"comments"`
}
func (ParagraphCommentsResponseDataSchema) Init ¶
func (p ParagraphCommentsResponseDataSchema) Init(comments []models.Comment) ParagraphCommentsResponseDataSchema
type ParagraphCommentsResponseSchema ¶
type ParagraphCommentsResponseSchema struct {
ResponseSchema
Data ParagraphCommentsResponseDataSchema `json:"data"`
}
type ParagraphSchema ¶
type PaymentResponseSchema ¶
type PaymentResponseSchema struct {
ResponseSchema
Data TransactionSchema `json:"data"`
}
type ReadNotificationSchema ¶
type RefreshTokenSchema ¶
type RefreshTokenSchema struct {
Refresh string `` /* 172-byte string literal not displayed */
}
type RegisterResponseSchema ¶
type RegisterResponseSchema struct {
ResponseSchema
Data EmailRequestSchema `json:"data"`
}
RESPONSE BODY SCHEMAS
type RegisterUser ¶
type RegisterUser struct {
Email string `json:"email" validate:"required,min=5,email" example:"johndoe@email.com"`
Password string `json:"password" validate:"required,min=8,max=50" example:"strongpassword"`
}
REQUEST BODY SCHEMAS
type RepliesResponseDataSchema ¶
type RepliesResponseDataSchema struct {
PaginatedResponseDataSchema
Items []ReplySchema `json:"replies"`
}
func (RepliesResponseDataSchema) Init ¶
func (r RepliesResponseDataSchema) Init(replies []models.Comment) RepliesResponseDataSchema
type RepliesResponseSchema ¶
type RepliesResponseSchema struct {
ResponseSchema
Data RepliesResponseDataSchema `json:"data"`
}
type ReplyEditSchema ¶
type ReplyEditSchema struct {
Text string `json:"text" validate:"required,max=10000"`
}
type ReplyResponseSchema ¶
type ReplyResponseSchema struct {
ResponseSchema
Data ReplySchema `json:"data"`
}
type ReplyReviewOrCommentSchema ¶
type ReplyReviewOrCommentSchema struct {
ReplyEditSchema
Type choices.ReplyType `json:"type" validate:"required,reply_type_validator"`
}
type ReplySchema ¶
type ReplySchema struct {
ID uuid.UUID `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
User UserDataSchema `json:"user"`
Text string `json:"text"`
LikesCount int `json:"likes_count"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
UpdatedAt time.Time `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (ReplySchema) Init ¶
func (r ReplySchema) Init(reply models.Comment) ReplySchema
type ResponseSchema ¶
type ResponseSchema struct {
Status string `json:"status" example:"success"`
Message string `json:"message" example:"Data fetched/created/updated/deleted"`
}
func (ResponseSchema) Init ¶
func (obj ResponseSchema) Init() ResponseSchema
type RetentionStatsSchema ¶
type ReviewBookSchema ¶
type ReviewBookSchema struct {
Rating choices.RatingChoice `json:"rating" validate:"required,rating_choice_validator"`
Text string `json:"text" validate:"required,max=10000"`
}
type ReviewResponseSchema ¶
type ReviewResponseSchema struct {
ResponseSchema
Data ReviewSchema `json:"data"`
}
type ReviewSchema ¶
type ReviewSchema struct {
ReviewBookSchema
ID uuid.UUID `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
User UserDataSchema `json:"user"`
LikesCount int `json:"likes_count"`
RepliesCount int `json:"replies_count"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
UpdatedAt time.Time `json:"updated_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (ReviewSchema) Init ¶
func (r ReviewSchema) Init(review models.Comment) ReviewSchema
type ReviewsResponseDataSchema ¶
type ReviewsResponseDataSchema struct {
PaginatedResponseDataSchema
Items []ReviewSchema `json:"items"`
}
type SectionSchema ¶
func (SectionSchema) Init ¶
func (s SectionSchema) Init(section models.Section) SectionSchema
type SectionWithSubsectionsSchema ¶
type SectionWithSubsectionsSchema struct {
Name string `json:"name"`
Slug string `json:"slug"`
SubSections []SubSectionSchema `json:"sub_sections"`
SubSectionsCount int `json:"sub_sections_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (SectionWithSubsectionsSchema) Init ¶
func (s SectionWithSubsectionsSchema) Init(section models.Section) SectionWithSubsectionsSchema
type SectionsResponseSchema ¶
type SectionsResponseSchema struct {
ResponseSchema
Data []SectionSchema `json:"data"`
}
func (SectionsResponseSchema) Init ¶
func (s SectionsResponseSchema) Init(sections []models.Section) SectionsResponseSchema
type SectionsWithSubSectionsSchema ¶
type SectionsWithSubSectionsSchema struct {
ResponseSchema
Data []SectionWithSubsectionsSchema `json:"data"`
}
func (SectionsWithSubSectionsSchema) Init ¶
func (s SectionsWithSubSectionsSchema) Init(sections []models.Section) SectionsWithSubSectionsSchema
type SentGiftResponseSchema ¶
type SentGiftResponseSchema struct {
ResponseSchema
Data SentGiftSchema `json:"data"`
}
type SentGiftSchema ¶
type SentGiftSchema struct {
ID uuid.UUID `json:"id" example:"2b3bd817-135e-41bd-9781-33807c92ff40"`
Sender UserDataSchema `json:"sender"`
Receiver UserDataSchema `json:"receiver"`
Item GiftSchema `json:"gift"`
Claimed bool `json:"claimed"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (SentGiftSchema) Init ¶
func (s SentGiftSchema) Init(sentGift models.SentGift) SentGiftSchema
type SentGiftsResponseDataSchema ¶
type SentGiftsResponseDataSchema struct {
PaginatedResponseDataSchema
Items []SentGiftSchema `json:"gifts"`
}
func (SentGiftsResponseDataSchema) Init ¶
func (s SentGiftsResponseDataSchema) Init(sentGifts []models.SentGift) SentGiftsResponseDataSchema
type SentGiftsResponseSchema ¶
type SentGiftsResponseSchema struct {
ResponseSchema
Data SentGiftsResponseDataSchema `json:"data"`
}
type SetNewPasswordSchema ¶
type SetNewPasswordSchema struct {
EmailRequestSchema
TokenString string `` /* 150-byte string literal not displayed */
Password string `json:"password" validate:"required,min=8,max=50" example:"newstrongpassword"`
}
type SiteDetailResponseSchema ¶
type SiteDetailResponseSchema struct {
ResponseSchema
Data models.SiteDetail `json:"data"`
}
type SocialLoginSchema ¶
type SocialLoginSchema struct {
DeviceType choices.DeviceType `json:"device_type" validate:"device_type_validator"`
Token string `` /* 177-byte string literal not displayed */
}
type SubSectionBookResponseSchema ¶
type SubSectionBookResponseSchema struct {
PaginatedResponseDataSchema
Items []SubSectionBookSchema `json:"items"`
}
type SubSectionBookSchema ¶
type SubSectionBookSchema struct {
OrderInSection uint `json:"order_in_section"`
Title string `json:"title"`
Author UserDataSchema `json:"author"`
}
type SubSectionSchema ¶
type SubSectionSchema struct {
Name string `json:"name"`
Slug string `json:"slug"`
BooksCount int `json:"books_count"`
}
func (SubSectionSchema) Init ¶
func (s SubSectionSchema) Init(subSection *models.SubSection) SubSectionSchema
type SubSectionWithBooksResponseSchema ¶
type SubSectionWithBooksResponseSchema struct {
ResponseSchema
Data SubSectionWithBooksSchema `json:"data"`
}
type SubSectionWithBooksSchema ¶
type SubSectionWithBooksSchema struct {
SubSectionSchema
Section string `json:"section"`
Books SubSectionBookResponseSchema `json:"books"`
}
func (SubSectionWithBooksSchema) Init ¶
func (s SubSectionWithBooksSchema) Init(subSection models.SubSection, books []BookWithOrder, paginatedData PaginatedResponseDataSchema) SubSectionWithBooksSchema
type SubSectionsResponseSchema ¶
type SubSectionsResponseSchema struct {
ResponseSchema
Data []SubSectionSchema `json:"data"`
}
func (SubSectionsResponseSchema) Init ¶
func (s SubSectionsResponseSchema) Init(subSections []models.SubSection) SubSectionsResponseSchema
type SubscriberResponseSchema ¶
type SubscriberResponseSchema struct {
ResponseSchema
Data models.Subscriber `json:"data"`
}
type SubscriptionPlanResponseSchema ¶
type SubscriptionPlanResponseSchema struct {
ResponseSchema
Data SubscriptionPlanSchema `json:"data"`
}
type SubscriptionPlanSchema ¶
type SubscriptionPlanSchema struct {
Amount decimal.Decimal `json:"amount" validate:"required"`
SubType choices.SubscriptionTypeChoice `json:"subtype" validate:"required,subscription_type_validator"`
}
func (SubscriptionPlanSchema) Init ¶
func (s SubscriptionPlanSchema) Init(subscriptionPlan models.SubscriptionPlan) SubscriptionPlanSchema
type SubscriptionPlansResponseSchema ¶
type SubscriptionPlansResponseSchema struct {
ResponseSchema
Data []SubscriptionPlanSchema `json:"data"`
}
func (SubscriptionPlansResponseSchema) Init ¶
func (s SubscriptionPlansResponseSchema) Init(subscriptionPlans []models.SubscriptionPlan) SubscriptionPlansResponseSchema
type TagSchema ¶
type TagsAddSchema ¶
type TagsAddSchema struct {
Name string `json:"name" validate:"required"`
}
type TagsResponseSchema ¶
type TagsResponseSchema struct {
ResponseSchema
Data []TagSchema `json:"data"`
}
func (TagsResponseSchema) Init ¶
func (t TagsResponseSchema) Init(tags []models.Tag) TagsResponseSchema
type TokensResponseSchema ¶
type TokensResponseSchema struct {
UserProfile
Access string `` /* 151-byte string literal not displayed */
Refresh string `` /* 152-byte string literal not displayed */
FeaturedContents []FeaturedContentSchema `json:"featured_contents"`
}
func (TokensResponseSchema) Init ¶
func (t TokensResponseSchema) Init(user models.User, featuredContents []models.FeaturedContent) TokensResponseSchema
type TransactionSchema ¶
type TransactionSchema struct {
Reference string `json:"reference"`
Coins *int `json:"coins" example:"10"`
CoinsTotal *int `json:"coins_total" example:"30"`
PaymentType choices.PaymentType `json:"payment_type" example:"STRIPE"`
PaymentPurpose choices.PaymentPurpose `json:"payment_purpose" example:"SUBSCRIPTION"`
Quantity int `json:"quantity" example:"10"`
Amount decimal.Decimal `json:"amount" example:"10.35"`
AmountTotal decimal.Decimal `json:"amount_total" example:"30.35"`
PaymentStatus choices.PaymentStatus `json:"payment_status"`
ClientSecret string `json:"client_secret"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (TransactionSchema) Init ¶
func (t TransactionSchema) Init(transaction models.Transaction) TransactionSchema
type TransactionsResponseDataSchema ¶
type TransactionsResponseDataSchema struct {
PaginatedResponseDataSchema
Items []TransactionSchema `json:"transactions"`
}
func (TransactionsResponseDataSchema) Init ¶
func (t TransactionsResponseDataSchema) Init(transactions []models.Transaction) TransactionsResponseDataSchema
type TransactionsResponseSchema ¶
type TransactionsResponseSchema struct {
ResponseSchema
Data TransactionsResponseDataSchema `json:"data"`
}
type UpdatePasswordSchema ¶
type UpdateUserProfileSchema ¶
type UpdateUserProfileSchema struct {
Name *string `json:"name,omitempty" validate:"min=3,max=1000" example:"John Doe"`
Bio *string `json:"bio,omitempty" validate:"min=3,max=1000" example:"I'm here to read good books"`
Username *string `json:"username,omitempty" validate:"min=3,max=1000" example:"johndoe"`
}
type UpdateUserRoleSchema ¶
type UserDataSchema ¶
type UserDataSchema struct {
// For short user data
Name *string `json:"name"`
Username string `json:"username"`
Avatar string `json:"avatar"`
}
func (UserDataSchema) Init ¶
func (u UserDataSchema) Init(user models.User) UserDataSchema
type UserGrowthData ¶
type UserProfile ¶
type UserProfile struct {
Name *string `json:"name"`
Username string `json:"username"`
Email string `json:"email"`
Avatar *string `json:"avatar"`
Bio *string `json:"bio"`
AccountType choices.AccType `json:"account_type"`
StoriesCount int `json:"stories_count"`
Followers []FollowerData `json:"followers"`
Followings []FollowerData `json:"followings"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
CurrentPlan *choices.SubscriptionTypeChoice `json:"current_plan"`
IsFollowing bool `json:"is_following"`
IsActive bool `json:"is_active"`
}
func (UserProfile) Init ¶
func (u UserProfile) Init(user models.User, currentUser *models.User) UserProfile
type UserProfileResponseSchema ¶
type UserProfileResponseSchema struct {
ResponseSchema
Data UserProfile `json:"data"`
}
type UserProfilesResponseDataSchema ¶
type UserProfilesResponseDataSchema struct {
PaginatedResponseDataSchema
Items []UserProfile `json:"users"`
}
func (UserProfilesResponseDataSchema) Init ¶
func (u UserProfilesResponseDataSchema) Init(users []models.User) UserProfilesResponseDataSchema
type UserProfilesResponseSchema ¶
type UserProfilesResponseSchema struct {
ResponseSchema
Data UserProfilesResponseDataSchema `json:"data"`
}
type VerifyEmailRequestSchema ¶
type VerifyEmailRequestSchema struct {
EmailRequestSchema
Otp uint `json:"otp" validate:"required" example:"123456"`
}
type WaitlistListResponseSchema ¶
type WaitlistListResponseSchema struct {
ResponseSchema
Data WaitlistResponseDataSchema `json:"data"`
}
type WaitlistResponse ¶
type WaitlistResponse struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
GenreID uuid.UUID `json:"genre_id"`
GenreName string `json:"genre_name"`
CreatedAt time.Time `json:"created_at" example:"2024-06-05T02:32:34.462196+01:00"`
}
func (WaitlistResponse) Init ¶
func (w WaitlistResponse) Init(waitlist models.Waitlist) WaitlistResponse
type WaitlistResponseDataSchema ¶
type WaitlistResponseDataSchema struct {
PaginatedResponseDataSchema
Items []WaitlistResponse `json:"waitlist"`
}
func (WaitlistResponseDataSchema) Init ¶
func (wr WaitlistResponseDataSchema) Init(waitlists []models.Waitlist) WaitlistResponseDataSchema
type WaitlistResponseSchema ¶
type WaitlistResponseSchema struct {
ResponseSchema
}
Click to show internal directories.
Click to hide internal directories.