package org.springblade.payment.callback.inivtation;

import org.springblade.common.enums.AppConstant;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: lianghanqiang
 * @description: 入网通知回调
 * @since: 9/15/21 -- 5:27 PM
 */
public class InvitationCallback implements InvitationCallbackHandle {

	private Map<AppConstant.InvitationType,InvitationCallbackHandle> handleMap = new HashMap(4){{
		put(AppConstant.InvitationType.MALL_INVITATION,new MallInvitationCallback());
		put(AppConstant.InvitationType.SHOP_INVITATION,new ShopInvitationCallback());
	}};

	@Override
	public void handle(HttpServletRequest httpRequest, AppConstant.InvitationType invitationType) {
		this.handleMap.get(invitationType).handle(httpRequest,invitationType);
	}
}
