binchoo / PaimonGanyu

여행 비서 페이몬! Genshin Impact AWS workflows & KakaoTalk chatbot skills
https://pf.kakao.com/_mtPFb
GNU General Public License v3.0
7 stars 1 forks source link

[Application] HoyopassController> convert barcode json with WebDataBinder and PropertyEditor #17

Closed binchoo closed 2 years ago

binchoo commented 2 years ago

As-is Line 32: an additional object mapping logic exists. https://github.com/binchoo/PaimonGanyu/blob/401993f42913ac104e28f61d89c605374a20e6cc/PaimonGanyu/application/src/main/java/org/binchoo/paimonganyu/chatbot/controllers/HoyopassController.java#L30-L38

https://github.com/binchoo/PaimonGanyu/blob/401993f42913ac104e28f61d89c605374a20e6cc/PaimonGanyu/application/src/main/java/org/binchoo/paimonganyu/chatbot/controllers/HoyopassController.java#L59-L66

To-be Use WebDataBinder. You customize it with PropertyEditor. ref: https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc-ann-initbinder

binchoo commented 2 years ago

No. If once a new PropertyEditor is introduced, still this cannot transparently bind the barcode string. The existing ActionParamResolver should explicitly use that editor.

I think that when the ActionParamResolver extends RequestResponseBodyMethodProcessor, things become easier.