
package cn.orionsec.ops.mapping.app;

import cn.orionsec.kit.lang.utils.convert.TypeStore;
import cn.orionsec.ops.entity.domain.ApplicationInfoDO;
import cn.orionsec.ops.entity.vo.app.ApplicationDetailVO;
import cn.orionsec.ops.entity.vo.app.ApplicationInfoVO;


public class ApplicationConversion {

    static {
        TypeStore.STORE.register(ApplicationInfoDO.class, ApplicationInfoVO.class, p -> {
            ApplicationInfoVO vo = new ApplicationInfoVO();
            vo.setId(p.getId());
            vo.setName(p.getAppName());
            vo.setTag(p.getAppTag());
            vo.setSort(p.getAppSort());
            vo.setRepoId(p.getRepoId());
            vo.setDescription(p.getDescription());
            return vo;
        });
    }

    static {
        TypeStore.STORE.register(ApplicationInfoDO.class, ApplicationDetailVO.class, p -> {
            ApplicationDetailVO vo = new ApplicationDetailVO();
            vo.setId(p.getId());
            vo.setName(p.getAppName());
            vo.setTag(p.getAppTag());
            vo.setDescription(p.getDescription());
            vo.setRepoId(p.getRepoId());
            return vo;
        });
    }

}
