ContentBizImpl.java 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * The MIT License (MIT)
  3. * Copyright (c) 2020 铭软科技(mingsoft.net)
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. * this software and associated documentation files (the "Software"), to deal in
  6. * the Software without restriction, including without limitation the rights to
  7. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  8. * the Software, and to permit persons to whom the Software is furnished to do so,
  9. * subject to the following conditions:
  10. * The above copyright notice and this permission notice shall be included in all
  11. * copies or substantial portions of the Software.
  12. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  14. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  15. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  16. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. */
  19. package net.mingsoft.cms.biz.impl;
  20. import net.mingsoft.base.biz.impl.BaseBizImpl;
  21. import net.mingsoft.base.dao.IBaseDao;
  22. import net.mingsoft.cms.bean.CategoryBean;
  23. import net.mingsoft.cms.bean.ContentBean;
  24. import net.mingsoft.cms.biz.IContentBiz;
  25. import net.mingsoft.cms.dao.ICategoryDao;
  26. import net.mingsoft.cms.dao.IContentDao;
  27. import net.mingsoft.cms.entity.ContentEntity;
  28. import net.mingsoft.mdiy.entity.ModelEntity;
  29. import org.slf4j.Logger;
  30. import org.slf4j.LoggerFactory;
  31. import org.springframework.beans.factory.annotation.Autowired;
  32. import org.springframework.beans.factory.annotation.Value;
  33. import org.springframework.stereotype.Service;
  34. import java.util.List;
  35. import java.util.Map;
  36. /**
  37. * 文章管理持久化层
  38. * @author 铭飞开发团队
  39. * 创建日期:2019-11-28 15:12:32<br/>
  40. * 历史修订:<br/>
  41. */
  42. @Service("cmscontentBizImpl")
  43. public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> implements IContentBiz {
  44. /*
  45. * log4j日志记录
  46. */
  47. protected final Logger LOG = LoggerFactory.getLogger(this.getClass());
  48. @Autowired
  49. private IContentDao contentDao;
  50. /**
  51. * 栏目管理业务层
  52. */
  53. @Autowired
  54. private ICategoryDao categoryDao;
  55. @Value("${ms.html-dir:html}")
  56. private String htmlDir;
  57. @Override
  58. protected IBaseDao getDao() {
  59. // TODO Auto-generated method stub
  60. return contentDao;
  61. }
  62. @Override
  63. public List<CategoryBean> queryIdsByCategoryIdForParser(ContentBean contentBean) {
  64. return this.contentDao.queryIdsByCategoryIdForParser(contentBean);
  65. }
  66. @Override
  67. public int getSearchCount(ModelEntity contentModel, List diyList, Map whereMap, int appId, String categoryIds) {
  68. if (contentModel!=null) {
  69. return contentDao.getSearchCount(contentModel.getModelTableName(),diyList,whereMap, appId,categoryIds);
  70. }
  71. return contentDao.getSearchCount(null,null,whereMap, appId,categoryIds);
  72. }
  73. }