-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: get article by id & filter by date
- Loading branch information
Showing
10 changed files
with
301 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,43 @@ | ||
package article | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/capstone-kelompok-7/backend-disappear/module/entities" | ||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
type RepositoryArticleInterface interface { | ||
CreateArticle(article *entities.ArticleModels) (*entities.ArticleModels, error) | ||
GetArticleById(id uint64) (*entities.ArticleModels, error) | ||
UpdateArticleById(id uint64, updatedArticle *entities.ArticleModels) (*entities.ArticleModels, error) | ||
UpdateArticleViews(article *entities.ArticleModels) error | ||
DeleteArticleById(id uint64) error | ||
FindAll(page, perpage int) ([]entities.ArticleModels, error) | ||
GetTotalArticleCount() (int64, error) | ||
FindByTitle(page, perpage int, title string) ([]entities.ArticleModels, error) | ||
GetTotalArticleCountByTitle(title string) (int64, error) | ||
UpdateArticleById(id uint64, updatedArticle *entities.ArticleModels) (*entities.ArticleModels, error) | ||
DeleteArticleById(id uint64) error | ||
GetArticleById(id uint64) (*entities.ArticleModels, error) | ||
GetArticlesByDateRange(page, perpage int, startDate, endDate time.Time) ([]entities.ArticleModels, error) | ||
GetTotalArticleCountByDateRange(startDate, endDate time.Time) (int64, error) | ||
} | ||
|
||
type ServiceArticleInterface interface { | ||
CreateArticle(articleData *entities.ArticleModels) (*entities.ArticleModels, error) | ||
UpdateArticleById(id uint64, updatedArticle *entities.ArticleModels) (*entities.ArticleModels, error) | ||
DeleteArticleById(id uint64) error | ||
GetAll(page, perPage int) ([]entities.ArticleModels, int64, error) | ||
GetArticlesByTitle(page, perPage int, title string) ([]entities.ArticleModels, int64, error) | ||
GetArticleById(id uint64, incrementVIews bool) (*entities.ArticleModels, error) | ||
GetArticlesByDateRange(page, perPage int, filterType string) ([]entities.ArticleModels, int64, error) | ||
CalculatePaginationValues(page int, totalItems int, perPage int) (int, int) | ||
GetNextPage(currentPage, totalPages int) int | ||
GetPrevPage(currentPage int) int | ||
GetArticlesByTitle(page, perPage int, title string) ([]entities.ArticleModels, int64, error) | ||
GetArticleById(id uint64) (*entities.ArticleModels, error) | ||
UpdateArticleById(id uint64, updatedArticle *entities.ArticleModels) (*entities.ArticleModels, error) | ||
DeleteArticleById(id uint64) error | ||
} | ||
|
||
type HandlerArticleInterface interface { | ||
CreateArticle() echo.HandlerFunc | ||
GetAllArticles() echo.HandlerFunc | ||
UpdateArticleById() echo.HandlerFunc | ||
DeleteArticleById() echo.HandlerFunc | ||
GetAllArticles() echo.HandlerFunc | ||
GetArticleById() echo.HandlerFunc | ||
} |
Oops, something went wrong.