mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 08:05:04 +08:00
6
pom.xml
6
pom.xml
@@ -66,12 +66,6 @@
|
|||||||
<version>3.1.0</version>
|
<version>3.1.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.16.6</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class TicketPush extends API {
|
|||||||
if (u == null) {
|
if (u == null) {
|
||||||
return Error.USER_NOT_FOUND;
|
return Error.USER_NOT_FOUND;
|
||||||
}
|
}
|
||||||
Ticket t = new Ticket(null, u, desc, null, "Pushed By Admin", null, op, Status.UNCHECKED);
|
Ticket t = new Ticket(u, desc, null, "Pushed By Admin", null, op, Status.UNCHECKED);
|
||||||
s.save(t);
|
s.save(t);
|
||||||
s.getTransaction().commit();
|
s.getTransaction().commit();
|
||||||
return t;
|
return t;
|
||||||
|
|||||||
@@ -67,14 +67,12 @@ public class ToolsCheck extends API {
|
|||||||
try (Session s = SQLCore.sf.openSession()) {
|
try (Session s = SQLCore.sf.openSession()) {
|
||||||
s.beginTransaction();
|
s.beginTransaction();
|
||||||
s.save(new love.sola.netsupport.pojo.ToolsCheck(
|
s.save(new love.sola.netsupport.pojo.ToolsCheck(
|
||||||
null,
|
|
||||||
op,
|
op,
|
||||||
op.getBlock(),
|
op.getBlock(),
|
||||||
new Date(),
|
new Date(),
|
||||||
status,
|
status,
|
||||||
remark
|
remark
|
||||||
)
|
));
|
||||||
);
|
|
||||||
s.getTransaction().commit();
|
s.getTransaction().commit();
|
||||||
return Error.OK;
|
return Error.OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.config;
|
package love.sola.netsupport.config;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -42,15 +41,19 @@ public class Cortana {
|
|||||||
String[] replies;
|
String[] replies;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class Rule {
|
public static class Rule {
|
||||||
String[] regexp;
|
String[] regexp;
|
||||||
String[] replies;
|
String[] replies;
|
||||||
|
|
||||||
|
public Rule() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class RawConfig {
|
public static class RawConfig {
|
||||||
Map<String, Rule> rules;
|
Map<String, Rule> rules;
|
||||||
|
|
||||||
|
public RawConfig() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,11 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.config;
|
package love.sola.netsupport.config;
|
||||||
|
|
||||||
import lombok.ToString;
|
|
||||||
import love.sola.netsupport.sql.TableConfig;
|
import love.sola.netsupport.sql.TableConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@ToString
|
|
||||||
public class Settings {
|
public class Settings {
|
||||||
|
|
||||||
public static final int MAX_DESC_LENGTH = 255;
|
public static final int MAX_DESC_LENGTH = 255;
|
||||||
@@ -34,9 +32,6 @@ public class Settings {
|
|||||||
I = TableConfig.getSettings();
|
I = TableConfig.getSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// CONFIGURATIONS
|
|
||||||
// -------------------------------------------- //
|
|
||||||
public String Wechat_AppId;
|
public String Wechat_AppId;
|
||||||
public String Wechat_Secret;
|
public String Wechat_Secret;
|
||||||
public String Wechat_Token;
|
public String Wechat_Token;
|
||||||
@@ -53,4 +48,17 @@ public class Settings {
|
|||||||
I = this;
|
I = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Settings{" +
|
||||||
|
"Wechat_AppId='" + Wechat_AppId + '\'' +
|
||||||
|
", Wechat_Secret='" + Wechat_Secret + '\'' +
|
||||||
|
", Wechat_Token='" + Wechat_Token + '\'' +
|
||||||
|
", Wechat_AesKey='" + Wechat_AesKey + '\'' +
|
||||||
|
", Check_Spam_Cache_Expire_Time=" + Check_Spam_Cache_Expire_Time +
|
||||||
|
", Check_Spam_Interval=" + Check_Spam_Interval +
|
||||||
|
", User_Session_Max_Inactive=" + User_Session_Max_Inactive +
|
||||||
|
", User_Wechat_Cache_Expire_Time=" + User_Wechat_Cache_Expire_Time +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package love.sola.netsupport.config;
|
|||||||
|
|
||||||
import com.thoughtworks.xstream.XStream;
|
import com.thoughtworks.xstream.XStream;
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
import lombok.ToString;
|
|
||||||
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
|
||||||
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
|
||||||
|
|
||||||
@@ -29,7 +28,6 @@ import java.io.InputStream;
|
|||||||
* @author chanjarster
|
* @author chanjarster
|
||||||
*/
|
*/
|
||||||
@XStreamAlias("wechat-config")
|
@XStreamAlias("wechat-config")
|
||||||
@ToString
|
|
||||||
public class WxMpXmlInMemoryConfigStorage extends WxMpInMemoryConfigStorage {
|
public class WxMpXmlInMemoryConfigStorage extends WxMpInMemoryConfigStorage {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|||||||
@@ -32,31 +32,18 @@
|
|||||||
*/
|
*/
|
||||||
package love.sola.netsupport.session;
|
package love.sola.netsupport.session;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(of = "id")
|
|
||||||
public final class MapSession implements WxSession, Serializable {
|
public final class MapSession implements WxSession, Serializable {
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final String id;
|
private final String id;
|
||||||
private Map<String, Object> sessionAttrs = new HashMap<String, Object>();
|
private Map<String, Object> sessionAttrs = new HashMap<String, Object>();
|
||||||
@Getter
|
|
||||||
private long creationTime = System.currentTimeMillis();
|
private long creationTime = System.currentTimeMillis();
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
private long lastAccessedTime = creationTime;
|
private long lastAccessedTime = creationTime;
|
||||||
@Getter
|
|
||||||
private boolean invalidated = false;
|
private boolean invalidated = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,4 +89,38 @@ public final class MapSession implements WxSession, Serializable {
|
|||||||
invalidated = true;
|
invalidated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getLastAccessedTime() {
|
||||||
|
return lastAccessedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastAccessedTime(long lastAccessedTime) {
|
||||||
|
this.lastAccessedTime = lastAccessedTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getCreationTime() {
|
||||||
|
return creationTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInvalidated() {
|
||||||
|
return invalidated;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (!(o instanceof MapSession)) return false;
|
||||||
|
MapSession that = (MapSession) o;
|
||||||
|
return Objects.equals(id, that.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user