/** 数据对象到模型对象 */ public static UploadFileModel convert(UploadFileDTO srcObj) { if (srcObj == null) { return null; } UploadFileModel dstObj = new UploadFileModel(); BeanUtils.copyProperties(srcObj, dstObj); dstObj.setCatgEnum(UploadFileCatgEnum.find(srcObj.getCatg())); return dstObj; }
/** 模型对象到数据对象 */ public static UploadFileDTO convert(UploadFileModel srcObj) { if (srcObj == null) { return null; } UploadFileDTO dstObj = new UploadFileDTO(); BeanUtils.copyProperties(srcObj, dstObj); dstObj.setCatg(srcObj.getCatgEnum().code()); return dstObj; }