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


# cet
cet_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
cet_test_config = RequestConfig(
    url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
    token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
cet_sb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')

CET_CONFIGS = {
    'local': cet_local_config,
    'test': cet_test_config,
    'sb': cet_sb_config
}

# regbook
regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
regbook_test_config = RequestConfig(
    url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
    token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
regbook_sb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')

REGBOOK_CONFIGS = {
    'local': regbook_local_config,
    'test': regbook_test_config,
    'sb': regbook_sb_config
}

OCR_CONFIGS = {
    'cet': CET_CONFIGS,
    'regbook': REGBOOK_CONFIGS
}

# business_license
business_license_local_config = RequestConfig(url='http://192.168.199.249:18060/ocr_system/business_license', token='')
business_license_test_config = RequestConfig(
    url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
    token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
business_license_sb_config = RequestConfig(
    url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
    token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')

BUSINESS_CONFIGS = {
    'local': business_license_local_config,
    'test': business_license_test_config,
    'sb': business_license_sb_config
}

OCR_CONFIGS = {
    'cet': CET_CONFIGS,
    'regbook': REGBOOK_CONFIGS,
    'business_license': BUSINESS_CONFIGS
}

# 字段
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']

Filed = {
    'cet': cet_field,
    'regbook': regbook_field
}