doc_file_service.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package service
  2. import (
  3. "ulink-admin/modules/doc/dao"
  4. "ulink-admin/modules/doc/models/model"
  5. "ulink-admin/modules/doc/models/req"
  6. )
  7. type DocFileService struct {
  8. docFileDao dao.DocFileDao
  9. }
  10. // List 查询所有文档管理业务方法
  11. func (this DocFileService) List(query *req.DocFileQuery, list interface{}) {
  12. this.docFileDao.List(query, list)
  13. }
  14. // Page 查询文档管理分页列表
  15. func (this DocFileService) Page(query *req.DocFileQuery) (*[]model.DocFile, int64) {
  16. return this.docFileDao.Page(query)
  17. }
  18. // Insert 添加文档管理
  19. func (this DocFileService) Insert(docFile *model.DocFile) {
  20. this.docFileDao.Insert(docFile)
  21. }
  22. // Get 查询
  23. func (this DocFileService) Get(id int64) *model.DocFile {
  24. model := &model.DocFile{}
  25. this.docFileDao.GetById(id, model)
  26. return model
  27. }
  28. // Delete 批量删除
  29. func (this DocFileService) Delete(list []int64) {
  30. this.docFileDao.Delete(&model.DocFile{}, list)
  31. }
  32. // Edit 修改
  33. func (this DocFileService) Edit(docFile *model.DocFile, cols []string) {
  34. this.docFileDao.Update(docFile, cols...)
  35. }