Open qiaohui opened 6 years ago
基于反射的 viewmapper 的设置这里有个条件判断一直是 false: if (parameterTypes.length == 2 && parameterTypes[1] == BuildContext.class) 发现其中条件 parameterTypes[1] == BuildContext.class永远是false,估计不能这么判断, 所以测试时我把这个条件去掉,貌似还是在 map 时异常,找不到对应的view: apiHelper.getViewMapper().map(rv, buildContext)
ViewMapper建议你自己根据你的项目实现,或者其实自己直接map,viewmapper在jdk8下其实用处不大,就是一个自动根据类型map的实现,可以不用,只用model-builder就可以了。
也好,貌似orika这个包就是做深度beanclass复制
刚开始我用这个也是出现scan不到的问题,后来发现分析发现构造函数有特殊要求,不过用这么几年太顺了,以至于我想改造成注解模式scan也搁置了。 天船老师能不能在开源点其他的东西,我等着给你star呢 😆
@hai046 老了……开不动了……
https://github.com/qiaohui/credit-card
2017-11-09-17:58:03.810 INFO [restartedMain]-com.pay.card.utils.ApiHelper:67>>register view [CreditBankView] for model [CreditBank] with buildContext.
启动时,model view 会有 register。
但是 api 调用时会找不到 view:
帮忙看看是不是我把CardBuildContext使用错了,谢谢!