mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-28 23:55:04 +08:00
add other sip
This commit is contained in:
45
src/main/java/love/sola/netsupport/api/test/TestSession.java
Normal file
45
src/main/java/love/sola/netsupport/api/test/TestSession.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package love.sola.netsupport.api.test;
|
||||||
|
|
||||||
|
import javax.servlet.ServletConfig;
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.annotation.WebServlet;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2014/8/20.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
@WebServlet(name = "TestSession", urlPatterns = "/api/testsession", loadOnStartup = 11)
|
||||||
|
public class TestSession extends HttpServlet {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ServletConfig config) throws ServletException {
|
||||||
|
super.init(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
doGet(request, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
request.setCharacterEncoding("utf-8");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.addHeader("Content-type", "text/plain;charset=utf-8");
|
||||||
|
PrintWriter out = response.getWriter();
|
||||||
|
HttpSession httpSession = request.getSession(false);
|
||||||
|
if (httpSession == null) {
|
||||||
|
out.println(httpSession);
|
||||||
|
} else {
|
||||||
|
out.println(httpSession.getId());
|
||||||
|
}
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,7 +15,9 @@ public enum ISP {
|
|||||||
|
|
||||||
TELECOM(1, "^1[3|4|5|7|8][0-9]{9}$"),
|
TELECOM(1, "^1[3|4|5|7|8][0-9]{9}$"),
|
||||||
UNICOM(2, "ZSZJLAN[0-9]{10}@16900\\.gd"),
|
UNICOM(2, "ZSZJLAN[0-9]{10}@16900\\.gd"),
|
||||||
CHINAMOBILE(3, "^1[3|4|5|7|8][0-9]{9}@139\\.gd$"),;
|
CHINAMOBILE(3, "^1[3|4|5|7|8][0-9]{9}@139\\.gd$"),
|
||||||
|
OTHER(4, ".*"),
|
||||||
|
;
|
||||||
|
|
||||||
private static final Map<String, ISP> NAME_MAP = new HashMap<>();
|
private static final Map<String, ISP> NAME_MAP = new HashMap<>();
|
||||||
private static final Map<Integer, ISP> ID_MAP = new HashMap<>();
|
private static final Map<Integer, ISP> ID_MAP = new HashMap<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user