我在用个OA短信接口,他给了个例子://他们的接口
public interface SmsService {
public boolean sendSMS(String smsId,String number,String msg);
}
//例子
public class TestService implements SmsService{
public boolean sendSMS(String smsId,String number,String msg){
System.out.println("接受人:"+number);
System.out.println("测试短信:"+msg);
return true;
}
}
问题是我不知道这个TestService 的全局函数应该写在哪啊?
public interface SmsService {
public boolean sendSMS(String smsId,String number,String msg);
}
//例子
public class TestService implements SmsService{
public boolean sendSMS(String smsId,String number,String msg){
System.out.println("接受人:"+number);
System.out.println("测试短信:"+msg);
return true;
}
}
问题是我不知道这个TestService 的全局函数应该写在哪啊?
application是哪?任意一个页面中吗?
我原来也是这么想的,但是他这个接口还需要配置sms.xml<module id="sms" version="1.0.0">
<service-point id="smssender" interface="weaver.sms.SmsService">
<invoke-factory>
<construct class="weaver.sms.TestService">
//如果之前不是用全局函数,那么这个construct class是什么回事?
</construct>
</invoke-factory>
</service-point>
</module>
表示
\weaver\sms\TestService.CLASS 也不知道对不对……我写成这样看看
而application是存在服务器中的 除非你的服务器重启了否则application会一直存在
当然前提是你没有吧application给remove掉啦
变量保存在配置文件中也可以 恩