In my project, there is a logic similar to the following code, and there will be many types, but this is too messy to write, I want to ask if there is any m