package com.fr.plugin.third.sms.test; import com.fr.decision.fun.impl.BaseHttpHandler; import com.fr.plugin.third.sms.fun.SmsClient; import com.fr.third.springframework.web.bind.annotation.RequestMethod; import com.fr.web.utils.WebUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author richie * @version 10.0 * Created by richie on 2019/11/8 */ public class SmsTestHandler extends BaseHttpHandler { @Override public RequestMethod getMethod() { return RequestMethod.GET; } @Override public String getPath() { return "/ts/test"; } @Override public boolean isPublic() { return false; } @Override public void handle(HttpServletRequest req, HttpServletResponse res) throws Exception { String mobile = "13898675683"; boolean status = SmsClient.getInstance().send(mobile); if (status) { WebUtils.printAsString(res, "已向" + mobile + "发送测试短信"); } else { WebUtils.printAsString(res, "向" + mobile + "发送测试短信失败"); } } }