示例#1
0
 def get() -> Union[Tuple[Resource, int], Response]:
     parser = entity_.parse_args()
     type_tree = {'typeTree': GetTypeTree.get_type_tree()}
     if parser['count']:
         return jsonify(len(type_tree['type_tree']))
     template = TypeTreeTemplate.type_tree_template()
     if parser['download']:
         return download(type_tree, template, 'type_tree')
     return marshal(type_tree, template), 200
示例#2
0
 def get(id_: int) -> Union[tuple[Resource, int], Response, dict[str, Any]]:
     entities = GetTypeEntitiesAll.get_node_all(id_)
     if not entities:
         entities = get_entities_by_ids(
             GetTypeEntitiesAll.get_special_node(id_, []))
     return resolve_entities(entities, entity_.parse_args(), id_)
示例#3
0
 def get(code: str) -> \
         Union[tuple[Resource, int], Response, dict[str, Any]]:
     parsed = entity_.parse_args()
     return resolve_entities(GetByCode.get_by_view(code, parsed), parsed,
                             code)
示例#4
0
 def get(class_code: str) \
         -> Union[tuple[Resource, int], Response, dict[str, Any]]:
     return resolve_entities(
         GetByClass.get_by_class(class_code, entity_.parse_args()),
         entity_.parse_args(),
         class_code)
示例#5
0
 def get(id_: int) -> Union[Tuple[Resource, int], Response, Dict[str, Any]]:
     return GetEntity.resolve_entity(get_entity_by_id(id_),
                                     entity_.parse_args())
示例#6
0
 def get(code: str
         ) -> Union[Tuple[Resource, int], Response, Dict[str, Any]]:
     p = entity_.parse_args()
     return resolve_entities(GetByCode.get_by_view(code, p), p, code)
示例#7
0
 def get(id_: int) -> Union[Tuple[Resource, int], Response, Dict[str, Any]]:
     return resolve_entities(
         GetLinkedEntities.get_linked_entities(id_),
         entity_.parse_args(),
         'linkedEntities')
示例#8
0
 def get(id_: int) -> Union[Tuple[Resource, int], Response, Dict[str, Any]]:
     entities = [entity for entity in GetTypeEntities.get_node(id_)]
     if not entities:
         entities = GetTypeEntities.get_special_nodes(id_)
     return resolve_entities(entities, entity_.parse_args(), id_)
示例#9
0
 def get(latest: int) -> \
         Union[tuple[Resource, int], Response, dict[str, Any]]:
     return resolve_entities(GetLatest.get_latest(latest),
                             entity_.parse_args(), latest)
示例#10
0
 def get(system_class: str) \
         -> Union[Tuple[Resource, int], Response, Dict[str, Any]]:
     return resolve_entities(
         GetBySystemClass.get_by_system(system_class, entity_.parse_args()),
         entity_.parse_args(), system_class)