// Path: src/main/java/love/sola/netsupport/enums/ISP.java
// public enum ISP {
// 
//     TELECOM(1, "^1[3|4|5|6|7|8|9][0-9]{9}$"),
//     UNICOM(2, "^\\w+([-+.]\\w+)*@16900\\.gd"),
//     CHINAMOBILE(3, "^1[3|4|5|6|7|8|9][0-9]{9}@139\\.gd$"),
//     OTHER(4, ".*"),
//     ;
// 
//     private static final Map<String, ISP> NAME_MAP = new HashMap<>();
//     private static final Map<Integer, ISP> ID_MAP = new HashMap<>();
// 
//     static {
//         for (ISP type : values()) {
//             if (type.name != null) {
//                 NAME_MAP.put(type.name.toLowerCase(), type);
//             }
//             if (type.id > 0) {
//                 ID_MAP.put(type.id, type);
//             }
//         }
//     }
// 
//     public final int id;
//     public final String name;
//     public final String accountRegex;
// 
//     ISP(int id, String accountRegex) {
//         this.id = id;
//         this.name = lang("ISP_" + name());
//         this.accountRegex = accountRegex;
//     }
// 
//     public static ISP fromName(String name) {
//         if (name == null) {
//             return null;
//         }
//         return NAME_MAP.get(name.toLowerCase());
//     }
// 
//     public static ISP fromId(int id) {
//         return ID_MAP.get(id);
//     }
// 
//     @Override
//     public String toString() {
//         return name;
//     }
// 
// }
// 
// Path: src/main/java/love/sola/netsupport/wechat/Command.java
// public enum Command {
// 
//     REGISTER(0, RegisterHandler.class),
//     QUERY(1, QueryHandler.class),
//     SUBMIT(2, SubmitHandler.class),
//     CANCEL(3, CancelHandler.class),
//     PROFILE(4, ProfileHandler.class),
//     LOGIN(10, LoginHandler.class),
//     OPERATOR_INFO(11, OperatorInfoHandler.class),
//     SIGN(12, SignHandler.class), //FIXME
//     ;
// 
//     private static final Map<Integer, Command> ID_MAP = new HashMap<>();
// 
//     static {
//         for (Command type : values()) {
//             if (type.id >= 0) {
//                 ID_MAP.put(type.id, type);
//             }
//         }
//     }
// 
//     public final String regex;
//     public final Class<? extends WxMpMessageHandler> handler;
//     public final int id;
// 
//     Command(int id, Class<? extends WxMpMessageHandler> handler) {
//         this.id = id;
//         this.regex = lang("REGEX_" + name());
//         this.handler = handler;
//     }
// 
//     public static Command fromId(int id) {
//         return ID_MAP.get(id);
//     }
// 
//     @Override
//     public String toString() {
//         return name();
//     }
// 
// }


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.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.AuditReaderFactory;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.service.ServiceRegistry;
import java.io.IOException;
import java.util.Date;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import love.sola.netsupport.enums.ISP;
import love.sola.netsupport.wechat.Command;
    public static DataSource ds;
    public static SessionFactory sf;
    public static ServiceRegistry sr;
    public static Gson gson = new GsonBuilder()
            .addSerializationExclusionStrategy(new ExclusionStrategy() {
                @Override
                public boolean shouldSkipField(FieldAttributes fieldAttributes) {
                    final Expose expose = fieldAttributes.getAnnotation(Expose.class);
                    return expose != null && !expose.serialize();
                }

                @Override
                public boolean shouldSkipClass(Class<?> aClass) {
                    return false;
                }
            })
            .addDeserializationExclusionStrategy(new ExclusionStrategy() {
                @Override
                public boolean shouldSkipField(FieldAttributes fieldAttributes) {
                    final Expose expose = fieldAttributes.getAnnotation(Expose.class);
                    return expose != null && !expose.deserialize();
                }

                @Override
                public boolean shouldSkipClass(Class<?> aClass) {
                    return false;
                }
            })
            .registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()))
            .registerTypeAdapter(Date.class, (JsonSerializer<Date>) (src, typeOfSrc, context) -> new JsonPrimitive(src.getTime()))
// Path: src/main/java/love/sola/netsupport/enums/ISP.java
// public enum ISP {
// 
//     TELECOM(1, "^1[3|4|5|6|7|8|9][0-9]{9}$"),
//     UNICOM(2, "^\\w+([-+.]\\w+)*@16900\\.gd"),
//     CHINAMOBILE(3, "^1[3|4|5|6|7|8|9][0-9]{9}@139\\.gd$"),
//     OTHER(4, ".*"),
//     ;
// 
//     private static final Map<String, ISP> NAME_MAP = new HashMap<>();
//     private static final Map<Integer, ISP> ID_MAP = new HashMap<>();
// 
//     static {
//         for (ISP type : values()) {
//             if (type.name != null) {
//                 NAME_MAP.put(type.name.toLowerCase(), type);
//             }
//             if (type.id > 0) {
//                 ID_MAP.put(type.id, type);
//             }
//         }
//     }
// 
//     public final int id;
//     public final String name;
//     public final String accountRegex;
// 
//     ISP(int id, String accountRegex) {
//         this.id = id;
//         this.name = lang("ISP_" + name());
//         this.accountRegex = accountRegex;
//     }
// 
//     public static ISP fromName(String name) {
//         if (name == null) {
//             return null;
//         }
//         return NAME_MAP.get(name.toLowerCase());
//     }
// 
//     public static ISP fromId(int id) {
//         return ID_MAP.get(id);
//     }
// 
//     @Override
//     public String toString() {
//         return name;
//     }
// 
// }
// 
// Path: src/main/java/love/sola/netsupport/wechat/Command.java
// public enum Command {
// 
//     REGISTER(0, RegisterHandler.class),
//     QUERY(1, QueryHandler.class),
//     SUBMIT(2, SubmitHandler.class),
//     CANCEL(3, CancelHandler.class),
//     PROFILE(4, ProfileHandler.class),
//     LOGIN(10, LoginHandler.class),
//     OPERATOR_INFO(11, OperatorInfoHandler.class),
//     SIGN(12, SignHandler.class), //FIXME
//     ;
// 
//     private static final Map<Integer, Command> ID_MAP = new HashMap<>();
// 
//     static {
//         for (Command type : values()) {
//             if (type.id >= 0) {
//                 ID_MAP.put(type.id, type);
//             }
//         }
//     }
// 
//     public final String regex;
//     public final Class<? extends WxMpMessageHandler> handler;
//     public final int id;
// 
//     Command(int id, Class<? extends WxMpMessageHandler> handler) {
//         this.id = id;
//         this.regex = lang("REGEX_" + name());
//         this.handler = handler;
//     }
// 
//     public static Command fromId(int id) {
//         return ID_MAP.get(id);
//     }
// 
//     @Override
//     public String toString() {
//         return name();
//     }
// 
// }


// Path: src/main/java/love/sola/netsupport/sql/SQLCore.java
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.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.envers.AuditReader;
import org.hibernate.envers.AuditReaderFactory;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.service.ServiceRegistry;
import java.io.IOException;
import java.util.Date;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import love.sola.netsupport.enums.ISP;
import love.sola.netsupport.wechat.Command;

    public static DataSource ds;
    public static SessionFactory sf;
    public static ServiceRegistry sr;
    public static Gson gson = new GsonBuilder()
            .addSerializationExclusionStrategy(new ExclusionStrategy() {
                @Override
                public boolean shouldSkipField(FieldAttributes fieldAttributes) {
                    final Expose expose = fieldAttributes.getAnnotation(Expose.class);
                    return expose != null && !expose.serialize();
                }

                @Override
                public boolean shouldSkipClass(Class<?> aClass) {
                    return false;
                }
            })
            .addDeserializationExclusionStrategy(new ExclusionStrategy() {
                @Override
                public boolean shouldSkipField(FieldAttributes fieldAttributes) {
                    final Expose expose = fieldAttributes.getAnnotation(Expose.class);
                    return expose != null && !expose.deserialize();
                }

                @Override
                public boolean shouldSkipClass(Class<?> aClass) {
                    return false;
                }
            })
            .registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()))
            .registerTypeAdapter(Date.class, (JsonSerializer<Date>) (src, typeOfSrc, context) -> new JsonPrimitive(src.getTime()))
            .registerTypeAdapter(ISP.class, (JsonDeserializer<ISP>) (json, typeOfT, context) -> ISP.fromId(json.getAsJsonPrimitive().getAsInt()))