mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 16:14:16 +08:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cf480ee85 | ||
|
|
f855d5b348 | ||
|
|
af2fbfd3bf | ||
|
|
ee608c63fc | ||
|
|
f987ce0ef6 | ||
|
|
d94e524236 | ||
|
|
a6d7918ffe | ||
|
|
485260d12a | ||
|
|
b3ac50e327 | ||
|
|
5e6708fca8 | ||
|
|
11f5cca1a2 | ||
|
|
ecf741007f | ||
|
|
5009d64f5a | ||
|
|
008a1f5c5e | ||
|
|
97e5319e0f | ||
|
|
427c713e50 | ||
|
|
9d59b2d1d3 | ||
|
|
c8dd0d6306 | ||
|
|
4f3fbc2c91 | ||
|
|
0de1ce63d9 | ||
|
|
9ccd27d9d9 | ||
|
|
2cbc843227 | ||
|
|
8d7d7d22e4 | ||
|
|
6f11c7f965 |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[*]
|
||||||
|
charset=utf-8
|
||||||
|
end_of_line=lf
|
||||||
|
trim_trailing_whitespace=true
|
||||||
|
insert_final_newline=true
|
||||||
|
indent_style=space
|
||||||
|
indent_size=4
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_style=space
|
||||||
|
indent_size=2
|
||||||
|
|
||||||
|
[{*.ddl,*.sql}]
|
||||||
|
indent_style=space
|
||||||
|
indent_size=2
|
||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,12 +1,5 @@
|
|||||||
/buildNumber.properties
|
|
||||||
/docs
|
/docs
|
||||||
.idea/
|
.idea/
|
||||||
out/
|
|
||||||
/.metadata/
|
|
||||||
/web/META-INF/context.xml
|
|
||||||
*.iml
|
*.iml
|
||||||
~*
|
|
||||||
.DS_Store
|
|
||||||
.classpath
|
|
||||||
/target
|
/target
|
||||||
.project
|
.vscode
|
||||||
16
README.md
16
README.md
@@ -1,7 +1,7 @@
|
|||||||
#WechatTicketSystem
|
# WechatTicketSystem
|
||||||
WechatTicketSystem is a basic ticket system for network maintaining, based on Wechat.
|
WechatTicketSystem is a basic ticket system for network maintaining, based on Wechat.
|
||||||
|
|
||||||
##Build
|
## Build
|
||||||
### Requirements
|
### Requirements
|
||||||
- [Apache Maven](https://maven.apache.org/) (latest version recommended)
|
- [Apache Maven](https://maven.apache.org/) (latest version recommended)
|
||||||
|
|
||||||
@@ -11,19 +11,19 @@ WechatTicketSystem is a basic ticket system for network maintaining, based on We
|
|||||||
3. Build with Maven `mvn clean package`
|
3. Build with Maven `mvn clean package`
|
||||||
4. The out file will be in `target/` folder
|
4. The out file will be in `target/` folder
|
||||||
|
|
||||||
##Contributing
|
## Contributing
|
||||||
###Code Style
|
### Code Style
|
||||||
The code style configuration is [here](http://stash.sola.love/projects/PSS/repos/ide_configuration/browse/intellij%20idea/Code_Style_Use_Tab.xml).
|
The code style configuration is [here](http://stash.sola.love/projects/PSS/repos/ide_configuration/browse/intellij%20idea/Code_Style_Use_Tab.xml).
|
||||||
|
|
||||||
In Intellij IDEA, you can import the configuration by Settings-\>Editor-\>Code Style-\>Manage(at right side)-\>Import..
|
In Intellij IDEA, you can import the configuration by Settings-\>Editor-\>Code Style-\>Manage(at right side)-\>Import..
|
||||||
###Pull Request
|
### Pull Request
|
||||||
Please notice that the pull requests should compare with `develop` branch instead of `master`,
|
Please notice that the pull requests should compare with `develop` branch instead of `master`,
|
||||||
submit pull requests to `master` branch will be ignored.
|
submit pull requests to `master` branch will be ignored.
|
||||||
##TroubleShooting
|
## TroubleShooting
|
||||||
- Before you report a bug, please [search the issue tracker](https://github.com/ZSCNetSupportDept/WechatTicketSystem/issues) to see if someone has already reported the problem.
|
- Before you report a bug, please [search the issue tracker](https://github.com/ZSCNetSupportDept/WechatTicketSystem/issues) to see if someone has already reported the problem.
|
||||||
- If the issue doesn’t already exist, [create a new issue](https://github.com/ZSCNetSupportDept/WechatTicketSystem/issues/new).
|
- If the issue doesn’t already exist, [create a new issue](https://github.com/ZSCNetSupportDept/WechatTicketSystem/issues/new).
|
||||||
- Please provide as much information as possible with the issue report, we like to know the version of FYoung4j that you are using, as well as your Operating System and JVM version.
|
- Please provide as much information as possible with the issue report, we like to know the version you are using, as well as your Operating System and JVM version.
|
||||||
- If you need to paste code, or include a stack trace use Markdown ```` ``` ```` escapes before and after your text.
|
- If you need to paste code, or include a stack trace use Markdown ```` ``` ```` escapes before and after your text.
|
||||||
|
|
||||||
##License
|
## License
|
||||||
WechatTicketSystem is distributed under the GNU Lesser General Public License v3.0 (LGPLv3).
|
WechatTicketSystem is distributed under the GNU Lesser General Public License v3.0 (LGPLv3).
|
||||||
46
pom.xml
46
pom.xml
@@ -1,11 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>WechatTicketSystem</name>
|
<name>WechatTicketSystem</name>
|
||||||
<groupId>love.sola.netsupport</groupId>
|
<groupId>love.sola.netsupport</groupId>
|
||||||
<artifactId>WechatTicketSystem</artifactId>
|
<artifactId>WechatTicketSystem</artifactId>
|
||||||
<version>2.1-SNAPSHOT</version>
|
<version>2.2-SNAPSHOT</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -15,13 +16,6 @@
|
|||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<scm>
|
|
||||||
<connection>scm:svn:http://127.0.0.1/dummy</connection>
|
|
||||||
<developerConnection>scm:svn:https://127.0.0.1/dummy</developerConnection>
|
|
||||||
<tag>HEAD</tag>
|
|
||||||
<url>http://127.0.0.1/dummy</url>
|
|
||||||
</scm>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@@ -34,29 +28,21 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.apache.tomcat.maven</groupId>
|
||||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||||
<version>1.4</version>
|
<version>2.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<format>{0,number,0000}</format>
|
<url>http://localhost:8080/manager/text</url>
|
||||||
<items>
|
<server>wwbx</server>
|
||||||
<item>buildNumber0</item>
|
<path>/WechatTicketSystem</path>
|
||||||
</items>
|
|
||||||
<doCheck>false</doCheck>
|
|
||||||
<doUpdate>false</doUpdate>
|
|
||||||
<revisionOnScmFailure>unknown</revisionOnScmFailure>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
</plugin>
|
||||||
<execution>
|
<plugin>
|
||||||
<phase>validate</phase>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<goals>
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
<goal>create</goal>
|
<version>3.3.2</version>
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}##${buildNumber}</finalName>
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -110,7 +96,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mchange</groupId>
|
<groupId>com.mchange</groupId>
|
||||||
<artifactId>c3p0</artifactId>
|
<artifactId>c3p0</artifactId>
|
||||||
<version>0.9.5.1</version>
|
<version>0.9.5.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
|
|||||||
@@ -17,13 +17,14 @@
|
|||||||
|
|
||||||
package love.sola.netsupport;
|
package love.sola.netsupport;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.annotation.WebServlet;
|
import javax.servlet.annotation.WebServlet;
|
||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,14 +17,16 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api;
|
package love.sola.netsupport.api;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -18,6 +18,23 @@
|
|||||||
package love.sola.netsupport.api;
|
package love.sola.netsupport.api;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import org.hibernate.HibernateException;
|
||||||
|
import org.reflections.Reflections;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
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 love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.Operator;
|
import love.sola.netsupport.pojo.Operator;
|
||||||
@@ -25,20 +42,6 @@ import love.sola.netsupport.pojo.User;
|
|||||||
import love.sola.netsupport.session.WechatSession;
|
import love.sola.netsupport.session.WechatSession;
|
||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import org.hibernate.HibernateException;
|
|
||||||
import org.reflections.Reflections;
|
|
||||||
|
|
||||||
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 java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,14 +17,15 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api;
|
package love.sola.netsupport.api;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,6 +18,16 @@
|
|||||||
package love.sola.netsupport.api;
|
package love.sola.netsupport.api;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
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 love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.Operator;
|
import love.sola.netsupport.pojo.Operator;
|
||||||
@@ -28,17 +38,8 @@ import love.sola.netsupport.sql.SQLCore;
|
|||||||
import love.sola.netsupport.sql.TableOperator;
|
import love.sola.netsupport.sql.TableOperator;
|
||||||
import love.sola.netsupport.sql.TableUser;
|
import love.sola.netsupport.sql.TableUser;
|
||||||
import love.sola.netsupport.util.Crypto;
|
import love.sola.netsupport.util.Crypto;
|
||||||
import love.sola.netsupport.util.RSAUtil;
|
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
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 java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@@ -73,7 +74,7 @@ public class Login extends HttpServlet {
|
|||||||
else if (op.getAccess() >= Access.NO_LOGIN)
|
else if (op.getAccess() >= Access.NO_LOGIN)
|
||||||
return Error.PERMISSION_DENIED;
|
return Error.PERMISSION_DENIED;
|
||||||
|
|
||||||
if (!Crypto.check(bypass ? password : RSAUtil.decrypt(password), op.getPassword())) {
|
if (!Crypto.check(password, op.getPassword())) {
|
||||||
return Error.WRONG_PASSWORD;
|
return Error.WRONG_PASSWORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.manager;
|
package love.sola.netsupport.api.manager;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -25,8 +27,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.TableUser;
|
import love.sola.netsupport.sql.TableUser;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.manager;
|
package love.sola.netsupport.api.manager;
|
||||||
|
|
||||||
|
import org.hibernate.Session;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.config.Settings;
|
import love.sola.netsupport.config.Settings;
|
||||||
@@ -30,9 +34,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import love.sola.netsupport.util.Checker;
|
import love.sola.netsupport.util.Checker;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.Session;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,15 +17,16 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.root;
|
package love.sola.netsupport.api.root;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.session.WechatSession;
|
import love.sola.netsupport.session.WechatSession;
|
||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.root;
|
package love.sola.netsupport.api.root;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -24,8 +26,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.TableUser;
|
import love.sola.netsupport.sql.TableUser;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.root;
|
package love.sola.netsupport.api.root;
|
||||||
|
|
||||||
|
import org.hibernate.Session;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -25,9 +29,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import love.sola.netsupport.util.Crypto;
|
import love.sola.netsupport.util.Crypto;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.Session;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package love.sola.netsupport.api.stuff;
|
|||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.pojo.Ticket;
|
import love.sola.netsupport.pojo.Ticket;
|
||||||
|
import love.sola.netsupport.pojo.User;
|
||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import love.sola.netsupport.sql.TableTicket;
|
import love.sola.netsupport.sql.TableTicket;
|
||||||
@@ -28,10 +29,12 @@ import org.apache.commons.lang3.time.DateUtils;
|
|||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.envers.AuditReader;
|
import org.hibernate.envers.AuditReader;
|
||||||
import org.hibernate.envers.query.AuditEntity;
|
import org.hibernate.envers.query.AuditEntity;
|
||||||
|
import org.hibernate.proxy.HibernateProxy;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
@@ -46,6 +49,7 @@ public class TicketLog extends API {
|
|||||||
authorize = Command.LOGIN;
|
authorize = Command.LOGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
protected Object process(HttpServletRequest req, WxSession session) throws Exception {
|
protected Object process(HttpServletRequest req, WxSession session) throws Exception {
|
||||||
int first;
|
int first;
|
||||||
@@ -59,13 +63,14 @@ public class TicketLog extends API {
|
|||||||
end = DateUtils.addDays(end, 1);
|
end = DateUtils.addDays(end, 1);
|
||||||
try (Session s = SQLCore.sf.openSession()) {
|
try (Session s = SQLCore.sf.openSession()) {
|
||||||
AuditReader reader = TableTicket.getAuditReader(s);
|
AuditReader reader = TableTicket.getAuditReader(s);
|
||||||
return reader.createQuery()
|
List<Object[]> resultList = reader.createQuery()
|
||||||
.forRevisionsOfEntity(Ticket.class, false, true)
|
.forRevisionsOfEntity(Ticket.class, false, true)
|
||||||
.addOrder(AuditEntity.revisionNumber().desc())
|
.addOrder(AuditEntity.revisionNumber().desc())
|
||||||
.add(AuditEntity.revisionProperty("timestamp").between(start.getTime(), end.getTime()))
|
.add(AuditEntity.revisionProperty("timestamp").between(start.getTime(), end.getTime()))
|
||||||
.setFirstResult(first)
|
.setFirstResult(first)
|
||||||
.setMaxResults(limit)
|
.setMaxResults(limit)
|
||||||
.getResultList();
|
.getResultList();
|
||||||
|
return TableTicket.initializeTickets(resultList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.stuff;
|
package love.sola.netsupport.api.stuff;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
@@ -25,8 +27,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.TableTicket;
|
import love.sola.netsupport.sql.TableTicket;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.stuff;
|
package love.sola.netsupport.api.stuff;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -24,8 +26,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.TableTicket;
|
import love.sola.netsupport.sql.TableTicket;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,12 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.stuff;
|
package love.sola.netsupport.api.stuff;
|
||||||
|
|
||||||
|
import org.hibernate.Session;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -27,10 +33,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import love.sola.netsupport.util.Checker;
|
import love.sola.netsupport.util.Checker;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.Session;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,14 +17,6 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.stuff;
|
package love.sola.netsupport.api.stuff;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
|
||||||
import love.sola.netsupport.api.Error;
|
|
||||||
import love.sola.netsupport.enums.Access;
|
|
||||||
import love.sola.netsupport.enums.Attribute;
|
|
||||||
import love.sola.netsupport.pojo.Operator;
|
|
||||||
import love.sola.netsupport.session.WxSession;
|
|
||||||
import love.sola.netsupport.sql.SQLCore;
|
|
||||||
import love.sola.netsupport.wechat.Command;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
@@ -33,9 +25,19 @@ import org.hibernate.criterion.Restrictions;
|
|||||||
import org.hibernate.type.IntegerType;
|
import org.hibernate.type.IntegerType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import love.sola.netsupport.api.API;
|
||||||
|
import love.sola.netsupport.api.Error;
|
||||||
|
import love.sola.netsupport.enums.Access;
|
||||||
|
import love.sola.netsupport.enums.Attribute;
|
||||||
|
import love.sola.netsupport.pojo.Operator;
|
||||||
|
import love.sola.netsupport.session.WxSession;
|
||||||
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola
|
* @author Sola
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.user;
|
package love.sola.netsupport.api.user;
|
||||||
|
|
||||||
|
import org.hibernate.exception.ConstraintViolationException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -26,11 +30,12 @@ import love.sola.netsupport.pojo.User;
|
|||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.sql.TableUser;
|
import love.sola.netsupport.sql.TableUser;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.exception.ConstraintViolationException;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import static love.sola.netsupport.util.Checker.checkBlock;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkISP;
|
||||||
import static love.sola.netsupport.util.Checker.*;
|
import static love.sola.netsupport.util.Checker.checkNetAccount;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkPhoneNumber;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkRoom;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.user;
|
package love.sola.netsupport.api.user;
|
||||||
|
|
||||||
|
import org.hibernate.exception.ConstraintViolationException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
@@ -26,11 +30,13 @@ import love.sola.netsupport.pojo.User;
|
|||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.sql.TableUser;
|
import love.sola.netsupport.sql.TableUser;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.exception.ConstraintViolationException;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import static love.sola.netsupport.util.Checker.checkBlock;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkISP;
|
||||||
import static love.sola.netsupport.util.Checker.*;
|
import static love.sola.netsupport.util.Checker.checkNetAccount;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkPhoneNumber;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkRoom;
|
||||||
|
import static love.sola.netsupport.util.Checker.checkStudentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
@@ -73,7 +79,8 @@ public class Register extends API {
|
|||||||
User user = TableUser.getById(sid);
|
User user = TableUser.getById(sid);
|
||||||
if (user == null) return Error.INVALID_PARAMETER.withMsg("Invalid_Student_Id");
|
if (user == null) return Error.INVALID_PARAMETER.withMsg("Invalid_Student_Id");
|
||||||
if (!user.getName().equals(name)) return Error.INVALID_PARAMETER.withMsg("Invalid_Name");
|
if (!user.getName().equals(name)) return Error.INVALID_PARAMETER.withMsg("Invalid_Name");
|
||||||
if (user.getWechatId() != null) return Error.INVALID_PARAMETER.withMsg("User_Already_Registered");
|
if (user.getWechatId() != null)
|
||||||
|
return Error.INVALID_PARAMETER.withMsg("User_Already_Registered");
|
||||||
user.setIsp(isp);
|
user.setIsp(isp);
|
||||||
user.setNetAccount(netAccount);
|
user.setNetAccount(netAccount);
|
||||||
user.setBlock(block);
|
user.setBlock(block);
|
||||||
|
|||||||
@@ -17,6 +17,13 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.user;
|
package love.sola.netsupport.api.user;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Session;
|
||||||
|
import org.hibernate.criterion.Order;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
@@ -25,12 +32,6 @@ import love.sola.netsupport.pojo.User;
|
|||||||
import love.sola.netsupport.session.WxSession;
|
import love.sola.netsupport.session.WxSession;
|
||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.Criteria;
|
|
||||||
import org.hibernate.Session;
|
|
||||||
import org.hibernate.criterion.Order;
|
|
||||||
import org.hibernate.criterion.Restrictions;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.api.user;
|
package love.sola.netsupport.api.user;
|
||||||
|
|
||||||
|
import org.hibernate.Session;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import love.sola.netsupport.api.API;
|
import love.sola.netsupport.api.API;
|
||||||
import love.sola.netsupport.api.Error;
|
import love.sola.netsupport.api.Error;
|
||||||
import love.sola.netsupport.config.Settings;
|
import love.sola.netsupport.config.Settings;
|
||||||
@@ -28,9 +32,6 @@ import love.sola.netsupport.session.WxSession;
|
|||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import love.sola.netsupport.sql.TableTicket;
|
import love.sola.netsupport.sql.TableTicket;
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import org.hibernate.Session;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,12 +17,9 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.auth;
|
package love.sola.netsupport.auth;
|
||||||
|
|
||||||
import love.sola.netsupport.session.WechatSession;
|
import java.io.IOException;
|
||||||
import love.sola.netsupport.session.WxSession;
|
import java.util.HashMap;
|
||||||
import love.sola.netsupport.util.Checker;
|
import java.util.Map;
|
||||||
import love.sola.netsupport.wechat.WxMpServlet;
|
|
||||||
import me.chanjar.weixin.mp.api.WxMpService;
|
|
||||||
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
|
|
||||||
|
|
||||||
import javax.servlet.AsyncContext;
|
import javax.servlet.AsyncContext;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
@@ -30,9 +27,13 @@ import javax.servlet.annotation.WebServlet;
|
|||||||
import javax.servlet.http.HttpServlet;
|
import javax.servlet.http.HttpServlet;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.HashMap;
|
import love.sola.netsupport.session.WechatSession;
|
||||||
import java.util.Map;
|
import love.sola.netsupport.session.WxSession;
|
||||||
|
import love.sola.netsupport.util.Checker;
|
||||||
|
import love.sola.netsupport.wechat.WxMpServlet;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.auth;
|
package love.sola.netsupport.auth;
|
||||||
|
|
||||||
import love.sola.netsupport.session.WxSession;
|
|
||||||
|
|
||||||
import javax.servlet.AsyncContext;
|
import javax.servlet.AsyncContext;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import love.sola.netsupport.session.WxSession;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of WechatTicketSystem.
|
|
||||||
*
|
|
||||||
* WechatTicketSystem is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* WechatTicketSystem is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with WechatTicketSystem. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package love.sola.netsupport.config;
|
|
||||||
|
|
||||||
import org.yaml.snakeyaml.Yaml;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
|
||||||
*/
|
|
||||||
public class Cortana {
|
|
||||||
|
|
||||||
public static List<Compiled> entries;
|
|
||||||
|
|
||||||
public static void load() {
|
|
||||||
InputStream in = Lang.class.getClassLoader().getResourceAsStream("cortana.yml");
|
|
||||||
RawConfig root = new Yaml().loadAs(in, RawConfig.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
static class Compiled {
|
|
||||||
Pattern[] patterns;
|
|
||||||
String[] replies;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Rule {
|
|
||||||
String[] regexp;
|
|
||||||
String[] replies;
|
|
||||||
|
|
||||||
public Rule() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class RawConfig {
|
|
||||||
Map<String, Rule> rules;
|
|
||||||
|
|
||||||
public RawConfig() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of WechatTicketSystem.
|
|
||||||
*
|
|
||||||
* WechatTicketSystem is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* WechatTicketSystem is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with WechatTicketSystem. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package love.sola.netsupport.config;
|
|
||||||
|
|
||||||
import com.thoughtworks.xstream.XStream;
|
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
|
||||||
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
|
||||||
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author chanjarster
|
|
||||||
*/
|
|
||||||
@XStreamAlias("wechat-config")
|
|
||||||
public class WxMpXmlInMemoryConfigStorage extends WxMpInMemoryConfigStorage {
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public static <T> T fromXml(Class<T> clazz, InputStream is) {
|
|
||||||
XStream xstream = XStreamInitializer.getInstance();
|
|
||||||
xstream.alias("wechat-config", clazz);
|
|
||||||
xstream.processAnnotations(clazz);
|
|
||||||
return (T) xstream.fromXML(is);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -84,6 +84,8 @@ public class Block {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// THANKS DATA PROVIDED BY Lai Juncheng
|
// THANKS DATA PROVIDED BY Lai Juncheng
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
// UPDATE 2018:BS was destroyed.Update by HTroy
|
||||||
|
// -------------------------------------------- //
|
||||||
AVAILABLE[FX_1] = new int[]{108, 208, 308, 408, 508};
|
AVAILABLE[FX_1] = new int[]{108, 208, 308, 408, 508};
|
||||||
AVAILABLE[FX_2] = new int[]{110, 210, 310, 410, 510, 610};
|
AVAILABLE[FX_2] = new int[]{110, 210, 310, 410, 510, 610};
|
||||||
AVAILABLE[FX_3] = new int[]{110, 210, 310, 410, 510, 610};
|
AVAILABLE[FX_3] = new int[]{110, 210, 310, 410, 510, 610};
|
||||||
@@ -109,16 +111,16 @@ public class Block {
|
|||||||
AVAILABLE[XH_C] = new int[]{126, 226, 326, 426, 526, 626, 726, 826, 926, 1026, 1126, 1226};
|
AVAILABLE[XH_C] = new int[]{126, 226, 326, 426, 526, 626, 726, 826, 926, 1026, 1126, 1226};
|
||||||
AVAILABLE[XH_D] = new int[]{128, 228, 328, 428, 528, 628, 728, 828, 928, 1028, 1128, 1228};
|
AVAILABLE[XH_D] = new int[]{128, 228, 328, 428, 528, 628, 728, 828, 928, 1028, 1128, 1228};
|
||||||
AVAILABLE[FX_6] = new int[0];
|
AVAILABLE[FX_6] = new int[0];
|
||||||
AVAILABLE[BS_1] = new int[]{102, 203, 301};
|
AVAILABLE[BS_1] = new int[0];
|
||||||
AVAILABLE[BS_2] = new int[]{102, 203, 301};
|
AVAILABLE[BS_2] = new int[0];
|
||||||
AVAILABLE[BS_3] = new int[]{103, 203, 302};
|
AVAILABLE[BS_3] = new int[0];
|
||||||
AVAILABLE[BS_4] = new int[]{102, 203, 301};
|
AVAILABLE[BS_4] = new int[0];
|
||||||
AVAILABLE[BS_5] = new int[]{102, 203, 301};
|
AVAILABLE[BS_5] = new int[0];
|
||||||
AVAILABLE[BS_6] = new int[]{102, 203, 302};
|
AVAILABLE[BS_6] = new int[0];
|
||||||
AVAILABLE[BS_7] = new int[]{102, 203, 301};
|
AVAILABLE[BS_7] = new int[0];
|
||||||
AVAILABLE[BS_8] = new int[]{102, 203, 301};
|
AVAILABLE[BS_8] = new int[0];
|
||||||
AVAILABLE[BS_9] = new int[]{103, 203, 302};
|
AVAILABLE[BS_9] = new int[0];
|
||||||
AVAILABLE[ZH] = new int[]{199, 299, 399, 499, 599, 699, 799, 899, 999, 1099, 1199, 1299, 1399};
|
AVAILABLE[ZH] = new int[]{199, 299, 399, 499, 599, 699, 799, 899, 999, 1099, 1199, 1299, 1399, 1499};
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,11 @@ import static love.sola.netsupport.config.Lang.lang;
|
|||||||
*/
|
*/
|
||||||
public enum ISP {
|
public enum ISP {
|
||||||
|
|
||||||
TELECOM(1, "^1[3|4|5|7|8][0-9]{9}$"),
|
TELECOM(1, "^1[3|4|5|6|7|8|9][0-9]{9}$"),
|
||||||
UNICOM(2, "ZSZJLAN[0-9]{10}@16900\\.gd"),
|
UNICOM(2, "^\\w+([-+.]\\w+)*@16900\\.gd"),
|
||||||
CHINAMOBILE(3, "^1[3|4|5|7|8][0-9]{9}@139\\.gd$"),
|
CHINAMOBILE(3, "^1[3|4|5|6|7|8|9][0-9]{9}@139\\.gd$"),
|
||||||
OTHER(4, ".*"),;
|
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<>();
|
||||||
|
|||||||
@@ -17,13 +17,22 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.pojo;
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
import love.sola.netsupport.sql.TableTicket;
|
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
import org.hibernate.envers.RelationTargetAuditMode;
|
import org.hibernate.envers.RelationTargetAuditMode;
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import love.sola.netsupport.sql.TableTicket;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@@ -47,7 +56,7 @@ public class Ticket {
|
|||||||
private Date submitTime;
|
private Date submitTime;
|
||||||
private String remark;
|
private String remark;
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
@ManyToOne(optional = true)
|
@ManyToOne
|
||||||
@JoinColumn(name = TableTicket.COLUMN_OPSID)
|
@JoinColumn(name = TableTicket.COLUMN_OPSID)
|
||||||
private Operator operator;
|
private Operator operator;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|||||||
@@ -3,9 +3,18 @@ package love.sola.netsupport.pojo;
|
|||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
import org.hibernate.annotations.DynamicInsert;
|
import org.hibernate.annotations.DynamicInsert;
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Index;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,11 +18,16 @@
|
|||||||
package love.sola.netsupport.pojo;
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Convert;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.ISP;
|
import love.sola.netsupport.enums.ISP;
|
||||||
import love.sola.netsupport.enums.ISPConverter;
|
import love.sola.netsupport.enums.ISPConverter;
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -33,7 +33,11 @@
|
|||||||
package love.sola.netsupport.session;
|
package love.sola.netsupport.session;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -35,13 +35,16 @@ package love.sola.netsupport.session;
|
|||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
import love.sola.netsupport.config.Settings;
|
|
||||||
import org.apache.commons.lang3.Validate;
|
import org.apache.commons.lang3.Validate;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import love.sola.netsupport.config.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,14 +17,21 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.sql;
|
package love.sola.netsupport.sql;
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.ExclusionStrategy;
|
||||||
|
import com.google.gson.FieldAttributes;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonPrimitive;
|
||||||
|
import com.google.gson.JsonSerializer;
|
||||||
|
import com.google.gson.TypeAdapter;
|
||||||
|
import com.google.gson.TypeAdapterFactory;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||||
import love.sola.netsupport.enums.ISP;
|
|
||||||
import love.sola.netsupport.wechat.Command;
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
@@ -35,11 +42,15 @@ import org.hibernate.envers.AuditReaderFactory;
|
|||||||
import org.hibernate.proxy.HibernateProxy;
|
import org.hibernate.proxy.HibernateProxy;
|
||||||
import org.hibernate.service.ServiceRegistry;
|
import org.hibernate.service.ServiceRegistry;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
import javax.naming.NamingException;
|
import javax.naming.NamingException;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Date;
|
import love.sola.netsupport.enums.ISP;
|
||||||
|
import love.sola.netsupport.wechat.Command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
@@ -146,7 +157,7 @@ public class SQLCore {
|
|||||||
// Get the TypeAdapter of the original class, to delegate the serialization
|
// Get the TypeAdapter of the original class, to delegate the serialization
|
||||||
TypeAdapter delegate = context.getAdapter(TypeToken.get(baseType));
|
TypeAdapter delegate = context.getAdapter(TypeToken.get(baseType));
|
||||||
// Get a filled instance of the original class
|
// Get a filled instance of the original class
|
||||||
Object unproxiedValue = ((HibernateProxy) value).getHibernateLazyInitializer()
|
Object unproxiedValue = value.getHibernateLazyInitializer()
|
||||||
.getImplementation();
|
.getImplementation();
|
||||||
// Serialize the value
|
// Serialize the value
|
||||||
delegate.write(out, unproxiedValue);
|
delegate.write(out, unproxiedValue);
|
||||||
|
|||||||
@@ -17,9 +17,13 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.sql;
|
package love.sola.netsupport.sql;
|
||||||
|
|
||||||
import love.sola.netsupport.config.Settings;
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
import java.sql.*;
|
import love.sola.netsupport.config.Settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
|||||||
@@ -17,11 +17,12 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.sql;
|
package love.sola.netsupport.sql;
|
||||||
|
|
||||||
import love.sola.netsupport.pojo.Operator;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.criterion.Projections;
|
import org.hibernate.criterion.Projections;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
|
||||||
|
import love.sola.netsupport.pojo.Operator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,9 +17,7 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.sql;
|
package love.sola.netsupport.sql;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Status;
|
import love.sola.netsupport.pojo.Operator;
|
||||||
import love.sola.netsupport.pojo.Ticket;
|
|
||||||
import love.sola.netsupport.pojo.User;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Projections;
|
import org.hibernate.criterion.Projections;
|
||||||
@@ -29,6 +27,11 @@ import org.hibernate.envers.query.AuditEntity;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import love.sola.netsupport.enums.Status;
|
||||||
|
import love.sola.netsupport.pojo.Ticket;
|
||||||
|
import love.sola.netsupport.pojo.User;
|
||||||
|
import org.hibernate.proxy.HibernateProxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@@ -104,13 +107,35 @@ public class TableTicket extends SQLCore {
|
|||||||
public static List<Object[]> track(int tid) {
|
public static List<Object[]> track(int tid) {
|
||||||
try (Session s = SQLCore.sf.openSession()) {
|
try (Session s = SQLCore.sf.openSession()) {
|
||||||
AuditReader reader = getAuditReader(s);
|
AuditReader reader = getAuditReader(s);
|
||||||
return reader.createQuery()
|
List<Object[]> resultList = reader.createQuery()
|
||||||
.forRevisionsOfEntity(Ticket.class, false, true)
|
.forRevisionsOfEntity(Ticket.class, false, true)
|
||||||
.addOrder(AuditEntity.revisionNumber().desc())
|
.addOrder(AuditEntity.revisionNumber().desc())
|
||||||
.add(AuditEntity.id().eq(tid))
|
.add(AuditEntity.id().eq(tid))
|
||||||
.getResultList()
|
.getResultList();
|
||||||
;
|
return initializeTickets(resultList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this is a hacky method to initialize all related entities of ticket
|
||||||
|
*/
|
||||||
|
public static List<Object[]> initializeTickets(List<Object[]> resultList) {
|
||||||
|
for (Object[] result : resultList) {
|
||||||
|
Ticket value = ((Ticket) result[0]);
|
||||||
|
HibernateProxy proxiedUser = (HibernateProxy) value.getUser();
|
||||||
|
if (proxiedUser != null) {
|
||||||
|
User unproxiedUser = ((User) proxiedUser.getHibernateLazyInitializer()
|
||||||
|
.getImplementation());
|
||||||
|
value.setUser(unproxiedUser);
|
||||||
|
}
|
||||||
|
HibernateProxy proxiedOperator = (HibernateProxy) value.getOperator();
|
||||||
|
if (proxiedOperator != null) {
|
||||||
|
Operator unproxiedOperator = ((Operator) proxiedOperator.getHibernateLazyInitializer()
|
||||||
|
.getImplementation());
|
||||||
|
value.setOperator(unproxiedOperator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,14 +20,16 @@ package love.sola.netsupport.sql;
|
|||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
import love.sola.netsupport.config.Settings;
|
|
||||||
import love.sola.netsupport.pojo.User;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import love.sola.netsupport.config.Settings;
|
||||||
|
import love.sola.netsupport.pojo.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import love.sola.netsupport.enums.ISP;
|
|||||||
*/
|
*/
|
||||||
public class Checker {
|
public class Checker {
|
||||||
|
|
||||||
public static final String STUDENT_ID_REGEX = "^(2014|2015|2016|2017)[0-9]{9}$";
|
public static final String STUDENT_ID_REGEX = "^(2|1)[0-9]{9,12}$";
|
||||||
public static final String PHONE_NUMBER_REGEX = "^1[34578][0-9]{9}$";
|
public static final String PHONE_NUMBER_REGEX = "^1[3456789][0-9]{9}$";
|
||||||
|
|
||||||
public static boolean hasNull(Object... v) {
|
public static boolean hasNull(Object... v) {
|
||||||
for (Object o : v) if (o == null) return true;
|
for (Object o : v) if (o == null) return true;
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.util;
|
package love.sola.netsupport.util;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Status;
|
import love.sola.netsupport.enums.Status;
|
||||||
import love.sola.netsupport.pojo.Ticket;
|
import love.sola.netsupport.pojo.Ticket;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +38,8 @@ public class ParseUtil {
|
|||||||
.append(lang("Ticket_Info_Submit_Time")).append(dateFormat.format(t.getSubmitTime())).append("\n");
|
.append(lang("Ticket_Info_Submit_Time")).append(dateFormat.format(t.getSubmitTime())).append("\n");
|
||||||
if (t.getOperator() != null)
|
if (t.getOperator() != null)
|
||||||
sb.append(lang("Ticket_Info_Operator")).append(t.getOperator().getId()).append("\n");
|
sb.append(lang("Ticket_Info_Operator")).append(t.getOperator().getId()).append("\n");
|
||||||
if (t.getRemark() != null) sb.append(lang("Ticket_Info_Remark")).append(t.getRemark()).append("\n");
|
if (t.getRemark() != null)
|
||||||
|
sb.append(lang("Ticket_Info_Remark")).append(t.getRemark()).append("\n");
|
||||||
if (t.getUpdateTime() != null)
|
if (t.getUpdateTime() != null)
|
||||||
sb.append(lang("Ticket_Info_Update_Time")).append(dateFormat.format(t.getUpdateTime())).append("\n");
|
sb.append(lang("Ticket_Info_Update_Time")).append(dateFormat.format(t.getUpdateTime())).append("\n");
|
||||||
sb.append(lang("Ticket_Info_Status")).append(Status.getLocalized(t.getStatus()));
|
sb.append(lang("Ticket_Info_Status")).append(Status.getLocalized(t.getStatus()));
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of WechatTicketSystem.
|
|
||||||
*
|
|
||||||
* WechatTicketSystem is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* WechatTicketSystem is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with WechatTicketSystem. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package love.sola.netsupport.util;
|
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.security.Key;
|
|
||||||
import java.security.KeyPair;
|
|
||||||
import java.security.KeyPairGenerator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
|
||||||
*/
|
|
||||||
public class RSAUtil {
|
|
||||||
|
|
||||||
|
|
||||||
public static Key publicKey;
|
|
||||||
public static Key privateKey;
|
|
||||||
public static String publicKey_s;
|
|
||||||
public static String privateKey_s;
|
|
||||||
|
|
||||||
static {
|
|
||||||
genKeyPair();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void genKeyPair() {
|
|
||||||
try {
|
|
||||||
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
|
|
||||||
kpg.initialize(1024);
|
|
||||||
KeyPair kp = kpg.genKeyPair();
|
|
||||||
publicKey = kp.getPublic();
|
|
||||||
privateKey = kp.getPrivate();
|
|
||||||
publicKey_s = Base64.encodeBase64String(publicKey.getEncoded());
|
|
||||||
privateKey_s = Base64.encodeBase64String(privateKey.getEncoded());
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String encrypt(String value) {
|
|
||||||
try {
|
|
||||||
Cipher cipher = Cipher.getInstance("RSA");
|
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
|
|
||||||
byte[] encrypted = cipher.doFinal(value.getBytes(StandardCharsets.UTF_8));
|
|
||||||
return Base64.encodeBase64String(encrypted);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String decrypt(String encrypted) {
|
|
||||||
try {
|
|
||||||
Cipher cipher = Cipher.getInstance("RSA");
|
|
||||||
cipher.init(Cipher.DECRYPT_MODE, privateKey);
|
|
||||||
byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
|
|
||||||
return new String(original, StandardCharsets.UTF_8);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -19,9 +19,10 @@ package love.sola.netsupport.util;
|
|||||||
|
|
||||||
import com.google.common.net.UrlEscapers;
|
import com.google.common.net.UrlEscapers;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +116,8 @@ public class Redirect {
|
|||||||
WARN("weui_icon_warn"),
|
WARN("weui_icon_warn"),
|
||||||
WARN_SAFE("weui_icon_safe_warn"),
|
WARN_SAFE("weui_icon_safe_warn"),
|
||||||
DOWNLOAD("weui_icon_download"),
|
DOWNLOAD("weui_icon_download"),
|
||||||
CANCEL("weui_icon_cancel"),;
|
CANCEL("weui_icon_cancel"),
|
||||||
|
;
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
|||||||
@@ -17,15 +17,19 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat;
|
package love.sola.netsupport.wechat;
|
||||||
|
|
||||||
import love.sola.netsupport.wechat.handler.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import love.sola.netsupport.wechat.handler.CancelHandler;
|
||||||
|
import love.sola.netsupport.wechat.handler.ProfileHandler;
|
||||||
|
import love.sola.netsupport.wechat.handler.QueryHandler;
|
||||||
|
import love.sola.netsupport.wechat.handler.RegisterHandler;
|
||||||
|
import love.sola.netsupport.wechat.handler.SubmitHandler;
|
||||||
import love.sola.netsupport.wechat.handler.admin.LoginHandler;
|
import love.sola.netsupport.wechat.handler.admin.LoginHandler;
|
||||||
import love.sola.netsupport.wechat.handler.admin.OperatorInfoHandler;
|
import love.sola.netsupport.wechat.handler.admin.OperatorInfoHandler;
|
||||||
import love.sola.netsupport.wechat.handler.admin.SignHandler;
|
import love.sola.netsupport.wechat.handler.admin.SignHandler;
|
||||||
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,6 +17,14 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat;
|
package love.sola.netsupport.wechat;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
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 love.sola.netsupport.auth.OAuth2;
|
import love.sola.netsupport.auth.OAuth2;
|
||||||
import love.sola.netsupport.auth.OAuth2Handler;
|
import love.sola.netsupport.auth.OAuth2Handler;
|
||||||
import love.sola.netsupport.config.Settings;
|
import love.sola.netsupport.config.Settings;
|
||||||
@@ -27,17 +35,14 @@ import love.sola.netsupport.wechat.matcher.CheckSpamMatcher;
|
|||||||
import love.sola.netsupport.wechat.matcher.RegisterMatcher;
|
import love.sola.netsupport.wechat.matcher.RegisterMatcher;
|
||||||
import me.chanjar.weixin.common.api.WxConsts;
|
import me.chanjar.weixin.common.api.WxConsts;
|
||||||
import me.chanjar.weixin.common.util.StringUtils;
|
import me.chanjar.weixin.common.util.StringUtils;
|
||||||
import me.chanjar.weixin.mp.api.*;
|
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMessageRouter;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpServiceImpl;
|
||||||
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
|
|
||||||
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 java.io.IOException;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||||
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||||
@@ -24,8 +26,6 @@ import me.chanjar.weixin.mp.api.WxMpService;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import org.hibernate.Session;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Status;
|
import love.sola.netsupport.enums.Status;
|
||||||
import love.sola.netsupport.pojo.Operator;
|
import love.sola.netsupport.pojo.Operator;
|
||||||
import love.sola.netsupport.pojo.Ticket;
|
import love.sola.netsupport.pojo.Ticket;
|
||||||
@@ -33,10 +38,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutNewsMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutNewsMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.NewsBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.NewsBuilder;
|
||||||
import org.hibernate.Session;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.AsyncContext;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import love.sola.netsupport.auth.OAuth2Handler;
|
import love.sola.netsupport.auth.OAuth2Handler;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.User;
|
import love.sola.netsupport.pojo.User;
|
||||||
@@ -33,10 +38,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
||||||
|
|
||||||
import javax.servlet.AsyncContext;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.Ticket;
|
import love.sola.netsupport.pojo.Ticket;
|
||||||
import love.sola.netsupport.pojo.User;
|
import love.sola.netsupport.pojo.User;
|
||||||
@@ -35,8 +37,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutNewsMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutNewsMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.NewsBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.NewsBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.User;
|
import love.sola.netsupport.pojo.User;
|
||||||
import love.sola.netsupport.session.WechatSession;
|
import love.sola.netsupport.session.WechatSession;
|
||||||
@@ -31,8 +33,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.User;
|
import love.sola.netsupport.pojo.User;
|
||||||
import love.sola.netsupport.session.WechatSession;
|
import love.sola.netsupport.session.WechatSession;
|
||||||
@@ -33,8 +35,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutNewsMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutNewsMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.NewsBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.NewsBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler;
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
import love.sola.netsupport.pojo.Operator;
|
import love.sola.netsupport.pojo.Operator;
|
||||||
import love.sola.netsupport.pojo.User;
|
import love.sola.netsupport.pojo.User;
|
||||||
@@ -33,8 +35,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler.admin;
|
package love.sola.netsupport.wechat.handler.admin;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.AsyncContext;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import love.sola.netsupport.auth.OAuth2Handler;
|
import love.sola.netsupport.auth.OAuth2Handler;
|
||||||
import love.sola.netsupport.enums.Access;
|
import love.sola.netsupport.enums.Access;
|
||||||
import love.sola.netsupport.enums.Attribute;
|
import love.sola.netsupport.enums.Attribute;
|
||||||
@@ -34,10 +39,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
||||||
|
|
||||||
import javax.servlet.AsyncContext;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler.admin;
|
package love.sola.netsupport.wechat.handler.admin;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import love.sola.netsupport.pojo.Operator;
|
import love.sola.netsupport.pojo.Operator;
|
||||||
import love.sola.netsupport.sql.TableOperator;
|
import love.sola.netsupport.sql.TableOperator;
|
||||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
@@ -27,8 +29,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static love.sola.netsupport.config.Lang.format;
|
import static love.sola.netsupport.config.Lang.format;
|
||||||
import static love.sola.netsupport.config.Lang.lang;
|
import static love.sola.netsupport.config.Lang.lang;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,14 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.handler.admin;
|
package love.sola.netsupport.wechat.handler.admin;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import love.sola.netsupport.sql.SQLCore;
|
import love.sola.netsupport.sql.SQLCore;
|
||||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||||
@@ -26,14 +34,6 @@ import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
|||||||
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
import me.chanjar.weixin.mp.bean.outxmlbuilder.TextBuilder;
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
* @deprecated limited time only
|
* @deprecated limited time only
|
||||||
|
|||||||
@@ -20,12 +20,13 @@ package love.sola.netsupport.wechat.matcher;
|
|||||||
import com.google.common.cache.CacheBuilder;
|
import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import love.sola.netsupport.config.Settings;
|
import love.sola.netsupport.config.Settings;
|
||||||
import me.chanjar.weixin.mp.api.WxMpMessageMatcher;
|
import me.chanjar.weixin.mp.api.WxMpMessageMatcher;
|
||||||
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.wechat.matcher;
|
package love.sola.netsupport.wechat.matcher;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import love.sola.netsupport.wechat.Command;
|
import love.sola.netsupport.wechat.Command;
|
||||||
import me.chanjar.weixin.mp.api.WxMpMessageMatcher;
|
import me.chanjar.weixin.mp.api.WxMpMessageMatcher;
|
||||||
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?><!--
|
||||||
<!--
|
|
||||||
~ Hibernate, Relational Persistence for Idiomatic Java
|
~ Hibernate, Relational Persistence for Idiomatic Java
|
||||||
~
|
~
|
||||||
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
-->
|
--><!DOCTYPE hibernate-configuration PUBLIC
|
||||||
<!DOCTYPE hibernate-configuration PUBLIC
|
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
||||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
||||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
|
||||||
|
|
||||||
<hibernate-configuration>
|
<hibernate-configuration>
|
||||||
|
|
||||||
@@ -28,7 +26,8 @@
|
|||||||
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
|
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
|
||||||
|
|
||||||
<!-- Disable the second-level cache -->
|
<!-- Disable the second-level cache -->
|
||||||
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
|
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider
|
||||||
|
</property>
|
||||||
|
|
||||||
<!-- Echo all executed SQL to stdout -->
|
<!-- Echo all executed SQL to stdout -->
|
||||||
<property name="show_sql">true</property>
|
<property name="show_sql">true</property>
|
||||||
@@ -37,10 +36,10 @@
|
|||||||
<property name="hbm2ddl.auto">validate</property>
|
<property name="hbm2ddl.auto">validate</property>
|
||||||
|
|
||||||
<!-- Names the annotated entity class -->
|
<!-- Names the annotated entity class -->
|
||||||
<mapping class="love.sola.netsupport.pojo.User"/>
|
<mapping class="love.sola.netsupport.pojo.User" />
|
||||||
<mapping class="love.sola.netsupport.pojo.Ticket"/>
|
<mapping class="love.sola.netsupport.pojo.Ticket" />
|
||||||
<mapping class="love.sola.netsupport.pojo.Operator"/>
|
<mapping class="love.sola.netsupport.pojo.Operator" />
|
||||||
<mapping class="love.sola.netsupport.pojo.ToolsCheck"/>
|
<mapping class="love.sola.netsupport.pojo.ToolsCheck" />
|
||||||
|
|
||||||
</session-factory>
|
</session-factory>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#System Exception
|
#System Exception
|
||||||
Access_Denied: 'Access denied.'
|
Access_Denied: 'Access denied.'
|
||||||
Illegal_Request: |
|
Illegal_Request: |
|
||||||
Access denied.
|
Access denied.
|
||||||
You are doing an illegal request, and our system has logged your behaviors.
|
You are doing an illegal request, and our system has logged your behaviors.
|
||||||
You have to take this seriously, you may be banned from our system if you do this frequently.
|
You have to take this seriously, you may be banned from our system if you do this frequently.
|
||||||
Unknown_Encrypt_Type: 'Unknown encrypt-type.'
|
Unknown_Encrypt_Type: 'Unknown encrypt-type.'
|
||||||
|
|
||||||
#Command Regex
|
#Command Regex
|
||||||
@@ -32,13 +32,13 @@ No_Ticket_Available: '您尚未提交过任何报修。'
|
|||||||
Already_Opening_Ticket: "您上次提交的报修单仍在处理中. 若需要查询报修单状态,请发送 '查询' 。"
|
Already_Opening_Ticket: "您上次提交的报修单仍在处理中. 若需要查询报修单状态,请发送 '查询' 。"
|
||||||
Submit_Title: '在网维工作人员上门解决您的问题之前...'
|
Submit_Title: '在网维工作人员上门解决您的问题之前...'
|
||||||
Submit_Desc: |
|
Submit_Desc: |
|
||||||
在网维工作人员上门解决您的问题之前,您可以尝试以下方法来更有效地解决您的问题:
|
在网维工作人员上门解决您的问题之前,您可以尝试以下方法来更有效地解决您的问题:
|
||||||
- 重新插拔您电脑的网线以及墙上的端口。
|
- 重新插拔您电脑的网线以及墙上的端口。
|
||||||
- 尝试卸载掉您的wifi共享软件并重启电脑。
|
- 尝试卸载掉您的wifi共享软件并重启电脑。
|
||||||
- 请您检查一下您的账号是否余额充足。
|
- 请您检查一下您的账号是否余额充足。
|
||||||
- 若您的电脑出现明显异常,请尝试使用他人的电脑能否正常登录,网维的工作成员主要负责网络的维护工作,可能无法解决您的个人电脑问题。
|
- 若您的电脑出现明显异常,请尝试使用他人的电脑能否正常登录,网维的工作成员主要负责网络的维护工作,可能无法解决您的个人电脑问题。
|
||||||
|
|
||||||
若以上步骤对您没有帮助,请点此提交报修表单。
|
若以上步骤对您没有帮助,请点此提交报修表单。
|
||||||
#Cancel
|
#Cancel
|
||||||
No_Open_Ticket_Available: '您当前没有未解决的报修表单。'
|
No_Open_Ticket_Available: '您当前没有未解决的报修表单。'
|
||||||
Cancel_Title: '报修已取消:'
|
Cancel_Title: '报修已取消:'
|
||||||
@@ -58,22 +58,22 @@ Left_Operator: '网络维护科的茁壮成长离不开每一位成员的陪伴
|
|||||||
Internal_Error: '啊哦,登录失败了哦。'
|
Internal_Error: '啊哦,登录失败了哦。'
|
||||||
#Operator_Info
|
#Operator_Info
|
||||||
Operator_Info: |
|
Operator_Info: |
|
||||||
网维成员资料:
|
网维成员资料:
|
||||||
网维ID: {0,number,#}
|
网维ID: {0,number,#}
|
||||||
姓名: {1}
|
姓名: {1}
|
||||||
岗位: {2,choice,0#'Administrator >ω<'|3#值班组长|6#正式成员|7#实习成员|9#'曾经的一员(TдT)'}
|
岗位: {2,choice,0#'Administrator >ω<'|3#值班组长|6#正式成员|7#实习成员|9#'曾经的一员(TдT)'}
|
||||||
值班片区: {3,choice,0#'全图 >ω<'|1#岐头片区|2#北门片区|3#东门片区|4#香灰片区|5#凤翔片区}
|
值班片区: {3,choice,0#'全图 >ω<'|1#岐头片区|2#北门片区|3#东门片区|4#香灰片区|5#凤翔片区|8#朝晖片区}
|
||||||
值班日: {4,choice,0#'2月30日 >ω<'|1#周一|2#周二|3#周三|4#周四|5#周五|6#周六|7#周日}
|
值班日: {4,choice,0#'2月30日 >ω<'|1#周一|2#周二|3#周三|4#周四|5#周五|6#周六|7#周日}
|
||||||
|
|
||||||
若以上信息有误,请及时联系@15-沙子森。
|
若以上信息有误,请及时联系@15-沙子森。
|
||||||
#URL
|
#URL
|
||||||
User_Register_Link: 'http://wwbx.zsc.edu.cn/nm/v2/user/reg.html?token={0}'
|
User_Register_Link: 'https://wwbx.davisye.cn/nm/v2/user/reg.html?token={0}'
|
||||||
User_Query_Link: 'http://wwbx.zsc.edu.cn/nm/v2/user/list.html?token={0}'
|
User_Query_Link: 'https://wwbx.davisye.cn/nm/v2/user/list.html?token={0}'
|
||||||
User_Submit_Link: 'http://wwbx.zsc.edu.cn/nm/v2/user/rrepair.html?token={0}&name={1}&isp={2}&room={3}&block={4}&phone={5,number,#}'
|
User_Submit_Link: 'https://wwbx.davisye.cn/nm/v2/user/rrepair.html?token={0}&name={1}&isp={2}&room={3}&block={4}&phone={5,number,#}'
|
||||||
User_Profile_Link: 'http://wwbx.zsc.edu.cn/nm/v2/user/modi.html?token={0}&name={1}&isp={2}&username={3}&block={4}&room={5}&phone={6,number,#}'
|
User_Profile_Link: 'https://wwbx.davisye.cn/nm/v2/user/modi.html?token={0}&name={1}&isp={2}&username={3}&block={4}&room={5}&phone={6,number,#}'
|
||||||
Result_Page: 'http://wwbx.zsc.edu.cn/nm/v2/result.html'
|
Result_Page: 'https://wwbx.davisye.cn/nm/v2/result.html'
|
||||||
Operator_Home_Page: 'http://wwbx.zsc.edu.cn/nm/v2/man/home.html?token={0}'
|
Operator_Home_Page: 'https://wwbx.davisye.cn/nm/v2/man/home.html?token={0}'
|
||||||
Operator_Login_Page: 'http://wwbx.zsc.edu.cn/nm/v2/man/login.html?pkey={0}'
|
Operator_Login_Page: 'https://wwbx.davisye.cn/nm/v2/man/login.html?pkey={0}'
|
||||||
|
|
||||||
#Localized
|
#Localized
|
||||||
#Status
|
#Status
|
||||||
|
|||||||
@@ -31,17 +31,17 @@
|
|||||||
{
|
{
|
||||||
"type": "view",
|
"type": "view",
|
||||||
"name": "关于报修系统",
|
"name": "关于报修系统",
|
||||||
"url": "http://wwbx.zsc.edu.cn/nm/v2/"
|
"url": "https://wwbx.davisye.cn/nm/v2/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "view",
|
"type": "view",
|
||||||
"name": "联系我们",
|
"name": "联系我们",
|
||||||
"url": "http://wwbx.zsc.edu.cn/nm/v2/404.html"
|
"url": "https://wwbx.davisye.cn/nm/v2/404.html"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "view",
|
"type": "view",
|
||||||
"name": "关于网维",
|
"name": "关于网维",
|
||||||
"url": "http://wwbx.zsc.edu.cn/nm/v2/404.html"
|
"url": "https://wwbx.davisye.cn/nm/v2/404.html"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<wechat-config>
|
|
||||||
<appId>****</appId>
|
|
||||||
<secret>****</secret>
|
|
||||||
<token>****</token>
|
|
||||||
<aesKey>****</aesKey>
|
|
||||||
</wechat-config>
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?><!--
|
||||||
<!--
|
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
this work for additional information regarding copyright ownership.
|
this work for additional information regarding copyright ownership.
|
||||||
@@ -14,9 +13,7 @@
|
|||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
--><!-- The contents of this file will be loaded for each web application --><!-- Don't swallowOutput for debugging, true for logging(production) -->
|
||||||
<!-- The contents of this file will be loaded for each web application -->
|
|
||||||
<!-- Don't swallowOutput for debugging, true for logging(production) -->
|
|
||||||
<Context antiResourceLocking="true">
|
<Context antiResourceLocking="true">
|
||||||
|
|
||||||
<!-- Default set of monitored resources -->
|
<!-- Default set of monitored resources -->
|
||||||
@@ -26,20 +23,12 @@
|
|||||||
<!--
|
<!--
|
||||||
<Manager pathname="" />
|
<Manager pathname="" />
|
||||||
-->
|
-->
|
||||||
<Resource auth="Container"
|
<Resource auth="Container" description="C3P0 database connection pool"
|
||||||
description="C3P0 database connection pool"
|
driverClass="com.mysql.jdbc.Driver" maxPoolSize="10" minPoolSize="2" acquireIncrement="1"
|
||||||
driverClass="com.mysql.jdbc.Driver"
|
maxIdleTime="3600" idleConnectionTestPeriod="1800" name="jdbc/netsupport" user="${DATABASE_USER}"
|
||||||
maxPoolSize="10"
|
password="${DATABASE_PASSWORD}" factory="org.apache.naming.factory.BeanFactory"
|
||||||
minPoolSize="2"
|
type="com.mchange.v2.c3p0.ComboPooledDataSource"
|
||||||
acquireIncrement="1"
|
jdbcUrl="jdbc:mysql://${DATABASE_HOST}:3306/netsupport?autoReconnect=true&characterEncoding=utf8" />
|
||||||
maxIdleTime="3600"
|
|
||||||
idleConnectionTestPeriod="1800"
|
|
||||||
name="jdbc/netsupport"
|
|
||||||
user="root"
|
|
||||||
password=""
|
|
||||||
factory="org.apache.naming.factory.BeanFactory"
|
|
||||||
type="com.mchange.v2.c3p0.ComboPooledDataSource"
|
|
||||||
jdbcUrl="jdbc:mysql://localhost:3306/netsupport?autoReconnect=true&characterEncoding=utf8"/>
|
|
||||||
<!-- Uncomment this to enable Comet connection tacking (provides events
|
<!-- Uncomment this to enable Comet connection tacking (provides events
|
||||||
on session expiration as well as webapp lifecycle) -->
|
on session expiration as well as webapp lifecycle) -->
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
|
||||||
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
|
||||||
version="3.1">
|
|
||||||
|
|
||||||
<!-- General description of your web application -->
|
<!-- General description of your web application -->
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
package love.sola.netsupport.config;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
|
||||||
*/
|
|
||||||
public class CortanaTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void load() throws Exception {
|
|
||||||
Cortana.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package love.sola.netsupport.util;
|
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.mindrot.jbcrypt.BCrypt;
|
|
||||||
|
|
||||||
import java.security.KeyFactory;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.spec.InvalidKeySpecException;
|
|
||||||
import java.security.spec.X509EncodedKeySpec;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
|
||||||
*/
|
|
||||||
public class EncryptTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testBCrypt() {
|
|
||||||
String hash = BCrypt.hashpw("mypasswordhere", BCrypt.gensalt());
|
|
||||||
assert BCrypt.checkpw("mypasswordhere", hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testRSA() {
|
|
||||||
assert "Hello World".equals(RSAUtil.decrypt(RSAUtil.encrypt("Hello World")));
|
|
||||||
assert "Encrypt".equals(RSAUtil.decrypt(RSAUtil.encrypt("Encrypt")));
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
public void testRSASpecKey() throws NoSuchAlgorithmException, InvalidKeySpecException {
|
|
||||||
System.out.println("RSAUtil.privateKey_s = " + RSAUtil.privateKey_s);
|
|
||||||
System.out.println("RSAUtil.publicKey_s = " + RSAUtil.publicKey_s);
|
|
||||||
// String pkey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCA0qyARvHSCIUQ6YM6K+e/QgiZ+dc/MpVz5DIFwQab5iiifruQiaoA74ilHOOiq5i0ToR1VxNhCUZcAy2saHNifoYKTauMOUSV6IoP4X5jp691PlI9yxNx328mSlPNM9+7BgOzrUP1pR71d+T4LDn0o4J6Ad82vVIe7yWszzF4qQIDAQAB";
|
|
||||||
String pkey = RSAUtil.publicKey_s;
|
|
||||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
|
|
||||||
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.decodeBase64(pkey));
|
|
||||||
RSAUtil.publicKey = keyFactory.generatePublic(keySpec);
|
|
||||||
System.out.println("RSAUtil.encrypt(\"233\") = " + RSAUtil.encrypt("233"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
package love.sola.netsupport.util;
|
package love.sola.netsupport.util;
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.Gson;
|
||||||
import love.sola.netsupport.enums.ISP;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonPrimitive;
|
||||||
|
import com.google.gson.JsonSerializer;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import love.sola.netsupport.enums.ISP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package love.sola.netsupport.util;
|
package love.sola.netsupport.util;
|
||||||
|
|
||||||
import com.google.common.net.UrlEscapers;
|
import com.google.common.net.UrlEscapers;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
@@ -24,7 +25,7 @@ public class URLEncodeTest {
|
|||||||
.title("Test Title")
|
.title("Test Title")
|
||||||
.msg("Test Message")
|
.msg("Test Message")
|
||||||
.toString(),
|
.toString(),
|
||||||
equalTo("http://s.wts.sola.love/nm/v2/result.html?type=1&title=Test%20Title&msg=Test%20Message&")
|
equalTo("https://wwbx.davisye.cn/nm/v2/result.html?type=1&title=Test%20Title&msg=Test%20Message&")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
rules:
|
|
||||||
rule1:
|
|
||||||
regexp:
|
|
||||||
- 'single test'
|
|
||||||
replies:
|
|
||||||
- 'single test'
|
|
||||||
rule2:
|
|
||||||
regexp: ['inline test', 'inline test']
|
|
||||||
replies: ['inline test', 'inline test']
|
|
||||||
rule3:
|
|
||||||
regexp:
|
|
||||||
- 'multi line test'
|
|
||||||
- 'multi line test'
|
|
||||||
replies:
|
|
||||||
- 'multi line test'
|
|
||||||
- 'multi line test'
|
|
||||||
Reference in New Issue
Block a user