| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- package com.cnd3b.common.parameter;
- import com.cnd3b.common.data.Row;
- import com.cnd3b.common.websocket.WebClientSocket;
- import p2.p2server.P2Server;
- import p2.pao.PaoRemote;
- import p2.pao.PaoSetRemote;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.concurrent.ConcurrentHashMap;
- /**
- * 参数及全局数据表
- *
- * @author SHENJW
- */
- public class parameter {
- //token:userid
- public static HashMap<String, Long> tokenlist = new HashMap<String, Long>(16);
- //token:time
- public static HashMap<String, Date> requesttime = new HashMap<String, Date>(16);
- //userid:usermsg
- public static HashMap<Long, Row> userIdList = new HashMap<>(16);
- public static String defaultsiteid = "BWJ";
- /**
- * 登录-手机号、验证码
- */
- public static HashMap<String, String> phonenumber_password = new HashMap<>(16);
- /**
- * 登陆-验证码,来源
- */
- public static HashMap<String, String> password_client = new HashMap<>(16);
- /**
- * 登录-验证码、有效期
- */
- public static HashMap<String, Date> phonenumber_date = new HashMap<>(16);
- /**
- * 修改手机号-手机号、验证码
- */
- public static HashMap<String, String> changephonenumber_passwordmap = new HashMap<>(16);
- /**
- * 修改手机号-验证码、有效期
- */
- public static HashMap<String, Date> changephonenumber_date = new HashMap<>(16);
- /**
- * 账号注册验证码
- */
- public static HashMap<String, String> register_passwordmap = new HashMap<>(16);
- /**
- * 账号注册验证码、有效期
- */
- public static HashMap<String, Date> registerpassword_date = new HashMap<>(16);
- /**
- * 账号注册验证码
- */
- public static HashMap<Long, String> changeAdministrator_passwordmap = new HashMap<>(16);
- /**
- * 账号注册验证码、有效期
- */
- public static HashMap<Long, Date> changeAdministratorpassword_date = new HashMap<>(16);
- //websocket连接池 userid:(token:session)
- public static Map<Long, ConcurrentHashMap<String, WebClientSocket>> websocketClients = new ConcurrentHashMap<Long, ConcurrentHashMap<String, WebClientSocket>>();
- public static Map<Long, Date> loginDate = new HashMap<>();
- /**
- * 方法请求次数
- */
- public static HashMap<String, Long> callmethodTimes = new HashMap<String, Long>(16);
- /**
- * 方法请求从缓存获取次数
- */
- public static HashMap<String, Long> callmethod_fromcacheTimes = new HashMap<String, Long>(16);
- /**
- * 方法请求查询平均时间
- */
- public static HashMap<String, Long> callmethodTimeLong = new HashMap<String, Long>(16);
- /**
- * 方法请求查询最新时间
- */
- public static HashMap<String, Long> callmethodLastTimeLong = new HashMap<String, Long>(16);
- /**
- * 方法请求最近时间
- */
- public static HashMap<String, Date> lastcallmethodtime = new HashMap<String, Date>(16);
- public static boolean isdebug() {
- parameter_init();
- return isdebug;
- }
- public static boolean isminiapp() {
- parameter_init();
- return isminiapp;
- }
- public static long OBS_expireSeconds() {
- parameter_init();
- return OBS_expireSeconds;
- }
- public static String SQLiteFilePath() {
- parameter_init();
- return SQLiteFilePath;
- }
- public static String UpLoadExcelErrFilePath() {
- parameter_init();
- return UpLoadExcelErrFilePath;
- }
- public static String Bucket_endPoint() {
- parameter_init();
- return Bucket_endPoint;
- }
- public static String Bucket_location() {
- parameter_init();
- return Bucket_location;
- }
- public static String Bucket_ak() {
- parameter_init();
- return Bucket_ak;
- }
- public static String Bucket_sk() {
- parameter_init();
- return Bucket_sk;
- }
- public static void parameter_init() {
- if (isparameterinit) {
- return;
- }
- PaoSetRemote tparameter = null;
- try {
- tparameter = P2Server.getP2Server().getPaoSet("tparameter", P2Server.getP2Server().getSystemUserInfo());
- if (!tparameter.isEmpty()) {
- PaoRemote pao = tparameter.getPao(0);
- isdebug = pao.getBoolean("isdebug");
- isminiapp = pao.getBoolean("isminiapp");
- Bucket_ak = pao.getString("bucket_ak");
- Bucket_sk = pao.getString("bucket_sk");
- Bucket_endPoint = pao.getString("bucket_endpoint");
- Bucket_location = pao.getString("bucket_location");
- OBS_expireSeconds = pao.getLong("obs_expireseconds");
- SQLiteFilePath = pao.getString("sqlitefilepath");
- UpLoadExcelErrFilePath = pao.getString("uploadexcelerrfilepath");
- isparameterinit = true;
- }
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- try {
- tparameter.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- /**
- * 参数是否初始化
- */
- public static boolean isparameterinit = false;
- /**
- * 云存储参数
- */
- private static String Bucket_endPoint;
- private static String Bucket_location;
- private static String Bucket_ak;
- private static String Bucket_sk;
- /**
- * 是否调试模式
- */
- private static boolean isdebug;
- /**
- * 是否小程序
- */
- private static boolean isminiapp;
- /**
- * obs分享链接实效
- */
- private static long OBS_expireSeconds;
- /**
- * SQLlite数据库文件路径
- */
- private static String SQLiteFilePath;
- /**
- * 上传数据错误文件存放路径
- */
- private static String UpLoadExcelErrFilePath;
- }
|