當前位置:名人名言大全網 - 祝福短信 - 問:關於泛微生態短信的二次開發。

問:關於泛微生態短信的二次開發。

1.編寫自己的實現。只需要實現泛微提供的SMSService接口:

公共接口SMS服務{

public boolean send SMS(String SMS id,String number,String msg);

}

假設是這樣實現的:

公共類TestService實現SmsService{

public boolean sendSMS(String SMS id,String number,String msg){

System.out.println("收件人:"+數字);

System.out.println("測試消息:"+msg);

返回true

}

}

然後生態系統會在發送短信時調用TestService中的sendSMS方法。

2.將上述實現部署到生態學中。只需修改sms.xml,或者以上面的實現為例:

& lt模塊id="sms "版本="1.0.0 " >

& lt服務點id = " SMS sender " interface = " weaver . SMS . SMS service " & gt;

& ltinvoke-factory & gt;

& ltconstruct class="TestService " >

& lt/construct & gt;

& lt/invoke-factory & gt;

& lt/服務點& gt

& lt/module & gt;