Commit 4dce1cee by rongkailun

【修改】资讯中心重构接口

parent 2ba44fb2
...@@ -542,5 +542,72 @@ public class NewsController extends AbstractController { ...@@ -542,5 +542,72 @@ public class NewsController extends AbstractController {
return R.ok().put("page", pageUtils); return R.ok().put("page", pageUtils);
} }
/***********************************资讯中心重构接口******************************************************/
/**
* 综合报道
*/
@Login
@RequestMapping("/api/zhbdList")
// @RequiresPermissions("manage:product:findPage")
public R zhbdList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.zhbdList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**
* 标准科研动态
*/
@Login
@RequestMapping("/api/bzkydtList")
// @RequiresPermissions("manage:product:findPage")
public R bzkydtList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.bzkydtList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**
* 深度专题
*/
@Login
@RequestMapping("/api/sdztList")
// @RequiresPermissions("manage:product:findPage")
public R sdztList(@RequestBody NewsParams newsParams) {
Page<NewtopicEntity> page = this.newsService.sdztList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**
* 精彩视频
*/
@Login
@RequestMapping("/api/jcspList")
// @RequiresPermissions("manage:product:findPage")
public R jcspList(@RequestBody NewsParams newsParams) {
Page<NewsMovieEntity> page = this.newsService.jcspList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
@Autowired
@Lazy
private NewsMovieService newsMovieService;
/**
*精彩视频详情
*/
@Login
/**
* 信息
*/
@RequestMapping("/api/jcspiInfo/{id}")
// @RequiresPermissions("manage:newsmovie:info")
public R jcspiInfo(@PathVariable("id") Integer id){
NewsMovieEntity newsMovie = newsMovieService.getById(id);
return R.ok().put("data", newsMovie);
}
} }
...@@ -95,4 +95,12 @@ public interface NewsDao extends BaseMapper<NewsEntity> { ...@@ -95,4 +95,12 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsEntity> relatedLinks(Map<String, Object> params); List<NewsEntity> relatedLinks(Map<String, Object> params);
List<SearchVo> getSearchInfo(@Param("name") String name,@Param("type") String type, Page page); List<SearchVo> getSearchInfo(@Param("name") String name,@Param("type") String type, Page page);
List<NewsEntity> zhbdList(@Param("newsParams")NewsParams newsParams, Page page);
List<NewsEntity> bzkydtList(NewsParams newsParams, Page page);
List<NewtopicEntity> sdztList(NewsParams newsParams, Page page);
List<NewsMovieEntity> jcspList(NewsParams newsParams, Page page);
} }
...@@ -93,5 +93,13 @@ public interface NewsService extends IService<NewsEntity> { ...@@ -93,5 +93,13 @@ public interface NewsService extends IService<NewsEntity> {
List<NewsEntity> relatedLinks(Map<String, Object> params); List<NewsEntity> relatedLinks(Map<String, Object> params);
Page<SearchVo> getSearchInfo(String name,String type, Page page); Page<SearchVo> getSearchInfo(String name,String type, Page page);
Page<NewsEntity> zhbdList(NewsParams newsParams, Page page);
Page<NewsEntity> bzkydtList(NewsParams newsParams, Page page);
Page<NewtopicEntity> sdztList(NewsParams newsParams, Page page);
Page<NewsMovieEntity> jcspList(NewsParams newsParams, Page page);
} }
...@@ -570,5 +570,33 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements ...@@ -570,5 +570,33 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return page; return page;
} }
@Override
public Page<NewsEntity> zhbdList(NewsParams newsParams, Page page) {
List<NewsEntity> list = this.newsDao.zhbdList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<NewsEntity> bzkydtList(NewsParams newsParams, Page page) {
List<NewsEntity> list = this.newsDao.bzkydtList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<NewtopicEntity> sdztList(NewsParams newsParams, Page page) {
List<NewtopicEntity> list = this.newsDao.sdztList(newsParams,page);
page.setRecords(list);
return page;
}
@Override
public Page<NewsMovieEntity> jcspList(NewsParams newsParams, Page page) {
List<NewsMovieEntity> list = this.newsDao.jcspList(newsParams,page);
page.setRecords(list);
return page;
}
} }
\ No newline at end of file
...@@ -622,9 +622,63 @@ order by releasedate desc ...@@ -622,9 +622,63 @@ order by releasedate desc
</select> </select>
<select id="zhbdList" resultType="io.office.modules.manage.entity.NewsEntity">
SELECT
ltrim(b.name) classname ,a.*
FROM
news a
LEFT JOIN newsclass b ON a.classid = b.id
WHERE
status = 1
AND levels > 0
AND (
classid = 5
OR (
classid IN (
SELECT
id
FROM
newsClass
WHERE
p_id = 5
)
)
)
ORDER BY
levels DESC,
a.showtime DESC,
a.id DESC
</select>
<select id="bzkydtList" resultType="io.office.modules.manage.entity.NewsEntity">
SELECT
*
FROM
news
WHERE
status = 1
AND levels > 0
AND classid IN (32, 33)
ORDER BY
levels DESC,
showtime DESC,
id DESC
</select>
<select id="sdztList" resultType="io.office.modules.manage.entity.NewtopicEntity">
select * from newtopic where levels>0 and parentid=0 and checkflag=1 order by levels desc,showtime desc,classid desc
</select>
<select id="jcspList" resultType="io.office.modules.manage.entity.NewsMovieEntity">
SELECT
*
FROM
news_movie
WHERE
status = 1
AND levels > 0
ORDER BY
levels DESC,
showtime DESC,
id DESC
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment