| | |
| | | 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); |
| | |
| | | } |
| | | int page_no_int = Integer.valueOf(page_no).intValue(); |
| | | Page<News> page = new Page<>(1, 1000000); |
| | | // List<News> list = this.newsService.cachePagedQuery(page_no_int, 20, language).getElements(); |
| | | if(language.equals("cht")){ |
| | | language = "CN"; |
| | | }else if(language.equals("jp")){ |
| | | language = "Japanese"; |
| | | } |
| | | LambdaQueryWrapper<News> lambdaQueryWrapper = Wrappers.<News>query().lambda().eq(News::getLanguage, language) |
| | | .eq(News::isPopUp,false); |
| | | lambdaQueryWrapper.orderByDesc(News::getCreateTime); |
| | |
| | | news.setShow(news.getUserId().equals(SecurityUtils.getCurrentUserId())); |
| | | } |
| | | if (StringUtils.isNotEmpty(news.getImgUrl())) { |
| | | news.setImgUrl(awsS3OSSFileService.getUrl(news.getImgUrl())); |
| | | news.setImgUrl(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()); |
| | | } |
| | | |
| | | } |
| | |
| | | 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()); |
| | | } |
| | | |
| | | } |