Closed binchoo closed 2 years ago
ActionParamResolver
extends RequestResponseBodyMethodProcessor
, which is an argument resolver for @RequestBody
, to transparently convert JSON string to BarcodeData
type.HoyopassController
can directly get BardcodeData
from its handler argument.
Related #17
HoyopassController
receivesSkillPayload.Action.Params['secure_hoyopass']
which is a JSON string containing a user's Hoyoverse auth info.As-is Line32:
HoyopassController
is responsible to extract thebarcodeData
field.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 Let me transfer its conversion responsibility to
ActionParamResolver
.RequestResponseBodyMethodProcessor
already can bind request body to arbitrary types. LetActionParamResolver
extend its functionality to fulfill the conversion requirement.BarcodeData
at:ikakao
module.