|
@@ -17,10 +17,7 @@ import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
-import org.jeecg.modules.aa.dto.AaCommodityDTO;
|
|
|
-import org.jeecg.modules.aa.dto.AaCommodityDTO2;
|
|
|
-import org.jeecg.modules.aa.dto.AaNewsQueryDTO;
|
|
|
-import org.jeecg.modules.aa.dto.SMDTO;
|
|
|
+import org.jeecg.modules.aa.dto.*;
|
|
|
import org.jeecg.modules.aa.entity.*;
|
|
|
import org.jeecg.modules.aa.service.*;
|
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
@@ -442,18 +439,34 @@ public class APIIndexenterController {
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
+ @ApiOperationSupport(order = 31)
|
|
|
+ @ApiOperation(value = "获取新闻页顶部资源", notes = "获取新闻页顶部资源")
|
|
|
+ @PostMapping(value = "/getNewsHeadAssets")
|
|
|
+ public Result<AaPoster> getNewsHeadAssets() {
|
|
|
+ AaPoster byId = aaPosterService.getById("1734144586119450625");
|
|
|
+ byId.setCover(host + "/sys/common/static/" + byId.getCover());
|
|
|
+ return Result.OK(byId);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@ApiOperationSupport(order = 30)
|
|
|
@ApiOperation(value="获取新闻分页列表", notes="获取新闻分页列表")
|
|
|
- @GetMapping(value = "/getNewsPageList")
|
|
|
- public Result<IPage<AaNews>> queryPageList(AaNews aaNews,
|
|
|
- @ApiParam(name="pageNo",value="页数") @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
- @ApiParam(name="pageSize",value="每页数量") @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
+ @PostMapping(value = "/getNewsPageList")
|
|
|
+ public Result<IPage<AaNews>> queryPageList(@RequestBody AaNewsDTO aaNews,
|
|
|
HttpServletRequest req) {
|
|
|
- if (aaNews!=null && !Strings.isNullOrEmpty(aaNews.getTitle())){
|
|
|
- aaNews.setTitle("*"+aaNews.getTitle()+"*");
|
|
|
+ Integer pageNo = aaNews.getPageNo();
|
|
|
+ if (pageNo ==null) {
|
|
|
+ pageNo = 1;
|
|
|
+ }
|
|
|
+ Integer pageSize = aaNews.getPageSize();
|
|
|
+ if (pageSize == null) {
|
|
|
+ pageSize = 10;
|
|
|
+ }
|
|
|
+ QueryWrapper<AaNews> queryWrapper = new QueryWrapper<>();
|
|
|
+ if (!Strings.isNullOrEmpty(aaNews.getTypeId())){
|
|
|
+ queryWrapper.eq("type_id",aaNews.getTypeId());
|
|
|
}
|
|
|
- QueryWrapper<AaNews> queryWrapper = QueryGenerator.initQueryWrapper(aaNews, req.getParameterMap());
|
|
|
+ queryWrapper.select("id,pic,title,title_english,des,des_english,weight,type_id,create_time");
|
|
|
queryWrapper.orderByDesc("create_time");
|
|
|
Page<AaNews> page = new Page<AaNews>(pageNo, pageSize);
|
|
|
IPage<AaNews> pageList = aaNewsService.page(page, queryWrapper);
|