重构支付模块时,我把 600 行 if-else 拆成了四个模式 上个月接手支付模块重构。打开 PaymentService.pay() 那一刻我有点懵:一个方法 600 多行,开头十几个 if (channel == WECHAT) ... else if (channel == ALIPAY)