All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.haoxuer.discover.article.rest.convert.ArticleCatalogSimpleConvert Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
package com.haoxuer.discover.article.rest.convert;

import com.haoxuer.discover.article.api.domain.simple.ArticleCatalogSimple;
import com.haoxuer.discover.article.data.entity.ArticleCatalog;
import com.haoxuer.discover.data.rest.core.Conver;
import com.haoxuer.discover.config.utils.ConverResourceUtils;
import lombok.Data;


@Data
public class ArticleCatalogSimpleConvert implements Conver {

    private int fetch;

    @Override
    public ArticleCatalogSimple conver(ArticleCatalog source) {
        ArticleCatalogSimple result = new ArticleCatalogSimple();

         result.setId(source.getId());
         result.setLabel(source.getName());
         result.setValue(""+source.getId());
         result.setName(source.getName());
         if (fetch!=0&&source.getChildren()!=null&&source.getChildren().size()>0){
             result.setChildren(ConverResourceUtils.converList(source.getChildren(),this));
         }
        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy