from dataclasses import dataclass
from typing import List


@dataclass
class Type:
    image_type: int
    image_field: List


@dataclass
class RequestConfig:
    url: str
    token: str


@dataclass
class Configs:
    request: RequestConfig
    type: Type

# idcard
idcard_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
idcard_TXtest_config = RequestConfig(
    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/sfzsbtest/idcard',
    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
idcard_TXsb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/sfzsb/idcard',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
idcard_DXtest_config = RequestConfig(
    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/sfzsbtest/idcard',
    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
idcard_DXsb_config = RequestConfig(
    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/sfzsb/idcard',
    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')

IDCARD_CONFIGS = {
    'local': idcard_local_config,
    'TXtest': idcard_TXtest_config,
    'TXsb': idcard_TXsb_config,
    'DXtest': idcard_DXtest_config,
    'DXsb': idcard_DXsb_config
}

# bankcard
bankcard_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
bankcard_TXtest_config = RequestConfig(
    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/yhksbtest/bankcard',
    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
bankcard_TXsb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/yhksb/bankcard',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
bankcard_DXtest_config = RequestConfig(
    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/yhksbtest/bankcard',
    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
bankcard_DXsb_config = RequestConfig(
    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/yhksb/bankcard',
    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')

BANKCARD_CONFIGS = {
    'local': bankcard_local_config,
    'TXtest': bankcard_TXtest_config,
    'TXsb': bankcard_TXsb_config,
    'DXtest': bankcard_DXtest_config,
    'DXsb': bankcard_DXsb_config
}

# school
school_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
school_TXtest_config = RequestConfig(
    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/xxwtest/schoolcert',
    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
school_TXsb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/xxw/schoolcert',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
school_DXtest_config = RequestConfig(
    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/xxwtest/schoolcert',
    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
school_DXsb_config = RequestConfig(
    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/xxw/schoolcert',
    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')

SCHOOL_CONFIGS = {
    'local': school_local_config,
    'TXtest': school_TXtest_config,
    'TXsb': school_TXsb_config,
    'DXtest': school_DXtest_config,
    'DXsb': school_DXsb_config
}


# cet
cet_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
cet_TXtest_config = RequestConfig(
    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
cet_TXsb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cet/cet',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
cet_DXtest_config = RequestConfig(
    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/cettest/cet',
    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
cet_DXsb_config = RequestConfig(
    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/cet/cet',
    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')

CET_CONFIGS = {
    'local': cet_local_config,
    'TXtest': cet_TXtest_config,
    'TXsb': cet_TXsb_config,
    'DXtest': cet_DXtest_config,
    'DXsb': cet_DXsb_config
}

# regbook
regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
regbook_TXtest_config = RequestConfig(
    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsbtest/regbook',
    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
regbook_TXsb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
regbook_DXtest_config = RequestConfig(
    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/hkbsbtest/regbook',
    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
regbook_DXsb_config = RequestConfig(
    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/hkbsb/regbook',
    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')

REGBOOK_CONFIGS = {
    'local': regbook_local_config,
    'TXtest': regbook_TXtest_config,
    'TXsb': regbook_TXsb_config,
    'DXtest': regbook_DXtest_config,
    'DXsb': regbook_DXsb_config
}

# business_license
blfe_local_config = RequestConfig(url='http://192.168.199.27:18060/ocr_system/business_license', token='')
blfe_TXtest_config = RequestConfig(
    url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/blfetest/blfe',
    token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
blfe_TXsb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/blfe/blfe',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
blfe_DXtest_config = RequestConfig(
    url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/blfetest/blfe',
    token='4e00c444-620b-4d3c-85f4-777e64276f0e')
blfe_DXsb_config = RequestConfig(
    url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/blfe/blfe',
    token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')

BLFE_CONFIGS = {
    'local': blfe_local_config,
    'TXtest': blfe_TXtest_config,
    'TXsb': blfe_TXsb_config,
    'DXtest': blfe_DXtest_config,
    'DXsb': blfe_DXsb_config
}

OCR_CONFIGS = {
    'cet': CET_CONFIGS,
    'regbook': REGBOOK_CONFIGS,
    'business_license': BLFE_CONFIGS,
    'schoolcert': SCHOOL_CONFIGS,
    'idcard': IDCARD_CONFIGS,
    'bankcard': BANKCARD_CONFIGS
}

# 字段
idcard_fieid = ['orientation', 'name', 'id', 'ethnicity', 'gender', 'birthday', 'address', 'address_province', 'address_city', 'address_region', 'address_detail', 'expire_date']
bankcard_fieid = ['orientation', 'number']
schoolcert_fieid = ['orientation', 'name', 'gender', 'admission_time', 'education_time', 'education_level', 'education_type', 'learning_type', 'school', 'major', 'number']
cet_field = ['orientation', 'name', 'id', 'language', 'level', 'exam_time', 'score']
regbook_field = ['orientation', 'name', 'id', 'gender', 'birthplace', 'birthplace_province', 'birthplace_city',
                 'birthplace_region', 'native_place', 'native_place_province', 'native_place_city',
                 'native_place_region', 'blood_type', 'religion']
business_license = ['orientation', 'social_code', 'company_name', 'legal_person', 'registered_capital', 'type',
                    'start_date', 'business_scope', 'expire_date', 'address', 'stamp']
Filed = {
    'cet': cet_field,
    'regbook': regbook_field,
    'business_license': business_license,
    'schoolcert': schoolcert_fieid,
    'idcard': idcard_fieid,
    'bankcard': bankcard_fieid
}
