mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 08:05:04 +08:00
Merge remote-tracking branch 'origin/develop'
# Conflicts: # README.md
This commit is contained in:
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>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class Error {
|
|||||||
public static final Object OK = new Object();
|
public static final Object OK = new Object();
|
||||||
public static final Error PARAMETER_REQUIRED = new Error(-1);
|
public static final Error PARAMETER_REQUIRED = new Error(-1);
|
||||||
public static final Error ILLEGAL_PARAMETER = new Error(-2);
|
public static final Error ILLEGAL_PARAMETER = new Error(-2);
|
||||||
// public static final Error REQUEST_FAILED = new Error(-3); REMOVED
|
// public static final Error REQUEST_FAILED = new Error(-3); REMOVED
|
||||||
public static final Error LENGTH_LIMIT_EXCEEDED = new Error(-4);
|
public static final Error LENGTH_LIMIT_EXCEEDED = new Error(-4);
|
||||||
public static final Error INVALID_PARAMETER = new Error(-5);
|
public static final Error INVALID_PARAMETER = new Error(-5);
|
||||||
public static final Error USER_NOT_FOUND = new Error(-11);
|
public static final Error USER_NOT_FOUND = new Error(-11);
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -18,10 +18,6 @@
|
|||||||
package love.sola.netsupport.pojo;
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -31,17 +27,16 @@ import javax.persistence.Table;
|
|||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
|
||||||
@ToString(exclude = "password")
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "operators")
|
@Table(name = "operators")
|
||||||
public class Operator {
|
public class Operator {
|
||||||
|
|
||||||
public static final String PROPERTY_WECHAT = "wechat";
|
public static final String PROPERTY_WECHAT = "wechat";
|
||||||
|
|
||||||
|
//System Accounts
|
||||||
|
public static Operator USER_SELF;
|
||||||
|
public static Operator ADMIN;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "id", nullable = false, insertable = false, updatable = false)
|
@Column(name = "id", nullable = false, insertable = false, updatable = false)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -57,9 +52,84 @@ public class Operator {
|
|||||||
@Expose(serialize = false)
|
@Expose(serialize = false)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
public Operator(Integer id, String name, Integer access, String wechat, Integer block, Integer week, String password) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.access = access;
|
||||||
|
this.wechat = wechat;
|
||||||
|
this.block = block;
|
||||||
|
this.week = week;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
//System Accounts
|
public Operator() {
|
||||||
public static Operator USER_SELF;
|
}
|
||||||
public static Operator ADMIN;
|
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAccess() {
|
||||||
|
return access;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccess(Integer access) {
|
||||||
|
this.access = access;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWechat() {
|
||||||
|
return wechat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWechat(String wechat) {
|
||||||
|
this.wechat = wechat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBlock() {
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlock(Integer block) {
|
||||||
|
this.block = block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getWeek() {
|
||||||
|
return week;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWeek(Integer week) {
|
||||||
|
this.week = week;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Operator{" +
|
||||||
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", access=" + access +
|
||||||
|
", wechat='" + wechat + '\'' +
|
||||||
|
", block=" + block +
|
||||||
|
", week=" + week +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,6 @@
|
|||||||
|
|
||||||
package love.sola.netsupport.pojo;
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import love.sola.netsupport.sql.TableTicket;
|
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;
|
||||||
@@ -30,9 +27,6 @@ import java.util.Date;
|
|||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "tickets")
|
@Table(name = "tickets")
|
||||||
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
|
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
|
||||||
@@ -58,4 +52,94 @@ public class Ticket {
|
|||||||
private Operator operator;
|
private Operator operator;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
public Ticket() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ticket(User user, String description, Date submitTime, String remark, Date updateTime, Operator operator, Integer status) {
|
||||||
|
this.user = user;
|
||||||
|
this.description = description;
|
||||||
|
this.submitTime = submitTime;
|
||||||
|
this.remark = remark;
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
this.operator = operator;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(User user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getSubmitTime() {
|
||||||
|
return submitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubmitTime(Date submitTime) {
|
||||||
|
this.submitTime = submitTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Operator getOperator() {
|
||||||
|
return operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperator(Operator operator) {
|
||||||
|
this.operator = operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Ticket{" +
|
||||||
|
"id=" + id +
|
||||||
|
", user=" + user +
|
||||||
|
", description='" + description + '\'' +
|
||||||
|
", submitTime=" + submitTime +
|
||||||
|
", remark='" + remark + '\'' +
|
||||||
|
", updateTime=" + updateTime +
|
||||||
|
", operator=" + operator +
|
||||||
|
", status=" + status +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package love.sola.netsupport.pojo;
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
import org.hibernate.annotations.DynamicInsert;
|
import org.hibernate.annotations.DynamicInsert;
|
||||||
|
|
||||||
@@ -12,9 +9,6 @@ import java.util.Date;
|
|||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "toolschk", indexes = {
|
@Table(name = "toolschk", indexes = {
|
||||||
@Index(columnList = "block,chktime,status"),
|
@Index(columnList = "block,chktime,status"),
|
||||||
@@ -37,4 +31,75 @@ public class ToolsCheck {
|
|||||||
private Integer status = 0;
|
private Integer status = 0;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
public ToolsCheck() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ToolsCheck(Operator operator, Integer block, Date checkTime, Integer status, String remark) {
|
||||||
|
this.operator = operator;
|
||||||
|
this.block = block;
|
||||||
|
this.checkTime = checkTime;
|
||||||
|
this.status = status;
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Operator getOperator() {
|
||||||
|
return operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperator(Operator operator) {
|
||||||
|
this.operator = operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBlock() {
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlock(Integer block) {
|
||||||
|
this.block = block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCheckTime() {
|
||||||
|
return checkTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckTime(Date checkTime) {
|
||||||
|
this.checkTime = checkTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ToolsCheck{" +
|
||||||
|
"id=" + id +
|
||||||
|
", operator=" + operator +
|
||||||
|
", block=" + block +
|
||||||
|
", checkTime=" + checkTime +
|
||||||
|
", status=" + status +
|
||||||
|
", remark='" + remark + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
package love.sola.netsupport.pojo;
|
package love.sola.netsupport.pojo;
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import love.sola.netsupport.enums.ISP;
|
import love.sola.netsupport.enums.ISP;
|
||||||
import love.sola.netsupport.enums.ISPConverter;
|
import love.sola.netsupport.enums.ISPConverter;
|
||||||
|
|
||||||
@@ -29,13 +26,15 @@ import javax.persistence.*;
|
|||||||
/**
|
/**
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
*/
|
*/
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "users")
|
@Table(name = "users")
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
|
//System Accounts
|
||||||
|
public static User OFFICIAL_CHINA_UNICOM_XH;
|
||||||
|
public static User OFFICIAL_CHINA_MOBILE_XH;
|
||||||
|
public static User OFFICIAL_CHINA_MOBILE_FX;
|
||||||
|
|
||||||
public static final String PROPERTY_NAME = "name";
|
public static final String PROPERTY_NAME = "name";
|
||||||
public static final String PROPERTY_WECHAT = "wechatId";
|
public static final String PROPERTY_WECHAT = "wechatId";
|
||||||
public static final String PROPERTY_BLOCK = "block";
|
public static final String PROPERTY_BLOCK = "block";
|
||||||
@@ -56,10 +55,95 @@ public class User {
|
|||||||
private Integer room;
|
private Integer room;
|
||||||
private Long phone;
|
private Long phone;
|
||||||
|
|
||||||
|
public User() {
|
||||||
|
}
|
||||||
|
|
||||||
//System Accounts
|
public User(Long id, String name, ISP isp, String netAccount, String wechatId, Integer block, Integer room, Long phone) {
|
||||||
public static User OFFICIAL_CHINA_UNICOM_XH;
|
this.id = id;
|
||||||
public static User OFFICIAL_CHINA_MOBILE_XH;
|
this.name = name;
|
||||||
public static User OFFICIAL_CHINA_MOBILE_FX;
|
this.isp = isp;
|
||||||
|
this.netAccount = netAccount;
|
||||||
|
this.wechatId = wechatId;
|
||||||
|
this.block = block;
|
||||||
|
this.room = room;
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISP getIsp() {
|
||||||
|
return isp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsp(ISP isp) {
|
||||||
|
this.isp = isp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetAccount() {
|
||||||
|
return netAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetAccount(String netAccount) {
|
||||||
|
this.netAccount = netAccount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWechatId() {
|
||||||
|
return wechatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWechatId(String wechatId) {
|
||||||
|
this.wechatId = wechatId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBlock() {
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlock(Integer block) {
|
||||||
|
this.block = block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRoom() {
|
||||||
|
return room;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoom(Integer room) {
|
||||||
|
this.room = room;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(Long phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "User{" +
|
||||||
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", isp=" + isp +
|
||||||
|
", netAccount='" + netAccount + '\'' +
|
||||||
|
", wechatId='" + wechatId + '\'' +
|
||||||
|
", block=" + block +
|
||||||
|
", room=" + room +
|
||||||
|
", phone=" + phone +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -35,8 +35,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated limited time only
|
|
||||||
* @author Sola {@literal <dev@sola.love>}
|
* @author Sola {@literal <dev@sola.love>}
|
||||||
|
* @deprecated limited time only
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class SignHandler implements WxMpMessageHandler {
|
public class SignHandler implements WxMpMessageHandler {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class EncryptTest {
|
|||||||
assert "Encrypt".equals(RSAUtil.decrypt(RSAUtil.encrypt("Encrypt")));
|
assert "Encrypt".equals(RSAUtil.decrypt(RSAUtil.encrypt("Encrypt")));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
public void testRSASpecKey() throws NoSuchAlgorithmException, InvalidKeySpecException {
|
public void testRSASpecKey() throws NoSuchAlgorithmException, InvalidKeySpecException {
|
||||||
System.out.println("RSAUtil.privateKey_s = " + RSAUtil.privateKey_s);
|
System.out.println("RSAUtil.privateKey_s = " + RSAUtil.privateKey_s);
|
||||||
System.out.println("RSAUtil.publicKey_s = " + RSAUtil.publicKey_s);
|
System.out.println("RSAUtil.publicKey_s = " + RSAUtil.publicKey_s);
|
||||||
|
|||||||
Reference in New Issue
Block a user