一、手写
public class ObjectModel implements Serializable {

public <T> T fromDTO(Object record, Class<T> Class) {

return JSONObject.parseObject(JSONObject.toJSONString(record), Class);
}

}

二、org.springframework.beans.BeanUtils
BeanUtils.copyProperties(inDto,data);



posted on 2022-01-27 17:41  茫无所知  阅读(44)  评论(0编辑  收藏  举报