package com.bonus.sgzb.auth.form;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author：梁超
 * @date：2024/1/26 - 13:41
 */
@Component
public class NwLoginConstants {

    public final static int ZERO = 0;

    public final static int ONE = 1;
    public final static int TWO = 2;
    public final static int THREE = 3;
    public final static int FOUR = 4;
    /**
     * 授权回调地址
     */
    public static final String REDIRECT_URI = "redirect_uri";

    /**
     * 编码
     */
    public static final String CODE = "code";

    public static final String DATA = "data";

    public static final String REGISTERED = "REGISTERED";
    /**
     * 描述
     */
    public static final String MESSAGE = "message";
    /**
     * 认证类型
     */
    public static final String GRANT_TYPE = "grant_type";
    public static final int LOGIN_ERROR_CODE = 501;
    public static final String LOGIN_ERROR_MESSAGE = "该用户不存在,请先注册";

    public static final String LOGIN_TYPE_EXCEPTION_CODE = "500";

    public static final String LOGIN_TYPE_EXCEPTION_MSG = "登录类型错误";

    public static final String IP_NULL_CODE = "33-005";

    public static final String IP_NULL_MSG = "IP地址为空";

    public static final String USER_NAME_EXISTS_CODE = "33-019";
    public static final String USER_NAME_EXISTS_MSG = "用户名已存在,请重新输入";

    public static final String PARAM_IS_NULL_ERROR_CODE = "0-0001";

    public static final String PARAM_IS_NULL_ERROR_CODE_MSG = "参数为空:%s";

    public static final String PHONE_NOT_NULL_CODE = "33-009";
    public static final String PHONE_NOT_NULL_MSG = "请输入手机号";

    public static final String MOBILE_FORMAT_ERROR_CODE = "33-001";
    public static final String MOBILE_FORMAT_ERROR_CODE_MSG = "手机号格式不正确";

    public static final String USER_NAME_NOT_NULL_CODE = "33-015";
    public static final String USER_NAME_NOT_NULL_MSG = "用户名称不能为空";

    public static final String PASSWORD_NOT_NULL_CODE = "33-017";
    public static final String PASSWORD_NOT_NULL_MSG = "密码不能为空";

    public static final String AGAIN_PASSWORD_NOT_NULL_CODE = "33-018";
    public static final String AGAIN_PASSWORD_NOT_NULL_MSG = "确认密码不能为空";

    public static final String CHECK_MOBILEPHONECODE_WRONG_ERROR_CODE = "31-002";
    public static final String CHECK_MOBILEPHONECODE_WRONG_ERROR_CODE_MSG = "短信验证码错误";

    public static final Long PLATFORM_ID = 20L;

    public static final String REGISTERIP_SUCCESS = "注册成功";
    public static final String REGISTERIP_SUCCESS_BIND = "该账号已注册";
    public static final String REGISTERIP_FAIL = "注册失败";
    /**
     * 授权范围
     */
    public static final String SCOPE = "scope";

    public static final String SCOPE_ALL = "all";

    public static final String HTTP_RESPONSE_CODE_200 = "200";

    /**
     * 南网 ExternalId
     */
    public static final String USER_LBCLOUD_EXTERNA_ID = "userId";

    public static final String USER_EXTERNAL_ID = "userId";

    /**
     * 脱敏参数
     */
    public static final String CACEL_DESENSITIZATION = "cancelDesensitization";

    /**
     * 状态值
     */
    public static final String TRUE = "true";

    public static final String LBCLOUD_ACCESS_KEY = "X-LBCloud-Access-Key";

    public static final String CONCAT_ACCESS_KEY = "Client ";

    public static final String CONCAT_SIGN_WORD = ":";

    public static final String HTTP_ERQUEST_FAILED_CODE = "33-036";
    public static final String HTTP_ERQUEST_FAILED_MSG = "Http远程请求错误";

    public static final String USER_DATA_QUERY_FAILED_MSG = "南网用户信息获取失败";
    /**
     * 返回数据
     */
    public static final String USER_RECORDS = "records";

    /**
     * 南网id
     */
    public static final String USER_LBCLOUD_ID = "id";

    /**
     * 用户姓名
     */
    public static final String USER_LBCLOUD_NAME = "userName";

    /**
     * 用户账号
     */
    public static final String USER_LBCLOUD_ACCOUNT = "userAccount";

    //用户注册 手机号注册
    public static String registerPhone;

    //短信验证码校验
    public static String verifyPhoneCode;

    @Value("${verifyPhoneCode}")
    public void setVerifyPhoneCode(String verifyPhoneCode) {
        NwLoginConstants.verifyPhoneCode = verifyPhoneCode;
    }

    // 绑定默认系统角色
    public static String userBindUrl;

    @Value("${userBindUrl}")
    public void setUserBindUrl(String userBindUrl) {
        NwLoginConstants.userBindUrl = userBindUrl;
    }

    @Value("${registerPhone}")
    public void setRegisterPhone(String registerPhone) {
        NwLoginConstants.registerPhone = registerPhone;
    }

    //用户列表查询（简单信息）
    public static String personEasyList;

    @Value("${getPersonDetailData}")
    public void setGetPersonDetailData(String getPersonDetailData) {
        NwLoginConstants.getPersonDetailData = getPersonDetailData;
    }

    //用户信息查询 详细信息
    public static String getPersonDetailData;

    //微服务平台认证接口
    public static String onlineApprove;

    //获取当前登陆用户 详细信息
    public static String getNowPersonDetailData;

    public static String wechatAppId;

    //访问地址
    public static String baseUrl;
    public static String wechatAppsecret;

    public static String appAppsecret;

    @Value("${appAppsecret}")
    public void setAppAppsecret(String appAppsecret) {
        NwLoginConstants.appAppsecret = appAppsecret;
    }

    @Value("${personEasyList}")
    public void setPersonEasyList(String personEasyList) {
        NwLoginConstants.personEasyList = personEasyList;
    }

    public static String appsecret;

    public static String h5Appsecret;

    @Value("${h5Appsecret}")
    public void setH5Appsecret(String h5Appsecret) {
        NwLoginConstants.h5Appsecret = h5Appsecret;
    }

    @Value("${appsecret}")
    public void setAppsecret(String appsecret) {
        NwLoginConstants.appsecret = appsecret;
    }

    public static String appId;

    public static String h5AppId;

    public static String appAppId;


    @Value("${appAppId}")
    public void setAppAppId(String appAppId) {
        NwLoginConstants.appAppId = appAppId;
    }


    @Value("${h5AppId}")
    public void setH5AppId(String h5AppId) {
        NwLoginConstants.h5AppId = h5AppId;
    }

    @Value("${appId}")
    public void setAppId(String appId) {
        NwLoginConstants.appId = appId;
    }

    @Value("${baseUrl}")
    public void setBaseUrl(String baseUrl) {
        NwLoginConstants.baseUrl = baseUrl;
    }

    @Value("${getNowPersonDetailData}")
    public void setGetNowPersonDetailData(String getNowPersonDetailData) {
        NwLoginConstants.getNowPersonDetailData = getNowPersonDetailData;
    }

    @Value("${wechatAppsecret}")
    public void setWechatAppsecret(String wechatAppsecret) {
        NwLoginConstants.wechatAppsecret = wechatAppsecret;
    }

    @Value("${wechatAppId}")
    public void setWechatAppId(String wechatAppId) {
        NwLoginConstants.wechatAppId = wechatAppId;
    }

    @Value("${onlineApprove}")
    public void setOnlineApprove(String onlineApprove) {
        NwLoginConstants.onlineApprove = onlineApprove;
    }
}
