package com.jsowell.common.constant;

import io.jsonwebtoken.Claims;

/**
 * 通用常量信息
 *
 * @author jsowell
 */
public class Constants {
	// 非法交易流水号 由充电桩启动的订单会传全是0的交易流水号
	public static final String ILLEGAL_TRANSACTION_CODE = "00000000000000000000000000000000";

	// 充电桩sn号长度
	public static final int PILE_SN_LENGTH = 14;

	// 充电桩枪口号长度
	public static final int CONNECTOR_CODE_LENGTH = 2;

	// 充电桩枪口编号长度
	public static final int PILE_CONNECTOR_CODE_LENGTH = PILE_SN_LENGTH + CONNECTOR_CODE_LENGTH;

	public static final String SOCKET_IP = "127.0.0.1";

	// 默认端口号
	public static final Integer SOCKET_PORT = 9011;

	// 阿里云服务器地址
	public static final String updateServerIP = "47.103.124.69";

	// ftp端口号
	public static final int port = 0x15;

	public static final byte[] updateServerPort = new byte[]{port};

	public static final String updateServerUserName = "ftptest";

	public static final String updateServerPassword = "js160829";

	public static final String filePath = "/update.bin";

	public static final String partnerId = "1632405339"; // 商户号Id

	public static final String OPERATORID_LIANLIAN = "MA1JLFUU8";

	// public static final String APP_ID = "wxbb3e0d474569481d";  // 举视充电网  wxbb3e0d474569481d
	//
	// public static final String APP_SECRET = "bbac689f4654b209de4d6944808ec80b"; // 举视充电网 bbac689f4654b209de4d6944808ec80b

	public static final String ZERO = "0";

	public static final String ONE = "1";

	public static final String TWO = "2";

	public static final String THREE = "3";

	public static final int zero = 0;

	public static final int one = 1;

	public static final byte zeroByte = 0x00;

	public static final byte[] zeroByteArray = new byte[]{zeroByte};

	public static final byte oneByte = 0x01;

	public static final byte[] oneByteArray = new byte[]{oneByte};

	public static final byte twoByte = 0x02;

	public static final byte[] twoByteArray = new byte[]{twoByte};

	public static final String FAULT_CODE = "255";

	public static final String DOUBLE_ZERO = "00";

	public static final String ZERO_ONE = "01";

	public static final String ZERO_THREE = "03";
	/**
	 * 删除标识 0标识正常
	 */
	public static final String DEL_FLAG_NORMAL = "0";

	/**
	 * 删除标识 1标识被删除
	 */
	public static final String DEL_FLAG_DELETE = "1";
	/**
	 * UTF-8 字符集
	 */
	public static final String UTF8 = "UTF-8";

	/**
	 * GBK 字符集
	 */
	public static final String GBK = "GBK";

	/**
	 * http请求
	 */
	public static final String HTTP = "http://";

	/**
	 * https请求
	 */
	public static final String HTTPS = "https://";

	/**
	 * 通用成功标识
	 */
	public static final String SUCCESS = "0";

	/**
	 * 通用失败标识
	 */
	public static final String FAIL = "1";

	/**
	 * 登录成功
	 */
	public static final String LOGIN_SUCCESS = "Success";

	/**
	 * 注销
	 */
	public static final String LOGOUT = "Logout";

	/**
	 * 注册
	 */
	public static final String REGISTER = "Register";

	/**
	 * 登录失败
	 */
	public static final String LOGIN_FAIL = "Error";

	/**
	 * 登录验证码有效期
	 */
	public static final Integer VERIFICATION_CODE_EXPIRATION_TIME = 10;

	/**
	 * 验证码有效期（分钟）
	 */
	public static final Integer CAPTCHA_EXPIRATION = 2;

	/**
	 * 令牌
	 */
	public static final String TOKEN = "token";

	/**
	 * 令牌前缀
	 */
	public static final String TOKEN_PREFIX = "Bearer";

	/**
	 * 令牌前缀
	 */
	public static final String LOGIN_USER_KEY = "login_user_key";

	/**
	 * 用户ID
	 */
	public static final String JWT_USERID = "userid";

	/**
	 * 用户名称
	 */
	public static final String JWT_USERNAME = Claims.SUBJECT;

	/**
	 * 用户头像
	 */
	public static final String JWT_AVATAR = "avatar";

	/**
	 * 创建时间
	 */
	public static final String JWT_CREATED = "created";

	/**
	 * 用户权限
	 */
	public static final String JWT_AUTHORITIES = "authorities";

	/**
	 * 资源映射路径 前缀
	 */
	public static final String RESOURCE_PREFIX = "/profile";

	/**
	 * RMI 远程方法调用
	 */
	public static final String LOOKUP_RMI = "rmi:";

	/**
	 * LDAP 远程方法调用
	 */
	public static final String LOOKUP_LDAP = "ldap:";

	/**
	 * LDAPS 远程方法调用
	 */
	public static final String LOOKUP_LDAPS = "ldaps:";

	/**
	 * 定时任务白名单配置（仅允许访问的包名，如其他需要可以自行添加）
	 */
	public static final String[] JOB_WHITELIST_STR = {"com.jsowell"};

	/**
	 * 定时任务违规的字符
	 */
	public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
			"org.springframework", "org.apache", "com.jsowell.common.util.file"};

	// Y-是
    public static final String  Y = "Y";

	// N-否
    public static final String  N = "N";
}
