8 lines
275 B
Python
8 lines
275 B
Python
![]() |
from .json_parser import JsonParser
|
||
|
|
||
|
class ParserFactory:
|
||
|
def get_parser(self, protocol_type: str):
|
||
|
if protocol_type == "json":
|
||
|
return JsonParser()
|
||
|
# 可扩展更多协议
|
||
|
raise ValueError(f"不支持的协议类型: {protocol_type}")
|