ThirdPayRoute.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:aaden-pay 作者:
public ThirdPayService route(PayChannel channel, PayType payType) throws Exception {
    if (thirdClassList == null)
        throw new Exception(ErrorMsgConstant.CHANNEL_NOT_SUPPORT);

    for (Class<?> clz : thirdClassList) {
        ChannelValue comment = clz.getAnnotation(ChannelValue.class);
        if (comment == null)
            continue;
        if (comment.channel() != channel)
            continue;

        if (!ArrayUtils.contains(comment.payType(), payType))
            continue;

        Service service = clz.getAnnotation(Service.class);
        if (service == null)
            continue;

        return (ThirdPayService) SpringContextHelper.getBean(service.value());
    }

    throw new Exception(ErrorMsgConstant.CHANNEL_NOT_SUPPORT);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号