Documentation ¶
Index ¶
- Variables
- type Article
- type ArticleService
- func (a ArticleService) Article(articleId int) (*response.ArticleDetails, error)
- func (a ArticleService) ArticleCommentList(pageInfo request.PageInfo, articleId int) ([]response.ArticleCommentInfo, error)
- func (a ArticleService) ArticlePage(pageInfo request.PageInfo) ([]response.HeadInfo, error)
- func (a ArticleService) CreateArticle(newArticle *request.PostArticle, userId uint) error
- func (a ArticleService) DeleteArticle(id int) error
- func (a ArticleService) HasArticle(id uint) bool
- func (a ArticleService) UpdateArticle(articleOld *model.Article) error
Constants ¶
This section is empty.
Variables ¶
var ArticleDao = new(dao.ArticleDao)
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
ArticleService
}
type ArticleService ¶
type ArticleService struct {
// contains filtered or unexported fields
}
func (ArticleService) Article ¶
func (a ArticleService) Article(articleId int) (*response.ArticleDetails, error)
Article @Date 2023-02-20 16:25:22 @Param articleId string @Return *article.Article @Return error @Description: 根据单个id查询文章内容
func (ArticleService) ArticleCommentList ¶
func (a ArticleService) ArticleCommentList(pageInfo request.PageInfo, articleId int) ([]response.ArticleCommentInfo, error)
ArticleCommentList @Date 2023-02-25 15:57:03 @Param pageInfo request.PageInfo @Param articleId int @Return []response.ArticleCommentInfo @Return error @Description: 分页查询一个文章的所有信息列表
func (ArticleService) ArticlePage ¶
ArticlePage @Date 2023-02-20 17:36:17 @Param pageInfo sysreq.PageInfo @Return []article.HeadInfo @Return error @Description: 分页查询文章信息列表
func (ArticleService) CreateArticle ¶
func (a ArticleService) CreateArticle(newArticle *request.PostArticle, userId uint) error
CreateArticle @Date 2023-02-20 16:46:19 @Param article *article.Article @Return error @Description: 创建一篇新文章
func (ArticleService) DeleteArticle ¶
func (a ArticleService) DeleteArticle(id int) error
DeleteArticle @Date 2023-02-20 16:51:16 @Param id string @Return error @Description: 删除文章
func (ArticleService) HasArticle ¶
func (a ArticleService) HasArticle(id uint) bool
HasArticle @Date 2023-02-20 16:58:12 @Param id uint @Return bool @Description: 判断文章是否存在
func (ArticleService) UpdateArticle ¶
func (a ArticleService) UpdateArticle(articleOld *model.Article) error
UpdateArticle @Date 2023-02-20 17:00:38 @Param articleOld *article.Article @Return error @Description: 更新文章