PicConfigVo.java 884 Bytes
package com.viontech.storage.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;
import com.viontech.storage.entity.Context;
import com.viontech.storage.model.Caption;
import com.viontech.storage.model.PicConfig;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * .
 *
 * @author 谢明辉
 * @date 2021/11/8
 */

@Getter
@Setter
public class PicConfigVo extends PicConfig{

    List<Context> contexts;


    public static PicConfigVo copy(PicConfig picConfig) {
        if (picConfig == null) {
            return null;
        }
        PicConfigVo picConfigVo = new PicConfigVo();
        BeanUtil.copyProperties(picConfig, picConfigVo, true);
        if (picConfigVo.getContext() != null) {
            picConfigVo.setContexts(JSONUtil.toList(picConfigVo.getContext(), Context.class));
        }
        return picConfigVo;
    }

}