All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quhaodian.plug.alidayu.DayuPlug Maven / Gradle / Ivy

There is a newer version: 1.8.10
Show newest version
package com.quhaodian.plug.alidayu;

import com.quhaodian.discover.rest.base.ResponseObject;
import com.quhaodian.plug.api.SendCodePlugin;
import com.quhaodian.plug.data.entity.PluginConfig;
import com.tongna.adminstore.AliyunCodePlug;
import com.tongna.adminstore.CodeSendDto;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component("dayuPlug")
public class DayuPlug extends SendCodePlugin {

    @Override
    public boolean sendCode(Map params) {
        PluginConfig pluginConfig = getPluginConfig();
        if (pluginConfig != null) {
            String code=params.get("code");
            String template=params.get("template");
            String phone=params.get("phone");
            String appkey = pluginConfig.getAttribute("appkey");
            String secret = pluginConfig.getAttribute("secret");
            String tempProduct = pluginConfig.getAttribute("product");
            String tempSignName = pluginConfig.getAttribute("signName");
            String temp = pluginConfig.getAttribute(template);

            AliyunCodePlug plug = new AliyunCodePlug(appkey, secret);
            CodeSendDto dto = new CodeSendDto();
            dto.setCode(code);
            dto.setPhone(phone);
            dto.setProduct(tempProduct);
            dto.setSignName(tempSignName);

            String templateTemp = pluginConfig.getAttribute(template);

            dto.setSmsTemplateCode(templateTemp);
            ResponseObject vo = plug.send(dto);
        }
        return false;
    }

    @Override
    public String getName() {
        return "阿里大鱼短信插件";
    }

    @Override
    public String getVersion() {
        return "1.01";
    }

    @Override
    public String getAuthor() {
        return "ada.young";
    }

    @Override
    public String getSiteUrl() {
        return "http://www.yichisancun.com";
    }

    @Override
    public String getInstallUrl() {
        return "admin/sendcode_plugin/alidayu/install.htm";
    }

    @Override
    public String getUninstallUrl() {
        return "admin/sendcode_plugin/alidayu/uninstall.htm";
    }

    @Override
    public String getSettingUrl() {
        return "admin/sendcode_plugin/alidayu/setting.htm";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy