# -*- coding: utf-8 -*-
"""
@File: consts.py
@Date: 2020-09-14
@author: A2TEC
@section MODIFYINFO 수정정보
- 수정자/수정일   : 수정내역
- 2022-01-14/hsj100@a2tec.co.kr : refactoring
@brief: consts
"""
from config import rest_config

# SUPPORT PROJECT
SUPPORT_PROJECT_BASIC = 'PROJECT_BASIC'

PROJECT_NAME = 'K_EYEWEAR'
SW_TITLE= f'{PROJECT_NAME} - REST API'
SW_VERSION = '0.1.0'
SW_DESCRIPTION = f'''
### K_EYEWEAR REST API

## API 이용법
  - 개별 API 설명과 Request/Response schema 참조


'''
TERMS_OF_SERVICE = 'http://www.a2tec.co.kr'
CONTEACT={
    'name': 'A2TEC (주)에이투텍',
    'url': 'http://www.a2tec.co.kr',
    'email': 'marketing@a2tec.co.kr'
}
LICENSE_INFO = {
    'name': 'Copyright by A2TEC', 'url': 'http://www.a2tec.co.kr'
}

REST_SERVER_PORT = 51000
DEFAULT_USER_ACCOUNT_PW = '1234'


class AdminInfo:
    def __init__(self):
        self.id: int = 1
        self.user_type: str = 'admin'
        self.account: str = 'a2d2_lc_manager@naver.com'  # !ekdnfeldpsdptm1 다울디엔에스
        self.pw: str = '$2b$12$PklBvVXdLhOQnIiNanlnIu.DJh5MspRARVChJQfFu1qg35vBoIuX2'
        self.name: str = 'administrator'
        self.email: str = 'a2d2_lc_manager@naver.com'  # daool1020
        self.email_pw: str = 'gAAAAABioV5NucuS9nQugZJnz-KjVG_FGnaowB9KAfhOoWjjiQ4jGLuYJh4Qe94mT_lCm6m3HhuOJqUeOgjppwREDpIQYzrUXA=='
        self.address: str = '대구광역시 동구 동촌로351 에이스빌딩 4F'
        self.phone_number: str = '053-384-3010'
        self.connect_token: str = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiYWNjb3VudCI6ImEyZDJfbGNfbWFuYWdlckBuYXZlci5jb20iLCJuYW1lIjoiYWRtaW5pc3RyYXRvciIsInBob25lX251bWJlciI6IjA1My0zODQtMzAxMCIsInByb2ZpbGVfaW1nIjpudWxsLCJhY2NvdW50X3R5cGUiOiJlbWFpbCJ9.SlQSCfAof1bv2YxmW2DO4dIBrbHLg1jPO3AJsX6xKbw'

    def get_dict(self):
        info = {}
        for k, v in self.__dict__.items():
            if type(v) is tuple:
                info[k] = v[0]
            else:
                info[k] = v
        return info


ADMIN_INIT_ACCOUNT_INFO = AdminInfo()

FERNET_SECRET_KEY = b'wQjpSYkmc4kX8MaAovk1NIHF02R2wZX760eeBTeIHW4='
AES_CBC_PUBLIC_KEY = b'daooldns12345678'
AES_CBC_IV = b'daooldns12345678'

COOKIES_AUTH = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTQsImVtYWlsIjoia29hbGFAZGluZ3JyLmNvbSIsIm5hbWUiOm51bGwsInBob25lX251bWJlciI6bnVsbCwicHJvZmlsZV9pbWciOm51bGwsInNuc190eXBlIjpudWxsfQ.4vgrFvxgH8odoXMvV70BBqyqXOFa2NDQtzYkGywhV48'

JWT_SECRET = 'ABCD1234!'
JWT_ALGORITHM = 'HS256'
EXCEPT_PATH_LIST = ['/', '/openapi.json']
EXCEPT_PATH_REGEX = '^(/docs|/redoc|/api/auth' +\
                    '|/api/user/check_account_exist' +\
                    '|/api/services' + \
                    '|/api/temp' + \
                    '|/api/dev' + \
                    '|/static' + \
                    ')'
MAX_API_KEY = 3
MAX_API_WHITELIST = 10

NUM_RETRY_UUID_GEN = 3

# DATABASE
DB_ADDRESS = "localhost"
DB_PORT = 53306
DB_USER_ID = 'root'
DB_USER_PW = rest_config.db_pw
DB_NAME = 'FM_TEST'
DB_CHARSET = 'utf8mb4'

# MAIL
# SMTP_HOST = 'smtp.gmail.com'
# SMTP_PORT = 587
SMTP_HOST = 'smtp.naver.com'
SMTP_PORT = 587
MAIL_REG_TITLE = f'{PROJECT_NAME} - Registration'
MAIL_REG_CONTENTS = '''
안녕하세요.
감사합니다.

'''