Search in sources :

Example 1 with TbImageExample

use of cn.exrick.manager.pojo.TbImageExample in project xmall by Exrick.

the class ContentImageServiceImpl method getContentImage.

@Override
public DataTablesResult getContentImage() {
    DataTablesResult result = new DataTablesResult();
    List<ImageDto> list = new ArrayList<>();
    TbImageExample example = new TbImageExample();
    List<TbImage> listImage = tbImageMapper.selectByExample(example);
    for (int i = 0; i < listImage.size(); i++) {
        ImageDto imageDto = DtoUtil.TbImage2ImageDto(listImage.get(i));
        TbContentCategory tbContentCategory = tbContentCategoryMapper.selectByPrimaryKey(Long.valueOf(listImage.get(i).getCategoryId()));
        imageDto.setCategory(tbContentCategory.getName());
        list.add(imageDto);
    }
    result.setData(list);
    return result;
}
Also used : TbImage(cn.exrick.manager.pojo.TbImage) TbContentCategory(cn.exrick.manager.pojo.TbContentCategory) DataTablesResult(cn.exrick.common.pojo.DataTablesResult) ArrayList(java.util.ArrayList) ImageDto(cn.exrick.manager.dto.ImageDto) TbImageExample(cn.exrick.manager.pojo.TbImageExample)

Aggregations

DataTablesResult (cn.exrick.common.pojo.DataTablesResult)1 ImageDto (cn.exrick.manager.dto.ImageDto)1 TbContentCategory (cn.exrick.manager.pojo.TbContentCategory)1 TbImage (cn.exrick.manager.pojo.TbImage)1 TbImageExample (cn.exrick.manager.pojo.TbImageExample)1 ArrayList (java.util.ArrayList)1