package com.kym.service.wechat;

import com.kym.common.enums.MsgTemplateType;
import com.kym.service.wechat.impl.OrderCompletedParamBuilder;
import com.kym.service.wechat.impl.ParkingCouponParamBuilder;
import com.kym.service.wechat.impl.PaymentSuccessParamBuilder;
import com.kym.service.wechat.impl.RefundApplyParamBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class TemplateParamBuilderConfig {

    @Bean
    public Map<MsgTemplateType, TemplateParamBuilder> templateParamBuilders() {
        Map<MsgTemplateType, TemplateParamBuilder> builders = new HashMap<>();
        builders.put(MsgTemplateType.PAYMENT_SUCCESS, new PaymentSuccessParamBuilder());
        builders.put(MsgTemplateType.ORDER_COMPLETED, new OrderCompletedParamBuilder());
        builders.put(MsgTemplateType.PARKING_COUPON, new ParkingCouponParamBuilder());
        builders.put(MsgTemplateType.REFUND_APPLY, new RefundApplyParamBuilder());
        builders.put(MsgTemplateType.REFUND_SUCCESS, new RefundApplyParamBuilder());
        return builders;
    }
}
