Documentation
¶
Index ¶
- type AuthController
- type BookController
- func (c BookController) CreateBook() gin.HandlerFunc
- func (c BookController) DeleteBook() gin.HandlerFunc
- func (c BookController) GetAllBooksSortedPaginated() gin.HandlerFunc
- func (c BookController) GetBookByISBN() gin.HandlerFunc
- func (c BookController) GetBookById() gin.HandlerFunc
- func (c BookController) GetBooksByAuthor() gin.HandlerFunc
- func (c BookController) GetBooksByGenre() gin.HandlerFunc
- func (c BookController) GetBooksByMatchingName() gin.HandlerFunc
- func (c BookController) UpdateBook() gin.HandlerFunc
- type DocumentController
- func (c DocumentController) CreateDocument() gin.HandlerFunc
- func (c DocumentController) DeleteDocument() gin.HandlerFunc
- func (c DocumentController) GetDocumentById() gin.HandlerFunc
- func (c DocumentController) GetMyCustomDocuments() gin.HandlerFunc
- func (c DocumentController) UpdateDocument() gin.HandlerFunc
- type MangaController
- func (c MangaController) CreateManga() gin.HandlerFunc
- func (c MangaController) DeleteManga() gin.HandlerFunc
- func (c MangaController) GetAllMangasSortedPaginated() gin.HandlerFunc
- func (c MangaController) GetMangaByAuthor() gin.HandlerFunc
- func (c MangaController) GetMangaByDemography() gin.HandlerFunc
- func (c MangaController) GetMangaByGenre() gin.HandlerFunc
- func (c MangaController) GetMangaById() gin.HandlerFunc
- func (c MangaController) GetMangaByMatchingName() gin.HandlerFunc
- func (c MangaController) UpdateManga() gin.HandlerFunc
- type ReadingController
- type ReadingListController
- func (c ReadingListController) AddReadingToList() gin.HandlerFunc
- func (c ReadingListController) CreateReadingList() gin.HandlerFunc
- func (c ReadingListController) DeleteReadingList() gin.HandlerFunc
- func (c ReadingListController) GetReadingListByUserId() gin.HandlerFunc
- func (c ReadingListController) RemoveReadingToList() gin.HandlerFunc
- func (c ReadingListController) UpdateReadingList() gin.HandlerFunc
- type ReadingListUserController
- func (c ReadingListUserController) AddReadingToList() gin.HandlerFunc
- func (c ReadingListUserController) CreateReadingList() gin.HandlerFunc
- func (c ReadingListUserController) DeleteMyReadingList() gin.HandlerFunc
- func (c ReadingListUserController) GetMyReadingListById() gin.HandlerFunc
- func (c ReadingListUserController) GetMyReadingLists() gin.HandlerFunc
- func (c ReadingListUserController) RemoveReadingToList() gin.HandlerFunc
- func (c ReadingListUserController) UpdateMyReadingList() gin.HandlerFunc
- type ReadingUserController
- func (c ReadingUserController) DeleteMyReading() gin.HandlerFunc
- func (c ReadingUserController) GetMyReadings() gin.HandlerFunc
- func (c ReadingUserController) GetMyReadingsByStatus() gin.HandlerFunc
- func (c ReadingUserController) GetMyReadingsByType() gin.HandlerFunc
- func (c ReadingUserController) StartReading() gin.HandlerFunc
- func (c ReadingUserController) UpdateMyReading() gin.HandlerFunc
- type RecordController
- type RecordUserController
- type UserController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthController ¶
type AuthController struct {
// contains filtered or unexported fields
}
func NewAuthController ¶
func NewAuthController(authServices services.AuthServices) *AuthController
func (AuthController) Login ¶
func (c AuthController) Login() gin.HandlerFunc
Login handles user authentication @Summary User Login @Description Authenticate an existing user @Tags Auth @Accept json @Produce json @Param login body dtos.LoginDTO true "User Login Information" @Success 200 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Failure 401 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /auth/login [post]
func (AuthController) Signup ¶
func (c AuthController) Signup() gin.HandlerFunc
Signup handles user registration @Summary User Signup @Description Register a new user @Tags Auth @Accept json @Produce json @Param signup body dtos.SignupDTO true "User Signup Information" @Success 200 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 409 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /auth/signup [post]
type BookController ¶
type BookController struct {
// contains filtered or unexported fields
}
BookController handles book-related operations
func NewBookController ¶
func NewBookController(bookService services.BookService) *BookController
NewBookController creates a new instance of BookController
func (BookController) CreateBook ¶
func (c BookController) CreateBook() gin.HandlerFunc
CreateBook creates a new book @Summary Create a new book @Description Create a new book entry @Tags Books @Accept json @Produce json @Param book body dtos.BookInsertDTO true "Book Information" @Success 201 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /books [post]
func (BookController) DeleteBook ¶
func (c BookController) DeleteBook() gin.HandlerFunc
DeleteBook deletes a book by its ID @Summary Delete a book @Description Delete a book entry by ID @Tags Books @Produce json @Param id path string true "Book ID" @Success 204 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /books/{id} [delete]
func (BookController) GetAllBooksSortedPaginated ¶
func (c BookController) GetAllBooksSortedPaginated() gin.HandlerFunc
GetAllBooksSortedPaginated retrieves all books with sorting and pagination @Summary Get all books with sorting and pagination @Description Get all books sorted and paginated @Tags Books @Produce json @Param page query int false "Page number" default(1) @Param limit query int false "Number of books per page" default(10) @Success 200 {object} []dtos.BookDTO @Failure 500 {object} utils.ApiResponse @Router /books [get]
func (BookController) GetBookByISBN ¶
func (c BookController) GetBookByISBN() gin.HandlerFunc
GetBookByISBN retrieves a book by its ISBN @Summary Get a book by ISBN @Description Get book details by ISBN @Tags Books @Produce json @Param isbn path string true "Book ISBN" @Success 200 {object} dtos.BookDTO @Failure 404 {object} utils.ApiResponse @Router /books/isbn/{isbn} [get]
func (BookController) GetBookById ¶
func (c BookController) GetBookById() gin.HandlerFunc
GetBookById retrieves a book by its ID @Summary Get a book by ID @Description Get book details by ID @Tags Books @Produce json @Param id path string true "Book ID" @Success 200 {object} dtos.BookDTO @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Router /books/{id} [get]
func (BookController) GetBooksByAuthor ¶
func (c BookController) GetBooksByAuthor() gin.HandlerFunc
GetBooksByAuthor retrieves books by the author's name @Summary Get books by author @Description Get books written by a specific author @Tags Books @Produce json @Param author path string true "Author Name" @Param page query int false "Page number" default(1) @Param limit query int false "Number of books per page" default(10) @Success 200 {object} []dtos.BookDTO @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Router /books/author/{author} [get]
func (BookController) GetBooksByGenre ¶
func (c BookController) GetBooksByGenre() gin.HandlerFunc
GetBooksByGenre retrieves books by genre @Summary Get books by genre @Description Get books of a specific genre @Tags Books @Produce json @Param genre path string true "Genre" @Param page query int false "Page number" default(1) @Param limit query int false "Number of books per page" default(10) @Success 200 {object} []dtos.BookDTO @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Router /books/genre/{genre} [get]
func (BookController) GetBooksByMatchingName ¶
func (c BookController) GetBooksByMatchingName() gin.HandlerFunc
GetBooksByMatchingName retrieves books matching a given name @Summary Get books by name pattern @Description Get books matching a specific name @Tags Books @Produce json @Param name path string true "Book Name" @Param page query int false "Page number" default(1) @Param limit query int false "Number of books per page" default(10) @Success 200 {object} []dtos.BookDTO @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Router /books/name/{name} [get]
func (BookController) UpdateBook ¶
func (c BookController) UpdateBook() gin.HandlerFunc
UpdateBook updates an existing book @Summary Update an existing book @Description Update a book entry by ID @Tags Books @Accept json @Produce json @Param id path string true "Book ID" @Param book body dtos.BookInsertDTO true "Book Information" @Success 200 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /books/{id} [put]
type DocumentController ¶
type DocumentController struct { CustomDocumentService services.CustomDocumentService // contains filtered or unexported fields }
DocumentController handles requests related to custom documents.
func NewDocumentController ¶
func NewDocumentController(CustomDocumentService services.CustomDocumentService) *DocumentController
NewDocumentController creates a new DocumentController.
func (DocumentController) CreateDocument ¶
func (c DocumentController) CreateDocument() gin.HandlerFunc
CreateDocument creates a new custom document. @Summary Create a new custom document @Description Create a custom document for the authenticated user @Tags documents @Accept json @Produce json @Param document body dtos.CustomDocumentInsertDTO true "Custom Document Data" @Success 201 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /documents [post]
func (DocumentController) DeleteDocument ¶
func (c DocumentController) DeleteDocument() gin.HandlerFunc
DeleteDocument deletes a custom document. @Summary Delete a custom document @Description Delete a custom document by ID for the authenticated user @Tags documents @Produce json @Param id path string true "Document ID" @Success 200 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /documents/{id} [delete]
func (DocumentController) GetDocumentById ¶
func (c DocumentController) GetDocumentById() gin.HandlerFunc
GetDocumentById retrieves a document by its ID. @Summary Get a document by ID @Description Retrieve a custom document by its ID for the authenticated user @Tags documents @Produce json @Param id path string true "Document ID" @Success 200 {object} dtos.CustomDocumentDTO @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /documents/{id} [get]
func (DocumentController) GetMyCustomDocuments ¶
func (c DocumentController) GetMyCustomDocuments() gin.HandlerFunc
GetMyCustomDocuments retrieves all custom documents for the user. @Summary Get all custom documents for the authenticated user @Description Retrieve all custom documents for the user @Tags documents @Produce json @Success 200 {array} dtos.CustomDocumentDTO @Failure 404 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /documents [get]
func (DocumentController) UpdateDocument ¶
func (c DocumentController) UpdateDocument() gin.HandlerFunc
UpdateDocument updates an existing custom document. @Summary Update an existing custom document @Description Update a custom document by ID for the authenticated user @Tags documents @Accept json @Produce json @Param id path string true "Document ID" @Param document body dtos.CustomDocumentInsertDTO true "Updated Custom Document Data" @Success 200 {object} utils.ApiResponse @Failure 400 {object} utils.ApiResponse @Failure 404 {object} utils.ApiResponse @Failure 500 {object} utils.ApiResponse @Router /documents/{id} [put]
type MangaController ¶
type MangaController struct {
// contains filtered or unexported fields
}
MangaController handles manga-related operations.
func NewMangaController ¶
func NewMangaController(mangaService services.MangaService) *MangaController
NewMangaController creates a new MangaController.
func (MangaController) CreateManga ¶
func (c MangaController) CreateManga() gin.HandlerFunc
CreateManga creates a new manga. @Summary Create Manga @Description Create a new manga in the system. @Tags Mangas @Accept json @Produce json @Param mangaInsertDTO body dtos.MangaInsertDTO true "Manga Insert DTO" @Success 201 {object} utils.ApiResponse "Manga Created" @Failure 400 {object} utils.ApiResponse "Invalid Data" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas [post]
func (MangaController) DeleteManga ¶
func (c MangaController) DeleteManga() gin.HandlerFunc
DeleteManga deletes a manga by ID. @Summary Delete Manga @Description Delete a manga by its ID. @Tags Mangas @Accept json @Produce json @Param mangaId path string true "Manga ID" @Success 200 {object} utils.ApiResponse "Manga Deleted" @Failure 400 {object} utils.ApiResponse "Invalid Manga ID" @Failure 404 {object} utils.ApiResponse "Manga not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/{mangaId} [delete]
func (MangaController) GetAllMangasSortedPaginated ¶
func (c MangaController) GetAllMangasSortedPaginated() gin.HandlerFunc
GetAllMangasSortedPaginated retrieves all mangas with sorting and pagination. @Summary Get All Mangas Sorted and Paginated @Description Retrieve all mangas with sorting and pagination options. @Tags Mangas @Accept json @Produce json @Param page query int false "Page number" default(1) @Param limit query int false "Number of results per page" default(10) @Success 200 {array} dtos.MangaDTO "Success" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas [get]
func (MangaController) GetMangaByAuthor ¶
func (c MangaController) GetMangaByAuthor() gin.HandlerFunc
GetMangaByAuthor retrieves mangas by a specific author. @Summary Get Mangas by Author @Description Retrieve all mangas written by a specific author. @Tags Mangas @Accept json @Produce json @Param author path string true "Author Name" @Success 200 {array} dtos.MangaDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid Author Name" @Failure 404 {object} utils.ApiResponse "No mangas found for this author" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/author/{author} [get]
func (MangaController) GetMangaByDemography ¶
func (c MangaController) GetMangaByDemography() gin.HandlerFunc
GetMangaByDemography retrieves mangas by demography. @Summary Get Mangas by Demography @Description Retrieve all mangas under a specific demography. @Tags Mangas @Accept json @Produce json @Param demography path string true "Demography Type" @Param page query int false "Page number" default(1) @Param limit query int false "Number of results per page" default(10) @Success 200 {array} dtos.MangaDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid Demography" @Failure 404 {object} utils.ApiResponse "No mangas found for this demography" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/demography/{demography} [get]
func (MangaController) GetMangaByGenre ¶
func (c MangaController) GetMangaByGenre() gin.HandlerFunc
GetMangaByGenre retrieves mangas by genre. @Summary Get Mangas by Genre @Description Retrieve all mangas under a specific genre. @Tags Mangas @Accept json @Produce json @Param genre path string true "Genre" @Param page query int false "Page number" default(1) @Param limit query int false "Number of results per page" default(10) @Success 200 {array} dtos.MangaDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid Genre" @Failure 404 {object} utils.ApiResponse "No mangas found for this genre" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/genre/{genre} [get]
func (MangaController) GetMangaById ¶
func (c MangaController) GetMangaById() gin.HandlerFunc
GetMangaById retrieves a manga by ID. @Summary Get Manga by ID @Description Retrieve a manga by its ID. @Tags Mangas @Accept json @Produce json @Param mangaId path string true "Manga ID" @Success 200 {object} dtos.MangaDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid Manga ID" @Failure 404 {object} utils.ApiResponse "Manga not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/{mangaId} [get]
func (MangaController) GetMangaByMatchingName ¶
func (c MangaController) GetMangaByMatchingName() gin.HandlerFunc
GetMangaByMatchingName retrieves mangas by name pattern. @Summary Get Mangas by Name Pattern @Description Retrieve all mangas that match a specific name pattern. @Tags Mangas @Accept json @Produce json @Param name path string true "Manga Name" @Param page query int false "Page number" default(1) @Param limit query int false "Number of results per page" default(10) @Success 200 {array} dtos.MangaDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid Name" @Failure 404 {object} utils.ApiResponse "No mangas found for this name" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/name/{name} [get]
func (MangaController) UpdateManga ¶
func (c MangaController) UpdateManga() gin.HandlerFunc
UpdateManga updates an existing manga. @Summary Update Manga @Description Update an existing manga by its ID. @Tags Mangas @Accept json @Produce json @Param mangaId path string true "Manga ID" @Param mangaInsertDTO body dtos.MangaInsertDTO true "Manga Insert DTO" @Success 200 {object} utils.ApiResponse "Manga Updated" @Failure 400 {object} utils.ApiResponse "Invalid Manga ID" @Failure 404 {object} utils.ApiResponse "Manga not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/mangas/{mangaId} [put]
type ReadingController ¶
type ReadingController struct {
// contains filtered or unexported fields
}
func NewReadingControler ¶
func NewReadingControler(readingService services.ReadingService) *ReadingController
func (ReadingController) CreateReading ¶
func (c ReadingController) CreateReading() gin.HandlerFunc
CreateReading creates a new reading @Summary Create Reading @Description Create a new reading @Tags Readings @Accept json @Produce json @Param userId query string true "User ID" @Param reading body dtos.ReadingInsertDTO true "Reading data" @Success 201 {object} utils.ApiResponse "Reading created" @Failure 400 {object} utils.ApiResponse "Invalid input" @Failure 500 {object} utils.ApiResponse "Internal server error" @Router /readings [post]
func (ReadingController) DeleteReading ¶
func (c ReadingController) DeleteReading() gin.HandlerFunc
DeleteReading deletes a reading @Summary Delete Reading @Description Delete a reading by its ID @Tags Readings @Param id path string true "Reading ID" @Param userId query string true "User ID" @Success 204 {object} utils.ApiResponse "Reading deleted" @Failure 400 {object} utils.ApiResponse "Invalid ID" @Failure 404 {object} utils.ApiResponse "Reading not found" @Failure 500 {object} utils.ApiResponse "Internal server error" @Router /readings/{id} [delete]
func (ReadingController) GetReadingById ¶
func (c ReadingController) GetReadingById() gin.HandlerFunc
GetReadingById retrieves a reading by its ID @Summary Get Reading by ID @Description Get a reading by its ID @Tags Readings @Param id path string true "Reading ID" @Success 200 {object} dtos.ReadingDTO "Successful response" @Failure 400 {object} utils.ApiResponse "Invalid ID" @Failure 500 {object} utils.ApiResponse "Internal server error" @Router /readings/{id} [get]
func (ReadingController) UpdateReading ¶
func (c ReadingController) UpdateReading() gin.HandlerFunc
UpdateReading updates an existing reading @Summary Update Reading @Description Update a reading by its ID @Tags Readings @Accept json @Produce json @Param id path string true "Reading ID" @Param userId query string true "User ID" @Param reading body dtos.ReadingInsertDTO true "Reading data" @Success 200 {object} utils.ApiResponse "Reading updated" @Failure 400 {object} utils.ApiResponse "Invalid input" @Failure 404 {object} utils.ApiResponse "Reading not found" @Failure 500 {object} utils.ApiResponse "Internal server error" @Router /readings/{id} [put]
type ReadingListController ¶
type ReadingListController struct {
// contains filtered or unexported fields
}
func NewReadingListController ¶
func NewReadingListController(readingListService services.ReadingListService) *ReadingListController
func (ReadingListController) AddReadingToList ¶
func (c ReadingListController) AddReadingToList() gin.HandlerFunc
AddReadingToList godoc @Summary Add readings to a user's reading list @Description Add readings to the specified user's reading list @Tags ReadingList @Accept json @Produce json @Param userId path string true "User ID" @Param body body dtos.UpdateReadingsToListDTO true "Readings to be added" @Success 200 {object} utils.ApiResponse "Successful addition" @Failure 400 {object} utils.ApiResponse "Invalid user ID or request body" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /reading-lists/{userId} [post]
func (ReadingListController) CreateReadingList ¶
func (c ReadingListController) CreateReadingList() gin.HandlerFunc
CreateReadingList godoc @Summary Create a new reading list @Description Create a new reading list for a specific user @Tags ReadingList @Accept json @Produce json @Param userId query string true "User ID" @Param body body dtos.ReadingListInsertDTO true "Reading List details" @Success 200 {object} utils.ApiResponse "Successful creation" @Failure 400 {object} utils.ApiResponse "Invalid user ID or request body" @Failure 404 {object} utils.ApiResponse "User not found" @Router /reading-lists [post]
func (ReadingListController) DeleteReadingList ¶
func (c ReadingListController) DeleteReadingList() gin.HandlerFunc
DeleteReadingList godoc @Summary Delete a reading list @Description Delete a specific reading list associated with a user @Tags ReadingList @Accept json @Produce json @Param userId query string true "User ID" @Param readingId path string true "Reading List ID" @Success 200 {object} utils.ApiResponse "Successful deletion" @Failure 400 {object} utils.ApiResponse "Invalid user ID or reading list ID" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /reading-lists/{readingId} [delete]
func (ReadingListController) GetReadingListByUserId ¶
func (c ReadingListController) GetReadingListByUserId() gin.HandlerFunc
GetReadingListByUserId godoc @Summary Get reading lists by user ID @Description Retrieve all reading lists associated with a specific user ID @Tags ReadingList @Accept json @Produce json @Param userId query string true "User ID" @Success 200 {object} utils.ApiResponse "Successful retrieval" @Failure 400 {object} utils.ApiResponse "Invalid user ID" @Failure 404 {object} utils.ApiResponse "User not found" @Router /reading-lists [get]
func (ReadingListController) RemoveReadingToList ¶
func (c ReadingListController) RemoveReadingToList() gin.HandlerFunc
RemoveReadingToList godoc @Summary Remove readings from a user's reading list @Description Remove readings from the specified user's reading list @Tags ReadingList @Accept json @Produce json @Param userId path string true "User ID" @Param body body dtos.UpdateReadingsToListDTO true "Readings to be removed" @Success 200 {object} utils.ApiResponse "Successful removal" @Failure 400 {object} utils.ApiResponse "Invalid user ID or request body" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /reading-lists/{userId} [delete]
func (ReadingListController) UpdateReadingList ¶
func (c ReadingListController) UpdateReadingList() gin.HandlerFunc
UpdateReadingList godoc @Summary Update an existing reading list @Description Update the details of a specific reading list @Tags ReadingList @Accept json @Produce json @Param userId query string true "User ID" @Param readingId path string true "Reading List ID" @Param body body dtos.ReadingListInsertDTO true "Updated Reading List details" @Success 200 {object} utils.ApiResponse "Successful update" @Failure 400 {object} utils.ApiResponse "Invalid user ID, reading list ID, or request body" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /reading-lists/{readingId} [put]
type ReadingListUserController ¶
type ReadingListUserController struct {
// contains filtered or unexported fields
}
func NewReadingListUserController ¶
func NewReadingListUserController(readingListService services.ReadingListService) *ReadingListUserController
func (ReadingListUserController) AddReadingToList ¶
func (c ReadingListUserController) AddReadingToList() gin.HandlerFunc
AddReadingToList godoc @Summary Add readings to a user's reading list @Description Add readings to the authenticated user's specified reading list @Tags ReadingList @Accept json @Produce json @Param body body dtos.UpdateReadingsToListDTO true "Readings to be added" @Success 200 {object} utils.ApiResponse "Successful addition" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /my-reading-lists [post]
func (ReadingListUserController) CreateReadingList ¶
func (c ReadingListUserController) CreateReadingList() gin.HandlerFunc
CreateReadingList godoc @Summary Create a new reading list for the authenticated user @Description Create a new reading list associated with the authenticated user @Tags ReadingList @Accept json @Produce json @Param body body dtos.ReadingListInsertDTO true "Reading List details" @Success 200 {object} utils.ApiResponse "Successful creation" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "User not found" @Router /my-reading-lists [post]
func (ReadingListUserController) DeleteMyReadingList ¶
func (c ReadingListUserController) DeleteMyReadingList() gin.HandlerFunc
DeleteMyReadingList godoc @Summary Delete a reading list for the authenticated user @Description Delete a specific reading list associated with the authenticated user @Tags ReadingList @Accept json @Produce json @Param readingId path string true "Reading List ID" @Success 200 {object} utils.ApiResponse "Successful deletion" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /my-reading-lists/{readingId} [delete]
func (ReadingListUserController) GetMyReadingListById ¶
func (c ReadingListUserController) GetMyReadingListById() gin.HandlerFunc
GetMyReadingListById godoc @Summary Get a specific reading list by ID for the authenticated user @Description Retrieve a reading list associated with the authenticated user by list ID @Tags ReadingList @Accept json @Produce json @Param listId query string true "Reading List ID" @Success 200 {object} utils.ApiResponse "Successful retrieval" @Failure 400 {object} utils.ApiResponse "Invalid list ID" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /my-reading-lists [get]
func (ReadingListUserController) GetMyReadingLists ¶
func (c ReadingListUserController) GetMyReadingLists() gin.HandlerFunc
GetMyReadingLists godoc @Summary Get reading lists for the authenticated user @Description Retrieve all reading lists associated with the authenticated user @Tags ReadingList @Accept json @Produce json @Success 200 {object} utils.ApiResponse "Successful retrieval" @Failure 404 {object} utils.ApiResponse "User not found" @Router /my-reading-lists [get]
func (ReadingListUserController) RemoveReadingToList ¶
func (c ReadingListUserController) RemoveReadingToList() gin.HandlerFunc
RemoveReadingToList godoc @Summary Remove readings from a user's reading list @Description Remove readings from the authenticated user's specified reading list @Tags ReadingList @Accept json @Produce json @Param body body dtos.UpdateReadingsToListDTO true "Readings to be removed" @Success 200 {object} utils.ApiResponse "Successful removal" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /my-reading-lists [delete]
func (ReadingListUserController) UpdateMyReadingList ¶
func (c ReadingListUserController) UpdateMyReadingList() gin.HandlerFunc
UpdateMyReadingList godoc @Summary Update an existing reading list for the authenticated user @Description Update the details of a specific reading list associated with the authenticated user @Tags ReadingList @Accept json @Produce json @Param readingId path string true "Reading List ID" @Param body body dtos.ReadingListInsertDTO true "Updated Reading List details" @Success 200 {object} utils.ApiResponse "Successful update" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading List not found" @Router /my-reading-lists/{readingId} [put]
type ReadingUserController ¶
type ReadingUserController struct {
// contains filtered or unexported fields
}
ReadingUserController handles user reading operations.
func NewReadingUserController ¶
func NewReadingUserController(readingService services.ReadingService) *ReadingUserController
NewReadingUserController creates a new ReadingUserController.
func (ReadingUserController) DeleteMyReading ¶
func (c ReadingUserController) DeleteMyReading() gin.HandlerFunc
DeleteMyReading deletes a reading for the authenticated user. @Summary Delete my reading @Description Delete a reading for the authenticated user. @Tags Readings @Accept json @Produce json @Param readingId path string true "Reading ID" @Success 204 {object} utils.ApiResponse "Deleted" @Failure 404 {object} utils.ApiResponse "Reading not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/readings/{readingId} [delete]
func (ReadingUserController) GetMyReadings ¶
func (c ReadingUserController) GetMyReadings() gin.HandlerFunc
GetMyReadings retrieves all readings for the authenticated user. @Summary Get my readings @Description Retrieve a paginated list of readings for the authenticated user. @Tags Readings @Accept json @Produce json @Param sort query string false "Sort order (asc or desc)" @Param page query int false "Page number" default(1) @Param limit query int false "Number of items per page" default(10) @Success 200 {array} dtos.ReadingDTO "Success" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/readings [get]
func (ReadingUserController) GetMyReadingsByStatus ¶
func (c ReadingUserController) GetMyReadingsByStatus() gin.HandlerFunc
GetMyReadingsByStatus retrieves readings for the authenticated user filtered by status. @Summary Get my readings by status @Description Retrieve readings for the authenticated user filtered by status. @Tags Readings @Accept json @Produce json @Param status query string false "Reading status (ongoing, paused, completed)" default(ongoing) @Param sort query string false "Sort order (asc or desc)" @Param page query int false "Page number" default(1) @Param limit query int false "Number of items per page" default(10) @Success 200 {array} dtos.ReadingDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid reading status" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/readings/status [get]
func (ReadingUserController) GetMyReadingsByType ¶
func (c ReadingUserController) GetMyReadingsByType() gin.HandlerFunc
GetMyReadingsByType retrieves readings for the authenticated user filtered by type. @Summary Get my readings by type @Description Retrieve readings for the authenticated user filtered by type. @Tags Readings @Accept json @Produce json @Param type query string false "Reading type (manga, book, custom_document)" default(book) @Param sort query string false "Sort order (asc or desc)" @Param page query int false "Page number" default(1) @Param limit query int false "Number of items per page" default(10) @Success 200 {array} dtos.ReadingDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid reading type" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/readings/type [get]
func (ReadingUserController) StartReading ¶
func (c ReadingUserController) StartReading() gin.HandlerFunc
StartReading initiates a new reading for the authenticated user. @Summary Start a reading @Description Start a new reading for the authenticated user. @Tags Readings @Accept json @Produce json @Param reading body dtos.ReadingInsertDTO true "Reading data" @Success 201 {object} utils.ApiResponse "Created" @Failure 400 {object} utils.ApiResponse "Validation error" @Failure 404 {object} utils.ApiResponse "Document not found" @Failure 409 {object} utils.ApiResponse "Duplicated reading" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/readings [post]
func (ReadingUserController) UpdateMyReading ¶
func (c ReadingUserController) UpdateMyReading() gin.HandlerFunc
UpdateMyReading updates an existing reading for the authenticated user. @Summary Update my reading @Description Update an existing reading for the authenticated user. @Tags Readings @Accept json @Produce json @Param readingId path string true "Reading ID" @Param reading body dtos.ReadingInsertDTO true "Updated reading data" @Success 200 {object} utils.ApiResponse "Updated" @Failure 400 {object} utils.ApiResponse "Validation error" @Failure 404 {object} utils.ApiResponse "Reading not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/readings/{readingId} [put]
type RecordController ¶
type RecordController struct {
// contains filtered or unexported fields
}
func NewRecordController ¶
func NewRecordController(recordService services.ReadingRecordService) *RecordController
func (RecordController) CreateRecord ¶
func (c RecordController) CreateRecord() gin.HandlerFunc
CreateRecord godoc @Summary Create a new reading record @Description Create a new reading record for the user @Tags ReadingRecord @Accept json @Produce json @Param userId query string true "User ID" @Param body body dtos.ReadingRecordInsertDTO true "Reading Record details" @Success 201 {object} utils.ApiResponse "Reading Record created" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading not found" @Router /records [post]
func (RecordController) DeleteRecord ¶
func (c RecordController) DeleteRecord() gin.HandlerFunc
DeleteRecord godoc @Summary Delete a reading record @Description Delete a specific reading record @Tags ReadingRecord @Accept json @Produce json @Param recordId path string true "Record ID" @Param readingId query string true "Reading ID" @Param userId query string true "User ID" @Success 200 {object} utils.ApiResponse "Reading Record deleted" @Failure 400 {object} utils.ApiResponse "Invalid request parameters" @Failure 404 {object} utils.ApiResponse "Reading not found" @Router /records/{recordId} [delete]
func (RecordController) UpdateRecord ¶
func (c RecordController) UpdateRecord() gin.HandlerFunc
UpdateRecord godoc @Summary Update an existing reading record @Description Update the details of a reading record @Tags ReadingRecord @Accept json @Produce json @Param recordId path string true "Record ID" @Param body body dtos.ReadingRecordInsertDTO true "Updated Reading Record details" @Success 200 {object} utils.ApiResponse "Reading Record updated" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading not found" @Router /records/{recordId} [put]
type RecordUserController ¶
type RecordUserController struct {
// contains filtered or unexported fields
}
func NewRecordUserController ¶
func NewRecordUserController(recordService services.ReadingRecordService) *RecordUserController
func (RecordUserController) AddRecord ¶
func (c RecordUserController) AddRecord() gin.HandlerFunc
AddRecord godoc @Summary Add a new record for a reading @Description Create a new record associated with a specific reading @Tags ReadingRecord @Accept json @Produce json @Param body body dtos.ReadingRecordInsertDTO true "Reading Record details" @Success 201 {object} utils.ApiResponse "Reading Record created" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading not found" @Router /records [post]
func (RecordUserController) GetRecordsFromMyReading ¶
func (c RecordUserController) GetRecordsFromMyReading() gin.HandlerFunc
GetRecordsFromMyReading godoc @Summary Get records for a specific reading @Description Retrieve all records from a user's reading by reading ID @Tags ReadingRecord @Accept json @Produce json @Param readingId path string true "Reading ID" @Success 200 {object} utils.ApiResponse "Found reading records" @Failure 404 {object} utils.ApiResponse "No records found" @Failure 400 {object} utils.ApiResponse "Invalid request parameters" @Router /records/{readingId} [get]
func (RecordUserController) RemoveMyRecord ¶
func (c RecordUserController) RemoveMyRecord() gin.HandlerFunc
RemoveMyRecord godoc @Summary Remove a record from my readings @Description Delete a specific reading record from a user's readings @Tags ReadingRecord @Accept json @Produce json @Param readingId query string true "Reading ID" @Param recordId path string true "Record ID" @Success 200 {object} utils.ApiResponse "Reading Record deleted" @Failure 400 {object} utils.ApiResponse "Invalid request parameters" @Failure 404 {object} utils.ApiResponse "Reading not found" @Router /records/{recordId} [delete]
func (RecordUserController) UpdateRecord ¶
func (c RecordUserController) UpdateRecord() gin.HandlerFunc
UpdateRecord godoc @Summary Update an existing record for a reading @Description Update the details of a specific record for a reading @Tags ReadingRecord @Accept json @Produce json @Param readingId path string true "Reading ID" @Param body body dtos.ReadingRecordInsertDTO true "Updated Reading Record details" @Success 200 {object} utils.ApiResponse "Reading Record updated" @Failure 400 {object} utils.ApiResponse "Invalid request body" @Failure 404 {object} utils.ApiResponse "Reading not found" @Router /records/{readingId} [put]
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController handles user-related operations.
func NewUserController ¶
func NewUserController(userService services.UserService) *UserController
NewUserController creates a new UserController.
func (UserController) CreateUser ¶
func (c UserController) CreateUser() gin.HandlerFunc
CreateUser creates a new user. @Summary Create User @Description Create a new user in the system. @Tags Users @Accept json @Produce json @Param user body dtos.UserInsertDTO true "User data" @Success 201 {object} dtos.UserDTO "User created" @Failure 400 {object} utils.ApiResponse "Validation error" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/users [post]
func (UserController) DeleteUser ¶
func (c UserController) DeleteUser() gin.HandlerFunc
DeleteUser deletes a user by ID. @Summary Delete User @Description Delete a user from the system by their ID. @Tags Users @Accept json @Produce json @Param userId path string true "User ID" @Success 204 {object} utils.ApiResponse "User deleted" @Failure 404 {object} utils.ApiResponse "User not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/users/{userId} [delete]
func (UserController) GetUserById ¶
func (c UserController) GetUserById() gin.HandlerFunc
GetUserById retrieves a user by ID. @Summary Get User by ID @Description Retrieve a user by their ID. @Tags Users @Accept json @Produce json @Param userId path string true "User ID" @Success 200 {object} dtos.UserDTO "Success" @Failure 400 {object} utils.ApiResponse "Invalid User ID" @Failure 404 {object} utils.ApiResponse "User not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/users/{userId} [get]
func (UserController) UpdateUser ¶
func (c UserController) UpdateUser() gin.HandlerFunc
UpdateUser updates an existing user. @Summary Update User @Description Update an existing user in the system. @Tags Users @Accept json @Produce json @Param userId path string true "User ID" @Param user body dtos.UserInsertDTO true "Updated user data" @Success 200 {object} dtos.UserDTO "User updated" @Failure 400 {object} utils.ApiResponse "Validation error" @Failure 404 {object} utils.ApiResponse "User not found" @Failure 500 {object} utils.ApiResponse "Internal Server Error" @Router /api/users/{userId} [put]