• 订单模块-结构设计


    IOrderDomainService给网关调用,接收一个参数orderType,比如createOrder(CreateOrderRequest req)

    =======================================================================================================

    class OrderDomainService

    public CreateOrderResult createOrder(CreateOrderRequest request) {

      //参数验证

      return this.getOrderService(request.getOrderType().toString()).createOrder(request);

    }

    private IOrderService getOrderService(String orderType) {
        String className = String.format("orderService%s", orderType);
        IOrderService orderService = MyApplicationContext.getInstance().getBean(className, IOrderService.class, false);
        if (orderService == null) {
          throw new ServiceException(String.format("合作方订单服务未定义[%s]", orderType), ServiceException.NOT_EXIST);
        }
        return orderService;
    }

    ====================================================================================================================

    @Service("orderService1")
    public class Child1OrderService extends AbstractOrderService implements IChild1OrderService

    @Service("orderService2")
    public class Child2OrderService extends AbstractOrderService implements IChild2OrderService

  • 相关阅读:
    关于雷达(Radar)信道
    关于High CPU及基本排查
    UCS内存问题排查
    ASA-ACL类型
    思科室外AP无法注册到WLC
    WLC-Right to Use Licensing
    无线连接网络-FAST SSID Change
    ASA升级
    ASA密码恢复流程
    Mobility Express部署外部镜像服务器
  • 原文地址:https://www.cnblogs.com/joke0406/p/10905794.html
Copyright © 2020-2023  润新知