Commit 477e0cc5 by rongkailun

【新增】首页资讯中心查询新增

parent 0c0d5523
......@@ -2,6 +2,8 @@ package io.office.modules.manage.controller;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.dto.NewsParams;
......@@ -134,5 +136,31 @@ public class NewsController extends AbstractController {
}
}
/**
* 资讯中心
*/
@Login
@PostMapping("/api/realTimeInfo")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R realTimeInfo(@RequestParam Map<String, Object> params) {
try {
return R.ok().put("data", newsService.selectRealTimeInfo(params));
} catch (Exception e) {
log.error("realTimeInfo error:", e);
return R.error(e.getMessage());
}
}
/**
* 资讯中心查看
*/
@Login
@GetMapping("/api/info/{id}")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id) {
NewsEntity news = newsService.getById(id);
return R.ok().put("data", news);
}
}
......@@ -141,4 +141,37 @@ public class PictureController extends AbstractController {
}
}
@Login
@PostMapping("/api/pictureList")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R pictureList() {
try {
QueryWrapper<PictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("status","1");
newsEntityQueryWrapper.gt("PicLevel","0");
newsEntityQueryWrapper.orderByDesc("PicLevel");
newsEntityQueryWrapper.orderByDesc("showtime");
newsEntityQueryWrapper.orderByDesc("inputDate");
newsEntityQueryWrapper.orderByDesc("pictureID");
List<PictureEntity> list = pictureService.list(newsEntityQueryWrapper);
return R.ok().put("data", list);
} catch (Exception e) {
log.error("pictureList error:", e);
return R.error(e.getMessage());
}
}
/**
* 信息
*/
@Login
@RequestMapping("/api/info/{pictureid}")
// @RequiresPermissions("generator:picture:info")
public R getDetail(@PathVariable("pictureid") Integer pictureid){
PictureEntity picture = pictureService.getById(pictureid);
return R.ok().put("picture", picture);
}
}
......@@ -30,4 +30,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
*/
List<NewsEntity> selectNewsListCondition(@Param("newsEntity") NewsEntity newsEntity);
List<NewsEntity> selectRealTimeInfo(Map<String, Object> params);
}
......@@ -33,5 +33,6 @@ public interface NewsService extends IService<NewsEntity> {
List<NewsEntity> selectNewsListCondition(NewsEntity newsEntity);
List<NewsEntity> selectRealTimeInfo(Map<String, Object> params);
}
......@@ -113,4 +113,9 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return newsDao.selectNewsListCondition(newsEntity);
}
@Override
public List<NewsEntity> selectRealTimeInfo(Map<String, Object> params) {
return newsDao.selectRealTimeInfo(params);
}
}
\ No newline at end of file
......@@ -181,5 +181,29 @@
id DESC
</select>
<select id="selectRealTimeInfo" resultMap="newsMap">
SELECT t.id,
t.title,
t.author,
t.showtime,
t.startdate,
t.keyword,
t.editor,
t.lasteditor,
t.auditor,
t.status,
t.classid,
t.levels,
t.releasedate,
t.updatedate,
t1.name
from news t
LEFT JOIN newsClass t1
on t.classid = t1.columnid
where t1.name is not null
and t.classid = #{classid}
and t.levels > 0
and t.status = '1'
order by t.levels desc,t.showtime desc ,t.id desc
</select>
</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