(type: any)
| 93 | } |
| 94 | |
| 95 | export const buildTranslateService = (type: any): {} => { |
| 96 | const info: { |
| 97 | name: string |
| 98 | // 是否需要秘钥 |
| 99 | isKey: boolean |
| 100 | // 是否单秘钥 |
| 101 | isOneAppKey: boolean |
| 102 | // 构建时默认信息 |
| 103 | defaultInfo: object |
| 104 | // 翻译语言 |
| 105 | languageList: [] |
| 106 | } = TranslateServiceBuilder.getServiceConfigInfo(type) |
| 107 | if (isNull(info.defaultInfo)) { |
| 108 | info.defaultInfo = {} |
| 109 | } |
| 110 | if (info?.isKey) { |
| 111 | return ServiceConfig.buildKeyService({ |
| 112 | type: type, |
| 113 | ...info.defaultInfo |
| 114 | }) |
| 115 | } else { |
| 116 | return ServiceConfig.buildIsBuiltInService({ |
| 117 | type: type, |
| 118 | ...info.defaultInfo |
| 119 | }) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | export class TranslateServiceBuilder { |
| 124 | /** |
nothing calls this directly
no test coverage detected