log.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package blog_service
  2. import (
  3. "gfast/plugin/blog/model/blog_log"
  4. )
  5. // 添加
  6. func AddLogSave(req *blog_log.AddReq) error {
  7. return blog_log.AddSave(req)
  8. }
  9. // 删除
  10. func DeleteLogByIDs(Ids []int) error {
  11. return blog_log.DeleteByIDs(Ids)
  12. }
  13. //修改
  14. func EditLogSave(editReq *blog_log.EditReq) error {
  15. return blog_log.EditSave(editReq)
  16. }
  17. // 根据ID查询
  18. func GetLogByID(id int64) (*blog_log.ListEntity, error) {
  19. return blog_log.GetLogByID(id)
  20. }
  21. // 分页查询日志
  22. func SelectLogListByPage(req *blog_log.SelectPageReq) (total int, page int64, list []*blog_log.ListEntity, err error) {
  23. return blog_log.SelectListByPage(req)
  24. }
  25. // 按时间倒序查询size篇标志为sign分类id为typeId,状态为status的文章,标志值0.一般,1.置顶,2.幻灯,3.推荐,typeId等于0时不区分分类
  26. func FindSizeArticleBySign(size int, status int, sign int, typeId int) ([]*blog_log.ListEntity, error) {
  27. return blog_log.FindSizeArticleBySign(size, status, sign, typeId)
  28. }
  29. // 按时间倒序查询size篇分类id为typeId,状态为status的文章,typeId等于0时不区分分类
  30. func FindSizeArticle(size int, status int, typeId int) (list []*blog_log.ListEntity, err error) {
  31. return blog_log.FindSizeArticle(size, status, typeId)
  32. }
  33. // 查询size篇文章并根据点击数排序
  34. func FindArticleByHits(size int, status int) ([]*blog_log.Entity, error) {
  35. return blog_log.FindArticleByHits(size, status)
  36. }