yujian
2020-01-01 eed54c262df12dd3d132bf14691915e6183afd4c
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/ArticleOfficialServiceImpl.java
@@ -8,6 +8,7 @@
import javax.annotation.Resource;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.yeshi.utils.DateUtil;
@@ -171,6 +172,28 @@
      return articleOfficialDao.getById(id);
   }
   
   @Override
   public void updateReadNum(String id) {
      ArticleOfficial article = articleOfficialDao.getById(id);
      if (article != null) {
         Integer readNum = article.getReadNum();
         if (readNum == null) {
            readNum = 0;
         }
         article.setReadNum(readNum + 1);
         Integer readNumReal = article.getReadNumReal();
         if (readNumReal == null) {
            readNumReal = 0;
         }
         article.setReadNumReal(readNumReal + 1);
         articleOfficialDao.save(article);
      }
   }
   @Override
   public List<ArticleOfficial> query(int start, int count, String key,Integer state) {
      return articleOfficialDao.query(start, count, key, state);
@@ -182,6 +205,7 @@
   }
   @Override
   @Cacheable(value = "dynamicCache", key = "'queryValid-'+#start+'-'+#key")
   public List<ArticleVO> queryValid(int start, int count, String key) {
      return articleOfficialDao.queryValid(start, count, key);
   }