SmsPipeline.java 1.04 KB
package com.diligrp.cashier.assistant.pipeline;

import com.diligrp.cashier.assistant.domain.SmsMessage;
import com.diligrp.cashier.assistant.type.SmsPipelineType;

public abstract class SmsPipeline {
    // 通道编码
    protected final int code;
    // 通道名称
    protected final String name;
    // 通道类型
    protected final SmsPipelineType type;

    public SmsPipeline(int code, String name, SmsPipelineType type) {
        this.code = code;
        this.name = name;
        this.type = type;
    }

    /**
     * 根据短信模版发送短信
     *
     * @param message - 短信
     * @return 短信唯一标识
     */
    public abstract String sendSmsMessage(SmsMessage message);

    public void destroy() {
    }

    /**
     * 获取通道code
     */
    public int getCode() {
        return this.code;
    }

    /**
     * 获取通道编码
     */
    public String getName() {
        return this.name;
    }

    /**
     * 获取通道类型
     */
    public SmsPipelineType getType() {
        return this.type;
    }
}