From f7b2baec57a19039ca85880bbba4e17fe27f0511 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 10 三月 2021 18:21:13 +0800 Subject: [PATCH] 删除冗余代码,初步优化首页的推荐专题,3.8.7之后在我的里面添加VIP分类 --- src/main/java/com/yeshi/buwan/service/imp/SystemService.java | 96 +++++++++--------------------------------------- 1 files changed, 18 insertions(+), 78 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/service/imp/SystemService.java b/src/main/java/com/yeshi/buwan/service/imp/SystemService.java index 51cebf9..437707d 100644 --- a/src/main/java/com/yeshi/buwan/service/imp/SystemService.java +++ b/src/main/java/com/yeshi/buwan/service/imp/SystemService.java @@ -1,9 +1,13 @@ package com.yeshi.buwan.service.imp; -import java.util.List; - -import javax.annotation.Resource; - +import com.yeshi.buwan.dao.system.DetailSystemDao; +import com.yeshi.buwan.dao.system.SystemInfoDao; +import com.yeshi.buwan.domain.*; +import com.yeshi.buwan.domain.special.Special; +import com.yeshi.buwan.domain.special.SuperSpecial; +import com.yeshi.buwan.domain.system.DetailSystem; +import com.yeshi.buwan.domain.system.SystemInfo; +import com.yeshi.buwan.util.Constant; import org.apache.log4j.Logger; import org.hibernate.HibernateException; import org.hibernate.Session; @@ -11,32 +15,8 @@ import org.springframework.orm.hibernate4.HibernateCallback; import org.springframework.stereotype.Service; -import com.yeshi.buwan.dao.DetailSystemDao; -import com.yeshi.buwan.dao.SystemInfoDao; -import com.yeshi.buwan.domain.DetailSystem; -import com.yeshi.buwan.domain.HomeAd; -import com.yeshi.buwan.domain.HomeType; -import com.yeshi.buwan.domain.HotSearch; -import com.yeshi.buwan.domain.HotStar; -import com.yeshi.buwan.domain.HotVideoType; -import com.yeshi.buwan.domain.ShareContent; -import com.yeshi.buwan.domain.SuperHomeAd; -import com.yeshi.buwan.domain.SuperHomeNotice; -import com.yeshi.buwan.domain.SuperHomeType; -import com.yeshi.buwan.domain.SuperHotSearch; -import com.yeshi.buwan.domain.SuperHotStar; -import com.yeshi.buwan.domain.SuperHotType; -import com.yeshi.buwan.domain.SuperRecommendAd; -import com.yeshi.buwan.domain.SuperUserBanner; -import com.yeshi.buwan.domain.SuperVideoType; -import com.yeshi.buwan.domain.SystemInfo; -import com.yeshi.buwan.domain.UserBanner; -import com.yeshi.buwan.domain.VideoBanQuan; -import com.yeshi.buwan.domain.VideoBanQuanVideo; -import com.yeshi.buwan.domain.VideoType; -import com.yeshi.buwan.domain.special.Special; -import com.yeshi.buwan.domain.special.SuperSpecial; -import com.yeshi.buwan.util.Constant; +import javax.annotation.Resource; +import java.util.List; /** * 绯荤粺鍒嗙被鏈嶅姟 @@ -58,61 +38,21 @@ @Resource private SpecialService specialService; - public ClassService getClassService() { - return classService; - } - - public void setClassService(ClassService classService) { - this.classService = classService; - } - - public StarService getStarService() { - return starService; - } - - public void setStarService(StarService starService) { - this.starService = starService; - } - - public SpecialService getSpecialService() { - return specialService; - } - - public void setSpecialService(SpecialService specialService) { - this.specialService = specialService; - } - - public SystemInfoDao getSystemInfoDao() { - return systemInfoDao; - } - - public void setSystemInfoDao(SystemInfoDao systemInfoDao) { - this.systemInfoDao = systemInfoDao; - } - - public DetailSystemDao getDetailSystemDao() { - return detailSystemDao; - } - - public void setDetailSystemDao(DetailSystemDao detailSystemDao) { - this.detailSystemDao = detailSystemDao; - } - - public List<DetailSystem> getDetailSystemList() { - List<DetailSystem> list = detailSystemDao.list("from DetailSystem"); + public List<DetailSystem> getDetailSystemList(String systemId) { + List<DetailSystem> list = detailSystemDao.list("from DetailSystem ds where ds.system.id=?", systemId); return list; } - public List<DetailSystem> getDetailSystemList(String key, int pageIndex) { + public List<DetailSystem> getDetailSystemList(String key, String systemId, int pageIndex) { List<DetailSystem> list = detailSystemDao.list( - "from DetailSystem ds where ds.appName like ? order by ds.createtime desc", - (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new String[]{"%" + key + "%"}); + "from DetailSystem ds where ds.appName like ? and ds.system.id=? order by ds.createtime desc", + (pageIndex - 1) * Constant.pageCount, Constant.pageCount, new String[]{"%" + key + "%", systemId}); return list; } - public long getDetailSystemListCount(String key) { - return detailSystemDao.getCount("select count(*) from DetailSystem d where d.appName like ?", - new String[]{"%" + key + "%"}); + public long getDetailSystemListCount(String key, String systemId) { + return detailSystemDao.getCount("select count(*) from DetailSystem d where d.appName like ? and d.system.id=?", + new String[]{"%" + key + "%", systemId}); } @Cacheable(value = "homeCache", key = "'getDetailSystemByPackage'+'-'+#packageName") -- Gitblit v1.8.0