| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yami.trading.bean.cms.News; |
| | | import com.yami.trading.common.constants.Constants; |
| | | import com.yami.trading.common.domain.Result; |
| | | import com.yami.trading.common.exception.YamiShopBindException; |
| | | import com.yami.trading.common.util.DateUtils; |
| | |
| | | |
| | | } |
| | | if (StringUtils.isNotEmpty(news.getImgUrl())) { |
| | | news.setImgUrl(awsS3OSSFileService.getUrl(news.getImgUrl())); |
| | | news.setImgUrl(Constants.IMAGES_HTTP+news.getImgUrl()); |
| | | } |
| | | |
| | | return Result.succeed(news); |
| | |
| | | */ |
| | | @RequestMapping(action + "list.action") |
| | | public Object list(HttpServletRequest request) { |
| | | |
| | | String page_no = request.getParameter("page_no"); |
| | | List<News> list = new ArrayList<>(); |
| | | return list; |
| | | /*String page_no = request.getParameter("page_no"); |
| | | String language = request.getParameter("language"); |
| | | if (StringUtils.isNullOrEmpty(page_no)) { |
| | | page_no = "1"; |
| | |
| | | .eq(News::isPopUp,false); |
| | | lambdaQueryWrapper.orderByDesc(News::getCreateTime); |
| | | newsService.page(page, lambdaQueryWrapper); |
| | | List<News> list = page.getRecords(); |
| | | list = page.getRecords(); |
| | | if (list != null) { |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setCreateTimeStr(DateUtils.format(list.get(i).getCreateTime(), DateUtils.DF_yyyyMMddHHmmss)); |
| | |
| | | news.setShow(news.getUserId().equals(SecurityUtils.getCurrentUserId())); |
| | | } |
| | | if (StringUtils.isNotEmpty(news.getImgUrl())) { |
| | | news.setImgUrl(awsS3OSSFileService.getUrl(news.getImgUrl())); |
| | | news.setImgUrl(news.getImgUrl()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return Result.succeed(list); |
| | | return Result.succeed(list);*/ |
| | | } |
| | | |
| | | /** |
| | |
| | | list.get(i).setCreateTimeStr(DateUtils.format(list.get(i).getCreateTime(), DateUtils.DF_yyyyMMddHHmmss)); |
| | | News news = list.get(i); |
| | | if (StringUtils.isNotEmpty(news.getImgUrl())) { |
| | | news.setImgUrl(awsS3OSSFileService.getUrl(news.getImgUrl())); |
| | | news.setImgUrl(Constants.IMAGES_HTTP+news.getImgUrl()); |
| | | } |
| | | |
| | | } |
| | |
| | | list.get(i).setCreateTimeStr(DateUtils.format(list.get(i).getCreateTime(), DateUtils.DF_yyyyMMddHHmmss)); |
| | | News news = list.get(i); |
| | | if (StringUtils.isNotEmpty(news.getImgUrl())) { |
| | | news.setImgUrl(awsS3OSSFileService.getUrl(news.getImgUrl())); |
| | | news.setImgUrl(Constants.IMAGES_HTTP+news.getImgUrl()); |
| | | } |
| | | |
| | | } |