1.2.2原版
This commit is contained in:
+510
@@ -0,0 +1,510 @@
|
|||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
max_line_length = 120
|
||||||
|
tab_width = 4
|
||||||
|
ij_continuation_indent_size = 8
|
||||||
|
ij_formatter_off_tag = @formatter:off
|
||||||
|
ij_formatter_on_tag = @formatter:on
|
||||||
|
ij_formatter_tags_enabled = false
|
||||||
|
ij_smart_tabs = false
|
||||||
|
ij_wrap_on_typing = false
|
||||||
|
|
||||||
|
[*.java]
|
||||||
|
max_line_length = 100
|
||||||
|
ij_continuation_indent_size = 4
|
||||||
|
ij_java_align_consecutive_assignments = false
|
||||||
|
ij_java_align_consecutive_variable_declarations = false
|
||||||
|
ij_java_align_group_field_declarations = false
|
||||||
|
ij_java_align_multiline_annotation_parameters = false
|
||||||
|
ij_java_align_multiline_array_initializer_expression = false
|
||||||
|
ij_java_align_multiline_assignment = false
|
||||||
|
ij_java_align_multiline_binary_operation = false
|
||||||
|
ij_java_align_multiline_chained_methods = false
|
||||||
|
ij_java_align_multiline_extends_list = false
|
||||||
|
ij_java_align_multiline_for = true
|
||||||
|
ij_java_align_multiline_method_parentheses = false
|
||||||
|
ij_java_align_multiline_parameters = false
|
||||||
|
ij_java_align_multiline_parameters_in_calls = false
|
||||||
|
ij_java_align_multiline_parenthesized_expression = false
|
||||||
|
ij_java_align_multiline_records = true
|
||||||
|
ij_java_align_multiline_resources = true
|
||||||
|
ij_java_align_multiline_ternary_operation = false
|
||||||
|
ij_java_align_multiline_text_blocks = false
|
||||||
|
ij_java_align_multiline_throws_list = false
|
||||||
|
ij_java_align_subsequent_simple_methods = false
|
||||||
|
ij_java_align_throws_keyword = false
|
||||||
|
ij_java_annotation_parameter_wrap = off
|
||||||
|
ij_java_array_initializer_new_line_after_left_brace = false
|
||||||
|
ij_java_array_initializer_right_brace_on_new_line = false
|
||||||
|
ij_java_array_initializer_wrap = normal
|
||||||
|
ij_java_assert_statement_colon_on_next_line = false
|
||||||
|
ij_java_assert_statement_wrap = normal
|
||||||
|
ij_java_assignment_wrap = normal
|
||||||
|
ij_java_binary_operation_sign_on_next_line = true
|
||||||
|
ij_java_binary_operation_wrap = normal
|
||||||
|
ij_java_blank_lines_after_anonymous_class_header = 0
|
||||||
|
ij_java_blank_lines_after_class_header = 0
|
||||||
|
ij_java_blank_lines_after_imports = 1
|
||||||
|
ij_java_blank_lines_after_package = 1
|
||||||
|
ij_java_blank_lines_around_class = 1
|
||||||
|
ij_java_blank_lines_around_field = 0
|
||||||
|
ij_java_blank_lines_around_field_in_interface = 0
|
||||||
|
ij_java_blank_lines_around_initializer = 1
|
||||||
|
ij_java_blank_lines_around_method = 1
|
||||||
|
ij_java_blank_lines_around_method_in_interface = 1
|
||||||
|
ij_java_blank_lines_before_class_end = 0
|
||||||
|
ij_java_blank_lines_before_imports = 0
|
||||||
|
ij_java_blank_lines_before_method_body = 0
|
||||||
|
ij_java_blank_lines_before_package = 1
|
||||||
|
ij_java_block_brace_style = end_of_line
|
||||||
|
ij_java_block_comment_at_first_column = false
|
||||||
|
ij_java_call_parameters_new_line_after_left_paren = false
|
||||||
|
ij_java_call_parameters_right_paren_on_new_line = false
|
||||||
|
ij_java_call_parameters_wrap = normal
|
||||||
|
ij_java_case_statement_on_separate_line = true
|
||||||
|
ij_java_catch_on_new_line = false
|
||||||
|
ij_java_class_annotation_wrap = split_into_lines
|
||||||
|
ij_java_class_brace_style = end_of_line
|
||||||
|
ij_java_class_count_to_use_import_on_demand = 999
|
||||||
|
ij_java_class_names_in_javadoc = 1
|
||||||
|
ij_java_do_not_indent_top_level_class_members = false
|
||||||
|
ij_java_do_not_wrap_after_single_annotation = false
|
||||||
|
ij_java_do_while_brace_force = always
|
||||||
|
ij_java_doc_add_blank_line_after_description = true
|
||||||
|
ij_java_doc_add_blank_line_after_param_comments = false
|
||||||
|
ij_java_doc_add_blank_line_after_return = false
|
||||||
|
ij_java_doc_add_p_tag_on_empty_lines = true
|
||||||
|
ij_java_doc_align_exception_comments = true
|
||||||
|
ij_java_doc_align_param_comments = false
|
||||||
|
ij_java_doc_do_not_wrap_if_one_line = false
|
||||||
|
ij_java_doc_enable_formatting = true
|
||||||
|
ij_java_doc_enable_leading_asterisks = true
|
||||||
|
ij_java_doc_indent_on_continuation = false
|
||||||
|
ij_java_doc_keep_empty_lines = true
|
||||||
|
ij_java_doc_keep_empty_parameter_tag = true
|
||||||
|
ij_java_doc_keep_empty_return_tag = true
|
||||||
|
ij_java_doc_keep_empty_throws_tag = true
|
||||||
|
ij_java_doc_keep_invalid_tags = true
|
||||||
|
ij_java_doc_param_description_on_new_line = false
|
||||||
|
ij_java_doc_preserve_line_breaks = false
|
||||||
|
ij_java_doc_use_throws_not_exception_tag = true
|
||||||
|
ij_java_else_on_new_line = false
|
||||||
|
ij_java_enum_constants_wrap = normal
|
||||||
|
ij_java_extends_keyword_wrap = normal
|
||||||
|
ij_java_extends_list_wrap = normal
|
||||||
|
ij_java_field_annotation_wrap = split_into_lines
|
||||||
|
ij_java_finally_on_new_line = false
|
||||||
|
ij_java_for_brace_force = always
|
||||||
|
ij_java_for_statement_new_line_after_left_paren = false
|
||||||
|
ij_java_for_statement_right_paren_on_new_line = false
|
||||||
|
ij_java_for_statement_wrap = normal
|
||||||
|
ij_java_generate_final_locals = false
|
||||||
|
ij_java_generate_final_parameters = false
|
||||||
|
ij_java_if_brace_force = always
|
||||||
|
ij_java_imports_layout = $*, |, *, |, *
|
||||||
|
ij_java_indent_case_from_switch = true
|
||||||
|
ij_java_insert_inner_class_imports = false
|
||||||
|
ij_java_insert_override_annotation = true
|
||||||
|
ij_java_keep_blank_lines_before_right_brace = 2
|
||||||
|
ij_java_keep_blank_lines_between_package_declaration_and_header = 2
|
||||||
|
ij_java_keep_blank_lines_in_code = 2
|
||||||
|
ij_java_keep_blank_lines_in_declarations = 2
|
||||||
|
ij_java_keep_control_statement_in_one_line = true
|
||||||
|
ij_java_keep_first_column_comment = true
|
||||||
|
ij_java_keep_indents_on_empty_lines = false
|
||||||
|
ij_java_keep_line_breaks = true
|
||||||
|
ij_java_keep_multiple_expressions_in_one_line = false
|
||||||
|
ij_java_keep_simple_blocks_in_one_line = false
|
||||||
|
ij_java_keep_simple_classes_in_one_line = false
|
||||||
|
ij_java_keep_simple_lambdas_in_one_line = false
|
||||||
|
ij_java_keep_simple_methods_in_one_line = false
|
||||||
|
ij_java_label_indent_absolute = false
|
||||||
|
ij_java_label_indent_size = 0
|
||||||
|
ij_java_lambda_brace_style = end_of_line
|
||||||
|
ij_java_layout_static_imports_separately = true
|
||||||
|
ij_java_line_comment_add_space = true
|
||||||
|
ij_java_line_comment_at_first_column = false
|
||||||
|
ij_java_method_annotation_wrap = split_into_lines
|
||||||
|
ij_java_method_brace_style = end_of_line
|
||||||
|
ij_java_method_call_chain_wrap = normal
|
||||||
|
ij_java_method_parameters_new_line_after_left_paren = false
|
||||||
|
ij_java_method_parameters_right_paren_on_new_line = false
|
||||||
|
ij_java_method_parameters_wrap = normal
|
||||||
|
ij_java_modifier_list_wrap = false
|
||||||
|
ij_java_names_count_to_use_import_on_demand = 999
|
||||||
|
ij_java_new_line_after_lparen_in_record_header = false
|
||||||
|
ij_java_parameter_annotation_wrap = normal
|
||||||
|
ij_java_parentheses_expression_new_line_after_left_paren = false
|
||||||
|
ij_java_parentheses_expression_right_paren_on_new_line = false
|
||||||
|
ij_java_place_assignment_sign_on_next_line = false
|
||||||
|
ij_java_prefer_longer_names = true
|
||||||
|
ij_java_prefer_parameters_wrap = false
|
||||||
|
ij_java_record_components_wrap = normal
|
||||||
|
ij_java_repeat_synchronized = true
|
||||||
|
ij_java_replace_instanceof_and_cast = false
|
||||||
|
ij_java_replace_null_check = true
|
||||||
|
ij_java_replace_sum_lambda_with_method_ref = true
|
||||||
|
ij_java_resource_list_new_line_after_left_paren = false
|
||||||
|
ij_java_resource_list_right_paren_on_new_line = false
|
||||||
|
ij_java_resource_list_wrap = normal
|
||||||
|
ij_java_rparen_on_new_line_in_record_header = false
|
||||||
|
ij_java_space_after_closing_angle_bracket_in_type_argument = false
|
||||||
|
ij_java_space_after_colon = true
|
||||||
|
ij_java_space_after_comma = true
|
||||||
|
ij_java_space_after_comma_in_type_arguments = true
|
||||||
|
ij_java_space_after_for_semicolon = true
|
||||||
|
ij_java_space_after_quest = true
|
||||||
|
ij_java_space_after_type_cast = true
|
||||||
|
ij_java_space_before_annotation_array_initializer_left_brace = false
|
||||||
|
ij_java_space_before_annotation_parameter_list = false
|
||||||
|
ij_java_space_before_array_initializer_left_brace = true
|
||||||
|
ij_java_space_before_catch_keyword = true
|
||||||
|
ij_java_space_before_catch_left_brace = true
|
||||||
|
ij_java_space_before_catch_parentheses = true
|
||||||
|
ij_java_space_before_class_left_brace = true
|
||||||
|
ij_java_space_before_colon = true
|
||||||
|
ij_java_space_before_colon_in_foreach = true
|
||||||
|
ij_java_space_before_comma = false
|
||||||
|
ij_java_space_before_do_left_brace = true
|
||||||
|
ij_java_space_before_else_keyword = true
|
||||||
|
ij_java_space_before_else_left_brace = true
|
||||||
|
ij_java_space_before_finally_keyword = true
|
||||||
|
ij_java_space_before_finally_left_brace = true
|
||||||
|
ij_java_space_before_for_left_brace = true
|
||||||
|
ij_java_space_before_for_parentheses = true
|
||||||
|
ij_java_space_before_for_semicolon = false
|
||||||
|
ij_java_space_before_if_left_brace = true
|
||||||
|
ij_java_space_before_if_parentheses = true
|
||||||
|
ij_java_space_before_method_call_parentheses = false
|
||||||
|
ij_java_space_before_method_left_brace = true
|
||||||
|
ij_java_space_before_method_parentheses = false
|
||||||
|
ij_java_space_before_opening_angle_bracket_in_type_parameter = false
|
||||||
|
ij_java_space_before_quest = true
|
||||||
|
ij_java_space_before_switch_left_brace = true
|
||||||
|
ij_java_space_before_switch_parentheses = true
|
||||||
|
ij_java_space_before_synchronized_left_brace = true
|
||||||
|
ij_java_space_before_synchronized_parentheses = true
|
||||||
|
ij_java_space_before_try_left_brace = true
|
||||||
|
ij_java_space_before_try_parentheses = true
|
||||||
|
ij_java_space_before_type_parameter_list = false
|
||||||
|
ij_java_space_before_while_keyword = true
|
||||||
|
ij_java_space_before_while_left_brace = true
|
||||||
|
ij_java_space_before_while_parentheses = true
|
||||||
|
ij_java_space_inside_one_line_enum_braces = false
|
||||||
|
ij_java_space_within_empty_array_initializer_braces = false
|
||||||
|
ij_java_space_within_empty_method_call_parentheses = false
|
||||||
|
ij_java_space_within_empty_method_parentheses = false
|
||||||
|
ij_java_spaces_around_additive_operators = true
|
||||||
|
ij_java_spaces_around_assignment_operators = true
|
||||||
|
ij_java_spaces_around_bitwise_operators = true
|
||||||
|
ij_java_spaces_around_equality_operators = true
|
||||||
|
ij_java_spaces_around_lambda_arrow = true
|
||||||
|
ij_java_spaces_around_logical_operators = true
|
||||||
|
ij_java_spaces_around_method_ref_dbl_colon = false
|
||||||
|
ij_java_spaces_around_multiplicative_operators = true
|
||||||
|
ij_java_spaces_around_relational_operators = true
|
||||||
|
ij_java_spaces_around_shift_operators = true
|
||||||
|
ij_java_spaces_around_type_bounds_in_type_parameters = true
|
||||||
|
ij_java_spaces_around_unary_operator = false
|
||||||
|
ij_java_spaces_within_angle_brackets = false
|
||||||
|
ij_java_spaces_within_annotation_parentheses = false
|
||||||
|
ij_java_spaces_within_array_initializer_braces = false
|
||||||
|
ij_java_spaces_within_braces = false
|
||||||
|
ij_java_spaces_within_brackets = false
|
||||||
|
ij_java_spaces_within_cast_parentheses = false
|
||||||
|
ij_java_spaces_within_catch_parentheses = false
|
||||||
|
ij_java_spaces_within_for_parentheses = false
|
||||||
|
ij_java_spaces_within_if_parentheses = false
|
||||||
|
ij_java_spaces_within_method_call_parentheses = false
|
||||||
|
ij_java_spaces_within_method_parentheses = false
|
||||||
|
ij_java_spaces_within_parentheses = false
|
||||||
|
ij_java_spaces_within_switch_parentheses = false
|
||||||
|
ij_java_spaces_within_synchronized_parentheses = false
|
||||||
|
ij_java_spaces_within_try_parentheses = false
|
||||||
|
ij_java_spaces_within_while_parentheses = false
|
||||||
|
ij_java_special_else_if_treatment = true
|
||||||
|
ij_java_subclass_name_suffix = Impl
|
||||||
|
ij_java_ternary_operation_signs_on_next_line = true
|
||||||
|
ij_java_ternary_operation_wrap = normal
|
||||||
|
ij_java_test_name_suffix = Test
|
||||||
|
ij_java_throws_keyword_wrap = normal
|
||||||
|
ij_java_throws_list_wrap = normal
|
||||||
|
ij_java_use_external_annotations = false
|
||||||
|
ij_java_use_fq_class_names = false
|
||||||
|
ij_java_use_relative_indents = false
|
||||||
|
ij_java_use_single_class_imports = true
|
||||||
|
ij_java_variable_annotation_wrap = normal
|
||||||
|
ij_java_visibility = public
|
||||||
|
ij_java_while_brace_force = always
|
||||||
|
ij_java_while_on_new_line = false
|
||||||
|
ij_java_wrap_comments = false
|
||||||
|
ij_java_wrap_first_method_in_call_chain = false
|
||||||
|
ij_java_wrap_long_lines = true
|
||||||
|
|
||||||
|
[*.properties]
|
||||||
|
ij_properties_align_group_field_declarations = false
|
||||||
|
ij_properties_keep_blank_lines = false
|
||||||
|
ij_properties_key_value_delimiter = equals
|
||||||
|
ij_properties_spaces_around_key_value_delimiter = false
|
||||||
|
|
||||||
|
[.editorconfig]
|
||||||
|
ij_editorconfig_align_group_field_declarations = false
|
||||||
|
ij_editorconfig_space_after_colon = false
|
||||||
|
ij_editorconfig_space_after_comma = true
|
||||||
|
ij_editorconfig_space_before_colon = false
|
||||||
|
ij_editorconfig_space_before_comma = false
|
||||||
|
ij_editorconfig_spaces_around_assignment_operators = true
|
||||||
|
|
||||||
|
[{*.ant, *.fxml, *.jhm, *.jnlp, *.jrxml, *.jspx, *.pom, *.rng, *.tagx, *.tld, *.wsdl, *.xml, *.xsd, *.xsl, *.xslt, *.xul}]
|
||||||
|
ij_xml_align_attributes = true
|
||||||
|
ij_xml_align_text = false
|
||||||
|
ij_xml_attribute_wrap = normal
|
||||||
|
ij_xml_block_comment_at_first_column = true
|
||||||
|
ij_xml_keep_blank_lines = 2
|
||||||
|
ij_xml_keep_indents_on_empty_lines = false
|
||||||
|
ij_xml_keep_line_breaks = true
|
||||||
|
ij_xml_keep_line_breaks_in_text = true
|
||||||
|
ij_xml_keep_whitespaces = false
|
||||||
|
ij_xml_keep_whitespaces_around_cdata = preserve
|
||||||
|
ij_xml_keep_whitespaces_inside_cdata = false
|
||||||
|
ij_xml_line_comment_at_first_column = true
|
||||||
|
ij_xml_space_after_tag_name = false
|
||||||
|
ij_xml_space_around_equals_in_attribute = false
|
||||||
|
ij_xml_space_inside_empty_tag = false
|
||||||
|
ij_xml_text_wrap = normal
|
||||||
|
|
||||||
|
[{*.bash, *.sh, *.zsh}]
|
||||||
|
indent_size = 2
|
||||||
|
tab_width = 2
|
||||||
|
ij_shell_binary_ops_start_line = false
|
||||||
|
ij_shell_keep_column_alignment_padding = false
|
||||||
|
ij_shell_minify_program = false
|
||||||
|
ij_shell_redirect_followed_by_space = false
|
||||||
|
ij_shell_switch_cases_indented = false
|
||||||
|
|
||||||
|
[{*.gant, *.gradle, *.groovy, *.gy}]
|
||||||
|
ij_groovy_align_group_field_declarations = false
|
||||||
|
ij_groovy_align_multiline_array_initializer_expression = false
|
||||||
|
ij_groovy_align_multiline_assignment = false
|
||||||
|
ij_groovy_align_multiline_binary_operation = false
|
||||||
|
ij_groovy_align_multiline_chained_methods = false
|
||||||
|
ij_groovy_align_multiline_extends_list = false
|
||||||
|
ij_groovy_align_multiline_for = true
|
||||||
|
ij_groovy_align_multiline_list_or_map = true
|
||||||
|
ij_groovy_align_multiline_method_parentheses = false
|
||||||
|
ij_groovy_align_multiline_parameters = true
|
||||||
|
ij_groovy_align_multiline_parameters_in_calls = false
|
||||||
|
ij_groovy_align_multiline_resources = true
|
||||||
|
ij_groovy_align_multiline_ternary_operation = false
|
||||||
|
ij_groovy_align_multiline_throws_list = false
|
||||||
|
ij_groovy_align_named_args_in_map = true
|
||||||
|
ij_groovy_align_throws_keyword = false
|
||||||
|
ij_groovy_array_initializer_new_line_after_left_brace = false
|
||||||
|
ij_groovy_array_initializer_right_brace_on_new_line = false
|
||||||
|
ij_groovy_array_initializer_wrap = off
|
||||||
|
ij_groovy_assert_statement_wrap = off
|
||||||
|
ij_groovy_assignment_wrap = off
|
||||||
|
ij_groovy_binary_operation_wrap = off
|
||||||
|
ij_groovy_blank_lines_after_class_header = 0
|
||||||
|
ij_groovy_blank_lines_after_imports = 1
|
||||||
|
ij_groovy_blank_lines_after_package = 1
|
||||||
|
ij_groovy_blank_lines_around_class = 1
|
||||||
|
ij_groovy_blank_lines_around_field = 0
|
||||||
|
ij_groovy_blank_lines_around_field_in_interface = 0
|
||||||
|
ij_groovy_blank_lines_around_method = 1
|
||||||
|
ij_groovy_blank_lines_around_method_in_interface = 1
|
||||||
|
ij_groovy_blank_lines_before_imports = 1
|
||||||
|
ij_groovy_blank_lines_before_method_body = 0
|
||||||
|
ij_groovy_blank_lines_before_package = 0
|
||||||
|
ij_groovy_block_brace_style = end_of_line
|
||||||
|
ij_groovy_block_comment_at_first_column = true
|
||||||
|
ij_groovy_call_parameters_new_line_after_left_paren = false
|
||||||
|
ij_groovy_call_parameters_right_paren_on_new_line = false
|
||||||
|
ij_groovy_call_parameters_wrap = off
|
||||||
|
ij_groovy_catch_on_new_line = false
|
||||||
|
ij_groovy_class_annotation_wrap = split_into_lines
|
||||||
|
ij_groovy_class_brace_style = end_of_line
|
||||||
|
ij_groovy_class_count_to_use_import_on_demand = 5
|
||||||
|
ij_groovy_do_while_brace_force = never
|
||||||
|
ij_groovy_else_on_new_line = false
|
||||||
|
ij_groovy_enum_constants_wrap = off
|
||||||
|
ij_groovy_extends_keyword_wrap = off
|
||||||
|
ij_groovy_extends_list_wrap = off
|
||||||
|
ij_groovy_field_annotation_wrap = split_into_lines
|
||||||
|
ij_groovy_finally_on_new_line = false
|
||||||
|
ij_groovy_for_brace_force = never
|
||||||
|
ij_groovy_for_statement_new_line_after_left_paren = false
|
||||||
|
ij_groovy_for_statement_right_paren_on_new_line = false
|
||||||
|
ij_groovy_for_statement_wrap = off
|
||||||
|
ij_groovy_if_brace_force = never
|
||||||
|
ij_groovy_import_annotation_wrap = 2
|
||||||
|
ij_groovy_indent_case_from_switch = true
|
||||||
|
ij_groovy_indent_label_blocks = true
|
||||||
|
ij_groovy_insert_inner_class_imports = false
|
||||||
|
ij_groovy_keep_blank_lines_before_right_brace = 2
|
||||||
|
ij_groovy_keep_blank_lines_in_code = 2
|
||||||
|
ij_groovy_keep_blank_lines_in_declarations = 2
|
||||||
|
ij_groovy_keep_control_statement_in_one_line = true
|
||||||
|
ij_groovy_keep_first_column_comment = true
|
||||||
|
ij_groovy_keep_indents_on_empty_lines = false
|
||||||
|
ij_groovy_keep_line_breaks = true
|
||||||
|
ij_groovy_keep_multiple_expressions_in_one_line = false
|
||||||
|
ij_groovy_keep_simple_blocks_in_one_line = false
|
||||||
|
ij_groovy_keep_simple_classes_in_one_line = true
|
||||||
|
ij_groovy_keep_simple_lambdas_in_one_line = true
|
||||||
|
ij_groovy_keep_simple_methods_in_one_line = true
|
||||||
|
ij_groovy_label_indent_absolute = false
|
||||||
|
ij_groovy_label_indent_size = 0
|
||||||
|
ij_groovy_lambda_brace_style = end_of_line
|
||||||
|
ij_groovy_layout_static_imports_separately = true
|
||||||
|
ij_groovy_line_comment_add_space = false
|
||||||
|
ij_groovy_line_comment_at_first_column = true
|
||||||
|
ij_groovy_method_annotation_wrap = split_into_lines
|
||||||
|
ij_groovy_method_brace_style = end_of_line
|
||||||
|
ij_groovy_method_call_chain_wrap = off
|
||||||
|
ij_groovy_method_parameters_new_line_after_left_paren = false
|
||||||
|
ij_groovy_method_parameters_right_paren_on_new_line = false
|
||||||
|
ij_groovy_method_parameters_wrap = off
|
||||||
|
ij_groovy_modifier_list_wrap = false
|
||||||
|
ij_groovy_names_count_to_use_import_on_demand = 3
|
||||||
|
ij_groovy_parameter_annotation_wrap = off
|
||||||
|
ij_groovy_parentheses_expression_new_line_after_left_paren = false
|
||||||
|
ij_groovy_parentheses_expression_right_paren_on_new_line = false
|
||||||
|
ij_groovy_prefer_parameters_wrap = false
|
||||||
|
ij_groovy_resource_list_new_line_after_left_paren = false
|
||||||
|
ij_groovy_resource_list_right_paren_on_new_line = false
|
||||||
|
ij_groovy_resource_list_wrap = off
|
||||||
|
ij_groovy_space_after_assert_separator = true
|
||||||
|
ij_groovy_space_after_colon = true
|
||||||
|
ij_groovy_space_after_comma = true
|
||||||
|
ij_groovy_space_after_comma_in_type_arguments = true
|
||||||
|
ij_groovy_space_after_for_semicolon = true
|
||||||
|
ij_groovy_space_after_quest = true
|
||||||
|
ij_groovy_space_after_type_cast = true
|
||||||
|
ij_groovy_space_before_annotation_parameter_list = false
|
||||||
|
ij_groovy_space_before_array_initializer_left_brace = false
|
||||||
|
ij_groovy_space_before_assert_separator = false
|
||||||
|
ij_groovy_space_before_catch_keyword = true
|
||||||
|
ij_groovy_space_before_catch_left_brace = true
|
||||||
|
ij_groovy_space_before_catch_parentheses = true
|
||||||
|
ij_groovy_space_before_class_left_brace = true
|
||||||
|
ij_groovy_space_before_closure_left_brace = true
|
||||||
|
ij_groovy_space_before_colon = true
|
||||||
|
ij_groovy_space_before_comma = false
|
||||||
|
ij_groovy_space_before_do_left_brace = true
|
||||||
|
ij_groovy_space_before_else_keyword = true
|
||||||
|
ij_groovy_space_before_else_left_brace = true
|
||||||
|
ij_groovy_space_before_finally_keyword = true
|
||||||
|
ij_groovy_space_before_finally_left_brace = true
|
||||||
|
ij_groovy_space_before_for_left_brace = true
|
||||||
|
ij_groovy_space_before_for_parentheses = true
|
||||||
|
ij_groovy_space_before_for_semicolon = false
|
||||||
|
ij_groovy_space_before_if_left_brace = true
|
||||||
|
ij_groovy_space_before_if_parentheses = true
|
||||||
|
ij_groovy_space_before_method_call_parentheses = false
|
||||||
|
ij_groovy_space_before_method_left_brace = true
|
||||||
|
ij_groovy_space_before_method_parentheses = false
|
||||||
|
ij_groovy_space_before_quest = true
|
||||||
|
ij_groovy_space_before_switch_left_brace = true
|
||||||
|
ij_groovy_space_before_switch_parentheses = true
|
||||||
|
ij_groovy_space_before_synchronized_left_brace = true
|
||||||
|
ij_groovy_space_before_synchronized_parentheses = true
|
||||||
|
ij_groovy_space_before_try_left_brace = true
|
||||||
|
ij_groovy_space_before_try_parentheses = true
|
||||||
|
ij_groovy_space_before_while_keyword = true
|
||||||
|
ij_groovy_space_before_while_left_brace = true
|
||||||
|
ij_groovy_space_before_while_parentheses = true
|
||||||
|
ij_groovy_space_in_named_argument = true
|
||||||
|
ij_groovy_space_in_named_argument_before_colon = false
|
||||||
|
ij_groovy_space_within_empty_array_initializer_braces = false
|
||||||
|
ij_groovy_space_within_empty_method_call_parentheses = false
|
||||||
|
ij_groovy_spaces_around_additive_operators = true
|
||||||
|
ij_groovy_spaces_around_assignment_operators = true
|
||||||
|
ij_groovy_spaces_around_bitwise_operators = true
|
||||||
|
ij_groovy_spaces_around_equality_operators = true
|
||||||
|
ij_groovy_spaces_around_lambda_arrow = true
|
||||||
|
ij_groovy_spaces_around_logical_operators = true
|
||||||
|
ij_groovy_spaces_around_multiplicative_operators = true
|
||||||
|
ij_groovy_spaces_around_regex_operators = true
|
||||||
|
ij_groovy_spaces_around_relational_operators = true
|
||||||
|
ij_groovy_spaces_around_shift_operators = true
|
||||||
|
ij_groovy_spaces_within_annotation_parentheses = false
|
||||||
|
ij_groovy_spaces_within_array_initializer_braces = false
|
||||||
|
ij_groovy_spaces_within_braces = true
|
||||||
|
ij_groovy_spaces_within_brackets = false
|
||||||
|
ij_groovy_spaces_within_cast_parentheses = false
|
||||||
|
ij_groovy_spaces_within_catch_parentheses = false
|
||||||
|
ij_groovy_spaces_within_for_parentheses = false
|
||||||
|
ij_groovy_spaces_within_gstring_injection_braces = false
|
||||||
|
ij_groovy_spaces_within_if_parentheses = false
|
||||||
|
ij_groovy_spaces_within_list_or_map = false
|
||||||
|
ij_groovy_spaces_within_method_call_parentheses = false
|
||||||
|
ij_groovy_spaces_within_method_parentheses = false
|
||||||
|
ij_groovy_spaces_within_parentheses = false
|
||||||
|
ij_groovy_spaces_within_switch_parentheses = false
|
||||||
|
ij_groovy_spaces_within_synchronized_parentheses = false
|
||||||
|
ij_groovy_spaces_within_try_parentheses = false
|
||||||
|
ij_groovy_spaces_within_tuple_expression = false
|
||||||
|
ij_groovy_spaces_within_while_parentheses = false
|
||||||
|
ij_groovy_special_else_if_treatment = true
|
||||||
|
ij_groovy_ternary_operation_wrap = off
|
||||||
|
ij_groovy_throws_keyword_wrap = off
|
||||||
|
ij_groovy_throws_list_wrap = off
|
||||||
|
ij_groovy_use_flying_geese_braces = false
|
||||||
|
ij_groovy_use_fq_class_names = false
|
||||||
|
ij_groovy_use_fq_class_names_in_javadoc = true
|
||||||
|
ij_groovy_use_relative_indents = false
|
||||||
|
ij_groovy_use_single_class_imports = true
|
||||||
|
ij_groovy_variable_annotation_wrap = off
|
||||||
|
ij_groovy_while_brace_force = never
|
||||||
|
ij_groovy_while_on_new_line = false
|
||||||
|
ij_groovy_wrap_long_lines = false
|
||||||
|
|
||||||
|
[{*.har, *.json}]
|
||||||
|
indent_size = 2
|
||||||
|
ij_json_keep_blank_lines_in_code = 0
|
||||||
|
ij_json_keep_indents_on_empty_lines = false
|
||||||
|
ij_json_keep_line_breaks = true
|
||||||
|
ij_json_space_after_colon = true
|
||||||
|
ij_json_space_after_comma = true
|
||||||
|
ij_json_space_before_colon = true
|
||||||
|
ij_json_space_before_comma = false
|
||||||
|
ij_json_spaces_within_braces = false
|
||||||
|
ij_json_spaces_within_brackets = false
|
||||||
|
ij_json_wrap_long_lines = false
|
||||||
|
|
||||||
|
[{*.htm, *.html, *.sht, *.shtm, *.shtml}]
|
||||||
|
ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3
|
||||||
|
ij_html_align_attributes = true
|
||||||
|
ij_html_align_text = false
|
||||||
|
ij_html_attribute_wrap = normal
|
||||||
|
ij_html_block_comment_at_first_column = true
|
||||||
|
ij_html_do_not_align_children_of_min_lines = 0
|
||||||
|
ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p
|
||||||
|
ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot
|
||||||
|
ij_html_enforce_quotes = false
|
||||||
|
ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var
|
||||||
|
ij_html_keep_blank_lines = 2
|
||||||
|
ij_html_keep_indents_on_empty_lines = false
|
||||||
|
ij_html_keep_line_breaks = true
|
||||||
|
ij_html_keep_line_breaks_in_text = true
|
||||||
|
ij_html_keep_whitespaces = false
|
||||||
|
ij_html_keep_whitespaces_inside = span, pre, textarea
|
||||||
|
ij_html_line_comment_at_first_column = true
|
||||||
|
ij_html_new_line_after_last_attribute = never
|
||||||
|
ij_html_new_line_before_first_attribute = never
|
||||||
|
ij_html_quote_style = double
|
||||||
|
ij_html_remove_new_line_before_tags = br
|
||||||
|
ij_html_space_after_tag_name = false
|
||||||
|
ij_html_space_around_equality_in_attribute = false
|
||||||
|
ij_html_space_inside_empty_tag = false
|
||||||
|
ij_html_text_wrap = normal
|
||||||
|
|
||||||
|
[{*.yaml, *.yml}]
|
||||||
|
indent_size = 2
|
||||||
|
ij_yaml_keep_indents_on_empty_lines = false
|
||||||
|
ij_yaml_keep_line_breaks = true
|
||||||
Executable
+75
@@ -0,0 +1,75 @@
|
|||||||
|
### Maven
|
||||||
|
target/
|
||||||
|
logs/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
### Gradle
|
||||||
|
.gradle
|
||||||
|
/build/
|
||||||
|
/out/
|
||||||
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
bin/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
log/
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
nbproject/private/
|
||||||
|
build/
|
||||||
|
nbbuild/
|
||||||
|
dist/
|
||||||
|
nbdist/
|
||||||
|
.nb-gradle/
|
||||||
|
|
||||||
|
### Mac
|
||||||
|
.DS_Store
|
||||||
|
*/.DS_Store
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
*.project
|
||||||
|
*.factorypath
|
||||||
|
|
||||||
|
### Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
### Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
### BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
### Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
### Package Files
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
### VSCode
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
### Local file
|
||||||
|
application-local.yml
|
||||||
|
application-local.yaml
|
||||||
|
application-local.properties
|
||||||
|
|
||||||
|
/ui/node_modules/
|
||||||
|
/workplace/
|
||||||
|
/src/main/resources/console/
|
||||||
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
reviewers:
|
||||||
|
- ruibaby
|
||||||
|
- guqing
|
||||||
|
- JohnNiang
|
||||||
|
- wangzhen-fit2cloud
|
||||||
|
|
||||||
|
approvers:
|
||||||
|
- ruibaby
|
||||||
|
- guqing
|
||||||
|
- JohnNiang
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# plugin-douban
|
||||||
|
|
||||||
|
* 豆瓣管理插件, 支持在 Console 进行管理以及为主题端提供 `/douban` 页面路由。
|
||||||
|
* 提供从豆瓣爬取到的数据
|
||||||
|
* 内置模板,无需主题支持,但也可以通过主题自定义模板。
|
||||||
|
|
||||||
|
## 致谢
|
||||||
|
该插件是从[WP-Douban](https://fatesinger.com/101005)插件进行重构的。对贡献者表示感谢。
|
||||||
|
|
||||||
|
## 使用方式
|
||||||
|
* 在应用市场下载并启用。
|
||||||
|
* 启用插件之后会在 Console 的左侧添加一个`豆瓣`的菜单项,点击即可进入`豆瓣`管理页面。
|
||||||
|
|
||||||
|
## 📃文档
|
||||||
|
https://docs.kunkunyu.com/docs/plugin-douban
|
||||||
|
|
||||||
|
## 开发环境
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone git@github.com:chengzhongxue/plugin-douban.git
|
||||||
|
|
||||||
|
# 或者当你 fork 之后
|
||||||
|
|
||||||
|
git clone git@github.com:{your_github_id}/plugin-douban.git
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd path/to/plugin-douban
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# macOS / Linux
|
||||||
|
./gradlew pnpmInstall
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
./gradlew.bat pnpmInstall
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# macOS / Linux
|
||||||
|
./gradlew haloServer
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
./gradlew.bat haloServer
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# macOS / Linux
|
||||||
|
./gradlew build
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
./gradlew.bat build
|
||||||
|
```
|
||||||
|
|
||||||
|
修改 Halo 配置文件:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
halo:
|
||||||
|
plugin:
|
||||||
|
runtime-mode: development
|
||||||
|
classes-directories:
|
||||||
|
- "build/classes"
|
||||||
|
- "build/resources"
|
||||||
|
lib-directories:
|
||||||
|
- "libs"
|
||||||
|
fixedPluginPath:
|
||||||
|
- "/path/to/plugin-douban"
|
||||||
|
```
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,75 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
id "com.github.node-gradle.node" version "7.0.2"
|
||||||
|
id "io.freefair.lombok" version "8.0.1"
|
||||||
|
id "run.halo.plugin.devtools" version "0.1.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
group 'run.halo.starter'
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'https://s01.oss.sonatype.org/content/repositories/releases' }
|
||||||
|
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
|
||||||
|
maven { url 'https://repo.spring.io/milestone' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation platform('run.halo.tools.platform:plugin:2.20.0-SNAPSHOT')
|
||||||
|
compileOnly 'run.halo.app:api'
|
||||||
|
|
||||||
|
testImplementation 'run.halo.app:api'
|
||||||
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
node {
|
||||||
|
nodeProjectDir = file("${project.projectDir}/ui")
|
||||||
|
}
|
||||||
|
|
||||||
|
task buildFrontend(type: PnpmTask) {
|
||||||
|
args = ['build']
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
// build frontend before build
|
||||||
|
tasks.getByName('compileJava').dependsOn('buildFrontend')
|
||||||
|
}
|
||||||
|
|
||||||
|
halo {
|
||||||
|
version = '2.20.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
haloPlugin {
|
||||||
|
openApi {
|
||||||
|
outputDir = file("$rootDir/api-docs/openapi/v3_0")
|
||||||
|
// 用于定义 API 分组规则
|
||||||
|
groupingRules {
|
||||||
|
// 此名称为 group name,定义后 groupedApiMappings 中的 /v3/api-docs/ 后的名称需要与之相同,要避免与 halo 中已经存在的 group 相同避免生成后出现与插件无关的 API
|
||||||
|
doubanApi {
|
||||||
|
// 分组显示名称
|
||||||
|
displayName = 'Extension API for Douban'
|
||||||
|
// 分组的 API 规则
|
||||||
|
pathsToMatch = ['/apis/douban.moony.la/v1alpha1/**',
|
||||||
|
'/apis/api.douban.moony.la/v1alpha1/**'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
groupedApiMappings = [
|
||||||
|
'/v3/api-docs/doubanApi': 'doubanApi.json'
|
||||||
|
]
|
||||||
|
generator {
|
||||||
|
// 默认配置可缺省
|
||||||
|
outputDir = file("${projectDir}/ui/src/api/generated")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
version=1.2.2
|
||||||
Vendored
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#Wed May 10 13:57:01 CST 2023
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright © 2015-2021 the original authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD=maximum
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "$( uname )" in #(
|
||||||
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
|
Darwin* ) darwin=true ;; #(
|
||||||
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
|
NONSTOP* ) nonstop=true ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
|
else
|
||||||
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD=java
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
|
# * args from the command line
|
||||||
|
# * the main class name
|
||||||
|
# * -classpath
|
||||||
|
# * -D...appname settings
|
||||||
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
Vendored
+89
@@ -0,0 +1,89 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rootProject.name = 'plugin-douban'
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.PropertyPlaceholderHelper;
|
||||||
|
import org.thymeleaf.context.ITemplateContext;
|
||||||
|
import org.thymeleaf.model.IModel;
|
||||||
|
import org.thymeleaf.model.IModelFactory;
|
||||||
|
import org.thymeleaf.processor.element.IElementModelStructureHandler;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.plugin.PluginContext;
|
||||||
|
import run.halo.app.theme.dialect.TemplateHeadProcessor;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class ContactDoubanWidget implements TemplateHeadProcessor {
|
||||||
|
private final PropertyPlaceholderHelper
|
||||||
|
PROPERTY_PLACEHOLDER_HELPER = new PropertyPlaceholderHelper("${", "}");
|
||||||
|
private final PluginContext pluginContext;
|
||||||
|
|
||||||
|
public Mono<Void> process(ITemplateContext context, IModel model, IElementModelStructureHandler structureHandler) {
|
||||||
|
return Mono.just(this.contactFormHtml()).doOnNext((html) -> {
|
||||||
|
IModelFactory modelFactory = context.getModelFactory();
|
||||||
|
model.add(modelFactory.createText(html));
|
||||||
|
}).then();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String contactFormHtml() {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
properties.setProperty("version", pluginContext.getVersion());
|
||||||
|
properties.setProperty("pluginStaticPath", "/plugins/plugin-douban/assets/static");
|
||||||
|
return this.PROPERTY_PLACEHOLDER_HELPER.replacePlaceholders(
|
||||||
|
"<link href=\"${pluginStaticPath}/style.css?version=${version}\" rel=\"stylesheet\"/>\n "
|
||||||
|
+ "<script src=\"${pluginStaticPath}/contact-douban.iife.js?version=${version}\"></script>\n ", properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContactDoubanWidget(PluginContext pluginContext) {
|
||||||
|
this.pluginContext = pluginContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import java.time.Clock;
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.time.DateTimeException;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.util.Objects;
|
||||||
|
import la.moony.douban.extension.CronDouban;
|
||||||
|
import la.moony.douban.service.DoubanService;
|
||||||
|
|
||||||
|
import org.springframework.boot.convert.ApplicationConversionService;
|
||||||
|
import org.springframework.scheduling.support.CronExpression;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import run.halo.app.extension.ExtensionClient;
|
||||||
|
import run.halo.app.extension.ExtensionUtil;
|
||||||
|
import run.halo.app.extension.controller.Controller;
|
||||||
|
import run.halo.app.extension.controller.ControllerBuilder;
|
||||||
|
import run.halo.app.extension.controller.Reconciler;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class CronDoubanReconciler implements Reconciler<Reconciler.Request>{
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(CronDoubanReconciler.class);
|
||||||
|
|
||||||
|
private final ExtensionClient client;
|
||||||
|
|
||||||
|
private final DoubanService doubanService;
|
||||||
|
private Clock clock;
|
||||||
|
|
||||||
|
|
||||||
|
public CronDoubanReconciler(ExtensionClient client, DoubanService doubanService) {
|
||||||
|
this.client = client;
|
||||||
|
this.doubanService = doubanService;
|
||||||
|
this.clock = Clock.systemDefaultZone();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void setClock(Clock clock) {
|
||||||
|
this.clock = clock;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Reconciler.Result reconcile(Reconciler.Request request) {
|
||||||
|
return (Reconciler.Result)this.client.fetch(CronDouban.class, request.name()).map((cronDouban) -> {
|
||||||
|
if (ExtensionUtil.isDeleted(cronDouban)) {
|
||||||
|
return Result.doNotRetry();
|
||||||
|
} else {
|
||||||
|
CronDouban.Spec spec = cronDouban.getSpec();
|
||||||
|
if (!spec.isSuspend()) {
|
||||||
|
return Result.doNotRetry();
|
||||||
|
}else {
|
||||||
|
String cron = spec.getCron();
|
||||||
|
String timezone = spec.getTimezone();
|
||||||
|
ZoneId zoneId = ZoneId.systemDefault();
|
||||||
|
if (timezone != null) {
|
||||||
|
try {
|
||||||
|
zoneId = (ZoneId) ApplicationConversionService.getSharedInstance().convert(timezone, ZoneId.class);
|
||||||
|
} catch (DateTimeException var18) {
|
||||||
|
log.error("Invalid zone ID {}", timezone, var18);
|
||||||
|
return Result.doNotRetry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Instant now = Instant.now(this.clock);
|
||||||
|
if (!CronExpression.isValidExpression(cron)) {
|
||||||
|
log.error("Cron expression {} is invalid.", cron);
|
||||||
|
return Result.doNotRetry();
|
||||||
|
} else {
|
||||||
|
CronExpression cronExp = CronExpression.parse(cron);
|
||||||
|
CronDouban.Status status = cronDouban.getStatus();
|
||||||
|
Instant lastScheduledTimestamp = status.getLastScheduledTimestamp();
|
||||||
|
if (lastScheduledTimestamp == null) {
|
||||||
|
lastScheduledTimestamp = cronDouban.getMetadata().getCreationTimestamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
ZonedDateTime nextFromNow = (ZonedDateTime)cronExp.next(now.atZone(zoneId));
|
||||||
|
ZonedDateTime nextFromLast = (ZonedDateTime)cronExp.next(lastScheduledTimestamp.atZone(zoneId));
|
||||||
|
|
||||||
|
if (nextFromNow != null && nextFromLast != null) {
|
||||||
|
if (Objects.equals(nextFromNow, nextFromLast)) {
|
||||||
|
log.info("Skip scheduling and next scheduled at {}", nextFromNow);
|
||||||
|
status.setNextSchedulingTimestamp(nextFromNow.toInstant());
|
||||||
|
this.client.update(cronDouban);
|
||||||
|
return new Reconciler.Result(true, Duration.between(now, nextFromNow));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.doubanService.synchronizationDouban();
|
||||||
|
|
||||||
|
ZonedDateTime zonedNow = now.atZone(zoneId);
|
||||||
|
ZonedDateTime scheduleTimestamp = now.atZone(zoneId);
|
||||||
|
|
||||||
|
ZonedDateTime next;
|
||||||
|
for(next = lastScheduledTimestamp.atZone(zoneId); next != null && next.isBefore(zonedNow); next = (ZonedDateTime)cronExp.next(next)) {
|
||||||
|
scheduleTimestamp = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
status.setLastScheduledTimestamp(scheduleTimestamp.toInstant());
|
||||||
|
if (next != null) {
|
||||||
|
status.setNextSchedulingTimestamp(next.toInstant());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.client.update(cronDouban);
|
||||||
|
log.info("Scheduled at {} and next scheduled at {}", scheduleTimestamp, next);
|
||||||
|
return new Reconciler.Result(true, Duration.between(now, next));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return Result.doNotRetry();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}).orElseGet(Reconciler.Result::doNotRetry);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Controller setupWith(ControllerBuilder builder) {
|
||||||
|
return builder.extension(new CronDouban()).workerCount(1).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import la.moony.douban.service.DoubanService;
|
||||||
|
import la.moony.douban.vo.DoubanMovieVo;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springdoc.webflux.core.fn.SpringdocRouteBuilder;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.core.extension.endpoint.CustomEndpoint;
|
||||||
|
import run.halo.app.extension.GroupVersion;
|
||||||
|
import run.halo.app.extension.ListResult;
|
||||||
|
|
||||||
|
import static org.springdoc.core.fn.builders.apiresponse.Builder.responseBuilder;
|
||||||
|
import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class DoubanEndpoint implements CustomEndpoint {
|
||||||
|
|
||||||
|
private final String doubanMovieTag = "api.douban.moony.la/v1alpha1/DoubanMovie";
|
||||||
|
|
||||||
|
private final DoubanService doubanService;
|
||||||
|
|
||||||
|
|
||||||
|
public DoubanEndpoint(DoubanService doubanService) {
|
||||||
|
this.doubanService = doubanService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RouterFunction<ServerResponse> endpoint() {
|
||||||
|
return SpringdocRouteBuilder.route()
|
||||||
|
.GET("doubanmovies", this::listDoubanmovie, builder -> {
|
||||||
|
builder.operationId("listDoubanMovie")
|
||||||
|
.description("List doubanMovie.")
|
||||||
|
.tag(doubanMovieTag)
|
||||||
|
.response(
|
||||||
|
responseBuilder()
|
||||||
|
.implementation(ListResult.generateGenericClass(DoubanMovie.class))
|
||||||
|
);
|
||||||
|
DoubanMovieQuery.buildParameters(builder);
|
||||||
|
})
|
||||||
|
.GET("doubanmovies/-/genres", this::ListGenres,
|
||||||
|
builder -> builder.operationId("ListGenres")
|
||||||
|
.description("List all douban genres.")
|
||||||
|
.tag(doubanMovieTag)
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.name("type")
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.description("Genres type to query")
|
||||||
|
.required(false)
|
||||||
|
.implementation(String.class)
|
||||||
|
)
|
||||||
|
.response(responseBuilder()
|
||||||
|
.implementation(String.class)
|
||||||
|
))
|
||||||
|
.GET("doubanmovies/-/getDoubanDetail", this::getDoubanDetail,
|
||||||
|
builder -> builder.operationId("getDoubanDetail")
|
||||||
|
.description("getDoubanDetail.")
|
||||||
|
.tag(doubanMovieTag)
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.name("url")
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.description("doubanmovie url to query")
|
||||||
|
.required(false)
|
||||||
|
.implementation(String.class)
|
||||||
|
)
|
||||||
|
.response(responseBuilder()
|
||||||
|
.implementation(DoubanMovieVo.class)
|
||||||
|
))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
Mono<ServerResponse> listDoubanmovie(ServerRequest request) {
|
||||||
|
DoubanMovieQuery query = new DoubanMovieQuery(request);
|
||||||
|
return doubanService.listDoubanMovie(query)
|
||||||
|
.flatMap(doubanMovies -> ServerResponse.ok().bodyValue(doubanMovies));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<ServerResponse> ListGenres(ServerRequest request) {
|
||||||
|
String type = request.queryParam("type").orElse(null);
|
||||||
|
return doubanService.listAllGenres(type)
|
||||||
|
.collectList()
|
||||||
|
.flatMap(result -> ServerResponse.ok().bodyValue(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<ServerResponse> getDoubanDetail(ServerRequest request) {
|
||||||
|
String url = request.queryParam("url").orElse(null);
|
||||||
|
return doubanService.getDoubanDetail(url)
|
||||||
|
.flatMap(result -> ServerResponse.ok().bodyValue(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GroupVersion groupVersion() {
|
||||||
|
return GroupVersion.parseAPIVersion("api.douban.moony.la/v1alpha1");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springdoc.core.fn.builders.operation.Builder;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||||
|
import run.halo.app.core.extension.endpoint.SortResolver;
|
||||||
|
import run.halo.app.extension.ListOptions;
|
||||||
|
import run.halo.app.extension.PageRequest;
|
||||||
|
import run.halo.app.extension.PageRequestImpl;
|
||||||
|
import run.halo.app.extension.router.IListRequest;
|
||||||
|
import run.halo.app.extension.router.SortableRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static java.util.Comparator.comparing;
|
||||||
|
import static org.springdoc.core.fn.builders.arrayschema.Builder.arraySchemaBuilder;
|
||||||
|
import static org.springdoc.core.fn.builders.parameter.Builder.parameterBuilder;
|
||||||
|
import static org.springdoc.core.fn.builders.schema.Builder.schemaBuilder;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.contains;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.equal;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.in;
|
||||||
|
import static run.halo.app.extension.router.QueryParamBuildUtil.sortParameter;
|
||||||
|
|
||||||
|
public class DoubanMovieQuery extends SortableRequest {
|
||||||
|
|
||||||
|
|
||||||
|
public DoubanMovieQuery(ServerRequest request) {
|
||||||
|
super(request.exchange());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public String getKeyword() {
|
||||||
|
return StringUtils.defaultIfBlank(queryParams.getFirst("keyword"), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public String getStatus() {
|
||||||
|
return queryParams.getFirst("status");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public String getType() {
|
||||||
|
return queryParams.getFirst("type");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public String getDataType() {
|
||||||
|
return queryParams.getFirst("dataType");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public Optional<List<String>> getGenres() {
|
||||||
|
return Optional.ofNullable(queryParams.get("genre"))
|
||||||
|
.filter(genres -> !genres.isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListOptions toListOptions() {
|
||||||
|
var builder = ListOptions.builder(super.toListOptions());
|
||||||
|
|
||||||
|
Optional.ofNullable(getKeyword())
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.ifPresent(keyword -> builder.andQuery(
|
||||||
|
contains("spec.name", getKeyword()))
|
||||||
|
);
|
||||||
|
|
||||||
|
Optional.ofNullable(getStatus())
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.ifPresent(status -> builder.andQuery(equal("faves.status", status)));
|
||||||
|
|
||||||
|
Optional.ofNullable(getType())
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.ifPresent(type -> builder.andQuery(equal("spec.type", type)));
|
||||||
|
|
||||||
|
Optional.ofNullable(getDataType())
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.ifPresent(dataType -> builder.andQuery(equal("spec.dataType", dataType)));
|
||||||
|
|
||||||
|
|
||||||
|
getGenres().ifPresent(genres -> builder.andQuery(in("spec.genres", genres)));
|
||||||
|
|
||||||
|
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Comparator<DoubanMovie> toComparator() {
|
||||||
|
List<Comparator<DoubanMovie>> comparators = new ArrayList<>();
|
||||||
|
var sort = getSort();
|
||||||
|
var ctOrder = sort.getOrderFor("createTime");
|
||||||
|
if (ctOrder != null) {
|
||||||
|
Comparator<DoubanMovie> comparator =
|
||||||
|
comparing(doubanMovie -> doubanMovie.getFaves().getCreateTime());
|
||||||
|
if (ctOrder.isDescending()) {
|
||||||
|
comparator = comparator.reversed();
|
||||||
|
}
|
||||||
|
comparators.add(comparator);
|
||||||
|
}
|
||||||
|
Comparator<DoubanMovie> comparator =
|
||||||
|
comparing(doubanMovie -> doubanMovie.getFaves().getCreateTime());
|
||||||
|
comparators.add(comparator.reversed());
|
||||||
|
return comparators.stream()
|
||||||
|
.reduce(Comparator::thenComparing)
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Sort getSort() {
|
||||||
|
var sort = SortResolver.defaultInstance.resolve(exchange);
|
||||||
|
return sort.and(Sort.by("faves.createTime").descending());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageRequest toPageRequest() {
|
||||||
|
return PageRequestImpl.of(getPage(), getSize(), getSort());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void buildParameters(Builder builder) {
|
||||||
|
IListRequest.buildParameters(builder);
|
||||||
|
builder.parameter(sortParameter())
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.name("keyword")
|
||||||
|
.description("DoubanMovies filtered by keyword.")
|
||||||
|
.implementation(String.class)
|
||||||
|
.required(false))
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.name("status")
|
||||||
|
.description("DoubanMovies filtered by status.")
|
||||||
|
.implementation(String.class)
|
||||||
|
.required(false))
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.name("type")
|
||||||
|
.description("DoubanMovies filtered by type.")
|
||||||
|
.implementation(String.class)
|
||||||
|
.required(false))
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.name("dataType")
|
||||||
|
.description("DoubanMovies filtered by dataType.")
|
||||||
|
.implementation(String.class)
|
||||||
|
.required(false))
|
||||||
|
.parameter(parameterBuilder()
|
||||||
|
.in(ParameterIn.QUERY)
|
||||||
|
.name("genre")
|
||||||
|
.description("DoubanMovies filtered by genre.")
|
||||||
|
.required(false)
|
||||||
|
.array(
|
||||||
|
arraySchemaBuilder()
|
||||||
|
.uniqueItems(true)
|
||||||
|
.schema(schemaBuilder()
|
||||||
|
.implementation(String.class))
|
||||||
|
)
|
||||||
|
.implementationArray(String.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import la.moony.douban.extension.CronDouban;
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import run.halo.app.extension.Scheme;
|
||||||
|
import run.halo.app.extension.SchemeManager;
|
||||||
|
import run.halo.app.extension.index.IndexSpec;
|
||||||
|
import run.halo.app.plugin.BasePlugin;
|
||||||
|
import run.halo.app.plugin.PluginContext;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static run.halo.app.extension.index.IndexAttributeFactory.multiValueAttribute;
|
||||||
|
import static run.halo.app.extension.index.IndexAttributeFactory.simpleAttribute;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author moony
|
||||||
|
* @url https://moony.la
|
||||||
|
* @date 2024/2/1
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class DoubanPlugin extends BasePlugin {
|
||||||
|
|
||||||
|
private final SchemeManager schemeManager;
|
||||||
|
|
||||||
|
public DoubanPlugin(PluginContext pluginContext, SchemeManager schemeManager) {
|
||||||
|
super(pluginContext);
|
||||||
|
this.schemeManager = schemeManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start() {
|
||||||
|
schemeManager.register(DoubanMovie.class, indexSpecs -> {
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("spec.genres")
|
||||||
|
.setIndexFunc(multiValueAttribute(DoubanMovie.class, doubanMovie -> {
|
||||||
|
var genres = doubanMovie.getSpec().getGenres();
|
||||||
|
return genres == null ? Set.of() : Set.copyOf(genres);
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("spec.type")
|
||||||
|
.setIndexFunc(
|
||||||
|
simpleAttribute(DoubanMovie.class, doubanMovie -> doubanMovie.getSpec().getType())));
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("spec.dataType")
|
||||||
|
.setIndexFunc(
|
||||||
|
simpleAttribute(DoubanMovie.class, doubanMovie -> doubanMovie.getSpec().getDataType())));
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("spec.name")
|
||||||
|
.setIndexFunc(
|
||||||
|
simpleAttribute(DoubanMovie.class, doubanMovie -> doubanMovie.getSpec().getName())));
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("spec.id")
|
||||||
|
.setIndexFunc(
|
||||||
|
simpleAttribute(DoubanMovie.class, doubanMovie -> doubanMovie.getSpec().getId())));
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("faves.status")
|
||||||
|
.setIndexFunc(simpleAttribute(DoubanMovie.class, doubanMovie -> {
|
||||||
|
var status = doubanMovie.getFaves().getStatus();
|
||||||
|
return status == null ? null : status.toString();
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
indexSpecs.add(new IndexSpec()
|
||||||
|
.setName("faves.createTime")
|
||||||
|
.setIndexFunc(simpleAttribute(DoubanMovie.class, moment -> {
|
||||||
|
var createTime = moment.getFaves().getCreateTime();
|
||||||
|
return createTime == null ? null : createTime.toString();
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
schemeManager.register(CronDouban.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
schemeManager.unregister(Scheme.buildFromType(DoubanMovie.class));
|
||||||
|
schemeManager.unregister(Scheme.buildFromType(CronDouban.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public class DoubanRequest {
|
||||||
|
private String userId;
|
||||||
|
private Integer count;
|
||||||
|
private Integer start;
|
||||||
|
private DoubanType type;
|
||||||
|
private DoubanStatus status;
|
||||||
|
|
||||||
|
public enum DoubanType{
|
||||||
|
movie,music,book,game,drama;
|
||||||
|
}
|
||||||
|
public enum DoubanStatus{
|
||||||
|
mark,doing,done;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package la.moony.douban;
|
||||||
|
|
||||||
|
import la.moony.douban.finders.DoubanFinder;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.reactive.function.server.RouterFunction;
|
||||||
|
import org.springframework.web.reactive.function.server.RouterFunctions;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerRequest;
|
||||||
|
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.plugin.ReactiveSettingFetcher;
|
||||||
|
import run.halo.app.theme.TemplateNameResolver;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class DoubanRouter {
|
||||||
|
|
||||||
|
private final TemplateNameResolver templateNameResolver;
|
||||||
|
|
||||||
|
private final ReactiveSettingFetcher settingFetcher;
|
||||||
|
|
||||||
|
private final DoubanFinder doubanFinder;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
RouterFunction<ServerResponse> friendTemplateRoute() {
|
||||||
|
|
||||||
|
return RouterFunctions.route().GET("/douban",this::handlerFunction)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<ServerResponse> handlerFunction(ServerRequest request) {
|
||||||
|
String type = request.queryParam("type")
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.orElse(null);
|
||||||
|
String status = request.queryParam("status")
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.orElse("done");
|
||||||
|
return templateNameResolver.resolveTemplateNameOrDefault(request.exchange(), "douban")
|
||||||
|
.flatMap( templateName -> ServerResponse.ok().render(templateName,
|
||||||
|
java.util.Map.of("title",getDoubanTitle(),
|
||||||
|
"douban",doubanFinder.list(type,status),
|
||||||
|
"genres",doubanFinder.listAllGenres(type),
|
||||||
|
"types",doubanFinder.listAllType())));
|
||||||
|
}
|
||||||
|
|
||||||
|
Mono<String> getDoubanTitle() {
|
||||||
|
return this.settingFetcher.get("base").map(
|
||||||
|
setting -> setting.get("title").asText("豆瓣记录")).defaultIfEmpty(
|
||||||
|
"豆瓣记录");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package la.moony.douban.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import la.moony.douban.service.DoubanService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.extension.ReactiveExtensionClient;
|
||||||
|
import run.halo.app.plugin.ApiVersion;
|
||||||
|
|
||||||
|
@ApiVersion("v1alpha1")
|
||||||
|
@RequestMapping("/douban")
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
public class DoubanController {
|
||||||
|
|
||||||
|
private final DoubanService doubanService;
|
||||||
|
|
||||||
|
private final ReactiveExtensionClient client;
|
||||||
|
|
||||||
|
public DoubanController(DoubanService doubanService, ReactiveExtensionClient client) {
|
||||||
|
this.doubanService = doubanService;
|
||||||
|
this.client = client;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/synchronizationDouban")
|
||||||
|
public void synchronizationDouban() {
|
||||||
|
doubanService.synchronizationDouban();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@DeleteMapping("/clear")
|
||||||
|
public Mono<Void> clearLogs() {
|
||||||
|
return client.list(DoubanMovie.class, null, null).flatMap(doubanMovie -> client.delete(doubanMovie))
|
||||||
|
.then();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package la.moony.douban.extension;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import run.halo.app.extension.AbstractExtension;
|
||||||
|
import run.halo.app.extension.GVK;
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@GVK(
|
||||||
|
group = "douban.moony.la",
|
||||||
|
version = "v1alpha1",
|
||||||
|
kind = "CronDouban",
|
||||||
|
singular = "crondouban",
|
||||||
|
plural = "crondoubans"
|
||||||
|
)
|
||||||
|
public class CronDouban extends AbstractExtension {
|
||||||
|
|
||||||
|
|
||||||
|
private Spec spec = new Spec();
|
||||||
|
|
||||||
|
private Status status = new Status();
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Spec {
|
||||||
|
private String cron;
|
||||||
|
private String timezone;
|
||||||
|
private boolean suspend;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Status {
|
||||||
|
private Instant lastScheduledTimestamp;
|
||||||
|
private Instant nextSchedulingTimestamp;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package la.moony.douban.extension;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import run.halo.app.extension.AbstractExtension;
|
||||||
|
import run.halo.app.extension.GVK;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@GVK(kind = "DoubanMovie", group = "douban.moony.la",
|
||||||
|
version = "v1alpha1", singular = "doubanmovie", plural = "doubanmovies")
|
||||||
|
public class DoubanMovie extends AbstractExtension {
|
||||||
|
|
||||||
|
public static final String REQUIRE_SYNC_ON_STARTUP_INDEX_NAME = "requireSyncOnStartup";
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(requiredMode = REQUIRED)
|
||||||
|
private DoubanMovieSpec spec;
|
||||||
|
|
||||||
|
@Schema(requiredMode = REQUIRED)
|
||||||
|
private DoubanMovieFaves faves;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DoubanMovieSpec {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String poster;
|
||||||
|
private String link;
|
||||||
|
private String id;
|
||||||
|
private String score;
|
||||||
|
private String year;
|
||||||
|
private String type;
|
||||||
|
private String pubdate;
|
||||||
|
private String cardSubtitle;
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
private Set<String> genres;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DoubanMovieFaves {
|
||||||
|
private String remark;
|
||||||
|
private Instant createTime;
|
||||||
|
private String score;
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package la.moony.douban.finders;
|
||||||
|
|
||||||
|
import la.moony.douban.vo.DoubanGenresVo;
|
||||||
|
import la.moony.douban.vo.DoubanMovieVo;
|
||||||
|
import la.moony.douban.vo.DoubanTypeVo;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.extension.ListResult;
|
||||||
|
|
||||||
|
public interface DoubanFinder {
|
||||||
|
|
||||||
|
Flux<DoubanGenresVo> listAllGenres(String type);
|
||||||
|
|
||||||
|
Flux<DoubanTypeVo> listAllType();
|
||||||
|
|
||||||
|
Mono<ListResult<DoubanMovieVo>> list(Integer page, Integer size);
|
||||||
|
|
||||||
|
Flux<DoubanMovieVo> listByGenre(String genre);
|
||||||
|
|
||||||
|
Mono<DoubanMovieVo> get(String doubanName);
|
||||||
|
|
||||||
|
Mono<ListResult<DoubanMovieVo>> listByType(Integer page, Integer size, String type);
|
||||||
|
|
||||||
|
Mono<ListResult<DoubanMovieVo>> list(Integer page, Integer size, String type, String status);
|
||||||
|
|
||||||
|
Flux<DoubanMovieVo> listByType(String type);
|
||||||
|
|
||||||
|
Flux<DoubanMovieVo> list(String type,String status);
|
||||||
|
}
|
||||||
@@ -0,0 +1,242 @@
|
|||||||
|
package la.moony.douban.finders.impl;
|
||||||
|
|
||||||
|
import jakarta.annotation.Nonnull;
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import la.moony.douban.finders.DoubanFinder;
|
||||||
|
import la.moony.douban.vo.DoubanGenresVo;
|
||||||
|
import la.moony.douban.vo.DoubanMovieVo;
|
||||||
|
import la.moony.douban.vo.DoubanTypeVo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.extension.ListOptions;
|
||||||
|
import run.halo.app.extension.ListResult;
|
||||||
|
import run.halo.app.extension.PageRequest;
|
||||||
|
import run.halo.app.extension.PageRequestImpl;
|
||||||
|
import run.halo.app.extension.ReactiveExtensionClient;
|
||||||
|
import run.halo.app.extension.router.selector.FieldSelector;
|
||||||
|
import run.halo.app.theme.finders.Finder;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.all;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.and;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.equal;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.isNotNull;
|
||||||
|
|
||||||
|
|
||||||
|
@Finder("doubanFinder")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DoubanFinderImpl implements DoubanFinder {
|
||||||
|
|
||||||
|
private final ReactiveExtensionClient client;
|
||||||
|
|
||||||
|
public static final Predicate<DoubanMovie> FIXED_PREDICATE = doubanMovie -> true;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<ListResult<DoubanMovieVo>> list(Integer page, Integer size) {
|
||||||
|
var pageRequest = PageRequestImpl.of(pageNullSafe(page), sizeNullSafe(size), defaultSort());
|
||||||
|
return pageDoubanMovie(null, pageRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<DoubanMovieVo> listByGenre(String genre) {
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(isNotNull("faves.status"),equal("spec.genres", genre));
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
return client.listAll(DoubanMovie.class, listOptions, defaultSort())
|
||||||
|
.flatMap(this::getDoubanMovieVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<DoubanMovieVo> get(String doubanName) {
|
||||||
|
return client.get(DoubanMovie.class, doubanName)
|
||||||
|
.filter(FIXED_PREDICATE)
|
||||||
|
.flatMap(this::getDoubanMovieVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Sort defaultSort() {
|
||||||
|
return Sort.by("faves.createTime").descending();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<DoubanGenresVo> listAllGenres(String type) {
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(all("spec.genres"),isNotNull("faves.status"));
|
||||||
|
FieldSelector fieldSelector = FieldSelector.of(query);
|
||||||
|
if (StringUtils.isNotEmpty(type)) {
|
||||||
|
fieldSelector = fieldSelector.andQuery(equal("spec.type", type));
|
||||||
|
}
|
||||||
|
listOptions.setFieldSelector(fieldSelector);
|
||||||
|
return client.listAll(DoubanMovie.class, listOptions, defaultSort())
|
||||||
|
.flatMapIterable(doubanMovie -> {
|
||||||
|
var genres = doubanMovie.getSpec().getGenres();
|
||||||
|
if (genres == null) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
return genres.stream()
|
||||||
|
.map(genre -> new DoubanMoviePair(genre, doubanMovie.getMetadata().getName()))
|
||||||
|
.toList();
|
||||||
|
})
|
||||||
|
.groupBy(DoubanMoviePair::genresName)
|
||||||
|
.flatMap(groupedFlux -> groupedFlux.count()
|
||||||
|
.defaultIfEmpty(0L)
|
||||||
|
.map(count -> DoubanGenresVo.builder()
|
||||||
|
.name(groupedFlux.key())
|
||||||
|
.doubanCount(count.intValue())
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
record DoubanMoviePair(String genresName, String doubanMovieName) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<DoubanTypeVo> listAllType() {
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(all("spec.type"),isNotNull("faves.status"));
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
return client.listAll(DoubanMovie.class, listOptions, defaultSort())
|
||||||
|
.flatMapIterable(doubanMovie -> {
|
||||||
|
var type = doubanMovie.getSpec().getType();
|
||||||
|
Set<String> types = new HashSet<>();
|
||||||
|
if (type == null) {
|
||||||
|
return List.of();
|
||||||
|
}else {
|
||||||
|
types.add(doubanMovie.getSpec().getType());
|
||||||
|
}
|
||||||
|
return types.stream()
|
||||||
|
.map(typeName -> new DoubanMoviePair(typeName, doubanMovie.getMetadata().getName()))
|
||||||
|
.toList();
|
||||||
|
})
|
||||||
|
.groupBy(DoubanMoviePair::genresName)
|
||||||
|
.flatMap(groupedFlux -> groupedFlux.count()
|
||||||
|
.defaultIfEmpty(0L)
|
||||||
|
.map(count -> DoubanTypeVo.builder()
|
||||||
|
.name(getTypeName(groupedFlux.key()))
|
||||||
|
.key(groupedFlux.key())
|
||||||
|
.doubanCount(count.intValue())
|
||||||
|
.build()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeName(String type){
|
||||||
|
String name = "";
|
||||||
|
switch (type){
|
||||||
|
case "movie":
|
||||||
|
name = "电影";
|
||||||
|
break;
|
||||||
|
case "book":
|
||||||
|
name = "图书";
|
||||||
|
break;
|
||||||
|
case "music":
|
||||||
|
name = "音乐";
|
||||||
|
break;
|
||||||
|
case "game":
|
||||||
|
name = "游戏";
|
||||||
|
break;
|
||||||
|
case "drama":
|
||||||
|
name = "舞台剧";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<ListResult<DoubanMovieVo>> listByType(Integer page, Integer size, String typeName) {
|
||||||
|
var query = all();
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(typeName)) {
|
||||||
|
query = and(query, equal("spec.type", typeName));
|
||||||
|
}
|
||||||
|
var pageRequest =
|
||||||
|
PageRequestImpl.of(pageNullSafe(page), sizeNullSafe(size), defaultSort());
|
||||||
|
return pageDoubanMovie(FieldSelector.of(query), pageRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<ListResult<DoubanMovieVo>> list(Integer page, Integer size, String typeName, String statusName) {
|
||||||
|
var query = all();
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(typeName)) {
|
||||||
|
query = and(query, equal("spec.type", typeName));
|
||||||
|
}
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(statusName)) {
|
||||||
|
query = and(query, equal("faves.status", statusName));
|
||||||
|
}
|
||||||
|
var pageRequest =
|
||||||
|
PageRequestImpl.of(pageNullSafe(page), sizeNullSafe(size), defaultSort());
|
||||||
|
|
||||||
|
return pageDoubanMovie(FieldSelector.of(query), pageRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<DoubanMovieVo> listByType(String type) {
|
||||||
|
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(equal("faves.status", "done"),equal("spec.type", type));
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
return client.listAll(DoubanMovie.class, listOptions, defaultSort())
|
||||||
|
.flatMap(this::getDoubanMovieVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<DoubanMovieVo> list(String type, String status) {
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = all();
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(type)) {
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(type)){
|
||||||
|
query = and(query,equal("spec.type", type));
|
||||||
|
}else {
|
||||||
|
query = and(equal("faves.status", "done"),equal("spec.type", type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(status)) {
|
||||||
|
query = and(query, equal("faves.status", status));
|
||||||
|
}
|
||||||
|
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
return client.listAll(DoubanMovie.class, listOptions, defaultSort())
|
||||||
|
.flatMap(this::getDoubanMovieVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<ListResult<DoubanMovieVo>> pageDoubanMovie(FieldSelector fieldSelector, PageRequest page) {
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = isNotNull("faves.status");
|
||||||
|
if (fieldSelector != null && fieldSelector.query() != null) {
|
||||||
|
query = and(query, fieldSelector.query());
|
||||||
|
}
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
return client.listBy(DoubanMovie.class, listOptions, page)
|
||||||
|
.flatMap(list -> Flux.fromStream(list.get())
|
||||||
|
.concatMap(this::getDoubanMovieVo)
|
||||||
|
.collectList()
|
||||||
|
.map(doubanMovieVos -> new ListResult<>(list.getPage(), list.getSize(),
|
||||||
|
list.getTotal(), doubanMovieVos)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.defaultIfEmpty(
|
||||||
|
new ListResult<>(page.getPageNumber(), page.getPageSize(), 0L, List.of()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<DoubanMovieVo> getDoubanMovieVo(@Nonnull DoubanMovie doubanMovie) {
|
||||||
|
DoubanMovieVo doubanMovieVo = DoubanMovieVo.from(doubanMovie);
|
||||||
|
return Mono.just(doubanMovieVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
int pageNullSafe(Integer page) {
|
||||||
|
return ObjectUtils.defaultIfNull(page, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int sizeNullSafe(Integer size) {
|
||||||
|
return ObjectUtils.defaultIfNull(size, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package la.moony.douban.service;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
|
import la.moony.douban.DoubanMovieQuery;
|
||||||
|
import la.moony.douban.DoubanRequest;
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import la.moony.douban.vo.DoubanMovieVo;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.extension.ListResult;
|
||||||
|
|
||||||
|
public interface DoubanService {
|
||||||
|
|
||||||
|
void synchronizationDouban();
|
||||||
|
|
||||||
|
Mono<DoubanMovieVo> getDoubanDetail(String url);
|
||||||
|
|
||||||
|
Flux<String> listAllGenres(String type);
|
||||||
|
|
||||||
|
Mono<ListResult<DoubanMovie>> listDoubanMovie(DoubanMovieQuery doubanMovieQuery);
|
||||||
|
}
|
||||||
@@ -0,0 +1,530 @@
|
|||||||
|
package la.moony.douban.service.impl;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import jakarta.annotation.Nonnull;
|
||||||
|
import la.moony.douban.DoubanMovieQuery;
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import la.moony.douban.service.DoubanService;
|
||||||
|
import la.moony.douban.vo.DoubanMovieVo;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.data.domain.Sort;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.reactive.function.client.WebClient;
|
||||||
|
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||||
|
import reactor.core.publisher.Flux;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
import run.halo.app.extension.ListOptions;
|
||||||
|
import run.halo.app.extension.ListResult;
|
||||||
|
import run.halo.app.extension.Metadata;
|
||||||
|
import run.halo.app.extension.ReactiveExtensionClient;
|
||||||
|
import run.halo.app.extension.router.selector.FieldSelector;
|
||||||
|
import run.halo.app.plugin.ReactiveSettingFetcher;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.and;
|
||||||
|
import static run.halo.app.extension.index.query.QueryFactory.equal;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class DoubanServiceImpl implements DoubanService {
|
||||||
|
|
||||||
|
private final Logger log = LoggerFactory.getLogger(DoubanServiceImpl.class);
|
||||||
|
private final ReactiveExtensionClient reactiveClient;
|
||||||
|
private static final String DB_API_LIST_URL = "https://fatesinger.com/dbapi/user/{userid}/interests?count={count}&start={start}&type={type}&status={status}";
|
||||||
|
private static final String DB_API_LIST_URL1 = "https://fatesinger.com/dbapi/user/%s/interests?count=%s&start=%s&type=%s&status=%s";
|
||||||
|
private static final String DB_API_DETAIL_URL = "https://fatesinger.com/dbapi/{type}/{id}?ck=xgtY&for_mobile=1";
|
||||||
|
private static final String TMDB_API_URL = "https://hk.fatesinger.com/api/{type}/{tmdbId}?api_key={apiKey}&language=zh-CN";
|
||||||
|
|
||||||
|
private final ReactiveSettingFetcher settingFetcher;
|
||||||
|
|
||||||
|
public DoubanServiceImpl(ReactiveExtensionClient reactiveClient,
|
||||||
|
ReactiveSettingFetcher settingFetcher) {
|
||||||
|
this.reactiveClient = reactiveClient;
|
||||||
|
this.settingFetcher = settingFetcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void synchronizationDouban() {
|
||||||
|
getDoubanId().flatMap(doubanId->{
|
||||||
|
if (StringUtils.isNotEmpty(doubanId)){
|
||||||
|
addDouban(doubanId);
|
||||||
|
}
|
||||||
|
return Mono.empty();
|
||||||
|
}).subscribe();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDouban(String DOUBAN_ID){
|
||||||
|
String[] types = {"movie","music","book", "game", "drama"};
|
||||||
|
String[] status = {"done","doing","mark"};
|
||||||
|
log.info("豆瓣开始抓取数据");
|
||||||
|
for (String type : types) {
|
||||||
|
for (String s : status) {
|
||||||
|
AtomicBoolean confition = new AtomicBoolean(true);
|
||||||
|
AtomicInteger i = new AtomicInteger(0);
|
||||||
|
while (confition.get()) {
|
||||||
|
String baseUrl = String.format(DB_API_LIST_URL1,DOUBAN_ID, 49, 49 * i.get() , type, s);
|
||||||
|
ArrayNode arrayNode = listDouban(baseUrl);
|
||||||
|
if (arrayNode.isEmpty()){
|
||||||
|
confition.set(false);
|
||||||
|
}else {
|
||||||
|
for(JsonNode node : arrayNode){
|
||||||
|
JsonNode subject = node.get("subject");
|
||||||
|
String name = subject.get("title").asText();
|
||||||
|
String poster = subject.get("pic").get("large").asText();
|
||||||
|
String id = subject.get("id").asText();
|
||||||
|
String doubanScore = subject.get("rating").get("value").asText();
|
||||||
|
String link = subject.get("url").asText();
|
||||||
|
String year = "";
|
||||||
|
if (subject.get("year")!=null){
|
||||||
|
year =subject.get("year").asText();
|
||||||
|
}
|
||||||
|
String type1 = type;
|
||||||
|
String pubdate = "";
|
||||||
|
if (subject.get("pubdate").isArray() && subject.get("pubdate").size()>0){
|
||||||
|
pubdate = subject.get("pubdate").get(0).asText("");
|
||||||
|
}
|
||||||
|
String cardSubtitle = subject.get("card_subtitle").asText();
|
||||||
|
Set<String> genres = new HashSet();
|
||||||
|
if (subject.get("genres")!=null){
|
||||||
|
subject.get("genres").forEach(genre -> {
|
||||||
|
genres.add(genre.asText());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
String createTime = node.get("create_time").asText();
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 定义日期格式
|
||||||
|
Date date = null;
|
||||||
|
try {
|
||||||
|
date = dateFormat.parse(createTime); // 将字符串转换为Date类型
|
||||||
|
} catch (ParseException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
String remark = node.get("comment").asText();
|
||||||
|
String score;
|
||||||
|
if (!node.get("rating").isEmpty()){
|
||||||
|
score = node.get("rating").get("value").asText();
|
||||||
|
} else {
|
||||||
|
score = "";
|
||||||
|
}
|
||||||
|
String status1 = node.get("status").asText();
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(equal("spec.type", type1),equal("spec.id", id));
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
Flux<DoubanMovie> list = reactiveClient.listAll(DoubanMovie.class, listOptions, Sort.by("faves.createTime"));
|
||||||
|
Mono<Boolean> booleanMono = list.hasElements();
|
||||||
|
Date finalDate = date;
|
||||||
|
String finalScore = score;
|
||||||
|
String finalYear = year;
|
||||||
|
String finalPubdate = pubdate;
|
||||||
|
Date finalDate1 = date;
|
||||||
|
booleanMono.flatMap(hasValue -> {
|
||||||
|
if (hasValue) {
|
||||||
|
return list.next().flatMap(doubanMovie -> {
|
||||||
|
if (StringUtils.isNotEmpty(doubanMovie.getFaves().getStatus())) {
|
||||||
|
if (doubanMovie.getFaves().getStatus().equals(status1)) {
|
||||||
|
confition.set(false);
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doubanMovie.getFaves().setCreateTime(finalDate.toInstant());
|
||||||
|
doubanMovie.getFaves().setRemark(remark);
|
||||||
|
doubanMovie.getFaves().setScore(finalScore);
|
||||||
|
doubanMovie.getFaves().setStatus(status1);
|
||||||
|
return reactiveClient.update(doubanMovie);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
DoubanMovie doubanMovie = new DoubanMovie();
|
||||||
|
doubanMovie.setMetadata(new Metadata());
|
||||||
|
doubanMovie.getMetadata().setGenerateName("douban-movie-");
|
||||||
|
doubanMovie.setSpec(new DoubanMovie.DoubanMovieSpec());
|
||||||
|
doubanMovie.getSpec().setName(name);
|
||||||
|
doubanMovie.getSpec().setPoster(poster);
|
||||||
|
doubanMovie.getSpec().setId(id);
|
||||||
|
doubanMovie.getSpec().setScore(doubanScore);
|
||||||
|
doubanMovie.getSpec().setLink(link);
|
||||||
|
doubanMovie.getSpec().setYear(finalYear);
|
||||||
|
doubanMovie.getSpec().setType(type1);
|
||||||
|
doubanMovie.getSpec().setPubdate(finalPubdate);
|
||||||
|
doubanMovie.getSpec().setCardSubtitle(cardSubtitle);
|
||||||
|
doubanMovie.getSpec().setGenres(genres);
|
||||||
|
doubanMovie.getSpec().setDataType("db");
|
||||||
|
doubanMovie.setFaves(new DoubanMovie.DoubanMovieFaves());
|
||||||
|
doubanMovie.getFaves().setCreateTime(finalDate1.toInstant());
|
||||||
|
doubanMovie.getFaves().setRemark(remark);
|
||||||
|
doubanMovie.getFaves().setScore(score);
|
||||||
|
doubanMovie.getFaves().setStatus(status1);
|
||||||
|
return reactiveClient.create(doubanMovie);
|
||||||
|
}
|
||||||
|
}).subscribe();
|
||||||
|
}
|
||||||
|
i.set(i.get()+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("豆瓣结束抓取数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<DoubanMovieVo> getDoubanDetail(String url) {
|
||||||
|
DoubanMovie doubanMovie = new DoubanMovie();
|
||||||
|
Map<String, Object> matcher = matcher(url);
|
||||||
|
String type = (String) matcher.get("type");
|
||||||
|
String id = (String) matcher.get("id");
|
||||||
|
int index = (int) matcher.get("index");
|
||||||
|
if (StringUtils.isNotEmpty(type) && StringUtils.isNotEmpty(id)){
|
||||||
|
switch (index){
|
||||||
|
case 1:
|
||||||
|
return embedHandlerDoubanlist(type,id);
|
||||||
|
case 2:
|
||||||
|
return embedHandlerDoubanablum(type,id);
|
||||||
|
case 3:
|
||||||
|
return embedHandlerDoubandrama(type,id);
|
||||||
|
case 4:
|
||||||
|
return embedHandlerTheMovieDb(type,id);
|
||||||
|
}
|
||||||
|
return getDoubanMovieVo(doubanMovie);
|
||||||
|
}else {
|
||||||
|
return getDoubanMovieVo(doubanMovie);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Flux<String> listAllGenres(String type) {
|
||||||
|
ListOptions listOptions = new ListOptions();
|
||||||
|
if (StringUtils.isNotEmpty(type)) {
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(equal("spec.type",type)));
|
||||||
|
}
|
||||||
|
return reactiveClient.listAll(DoubanMovie.class, listOptions,
|
||||||
|
Sort.by("metadata.name").descending())
|
||||||
|
.flatMapIterable(doubanMovie -> {
|
||||||
|
var genres = doubanMovie.getSpec().getGenres();
|
||||||
|
return Objects.requireNonNullElseGet(genres, List::of);
|
||||||
|
})
|
||||||
|
.distinct();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<ListResult<DoubanMovie>> listDoubanMovie(DoubanMovieQuery query) {
|
||||||
|
return this.settingFetcher.get("base").flatMap(base ->
|
||||||
|
reactiveClient.listBy(DoubanMovie.class, query.toListOptions(), query.toPageRequest())
|
||||||
|
.flatMap(listResult -> Flux.fromStream(listResult.get())
|
||||||
|
.map(doubanMovie -> {
|
||||||
|
//替换反代图片地址
|
||||||
|
String poster = doubanMovie.getSpec().getPoster();
|
||||||
|
boolean isProxy = base.get("isProxy").asBoolean(false);
|
||||||
|
|
||||||
|
if (doubanMovie.getSpec().getDataType() != "halo" && isProxy) {
|
||||||
|
if (StringUtils.isNotEmpty(base.get("proxyHost").asText())) {
|
||||||
|
String proxyHost = base.get("proxyHost").asText();
|
||||||
|
String replace =
|
||||||
|
poster.replaceAll("https://img\\d+.doubanio.com", proxyHost);
|
||||||
|
doubanMovie.getSpec().setPoster(replace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return doubanMovie;
|
||||||
|
})
|
||||||
|
.collectList()
|
||||||
|
.map(list -> new ListResult<>(listResult.getPage(), listResult.getSize(),
|
||||||
|
listResult.getTotal(), list)
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<DoubanMovieVo> embedHandlerDoubanlist(String type,String id){
|
||||||
|
|
||||||
|
if (StringUtils.contains("movie,book,music", type)){
|
||||||
|
return doubanDetail(type,id);
|
||||||
|
}
|
||||||
|
return getDoubanMovieVo(new DoubanMovie());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<DoubanMovieVo> embedHandlerDoubanablum(String type,String id){
|
||||||
|
if (StringUtils.contains("game", type)){
|
||||||
|
return doubanDetail(type,id);
|
||||||
|
}
|
||||||
|
return getDoubanMovieVo(new DoubanMovie());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<DoubanMovieVo> embedHandlerDoubandrama(String type,String id){
|
||||||
|
if (StringUtils.contains("drama", type)){
|
||||||
|
return doubanDetail(type,id);
|
||||||
|
}
|
||||||
|
return getDoubanMovieVo(new DoubanMovie());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<DoubanMovieVo> embedHandlerTheMovieDb(String type,String id){
|
||||||
|
if (StringUtils.contains("tv,movie", type)){
|
||||||
|
return getApiKey().flatMap(apiKey->{
|
||||||
|
if (StringUtils.isNotEmpty(apiKey) ){
|
||||||
|
return tmdbDetail(type,id,apiKey);
|
||||||
|
}
|
||||||
|
return getDoubanMovieVo(new DoubanMovie());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return getDoubanMovieVo(new DoubanMovie());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<DoubanMovieVo> tmdbDetail(String type,String id,String apiKey){
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(equal("spec.type", type),equal("spec.id", id),equal("spec.dataType", "tmdb"));
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
Flux<DoubanMovie> list = reactiveClient.listAll(DoubanMovie.class, listOptions, Sort.by("faves.createTime"));
|
||||||
|
Mono<Boolean> booleanMono = list.hasElements();
|
||||||
|
return booleanMono.flatMap(hasValue ->{
|
||||||
|
if (hasValue){
|
||||||
|
return (Mono<DoubanMovieVo>) list.next().flatMap(doubanMovie -> {
|
||||||
|
return getDoubanMovieVo(doubanMovie);
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
DoubanMovie doubanMovieDetail = new DoubanMovie();
|
||||||
|
return tmdbDetailRequest(type, id,apiKey).flatMap(jsonNode->{
|
||||||
|
String name = jsonNode.get("title")!=null ? jsonNode.get("title").asText() : jsonNode.get("name").asText();
|
||||||
|
String poster = "https://image.tmdb.org/t/p/original"+jsonNode.get("poster_path").asText();
|
||||||
|
String tmdbId = jsonNode.get("id").asText();
|
||||||
|
String doubanScore = jsonNode.get("vote_average").asText();
|
||||||
|
String link = jsonNode.get("homepage").asText();
|
||||||
|
String year = "";
|
||||||
|
String pubdate = jsonNode.get("release_date")!=null ? jsonNode.get("release_date").asText() : jsonNode.get("first_air_date").asText();
|
||||||
|
String cardSubtitle = jsonNode.get("overview").asText();
|
||||||
|
Set<String> genres = new HashSet();
|
||||||
|
if (jsonNode.get("genres")!=null){
|
||||||
|
jsonNode.get("genres").forEach(genre -> {
|
||||||
|
genres.add(genre.get("name").asText());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
doubanMovieDetail.setMetadata(new Metadata());
|
||||||
|
doubanMovieDetail.getMetadata().setGenerateName("douban-movie-");
|
||||||
|
doubanMovieDetail.setSpec(new DoubanMovie.DoubanMovieSpec());
|
||||||
|
doubanMovieDetail.getSpec().setName(name);
|
||||||
|
doubanMovieDetail.getSpec().setPoster(poster);
|
||||||
|
doubanMovieDetail.getSpec().setId(tmdbId);
|
||||||
|
doubanMovieDetail.getSpec().setScore(doubanScore);
|
||||||
|
doubanMovieDetail.getSpec().setLink(link);
|
||||||
|
doubanMovieDetail.getSpec().setYear(year);
|
||||||
|
doubanMovieDetail.getSpec().setType(type);
|
||||||
|
doubanMovieDetail.getSpec().setPubdate(pubdate);
|
||||||
|
doubanMovieDetail.getSpec().setCardSubtitle(cardSubtitle);
|
||||||
|
doubanMovieDetail.getSpec().setGenres(genres);
|
||||||
|
doubanMovieDetail.getSpec().setDataType("tmdb");
|
||||||
|
doubanMovieDetail.setFaves(new DoubanMovie.DoubanMovieFaves());
|
||||||
|
doubanMovieDetail.getFaves().setCreateTime(Instant.now());
|
||||||
|
doubanMovieDetail.getFaves().setRemark(null);
|
||||||
|
doubanMovieDetail.getFaves().setScore(null);
|
||||||
|
doubanMovieDetail.getFaves().setStatus(null);
|
||||||
|
return reactiveClient.create(doubanMovieDetail)
|
||||||
|
.thenReturn(doubanMovieDetail)
|
||||||
|
.flatMap(doubanMovie -> getDoubanMovieVo(doubanMovie));
|
||||||
|
}).onErrorResume(WebClientResponseException.NotFound.class, error -> {
|
||||||
|
log.error("Resource not found: ",error.getMessage());
|
||||||
|
return getDoubanMovieVo(doubanMovieDetail);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<DoubanMovieVo> doubanDetail(String type,String id){
|
||||||
|
var listOptions = new ListOptions();
|
||||||
|
var query = and(equal("spec.type", type),equal("spec.id", id));
|
||||||
|
listOptions.setFieldSelector(FieldSelector.of(query));
|
||||||
|
Flux<DoubanMovie> list = reactiveClient.listAll(DoubanMovie.class, listOptions, Sort.by("faves.createTime"));
|
||||||
|
Mono<Boolean> booleanMono = list.hasElements();
|
||||||
|
return this.settingFetcher.get("base").flatMap(base ->booleanMono
|
||||||
|
.flatMap(hasValue ->{
|
||||||
|
if (hasValue){
|
||||||
|
return (Mono<DoubanMovieVo>) list.next().flatMap(doubanMovie -> {
|
||||||
|
return getDoubanMovieVo(doubanMovie);
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
DoubanMovie doubanMovieDetail = new DoubanMovie();
|
||||||
|
return doubanDetailRequest(type, id).flatMap(jsonNode->{
|
||||||
|
String name = jsonNode.get("title").asText();
|
||||||
|
String poster = jsonNode.get("pic").get("large").asText();
|
||||||
|
String doubanId = jsonNode.get("id").asText();
|
||||||
|
String doubanScore = jsonNode.get("rating").get("value").asText();
|
||||||
|
String link = jsonNode.get("url").asText();
|
||||||
|
String year = "";
|
||||||
|
if (jsonNode.get("year")!=null){
|
||||||
|
year =jsonNode.get("year").asText();
|
||||||
|
}
|
||||||
|
String pubdate = "";
|
||||||
|
if (jsonNode.get("pubdate")!=null){
|
||||||
|
if (jsonNode.get("pubdate").isArray() && jsonNode.get("pubdate").size()>0){
|
||||||
|
pubdate = jsonNode.get("pubdate").get(0).asText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String cardSubtitle = jsonNode.get("card_subtitle").asText();
|
||||||
|
Set<String> genres = new HashSet();
|
||||||
|
if (jsonNode.get("genres")!=null){
|
||||||
|
jsonNode.get("genres").forEach(genre -> {
|
||||||
|
genres.add(genre.asText());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
doubanMovieDetail.setMetadata(new Metadata());
|
||||||
|
doubanMovieDetail.getMetadata().setGenerateName("douban-movie-");
|
||||||
|
doubanMovieDetail.setSpec(new DoubanMovie.DoubanMovieSpec());
|
||||||
|
doubanMovieDetail.getSpec().setName(name);
|
||||||
|
doubanMovieDetail.getSpec().setPoster(poster);
|
||||||
|
doubanMovieDetail.getSpec().setId(doubanId);
|
||||||
|
doubanMovieDetail.getSpec().setScore(doubanScore);
|
||||||
|
doubanMovieDetail.getSpec().setLink(link);
|
||||||
|
doubanMovieDetail.getSpec().setYear(year);
|
||||||
|
doubanMovieDetail.getSpec().setType(type);
|
||||||
|
doubanMovieDetail.getSpec().setPubdate(pubdate);
|
||||||
|
doubanMovieDetail.getSpec().setCardSubtitle(cardSubtitle);
|
||||||
|
doubanMovieDetail.getSpec().setGenres(genres);
|
||||||
|
doubanMovieDetail.getSpec().setDataType("db");
|
||||||
|
doubanMovieDetail.setFaves(new DoubanMovie.DoubanMovieFaves());
|
||||||
|
doubanMovieDetail.getFaves().setCreateTime(Instant.now());
|
||||||
|
doubanMovieDetail.getFaves().setRemark(null);
|
||||||
|
doubanMovieDetail.getFaves().setScore(null);
|
||||||
|
doubanMovieDetail.getFaves().setStatus(null);
|
||||||
|
return reactiveClient.create(doubanMovieDetail)
|
||||||
|
.thenReturn(doubanMovieDetail)
|
||||||
|
.flatMap(doubanMovie -> getDoubanMovieVo(doubanMovie));
|
||||||
|
}).onErrorResume(WebClientResponseException.NotFound.class, error -> {
|
||||||
|
log.error("Resource not found: ",error.getMessage());
|
||||||
|
return getDoubanMovieVo(doubanMovieDetail);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).map(doubanMovie -> {
|
||||||
|
//替换反代图片地址
|
||||||
|
String poster = doubanMovie.getSpec().getPoster();
|
||||||
|
boolean isProxy = base.get("isProxy").asBoolean(false);
|
||||||
|
|
||||||
|
if (doubanMovie.getSpec().getDataType() != "halo" && isProxy) {
|
||||||
|
if (StringUtils.isNotEmpty(base.get("proxyHost").asText())) {
|
||||||
|
String proxyHost = base.get("proxyHost").asText();
|
||||||
|
String replace =
|
||||||
|
poster.replaceAll("https://img\\d+.doubanio.com", proxyHost);
|
||||||
|
doubanMovie.getSpec().setPoster(replace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return doubanMovie;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,Object> matcher(String url){
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
String[] patterns = {
|
||||||
|
"https?://(\\w+)\\.douban\\.com/subject/(\\d+)",
|
||||||
|
"https?://www\\.douban\\.com/(\\w+)/(\\d+)",
|
||||||
|
"https?://www\\.douban\\.com/location/(\\w+)/(\\d+)",
|
||||||
|
"https?://www\\.themoviedb\\.org/(\\w+)/(\\d+)"
|
||||||
|
};
|
||||||
|
String input = url;
|
||||||
|
int index = 0;
|
||||||
|
for (String regex : patterns) {
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(input);
|
||||||
|
String type = null;
|
||||||
|
String id = null;
|
||||||
|
index = index+1;
|
||||||
|
if (matcher.find()) {
|
||||||
|
type = matcher.group(1);
|
||||||
|
id = matcher.group(2);
|
||||||
|
map.put("type",type);
|
||||||
|
map.put("id",id);
|
||||||
|
map.put("index",index);
|
||||||
|
return map;
|
||||||
|
}else {
|
||||||
|
log.info("No match found {}",url);
|
||||||
|
}
|
||||||
|
map.put("type",type);
|
||||||
|
map.put("id",id);
|
||||||
|
map.put("index",index);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
Mono<String> getDoubanId() {
|
||||||
|
return this.settingFetcher.get("base")
|
||||||
|
.map(setting -> setting.get("doubanId").asText());
|
||||||
|
}
|
||||||
|
|
||||||
|
Mono<String> getApiKey() {
|
||||||
|
return this.settingFetcher.get("base")
|
||||||
|
.map(setting -> setting.get("apiKey").asText());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mono<DoubanMovieVo> getDoubanMovieVo(@Nonnull DoubanMovie doubanMovie) {
|
||||||
|
DoubanMovieVo doubanMovieVo = DoubanMovieVo.from(doubanMovie);
|
||||||
|
return Mono.just(doubanMovieVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayNode listDouban(String url){
|
||||||
|
String result = null;
|
||||||
|
ArrayNode jsonNodes = new ArrayNode(null);
|
||||||
|
try {
|
||||||
|
|
||||||
|
// 创建连接
|
||||||
|
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||||
|
|
||||||
|
// 设置请求方法
|
||||||
|
connection.setRequestMethod("GET");
|
||||||
|
|
||||||
|
// 获取响应结果
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
String inputLine;
|
||||||
|
StringBuffer response = new StringBuffer();
|
||||||
|
while ((inputLine = in.readLine()) != null) {
|
||||||
|
response.append(inputLine);
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
result = response.toString();
|
||||||
|
|
||||||
|
// 创建一个 ObjectMapper 实例
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
// 将 String 解析为 JsonNode
|
||||||
|
JsonNode jsonNode = objectMapper.readTree(result);
|
||||||
|
// 将 JsonNode 转换为 ObjectNode
|
||||||
|
if (jsonNode.isObject()) {
|
||||||
|
ObjectNode objectNode = (ObjectNode) jsonNode;
|
||||||
|
jsonNodes = objectNode.withArray("/interests");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return jsonNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<JsonNode> doubanDetailRequest(String type,String id) {
|
||||||
|
return WebClient.create().get()
|
||||||
|
.uri(DB_API_DETAIL_URL, type,id)
|
||||||
|
.retrieve()
|
||||||
|
.bodyToMono(JsonNode.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Mono<JsonNode> tmdbDetailRequest(String type,String tmdbId,String apiKey) {
|
||||||
|
return WebClient.create().get()
|
||||||
|
.uri(TMDB_API_URL, type,tmdbId,apiKey)
|
||||||
|
.retrieve()
|
||||||
|
.bodyToMono(JsonNode.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package la.moony.douban.vo;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Value;
|
||||||
|
|
||||||
|
@Value
|
||||||
|
@Builder
|
||||||
|
public class DoubanGenresVo {
|
||||||
|
String name;
|
||||||
|
|
||||||
|
Integer doubanCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package la.moony.douban.vo;
|
||||||
|
|
||||||
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import run.halo.app.extension.MetadataOperator;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@ToString
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class DoubanMovieVo {
|
||||||
|
|
||||||
|
private MetadataOperator metadata;
|
||||||
|
|
||||||
|
private DoubanMovie.DoubanMovieSpec spec;
|
||||||
|
|
||||||
|
private DoubanMovie.DoubanMovieFaves faves;
|
||||||
|
|
||||||
|
public static DoubanMovieVo from(DoubanMovie doubanMovie) {
|
||||||
|
Assert.notNull(doubanMovie, "The doubanMovie must not be null.");
|
||||||
|
return DoubanMovieVo.builder()
|
||||||
|
.metadata(doubanMovie.getMetadata())
|
||||||
|
.spec(doubanMovie.getSpec())
|
||||||
|
.faves(doubanMovie.getFaves())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package la.moony.douban.vo;
|
||||||
|
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Value;
|
||||||
|
|
||||||
|
@Value
|
||||||
|
@Builder
|
||||||
|
public class DoubanTypeVo {
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
String key;
|
||||||
|
|
||||||
|
Integer doubanCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: plugin.halo.run/v1alpha1
|
||||||
|
kind: ReverseProxy
|
||||||
|
metadata:
|
||||||
|
name: douban-static-assets
|
||||||
|
rules:
|
||||||
|
- path: /static/**
|
||||||
|
file:
|
||||||
|
directory: static
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: role-template-douban-anonymous
|
||||||
|
labels:
|
||||||
|
rbac.authorization.halo.run/aggregate-to-anonymous: "true"
|
||||||
|
halo.run/role-template: "true"
|
||||||
|
halo.run/hidden: "true"
|
||||||
|
annotations:
|
||||||
|
rbac.authorization.halo.run/display-name: "查看朋友圈提交模板"
|
||||||
|
rules:
|
||||||
|
- apiGroups: [ "api.douban.moony.la" ]
|
||||||
|
resources: [ "doubanmovies","doubanmovies/genres","doubanmovies/getDoubanDetail"]
|
||||||
|
verbs: [ "get", "list" ]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: role-template-douban-view
|
||||||
|
labels:
|
||||||
|
halo.run/role-template: "true"
|
||||||
|
annotations:
|
||||||
|
rbac.authorization.halo.run/module: "豆瓣"
|
||||||
|
rbac.authorization.halo.run/display-name: "豆瓣查看"
|
||||||
|
rbac.authorization.halo.run/ui-permissions: |
|
||||||
|
["plugin:douban:view"]
|
||||||
|
rules:
|
||||||
|
- apiGroups: [ "douban.moony.la" ]
|
||||||
|
resources: [ "doubanmovies"]
|
||||||
|
verbs: [ "get", "list" ]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: role-template-douban-manage
|
||||||
|
labels:
|
||||||
|
halo.run/role-template: "true"
|
||||||
|
annotations:
|
||||||
|
rbac.authorization.halo.run/module: "豆瓣"
|
||||||
|
rbac.authorization.halo.run/display-name: "豆瓣管理"
|
||||||
|
rbac.authorization.halo.run/ui-permissions: |
|
||||||
|
["plugin:douban:manage"]
|
||||||
|
rbac.authorization.halo.run/dependencies: |
|
||||||
|
["role-template-douban-view"]
|
||||||
|
rules:
|
||||||
|
- apiGroups: [ "douban.moony.la" ]
|
||||||
|
resources: [ "doubanmovies"]
|
||||||
|
verbs: [ "create", "patch", "update", "delete", "deletecollection" ]
|
||||||
|
- nonResourceURLs: [ "/apis/api.plugin.halo.run/v1alpha1/plugins/plugin-douban/douban/*"]
|
||||||
|
verbs: [ "create" , "delete" ]
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
apiVersion: v1alpha1
|
||||||
|
kind: Setting
|
||||||
|
metadata:
|
||||||
|
name: plugin-douban-settings
|
||||||
|
spec:
|
||||||
|
forms:
|
||||||
|
- group: base
|
||||||
|
label: 基本设置
|
||||||
|
formSchema:
|
||||||
|
- $formkit: text
|
||||||
|
label: 页面标题
|
||||||
|
name: title
|
||||||
|
validation: required
|
||||||
|
value: '豆瓣记录'
|
||||||
|
- $formkit: text
|
||||||
|
label: 豆瓣的ID
|
||||||
|
name: doubanId
|
||||||
|
help: 我的豆瓣 https://www.douban.com/people/xxxx xxxx 就是你的ID
|
||||||
|
- $formkit: text
|
||||||
|
label: TMDB API Key
|
||||||
|
name: apiKey
|
||||||
|
help: 设置TMDB API Key在https://www.themoviedb.org/settings/api 自行申请
|
||||||
|
- $formkit: radio
|
||||||
|
label: 启用图片代理
|
||||||
|
name: isProxy
|
||||||
|
id: isProxy
|
||||||
|
value: false
|
||||||
|
help: 如果用豆瓣源的图片很慢可以自己搭建给图片反代站点
|
||||||
|
options:
|
||||||
|
- value: true
|
||||||
|
label: 开启
|
||||||
|
- value: false
|
||||||
|
label: 关闭
|
||||||
|
- $formkit: text
|
||||||
|
if: "$get(isProxy).value === true"
|
||||||
|
label: 代理地址
|
||||||
|
name: proxyHost
|
||||||
|
value: ""
|
||||||
|
help: "搭建教程:https://docs.kunkunyu.com/docs/plugin-douban/use#%E9%85%8D%E7%BD%AE%E5%9B%BE%E7%89%87%E4%BB%A3%E7%90%86"
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: plugin.halo.run/v1alpha1
|
||||||
|
kind: Plugin
|
||||||
|
metadata:
|
||||||
|
name: plugin-douban
|
||||||
|
annotations:
|
||||||
|
"store.halo.run/app-id": "app-srBOL"
|
||||||
|
spec:
|
||||||
|
enabled: true
|
||||||
|
requires: ">=2.20.0"
|
||||||
|
author:
|
||||||
|
name: 困困鱼
|
||||||
|
website: https://github.com/chengzhongxue
|
||||||
|
logo: logo.png
|
||||||
|
homepage: https://www.halo.run/store/apps/app-srBOL
|
||||||
|
repo: https://github.com/chengzhongxue/plugin-douban
|
||||||
|
issues: https://github.com/chengzhongxue/plugin-douban/issues
|
||||||
|
settingName: plugin-douban-settings
|
||||||
|
configMapName: plugin-douban-configmap
|
||||||
|
displayName: "豆瓣"
|
||||||
|
description: "提供从豆瓣爬取到的数据,提供页面路由"
|
||||||
|
license:
|
||||||
|
- name: "GPL-3.0"
|
||||||
|
url: "https://github.com/halo-dev/plugin-douban/blob/main/LICENSE"
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
(function () {
|
||||||
|
function getDoubanDetail(src, e) {
|
||||||
|
var url = '/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/getDoubanDetail?url=' + src;
|
||||||
|
fetch(url)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
renderer(data, e);
|
||||||
|
})
|
||||||
|
.catch(console.error)
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderer(data, e) {
|
||||||
|
let img = data.spec.dataType == 'db' ? `${data.spec.poster}` : data.spec.poster
|
||||||
|
let date = new Date(data.faves.createTime);
|
||||||
|
let dateString = date.toLocaleString(); // 使用默认的日期和时间格式
|
||||||
|
const r = document.createElement("div");
|
||||||
|
r.classList.add('doulist-item')
|
||||||
|
r.innerHTML = `<div class="doulist-subject">
|
||||||
|
<div class="doulist-post"><img decoding="async" referrerpolicy="no-referrer" class="fade-before fade-after"
|
||||||
|
src="${img}"></div>
|
||||||
|
<div class="db--viewTime JiEun">Marked ${dateString}</div>
|
||||||
|
<div class="doulist-content">
|
||||||
|
<div class="doulist-title"><a class="cute" target="_blank" rel="external nofollow"
|
||||||
|
href="${data.spec.link}">${data.spec.name}</a></div>
|
||||||
|
<div class="rating"><span class="allstardark"><span class="allstarlight" style="width: ${data.spec.score * 10}%;"></span></span><span
|
||||||
|
class="rating_nums">${data.spec.score}</span></div>
|
||||||
|
<div class="abstract">${data.faves?.remark != null && data.faves?.remark != '' ? data.faves?.remark : data.spec.cardSubtitle}</div>
|
||||||
|
</div>
|
||||||
|
</div>`
|
||||||
|
e.appendChild(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
const mf = () => {
|
||||||
|
const observer = new IntersectionObserver((entries) => {
|
||||||
|
entries.forEach((entry) => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
const e = entry.target;
|
||||||
|
const src = e.getAttribute("src");
|
||||||
|
if (src != null && src != '') {
|
||||||
|
getDoubanDetail(src, e);
|
||||||
|
observer.unobserve(e); // 停止观察已经加载的元素,防止重复加载
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
document.querySelectorAll("douban").forEach((e) => {
|
||||||
|
observer.observe(e);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
mf();
|
||||||
|
}, {
|
||||||
|
once: true
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener("pjax:success", () => {
|
||||||
|
mf();
|
||||||
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
class HALO_DOUBAN {
|
||||||
|
constructor() {
|
||||||
|
this.ver = "1.2.2";
|
||||||
|
this.type = "movie";
|
||||||
|
this.status = "done";
|
||||||
|
this.finished = false;
|
||||||
|
this.paged = 1;
|
||||||
|
this.genre_list = [];
|
||||||
|
this.genre = [];
|
||||||
|
this.subjects = [];
|
||||||
|
this._create();
|
||||||
|
}
|
||||||
|
|
||||||
|
on(t, e, n) {
|
||||||
|
var a = document.querySelectorAll(e);
|
||||||
|
a.forEach((item) => {
|
||||||
|
item.addEventListener(t, n);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_addSearchParams(url, params = {}) {
|
||||||
|
url = new URL(url, window.location.origin);
|
||||||
|
let new_url = new URL(
|
||||||
|
`${url.origin}${url.pathname}?${new URLSearchParams([
|
||||||
|
...Array.from(url.searchParams.entries()),
|
||||||
|
...Object.entries(params),
|
||||||
|
])}`
|
||||||
|
);
|
||||||
|
return new_url.href;
|
||||||
|
}
|
||||||
|
|
||||||
|
_fetchGenres() {
|
||||||
|
document.querySelector(".db--genres").innerHTML = "";
|
||||||
|
const url = '/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/genres';
|
||||||
|
fetch(
|
||||||
|
this._addSearchParams(url, {
|
||||||
|
type: this.type,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
if (data.length) {
|
||||||
|
this.genre_list = data;
|
||||||
|
this._renderGenre();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
_statusChange() {
|
||||||
|
this.on("click", ".db--typeItem", (t) => {
|
||||||
|
const self = t.currentTarget;
|
||||||
|
if (self.classList.contains("is-active")) {
|
||||||
|
// const index = this.genre.indexOf(self.innerText);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
document.querySelector(".db--list").innerHTML = "";
|
||||||
|
document.querySelector(".lds-ripple").classList.remove("u-hide");
|
||||||
|
document
|
||||||
|
.querySelector(".db--typeItem.is-active")
|
||||||
|
.classList.remove("is-active");
|
||||||
|
self.classList.add("is-active");
|
||||||
|
this.status = self.dataset.status;
|
||||||
|
this.paged = 1;
|
||||||
|
this.finished = false;
|
||||||
|
this.subjects = [];
|
||||||
|
this._fetchData();
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleGenreClick() {
|
||||||
|
this.on("click", ".db--genreItem", (t) => {
|
||||||
|
const self = t.currentTarget;
|
||||||
|
if (self.classList.contains("is-active")) {
|
||||||
|
const index = this.genre.indexOf(self.innerText);
|
||||||
|
self.classList.remove("is-active");
|
||||||
|
this.genre.splice(index, 1);
|
||||||
|
this.paged = 1;
|
||||||
|
this.finished = false;
|
||||||
|
this.subjects = [];
|
||||||
|
this._fetchData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
document.querySelector(".db--list").innerHTML = "";
|
||||||
|
document.querySelector(".lds-ripple").classList.remove("u-hide");
|
||||||
|
|
||||||
|
self.classList.add("is-active");
|
||||||
|
this.genre.push(self.innerText);
|
||||||
|
this.paged = 1;
|
||||||
|
this.finished = false;
|
||||||
|
this.subjects = [];
|
||||||
|
this._fetchData();
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_renderGenre() {
|
||||||
|
document.querySelector(".db--genres").innerHTML = this.genre_list
|
||||||
|
.map((item) => {
|
||||||
|
return `<span class="db--genreItem">${item}</span>`;
|
||||||
|
})
|
||||||
|
.join("");
|
||||||
|
this._handleGenreClick();
|
||||||
|
}
|
||||||
|
|
||||||
|
_fetchData() {
|
||||||
|
var url = `/apis/api.douban.moony.la/v1alpha1/doubanmovies?page=${this.paged}&size=49&type=${this.type}&status=${this.status}`;
|
||||||
|
const genre = this.genre
|
||||||
|
if (genre.length > 0) {
|
||||||
|
for (let i = 0; i < genre.length; i++) {
|
||||||
|
url = url + `&genre=${genre[i]}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fetch(url)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
if (data.items.length) {
|
||||||
|
if(this.subjects==null){
|
||||||
|
this.subjects =[]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
document
|
||||||
|
.querySelector(".db--list")
|
||||||
|
.classList.contains("db--list__card")
|
||||||
|
) {
|
||||||
|
this.subjects = [...this.subjects, ...data.items];
|
||||||
|
this._randerDateTemplate();
|
||||||
|
} else {
|
||||||
|
this.subjects = [...this.subjects, ...data.items];
|
||||||
|
this._randerListTemplate();
|
||||||
|
}
|
||||||
|
document
|
||||||
|
.querySelector(".lds-ripple")
|
||||||
|
.classList.add("u-hide");
|
||||||
|
} else {
|
||||||
|
document
|
||||||
|
.querySelector(".db--list")
|
||||||
|
.classList.contains("db--list__card")
|
||||||
|
? this._randerDateTemplate()
|
||||||
|
: this._randerListTemplate();
|
||||||
|
this.finished = true;
|
||||||
|
document
|
||||||
|
.querySelector(".lds-ripple")
|
||||||
|
.classList.add("u-hide");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_randerDateTemplate() {
|
||||||
|
if (!this.subjects.length)
|
||||||
|
return (document.querySelector(
|
||||||
|
".db--list"
|
||||||
|
).innerHTML = `<div class="db--empty"></div>`);
|
||||||
|
const result = this.subjects.reduce((result, item) => {
|
||||||
|
const date = new Date(item.faves.createTime);
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = date.getMonth() + 1;
|
||||||
|
const key = `${year}-${month.toString().padStart(2, "0")}`;
|
||||||
|
if (Object.prototype.hasOwnProperty.call(result, key)) {
|
||||||
|
result[key].push(item);
|
||||||
|
} else {
|
||||||
|
result[key] = [item];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
let html = ``;
|
||||||
|
for (let key in result) {
|
||||||
|
const date = key.split("-");
|
||||||
|
html += `<div class="db--listBydate"><div class="db--titleDate JiEun"><div class="db--titleDate__day">${date[1]}</div><div class="db--titleDate__month">${date[0]}</div></div><div class="db--dateList__card">`;
|
||||||
|
html += result[key]
|
||||||
|
.map((movie) => {
|
||||||
|
return `<div class="db--item"><img src="${
|
||||||
|
movie.spec.dataType == 'halo' ? movie.spec.poster : movie.spec.poster
|
||||||
|
}" referrerpolicy="unsafe-url" class="db--image"><div class="db--score JiEun">${
|
||||||
|
movie.spec.score > 0
|
||||||
|
? '<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" ><path d="M12 20.1l5.82 3.682c1.066.675 2.37-.322 2.09-1.584l-1.543-6.926 5.146-4.667c.94-.85.435-2.465-.799-2.567l-6.773-.602L13.29.89a1.38 1.38 0 0 0-2.581 0l-2.65 6.53-6.774.602C.052 8.126-.453 9.74.486 10.59l5.147 4.666-1.542 6.926c-.28 1.262 1.023 2.26 2.09 1.585L12 20.099z"></path></svg>' +
|
||||||
|
movie.spec.score
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
movie.spec.year > 0 ? " · " + movie.spec.year : ""
|
||||||
|
}</div><div class="db--title"><a href="${
|
||||||
|
movie.spec.link
|
||||||
|
}" target="_blank">${movie.spec.name}</a></div>
|
||||||
|
|
||||||
|
</div>`;
|
||||||
|
})
|
||||||
|
.join("");
|
||||||
|
html += `</div></div>`;
|
||||||
|
}
|
||||||
|
document.querySelector(".db--list").innerHTML = html;
|
||||||
|
}
|
||||||
|
|
||||||
|
_randerListTemplate() {
|
||||||
|
if (!this.subjects.length)
|
||||||
|
return (document.querySelector(
|
||||||
|
".db--list"
|
||||||
|
).innerHTML = `<div class="db--empty"></div>`);
|
||||||
|
document.querySelector(".db--list").innerHTML = this.subjects
|
||||||
|
.map((item) => {
|
||||||
|
return `<div class="db--item"><img src="${
|
||||||
|
item.spec.dataType == 'halo' ? item.spec.poster : item.spec.poster
|
||||||
|
}" referrerpolicy="unsafe-url" class="db--image"><div class="ipc-signpost JiEun">${
|
||||||
|
item.faves.createTime
|
||||||
|
}</div><div class="db--score JiEun">${
|
||||||
|
item.spec.score > 0
|
||||||
|
? '<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" ><path d="M12 20.1l5.82 3.682c1.066.675 2.37-.322 2.09-1.584l-1.543-6.926 5.146-4.667c.94-.85.435-2.465-.799-2.567l-6.773-.602L13.29.89a1.38 1.38 0 0 0-2.581 0l-2.65 6.53-6.774.602C.052 8.126-.453 9.74.486 10.59l5.147 4.666-1.542 6.926c-.28 1.262 1.023 2.26 2.09 1.585L12 20.099z"></path></svg>' +
|
||||||
|
item.spec.score
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
item.spec.year > 0 ? " · " + item.spec.year : ""
|
||||||
|
}</div><div class="db--title"><a href="${
|
||||||
|
item.spec.link
|
||||||
|
}" target="_blank">${item.spec.name}</a></div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
})
|
||||||
|
.join("");
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleScroll() {
|
||||||
|
window.addEventListener("scroll", () => {
|
||||||
|
var t = window.scrollY || window.pageYOffset;
|
||||||
|
// @ts-ignore
|
||||||
|
if (
|
||||||
|
document.querySelector(".block-more").offsetTop +
|
||||||
|
// @ts-ignore
|
||||||
|
-window.innerHeight <
|
||||||
|
t &&
|
||||||
|
document
|
||||||
|
.querySelector(".lds-ripple")
|
||||||
|
.classList.contains("u-hide") &&
|
||||||
|
!this.finished
|
||||||
|
) {
|
||||||
|
document
|
||||||
|
.querySelector(".lds-ripple")
|
||||||
|
.classList.remove("u-hide");
|
||||||
|
this.paged++;
|
||||||
|
this._fetchData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleNavClick() {
|
||||||
|
this.on("click", ".db--navItem", (t) => {
|
||||||
|
if (t.target.classList.contains("current")) return;
|
||||||
|
this.genre = [];
|
||||||
|
this.type = t.target.dataset.type;
|
||||||
|
if (this.type != "book") {
|
||||||
|
this._fetchGenres();
|
||||||
|
document
|
||||||
|
.querySelector(".db--genres")
|
||||||
|
.classList.remove("u-hide");
|
||||||
|
} else {
|
||||||
|
document.querySelector(".db--genres").classList.add("u-hide");
|
||||||
|
}
|
||||||
|
document.querySelector(".db--list").innerHTML = "";
|
||||||
|
document.querySelector(".lds-ripple").classList.remove("u-hide");
|
||||||
|
document
|
||||||
|
.querySelector(".db--navItem.current")
|
||||||
|
.classList.remove("current");
|
||||||
|
const self = t.target;
|
||||||
|
self.classList.add("current");
|
||||||
|
this.paged = 1;
|
||||||
|
//this.status = "done";
|
||||||
|
this.finished = false;
|
||||||
|
this.subjects = [];
|
||||||
|
this._fetchData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_create() {
|
||||||
|
if (document.querySelector(".db--container")) {
|
||||||
|
if (document.querySelector(".db--navItem.current")) {
|
||||||
|
this.type = document.querySelector(
|
||||||
|
".db--navItem.current"
|
||||||
|
).dataset.type;
|
||||||
|
}
|
||||||
|
if (document.querySelector(".db--list").dataset.type)
|
||||||
|
this.type = document.querySelector(".db--list").dataset.type;
|
||||||
|
if (this.type == "movie") {
|
||||||
|
document
|
||||||
|
.querySelector(".db--genres")
|
||||||
|
.classList.remove("u-hide");
|
||||||
|
}
|
||||||
|
this._fetchGenres();
|
||||||
|
this._fetchData();
|
||||||
|
this._handleScroll();
|
||||||
|
this._handleNavClick();
|
||||||
|
this._statusChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new HALO_DOUBAN();
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574920521513" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7948" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" p-id="7949" fill="#f99b01"></path></svg>
|
||||||
|
After Width: | Height: | Size: 809 B |
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574920559231" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8164" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" p-id="8165" fill="#f99b01"></path></svg>
|
||||||
|
After Width: | Height: | Size: 927 B |
@@ -0,0 +1 @@
|
|||||||
|
:root{--db--text-color-light:rgba(0, 0, 0, 0.6)}.doulist-item{margin:30px 0;border:1px solid #eee;border-radius:4px}.doulist-item:hover{box-shadow:0 3px 12px rgba(0,0,0,.05)}.doulist-item .doulist-subject{display:flex;align-items:flex-start;line-height:1.6;padding:12px;position:relative}.doulist-item .doulist-subject .db--viewTime{position:absolute;right:0;top:0;background:#f5c518;color:#000;border-radius:4px 4px 0 4px;line-height:1;padding:3px 5px 3px 10px;font-size:12px;display:flex;margin-bottom:2px;font-weight:900}.doulist-item .doulist-subject .db--viewTime:after{content:"";border-top-left-radius:0;border-bottom-left-radius:0;left:0;top:0;margin-left:-.2rem;border-radius:0 4px 4px 4px;background:inherit;height:100%;position:absolute;width:.75rem;transform:skewX(20deg)}.doulist-item .doulist-subject .doulist-content{flex:1 1 auto}.doulist-item .doulist-subject .doulist-post{width:96px;margin-right:15px;display:flex;flex:0 0 auto}.doulist-item .doulist-subject .doulist-title{margin-bottom:5px;font-size:18px}.doulist-item .doulist-subject .doulist-title a{text-decoration:none!important}.doulist-item .doulist-subject .rating{margin:0 0 5px;font-size:14px;line-height:1;display:flex;align-items:center}.doulist-item .doulist-subject .rating .allstardark{position:relative;color:#f99b01;height:16px;width:80px;background-repeat:repeat;background-image:url(/plugins/plugin-douban/assets/static/img/star.svg);background-size:auto 100%;margin-right:5px}.doulist-item .doulist-subject .rating .allstarlight{position:absolute;left:0;color:#f99b01;height:16px;overflow:hidden;background-repeat:repeat;background-image:url(/plugins/plugin-douban/assets/static/img/star-fill.svg);background-size:auto 100%}.doulist-item .doulist-subject .abstract{font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.6;max-height:3.2em}.doulist-item .doulist-subject img{width:96px!important;height:96px!important;border-radius:4px;object-fit:cover}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" th:with="version = '1.2.2'">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title th:text="${title}"></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<link rel="stylesheet" id="wpd-css-css" th:href="@{/plugins/plugin-douban/assets/static/db.min.css?v={version}(version=${version})}" type="text/css"
|
||||||
|
media="screen">
|
||||||
|
<style>
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metabar--block {
|
||||||
|
pointer-events: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
height: 68px;
|
||||||
|
font-size: 14px;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layoutSingleColumn {
|
||||||
|
max-width: 720px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
width: 92%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layoutSingleColumn--wide {
|
||||||
|
max-width: 1180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-paddingTop50 {
|
||||||
|
padding-top: 50px
|
||||||
|
}
|
||||||
|
|
||||||
|
.db--title a {
|
||||||
|
color: rgb(0 0 0 / 80%);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header class="metabar metabar--bordered">
|
||||||
|
<div class="metabar--block" itemprop="publisher" itemscope="">
|
||||||
|
<h1 class="metabar--headline" itemprop="logo" itemscope="" th:text="${title}"></h1>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<main class="main">
|
||||||
|
<div class="layoutSingleColumn layoutSingleColumn--wide u-paddingTop50">
|
||||||
|
<section class="db--container">
|
||||||
|
<nav class="db--nav">
|
||||||
|
<div th:each="type : ${types}" class="db--navItem JiEun"
|
||||||
|
th:classappend="${type.key == 'movie' ? 'current' : ''}" th:data-type="${type.key}"
|
||||||
|
th:text="${type.key}"></div>
|
||||||
|
</nav>
|
||||||
|
<div class="db--genres"></div>
|
||||||
|
<div class="db--type">
|
||||||
|
<div class="db--typeItem" data-status="mark">想看</div>
|
||||||
|
<div class="db--typeItem" data-status="doing">在看</div>
|
||||||
|
<div class="db--typeItem is-active" data-status="done">看过</div>
|
||||||
|
</div>
|
||||||
|
<div class="db--list db--list__card" data-type="movie">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="block-more block-more__centered">
|
||||||
|
<div class="lds-ripple u-hide">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
<footer class="site--footer">
|
||||||
|
<script th:src="@{/plugins/plugin-douban/assets/static/db.min.js?v={version}(version=${version})}"></script>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = true
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
require("@rushstack/eslint-patch/modern-module-resolution");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: [
|
||||||
|
"plugin:vue/vue3-recommended",
|
||||||
|
"eslint:recommended",
|
||||||
|
"@vue/eslint-config-typescript/recommended",
|
||||||
|
"@vue/eslint-config-prettier",
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
"vue/setup-compiler-macros": true,
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
coverage
|
||||||
|
*.local
|
||||||
|
|
||||||
|
/cypress/videos/
|
||||||
|
/cypress/screenshots/
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare module "axios" {
|
||||||
|
export interface AxiosRequestConfig {
|
||||||
|
mute?: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "vue" {
|
||||||
|
interface ComponentCustomProperties {
|
||||||
|
$formkit: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"name": "@kunkunyu/plugin-douban",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite build --watch --mode=development",
|
||||||
|
"build": "vite build",
|
||||||
|
"preview": "vite preview --port 4173",
|
||||||
|
"test:unit": "vitest --environment jsdom",
|
||||||
|
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
||||||
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@halo-dev/components": "^2.20.0",
|
||||||
|
"@halo-dev/console-shared": "^2.20.0",
|
||||||
|
"canvas-confetti": "^1.9.3",
|
||||||
|
"vue": "^3.4.31",
|
||||||
|
"@tanstack/vue-query": "^4.26.1",
|
||||||
|
"@vueuse/router": "^10.6.0",
|
||||||
|
"dayjs": "^1.11.9",
|
||||||
|
"javascript-time-ago": "^2.5.9",
|
||||||
|
"@types/lodash.clonedeep": "^4.5.7",
|
||||||
|
"lodash.clonedeep": "^4.5.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@halo-dev/richtext-editor": "^2.20.0",
|
||||||
|
"@halo-dev/ui-plugin-bundler-kit": "^2.20.0",
|
||||||
|
"@iconify/json": "^2.2.224",
|
||||||
|
"@rushstack/eslint-patch": "^1.10.3",
|
||||||
|
"@tsconfig/node20": "^20.1.4",
|
||||||
|
"@types/canvas-confetti": "^1.6.4",
|
||||||
|
"@types/jsdom": "^21.1.7",
|
||||||
|
"@types/node": "^20.14.9",
|
||||||
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
|
"@vue/eslint-config-prettier": "^9.0.0",
|
||||||
|
"@vue/eslint-config-typescript": "^13.0.0",
|
||||||
|
"@vue/test-utils": "^2.4.6",
|
||||||
|
"@vue/tsconfig": "^0.5.1",
|
||||||
|
"eslint": "^8.57.0",
|
||||||
|
"eslint-plugin-vue": "^9.26.0",
|
||||||
|
"jsdom": "^24.1.0",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "^3.3.2",
|
||||||
|
"sass": "^1.77.6",
|
||||||
|
"typescript": "~5.5.3",
|
||||||
|
"unplugin-icons": "^0.19.0",
|
||||||
|
"vite": "^5.3.2",
|
||||||
|
"vitest": "^1.6.0",
|
||||||
|
"vue-tsc": "^2.0.24"
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+4245
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
|||||||
|
wwwroot/*.js
|
||||||
|
node_modules
|
||||||
|
typings
|
||||||
|
dist
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
.gitignore
|
||||||
|
.npmignore
|
||||||
|
.openapi-generator-ignore
|
||||||
|
api.ts
|
||||||
|
api/api-douban-moony-la-v1alpha1-douban-movie-api.ts
|
||||||
|
api/cron-douban-v1alpha1-api.ts
|
||||||
|
api/douban-movie-v1alpha1-api.ts
|
||||||
|
base.ts
|
||||||
|
common.ts
|
||||||
|
configuration.ts
|
||||||
|
git_push.sh
|
||||||
|
index.ts
|
||||||
|
models/add-operation.ts
|
||||||
|
models/copy-operation.ts
|
||||||
|
models/cron-douban-list.ts
|
||||||
|
models/cron-douban.ts
|
||||||
|
models/douban-movie-faves.ts
|
||||||
|
models/douban-movie-list.ts
|
||||||
|
models/douban-movie-spec.ts
|
||||||
|
models/douban-movie-vo.ts
|
||||||
|
models/douban-movie.ts
|
||||||
|
models/index.ts
|
||||||
|
models/json-patch-inner.ts
|
||||||
|
models/metadata.ts
|
||||||
|
models/move-operation.ts
|
||||||
|
models/remove-operation.ts
|
||||||
|
models/replace-operation.ts
|
||||||
|
models/spec.ts
|
||||||
|
models/status.ts
|
||||||
|
models/test-operation.ts
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
7.7.0
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export * from './api/api-douban-moony-la-v1alpha1-douban-movie-api';
|
||||||
|
export * from './api/cron-douban-v1alpha1-api';
|
||||||
|
export * from './api/douban-movie-v1alpha1-api';
|
||||||
|
|
||||||
@@ -0,0 +1,445 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import type { Configuration } from '../configuration';
|
||||||
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||||
|
import globalAxios from 'axios';
|
||||||
|
// Some imports not used depending on template conditions
|
||||||
|
// @ts-ignore
|
||||||
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
||||||
|
// @ts-ignore
|
||||||
|
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieList } from '../models';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieVo } from '../models';
|
||||||
|
/**
|
||||||
|
* ApiDoubanMoonyLaV1alpha1DoubanMovieApi - axios parameter creator
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const ApiDoubanMoonyLaV1alpha1DoubanMovieApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* getDoubanDetail.
|
||||||
|
* @param {string} [url] doubanmovie url to query
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getDoubanDetail: async (url?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/getDoubanDetail`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (url !== undefined) {
|
||||||
|
localVarQueryParameter['url'] = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List doubanMovie.
|
||||||
|
* @param {number} [page] Page number. Default is 0.
|
||||||
|
* @param {number} [size] Size number. Default is 0.
|
||||||
|
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!=true
|
||||||
|
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name==halo
|
||||||
|
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @param {string} [keyword] DoubanMovies filtered by keyword.
|
||||||
|
* @param {string} [status] DoubanMovies filtered by status.
|
||||||
|
* @param {string} [type] DoubanMovies filtered by type.
|
||||||
|
* @param {string} [dataType] DoubanMovies filtered by dataType.
|
||||||
|
* @param {Array<string>} [genre] DoubanMovies filtered by genre.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listDoubanMovie: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, keyword?: string, status?: string, type?: string, dataType?: string, genre?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/api.douban.moony.la/v1alpha1/doubanmovies`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (page !== undefined) {
|
||||||
|
localVarQueryParameter['page'] = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size !== undefined) {
|
||||||
|
localVarQueryParameter['size'] = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labelSelector) {
|
||||||
|
localVarQueryParameter['labelSelector'] = labelSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fieldSelector) {
|
||||||
|
localVarQueryParameter['fieldSelector'] = fieldSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sort) {
|
||||||
|
localVarQueryParameter['sort'] = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keyword !== undefined) {
|
||||||
|
localVarQueryParameter['keyword'] = keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status !== undefined) {
|
||||||
|
localVarQueryParameter['status'] = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type !== undefined) {
|
||||||
|
localVarQueryParameter['type'] = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataType !== undefined) {
|
||||||
|
localVarQueryParameter['dataType'] = dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (genre) {
|
||||||
|
localVarQueryParameter['genre'] = genre;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all douban genres.
|
||||||
|
* @param {string} [type] Genres type to query
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listGenres: async (type?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/genres`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (type !== undefined) {
|
||||||
|
localVarQueryParameter['type'] = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ApiDoubanMoonyLaV1alpha1DoubanMovieApi - functional programming interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const ApiDoubanMoonyLaV1alpha1DoubanMovieApiFp = function(configuration?: Configuration) {
|
||||||
|
const localVarAxiosParamCreator = ApiDoubanMoonyLaV1alpha1DoubanMovieApiAxiosParamCreator(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* getDoubanDetail.
|
||||||
|
* @param {string} [url] doubanmovie url to query
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async getDoubanDetail(url?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovieVo>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getDoubanDetail(url, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['ApiDoubanMoonyLaV1alpha1DoubanMovieApi.getDoubanDetail']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List doubanMovie.
|
||||||
|
* @param {number} [page] Page number. Default is 0.
|
||||||
|
* @param {number} [size] Size number. Default is 0.
|
||||||
|
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!=true
|
||||||
|
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name==halo
|
||||||
|
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @param {string} [keyword] DoubanMovies filtered by keyword.
|
||||||
|
* @param {string} [status] DoubanMovies filtered by status.
|
||||||
|
* @param {string} [type] DoubanMovies filtered by type.
|
||||||
|
* @param {string} [dataType] DoubanMovies filtered by dataType.
|
||||||
|
* @param {Array<string>} [genre] DoubanMovies filtered by genre.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async listDoubanMovie(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, keyword?: string, status?: string, type?: string, dataType?: string, genre?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovieList>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listDoubanMovie(page, size, labelSelector, fieldSelector, sort, keyword, status, type, dataType, genre, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['ApiDoubanMoonyLaV1alpha1DoubanMovieApi.listDoubanMovie']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all douban genres.
|
||||||
|
* @param {string} [type] Genres type to query
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async listGenres(type?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listGenres(type, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['ApiDoubanMoonyLaV1alpha1DoubanMovieApi.listGenres']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ApiDoubanMoonyLaV1alpha1DoubanMovieApi - factory interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const ApiDoubanMoonyLaV1alpha1DoubanMovieApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||||
|
const localVarFp = ApiDoubanMoonyLaV1alpha1DoubanMovieApiFp(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* getDoubanDetail.
|
||||||
|
* @param {ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetailRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getDoubanDetail(requestParameters: ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetailRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovieVo> {
|
||||||
|
return localVarFp.getDoubanDetail(requestParameters.url, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List doubanMovie.
|
||||||
|
* @param {ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listDoubanMovie(requestParameters: ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovieRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovieList> {
|
||||||
|
return localVarFp.listDoubanMovie(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.keyword, requestParameters.status, requestParameters.type, requestParameters.dataType, requestParameters.genre, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List all douban genres.
|
||||||
|
* @param {ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenresRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listGenres(requestParameters: ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenresRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<string> {
|
||||||
|
return localVarFp.listGenres(requestParameters.type, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for getDoubanDetail operation in ApiDoubanMoonyLaV1alpha1DoubanMovieApi.
|
||||||
|
* @export
|
||||||
|
* @interface ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetailRequest
|
||||||
|
*/
|
||||||
|
export interface ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetailRequest {
|
||||||
|
/**
|
||||||
|
* doubanmovie url to query
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetail
|
||||||
|
*/
|
||||||
|
readonly url?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for listDoubanMovie operation in ApiDoubanMoonyLaV1alpha1DoubanMovieApi.
|
||||||
|
* @export
|
||||||
|
* @interface ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovieRequest
|
||||||
|
*/
|
||||||
|
export interface ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovieRequest {
|
||||||
|
/**
|
||||||
|
* Page number. Default is 0.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly page?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size number. Default is 0.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly size?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Label selector. e.g.: hidden!=true
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly labelSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field selector. e.g.: metadata.name==halo
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly fieldSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly sort?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovies filtered by keyword.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly keyword?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovies filtered by status.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly status?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovies filtered by type.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly type?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovies filtered by dataType.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly dataType?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovies filtered by genre.
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly genre?: Array<string>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for listGenres operation in ApiDoubanMoonyLaV1alpha1DoubanMovieApi.
|
||||||
|
* @export
|
||||||
|
* @interface ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenresRequest
|
||||||
|
*/
|
||||||
|
export interface ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenresRequest {
|
||||||
|
/**
|
||||||
|
* Genres type to query
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenres
|
||||||
|
*/
|
||||||
|
readonly type?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ApiDoubanMoonyLaV1alpha1DoubanMovieApi - object-oriented interface
|
||||||
|
* @export
|
||||||
|
* @class ApiDoubanMoonyLaV1alpha1DoubanMovieApi
|
||||||
|
* @extends {BaseAPI}
|
||||||
|
*/
|
||||||
|
export class ApiDoubanMoonyLaV1alpha1DoubanMovieApi extends BaseAPI {
|
||||||
|
/**
|
||||||
|
* getDoubanDetail.
|
||||||
|
* @param {ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetailRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApi
|
||||||
|
*/
|
||||||
|
public getDoubanDetail(requestParameters: ApiDoubanMoonyLaV1alpha1DoubanMovieApiGetDoubanDetailRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return ApiDoubanMoonyLaV1alpha1DoubanMovieApiFp(this.configuration).getDoubanDetail(requestParameters.url, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List doubanMovie.
|
||||||
|
* @param {ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApi
|
||||||
|
*/
|
||||||
|
public listDoubanMovie(requestParameters: ApiDoubanMoonyLaV1alpha1DoubanMovieApiListDoubanMovieRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return ApiDoubanMoonyLaV1alpha1DoubanMovieApiFp(this.configuration).listDoubanMovie(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, requestParameters.keyword, requestParameters.status, requestParameters.type, requestParameters.dataType, requestParameters.genre, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List all douban genres.
|
||||||
|
* @param {ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenresRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof ApiDoubanMoonyLaV1alpha1DoubanMovieApi
|
||||||
|
*/
|
||||||
|
public listGenres(requestParameters: ApiDoubanMoonyLaV1alpha1DoubanMovieApiListGenresRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return ApiDoubanMoonyLaV1alpha1DoubanMovieApiFp(this.configuration).listGenres(requestParameters.type, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,665 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import type { Configuration } from '../configuration';
|
||||||
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||||
|
import globalAxios from 'axios';
|
||||||
|
// Some imports not used depending on template conditions
|
||||||
|
// @ts-ignore
|
||||||
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
||||||
|
// @ts-ignore
|
||||||
|
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { CronDouban } from '../models';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { CronDoubanList } from '../models';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { JsonPatchInner } from '../models';
|
||||||
|
/**
|
||||||
|
* CronDoubanV1alpha1Api - axios parameter creator
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CronDoubanV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Create CronDouban
|
||||||
|
* @param {CronDouban} [cronDouban] Fresh crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
createCronDouban: async (cronDouban?: CronDouban, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/crondoubans`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(cronDouban, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Delete CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
deleteCronDouban: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('deleteCronDouban', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/crondoubans/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getCronDouban: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('getCronDouban', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/crondoubans/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List CronDouban
|
||||||
|
* @param {number} [page] Page number. Default is 0.
|
||||||
|
* @param {number} [size] Size number. Default is 0.
|
||||||
|
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!=true
|
||||||
|
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name==halo
|
||||||
|
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listCronDouban: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/crondoubans`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (page !== undefined) {
|
||||||
|
localVarQueryParameter['page'] = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size !== undefined) {
|
||||||
|
localVarQueryParameter['size'] = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labelSelector) {
|
||||||
|
localVarQueryParameter['labelSelector'] = labelSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fieldSelector) {
|
||||||
|
localVarQueryParameter['fieldSelector'] = fieldSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sort) {
|
||||||
|
localVarQueryParameter['sort'] = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Patch CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {Array<JsonPatchInner>} [jsonPatchInner]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
patchCronDouban: async (name: string, jsonPatchInner?: Array<JsonPatchInner>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('patchCronDouban', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/crondoubans/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {CronDouban} [cronDouban] Updated crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
updateCronDouban: async (name: string, cronDouban?: CronDouban, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('updateCronDouban', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/crondoubans/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(cronDouban, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CronDoubanV1alpha1Api - functional programming interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CronDoubanV1alpha1ApiFp = function(configuration?: Configuration) {
|
||||||
|
const localVarAxiosParamCreator = CronDoubanV1alpha1ApiAxiosParamCreator(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Create CronDouban
|
||||||
|
* @param {CronDouban} [cronDouban] Fresh crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async createCronDouban(cronDouban?: CronDouban, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronDouban>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createCronDouban(cronDouban, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['CronDoubanV1alpha1Api.createCronDouban']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Delete CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async deleteCronDouban(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCronDouban(name, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['CronDoubanV1alpha1Api.deleteCronDouban']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async getCronDouban(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronDouban>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getCronDouban(name, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['CronDoubanV1alpha1Api.getCronDouban']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List CronDouban
|
||||||
|
* @param {number} [page] Page number. Default is 0.
|
||||||
|
* @param {number} [size] Size number. Default is 0.
|
||||||
|
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!=true
|
||||||
|
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name==halo
|
||||||
|
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async listCronDouban(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronDoubanList>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listCronDouban(page, size, labelSelector, fieldSelector, sort, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['CronDoubanV1alpha1Api.listCronDouban']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Patch CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {Array<JsonPatchInner>} [jsonPatchInner]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async patchCronDouban(name: string, jsonPatchInner?: Array<JsonPatchInner>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronDouban>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.patchCronDouban(name, jsonPatchInner, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['CronDoubanV1alpha1Api.patchCronDouban']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update CronDouban
|
||||||
|
* @param {string} name Name of crondouban
|
||||||
|
* @param {CronDouban} [cronDouban] Updated crondouban
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async updateCronDouban(name: string, cronDouban?: CronDouban, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CronDouban>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCronDouban(name, cronDouban, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['CronDoubanV1alpha1Api.updateCronDouban']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CronDoubanV1alpha1Api - factory interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CronDoubanV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||||
|
const localVarFp = CronDoubanV1alpha1ApiFp(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Create CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiCreateCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
createCronDouban(requestParameters: CronDoubanV1alpha1ApiCreateCronDoubanRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<CronDouban> {
|
||||||
|
return localVarFp.createCronDouban(requestParameters.cronDouban, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Delete CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiDeleteCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
deleteCronDouban(requestParameters: CronDoubanV1alpha1ApiDeleteCronDoubanRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||||
|
return localVarFp.deleteCronDouban(requestParameters.name, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiGetCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getCronDouban(requestParameters: CronDoubanV1alpha1ApiGetCronDoubanRequest, options?: RawAxiosRequestConfig): AxiosPromise<CronDouban> {
|
||||||
|
return localVarFp.getCronDouban(requestParameters.name, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiListCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listCronDouban(requestParameters: CronDoubanV1alpha1ApiListCronDoubanRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<CronDoubanList> {
|
||||||
|
return localVarFp.listCronDouban(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Patch CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiPatchCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
patchCronDouban(requestParameters: CronDoubanV1alpha1ApiPatchCronDoubanRequest, options?: RawAxiosRequestConfig): AxiosPromise<CronDouban> {
|
||||||
|
return localVarFp.patchCronDouban(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiUpdateCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
updateCronDouban(requestParameters: CronDoubanV1alpha1ApiUpdateCronDoubanRequest, options?: RawAxiosRequestConfig): AxiosPromise<CronDouban> {
|
||||||
|
return localVarFp.updateCronDouban(requestParameters.name, requestParameters.cronDouban, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for createCronDouban operation in CronDoubanV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanV1alpha1ApiCreateCronDoubanRequest
|
||||||
|
*/
|
||||||
|
export interface CronDoubanV1alpha1ApiCreateCronDoubanRequest {
|
||||||
|
/**
|
||||||
|
* Fresh crondouban
|
||||||
|
* @type {CronDouban}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiCreateCronDouban
|
||||||
|
*/
|
||||||
|
readonly cronDouban?: CronDouban
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for deleteCronDouban operation in CronDoubanV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanV1alpha1ApiDeleteCronDoubanRequest
|
||||||
|
*/
|
||||||
|
export interface CronDoubanV1alpha1ApiDeleteCronDoubanRequest {
|
||||||
|
/**
|
||||||
|
* Name of crondouban
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiDeleteCronDouban
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for getCronDouban operation in CronDoubanV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanV1alpha1ApiGetCronDoubanRequest
|
||||||
|
*/
|
||||||
|
export interface CronDoubanV1alpha1ApiGetCronDoubanRequest {
|
||||||
|
/**
|
||||||
|
* Name of crondouban
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiGetCronDouban
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for listCronDouban operation in CronDoubanV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanV1alpha1ApiListCronDoubanRequest
|
||||||
|
*/
|
||||||
|
export interface CronDoubanV1alpha1ApiListCronDoubanRequest {
|
||||||
|
/**
|
||||||
|
* Page number. Default is 0.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiListCronDouban
|
||||||
|
*/
|
||||||
|
readonly page?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size number. Default is 0.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiListCronDouban
|
||||||
|
*/
|
||||||
|
readonly size?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Label selector. e.g.: hidden!=true
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiListCronDouban
|
||||||
|
*/
|
||||||
|
readonly labelSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field selector. e.g.: metadata.name==halo
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiListCronDouban
|
||||||
|
*/
|
||||||
|
readonly fieldSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiListCronDouban
|
||||||
|
*/
|
||||||
|
readonly sort?: Array<string>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for patchCronDouban operation in CronDoubanV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanV1alpha1ApiPatchCronDoubanRequest
|
||||||
|
*/
|
||||||
|
export interface CronDoubanV1alpha1ApiPatchCronDoubanRequest {
|
||||||
|
/**
|
||||||
|
* Name of crondouban
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiPatchCronDouban
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<JsonPatchInner>}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiPatchCronDouban
|
||||||
|
*/
|
||||||
|
readonly jsonPatchInner?: Array<JsonPatchInner>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for updateCronDouban operation in CronDoubanV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanV1alpha1ApiUpdateCronDoubanRequest
|
||||||
|
*/
|
||||||
|
export interface CronDoubanV1alpha1ApiUpdateCronDoubanRequest {
|
||||||
|
/**
|
||||||
|
* Name of crondouban
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiUpdateCronDouban
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updated crondouban
|
||||||
|
* @type {CronDouban}
|
||||||
|
* @memberof CronDoubanV1alpha1ApiUpdateCronDouban
|
||||||
|
*/
|
||||||
|
readonly cronDouban?: CronDouban
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CronDoubanV1alpha1Api - object-oriented interface
|
||||||
|
* @export
|
||||||
|
* @class CronDoubanV1alpha1Api
|
||||||
|
* @extends {BaseAPI}
|
||||||
|
*/
|
||||||
|
export class CronDoubanV1alpha1Api extends BaseAPI {
|
||||||
|
/**
|
||||||
|
* Create CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiCreateCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof CronDoubanV1alpha1Api
|
||||||
|
*/
|
||||||
|
public createCronDouban(requestParameters: CronDoubanV1alpha1ApiCreateCronDoubanRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return CronDoubanV1alpha1ApiFp(this.configuration).createCronDouban(requestParameters.cronDouban, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiDeleteCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof CronDoubanV1alpha1Api
|
||||||
|
*/
|
||||||
|
public deleteCronDouban(requestParameters: CronDoubanV1alpha1ApiDeleteCronDoubanRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return CronDoubanV1alpha1ApiFp(this.configuration).deleteCronDouban(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiGetCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof CronDoubanV1alpha1Api
|
||||||
|
*/
|
||||||
|
public getCronDouban(requestParameters: CronDoubanV1alpha1ApiGetCronDoubanRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return CronDoubanV1alpha1ApiFp(this.configuration).getCronDouban(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiListCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof CronDoubanV1alpha1Api
|
||||||
|
*/
|
||||||
|
public listCronDouban(requestParameters: CronDoubanV1alpha1ApiListCronDoubanRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return CronDoubanV1alpha1ApiFp(this.configuration).listCronDouban(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiPatchCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof CronDoubanV1alpha1Api
|
||||||
|
*/
|
||||||
|
public patchCronDouban(requestParameters: CronDoubanV1alpha1ApiPatchCronDoubanRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return CronDoubanV1alpha1ApiFp(this.configuration).patchCronDouban(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update CronDouban
|
||||||
|
* @param {CronDoubanV1alpha1ApiUpdateCronDoubanRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof CronDoubanV1alpha1Api
|
||||||
|
*/
|
||||||
|
public updateCronDouban(requestParameters: CronDoubanV1alpha1ApiUpdateCronDoubanRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return CronDoubanV1alpha1ApiFp(this.configuration).updateCronDouban(requestParameters.name, requestParameters.cronDouban, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,665 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import type { Configuration } from '../configuration';
|
||||||
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||||
|
import globalAxios from 'axios';
|
||||||
|
// Some imports not used depending on template conditions
|
||||||
|
// @ts-ignore
|
||||||
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
||||||
|
// @ts-ignore
|
||||||
|
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovie } from '../models';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieList } from '../models';
|
||||||
|
// @ts-ignore
|
||||||
|
import type { JsonPatchInner } from '../models';
|
||||||
|
/**
|
||||||
|
* DoubanMovieV1alpha1Api - axios parameter creator
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const DoubanMovieV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Create DoubanMovie
|
||||||
|
* @param {DoubanMovie} [doubanMovie] Fresh doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
createDoubanMovie: async (doubanMovie?: DoubanMovie, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/doubanmovies`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(doubanMovie, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Delete DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
deleteDoubanMovie: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('deleteDoubanMovie', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/doubanmovies/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getDoubanMovie: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('getDoubanMovie', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/doubanmovies/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List DoubanMovie
|
||||||
|
* @param {number} [page] Page number. Default is 0.
|
||||||
|
* @param {number} [size] Size number. Default is 0.
|
||||||
|
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!=true
|
||||||
|
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name==halo
|
||||||
|
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listDoubanMovie1: async (page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/doubanmovies`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
if (page !== undefined) {
|
||||||
|
localVarQueryParameter['page'] = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size !== undefined) {
|
||||||
|
localVarQueryParameter['size'] = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labelSelector) {
|
||||||
|
localVarQueryParameter['labelSelector'] = labelSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fieldSelector) {
|
||||||
|
localVarQueryParameter['fieldSelector'] = fieldSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sort) {
|
||||||
|
localVarQueryParameter['sort'] = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Patch DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {Array<JsonPatchInner>} [jsonPatchInner]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
patchDoubanMovie: async (name: string, jsonPatchInner?: Array<JsonPatchInner>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('patchDoubanMovie', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/doubanmovies/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {DoubanMovie} [doubanMovie] Updated doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
updateDoubanMovie: async (name: string, doubanMovie?: DoubanMovie, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('updateDoubanMovie', 'name', name)
|
||||||
|
const localVarPath = `/apis/douban.moony.la/v1alpha1/doubanmovies/{name}`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication basicAuth required
|
||||||
|
// http basic authentication required
|
||||||
|
setBasicAuthToObject(localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
// authentication bearerAuth required
|
||||||
|
// http bearer authentication required
|
||||||
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
localVarRequestOptions.data = serializeDataIfNeeded(doubanMovie, localVarRequestOptions, configuration)
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovieV1alpha1Api - functional programming interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const DoubanMovieV1alpha1ApiFp = function(configuration?: Configuration) {
|
||||||
|
const localVarAxiosParamCreator = DoubanMovieV1alpha1ApiAxiosParamCreator(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Create DoubanMovie
|
||||||
|
* @param {DoubanMovie} [doubanMovie] Fresh doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async createDoubanMovie(doubanMovie?: DoubanMovie, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovie>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createDoubanMovie(doubanMovie, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['DoubanMovieV1alpha1Api.createDoubanMovie']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Delete DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async deleteDoubanMovie(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDoubanMovie(name, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['DoubanMovieV1alpha1Api.deleteDoubanMovie']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async getDoubanMovie(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovie>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getDoubanMovie(name, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['DoubanMovieV1alpha1Api.getDoubanMovie']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List DoubanMovie
|
||||||
|
* @param {number} [page] Page number. Default is 0.
|
||||||
|
* @param {number} [size] Size number. Default is 0.
|
||||||
|
* @param {Array<string>} [labelSelector] Label selector. e.g.: hidden!=true
|
||||||
|
* @param {Array<string>} [fieldSelector] Field selector. e.g.: metadata.name==halo
|
||||||
|
* @param {Array<string>} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async listDoubanMovie1(page?: number, size?: number, labelSelector?: Array<string>, fieldSelector?: Array<string>, sort?: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovieList>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listDoubanMovie1(page, size, labelSelector, fieldSelector, sort, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['DoubanMovieV1alpha1Api.listDoubanMovie1']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Patch DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {Array<JsonPatchInner>} [jsonPatchInner]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async patchDoubanMovie(name: string, jsonPatchInner?: Array<JsonPatchInner>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovie>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.patchDoubanMovie(name, jsonPatchInner, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['DoubanMovieV1alpha1Api.patchDoubanMovie']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update DoubanMovie
|
||||||
|
* @param {string} name Name of doubanmovie
|
||||||
|
* @param {DoubanMovie} [doubanMovie] Updated doubanmovie
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async updateDoubanMovie(name: string, doubanMovie?: DoubanMovie, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DoubanMovie>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.updateDoubanMovie(name, doubanMovie, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['DoubanMovieV1alpha1Api.updateDoubanMovie']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovieV1alpha1Api - factory interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const DoubanMovieV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||||
|
const localVarFp = DoubanMovieV1alpha1ApiFp(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Create DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiCreateDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
createDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiCreateDoubanMovieRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovie> {
|
||||||
|
return localVarFp.createDoubanMovie(requestParameters.doubanMovie, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Delete DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiDeleteDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
deleteDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiDeleteDoubanMovieRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||||
|
return localVarFp.deleteDoubanMovie(requestParameters.name, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Get DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiGetDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
getDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiGetDoubanMovieRequest, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovie> {
|
||||||
|
return localVarFp.getDoubanMovie(requestParameters.name, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* List DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiListDoubanMovie1Request} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
listDoubanMovie1(requestParameters: DoubanMovieV1alpha1ApiListDoubanMovie1Request = {}, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovieList> {
|
||||||
|
return localVarFp.listDoubanMovie1(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Patch DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiPatchDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
patchDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiPatchDoubanMovieRequest, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovie> {
|
||||||
|
return localVarFp.patchDoubanMovie(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Update DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiUpdateDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
updateDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiUpdateDoubanMovieRequest, options?: RawAxiosRequestConfig): AxiosPromise<DoubanMovie> {
|
||||||
|
return localVarFp.updateDoubanMovie(requestParameters.name, requestParameters.doubanMovie, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for createDoubanMovie operation in DoubanMovieV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieV1alpha1ApiCreateDoubanMovieRequest
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieV1alpha1ApiCreateDoubanMovieRequest {
|
||||||
|
/**
|
||||||
|
* Fresh doubanmovie
|
||||||
|
* @type {DoubanMovie}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiCreateDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly doubanMovie?: DoubanMovie
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for deleteDoubanMovie operation in DoubanMovieV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieV1alpha1ApiDeleteDoubanMovieRequest
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieV1alpha1ApiDeleteDoubanMovieRequest {
|
||||||
|
/**
|
||||||
|
* Name of doubanmovie
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiDeleteDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for getDoubanMovie operation in DoubanMovieV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieV1alpha1ApiGetDoubanMovieRequest
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieV1alpha1ApiGetDoubanMovieRequest {
|
||||||
|
/**
|
||||||
|
* Name of doubanmovie
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiGetDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for listDoubanMovie1 operation in DoubanMovieV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieV1alpha1ApiListDoubanMovie1Request
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieV1alpha1ApiListDoubanMovie1Request {
|
||||||
|
/**
|
||||||
|
* Page number. Default is 0.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiListDoubanMovie1
|
||||||
|
*/
|
||||||
|
readonly page?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size number. Default is 0.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiListDoubanMovie1
|
||||||
|
*/
|
||||||
|
readonly size?: number
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Label selector. e.g.: hidden!=true
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiListDoubanMovie1
|
||||||
|
*/
|
||||||
|
readonly labelSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field selector. e.g.: metadata.name==halo
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiListDoubanMovie1
|
||||||
|
*/
|
||||||
|
readonly fieldSelector?: Array<string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiListDoubanMovie1
|
||||||
|
*/
|
||||||
|
readonly sort?: Array<string>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for patchDoubanMovie operation in DoubanMovieV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieV1alpha1ApiPatchDoubanMovieRequest
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieV1alpha1ApiPatchDoubanMovieRequest {
|
||||||
|
/**
|
||||||
|
* Name of doubanmovie
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiPatchDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<JsonPatchInner>}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiPatchDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly jsonPatchInner?: Array<JsonPatchInner>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for updateDoubanMovie operation in DoubanMovieV1alpha1Api.
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieV1alpha1ApiUpdateDoubanMovieRequest
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieV1alpha1ApiUpdateDoubanMovieRequest {
|
||||||
|
/**
|
||||||
|
* Name of doubanmovie
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiUpdateDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updated doubanmovie
|
||||||
|
* @type {DoubanMovie}
|
||||||
|
* @memberof DoubanMovieV1alpha1ApiUpdateDoubanMovie
|
||||||
|
*/
|
||||||
|
readonly doubanMovie?: DoubanMovie
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DoubanMovieV1alpha1Api - object-oriented interface
|
||||||
|
* @export
|
||||||
|
* @class DoubanMovieV1alpha1Api
|
||||||
|
* @extends {BaseAPI}
|
||||||
|
*/
|
||||||
|
export class DoubanMovieV1alpha1Api extends BaseAPI {
|
||||||
|
/**
|
||||||
|
* Create DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiCreateDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof DoubanMovieV1alpha1Api
|
||||||
|
*/
|
||||||
|
public createDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiCreateDoubanMovieRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return DoubanMovieV1alpha1ApiFp(this.configuration).createDoubanMovie(requestParameters.doubanMovie, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiDeleteDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof DoubanMovieV1alpha1Api
|
||||||
|
*/
|
||||||
|
public deleteDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiDeleteDoubanMovieRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return DoubanMovieV1alpha1ApiFp(this.configuration).deleteDoubanMovie(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiGetDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof DoubanMovieV1alpha1Api
|
||||||
|
*/
|
||||||
|
public getDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiGetDoubanMovieRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return DoubanMovieV1alpha1ApiFp(this.configuration).getDoubanMovie(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiListDoubanMovie1Request} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof DoubanMovieV1alpha1Api
|
||||||
|
*/
|
||||||
|
public listDoubanMovie1(requestParameters: DoubanMovieV1alpha1ApiListDoubanMovie1Request = {}, options?: RawAxiosRequestConfig) {
|
||||||
|
return DoubanMovieV1alpha1ApiFp(this.configuration).listDoubanMovie1(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiPatchDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof DoubanMovieV1alpha1Api
|
||||||
|
*/
|
||||||
|
public patchDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiPatchDoubanMovieRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return DoubanMovieV1alpha1ApiFp(this.configuration).patchDoubanMovie(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update DoubanMovie
|
||||||
|
* @param {DoubanMovieV1alpha1ApiUpdateDoubanMovieRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof DoubanMovieV1alpha1Api
|
||||||
|
*/
|
||||||
|
public updateDoubanMovie(requestParameters: DoubanMovieV1alpha1ApiUpdateDoubanMovieRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return DoubanMovieV1alpha1ApiFp(this.configuration).updateDoubanMovie(requestParameters.name, requestParameters.doubanMovie, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import type { Configuration } from './configuration';
|
||||||
|
// Some imports not used depending on template conditions
|
||||||
|
// @ts-ignore
|
||||||
|
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||||
|
import globalAxios from 'axios';
|
||||||
|
|
||||||
|
export const BASE_PATH = "http://localhost:49992".replace(/\/+$/, "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const COLLECTION_FORMATS = {
|
||||||
|
csv: ",",
|
||||||
|
ssv: " ",
|
||||||
|
tsv: "\t",
|
||||||
|
pipes: "|",
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface RequestArgs
|
||||||
|
*/
|
||||||
|
export interface RequestArgs {
|
||||||
|
url: string;
|
||||||
|
options: RawAxiosRequestConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @class BaseAPI
|
||||||
|
*/
|
||||||
|
export class BaseAPI {
|
||||||
|
protected configuration: Configuration | undefined;
|
||||||
|
|
||||||
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
||||||
|
if (configuration) {
|
||||||
|
this.configuration = configuration;
|
||||||
|
this.basePath = configuration.basePath ?? basePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @class RequiredError
|
||||||
|
* @extends {Error}
|
||||||
|
*/
|
||||||
|
export class RequiredError extends Error {
|
||||||
|
constructor(public field: string, msg?: string) {
|
||||||
|
super(msg);
|
||||||
|
this.name = "RequiredError"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ServerMap {
|
||||||
|
[key: string]: {
|
||||||
|
url: string,
|
||||||
|
description: string,
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const operationServerMap: ServerMap = {
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import type { Configuration } from "./configuration";
|
||||||
|
import type { RequestArgs } from "./base";
|
||||||
|
import type { AxiosInstance, AxiosResponse } from 'axios';
|
||||||
|
import { RequiredError } from "./base";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const DUMMY_BASE_URL = 'https://example.com'
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
||||||
|
if (paramValue === null || paramValue === undefined) {
|
||||||
|
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
||||||
|
if (configuration && configuration.apiKey) {
|
||||||
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
||||||
|
? await configuration.apiKey(keyParamName)
|
||||||
|
: await configuration.apiKey;
|
||||||
|
object[keyParamName] = localVarApiKeyValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
||||||
|
if (configuration && (configuration.username || configuration.password)) {
|
||||||
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
||||||
|
if (configuration && configuration.accessToken) {
|
||||||
|
const accessToken = typeof configuration.accessToken === 'function'
|
||||||
|
? await configuration.accessToken()
|
||||||
|
: await configuration.accessToken;
|
||||||
|
object["Authorization"] = "Bearer " + accessToken;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
||||||
|
if (configuration && configuration.accessToken) {
|
||||||
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
||||||
|
? await configuration.accessToken(name, scopes)
|
||||||
|
: await configuration.accessToken;
|
||||||
|
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
||||||
|
if (parameter == null) return;
|
||||||
|
if (typeof parameter === "object") {
|
||||||
|
if (Array.isArray(parameter)) {
|
||||||
|
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object.keys(parameter).forEach(currentKey =>
|
||||||
|
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (urlSearchParams.has(key)) {
|
||||||
|
urlSearchParams.append(key, parameter);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
urlSearchParams.set(key, parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
||||||
|
const searchParams = new URLSearchParams(url.search);
|
||||||
|
setFlattenedQueryParams(searchParams, objects);
|
||||||
|
url.search = searchParams.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
||||||
|
const nonString = typeof value !== 'string';
|
||||||
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
||||||
|
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
||||||
|
: nonString;
|
||||||
|
return needsSerialization
|
||||||
|
? JSON.stringify(value !== undefined ? value : {})
|
||||||
|
: (value || "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const toPathString = function (url: URL) {
|
||||||
|
return url.pathname + url.search + url.hash
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
||||||
|
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
||||||
|
return axios.request<T, R>(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
export interface ConfigurationParameters {
|
||||||
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
||||||
|
username?: string;
|
||||||
|
password?: string;
|
||||||
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||||
|
basePath?: string;
|
||||||
|
serverIndex?: number;
|
||||||
|
baseOptions?: any;
|
||||||
|
formDataCtor?: new () => any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Configuration {
|
||||||
|
/**
|
||||||
|
* parameter for apiKey security
|
||||||
|
* @param name security name
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
||||||
|
/**
|
||||||
|
* parameter for basic security
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
username?: string;
|
||||||
|
/**
|
||||||
|
* parameter for basic security
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
password?: string;
|
||||||
|
/**
|
||||||
|
* parameter for oauth2 security
|
||||||
|
* @param name security name
|
||||||
|
* @param scopes oauth2 scope
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||||
|
/**
|
||||||
|
* override base path
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
basePath?: string;
|
||||||
|
/**
|
||||||
|
* override server index
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
serverIndex?: number;
|
||||||
|
/**
|
||||||
|
* base options for axios calls
|
||||||
|
*
|
||||||
|
* @type {any}
|
||||||
|
* @memberof Configuration
|
||||||
|
*/
|
||||||
|
baseOptions?: any;
|
||||||
|
/**
|
||||||
|
* The FormData constructor that will be used to create multipart form data
|
||||||
|
* requests. You can inject this here so that execution environments that
|
||||||
|
* do not support the FormData class can still run the generated client.
|
||||||
|
*
|
||||||
|
* @type {new () => FormData}
|
||||||
|
*/
|
||||||
|
formDataCtor?: new () => any;
|
||||||
|
|
||||||
|
constructor(param: ConfigurationParameters = {}) {
|
||||||
|
this.apiKey = param.apiKey;
|
||||||
|
this.username = param.username;
|
||||||
|
this.password = param.password;
|
||||||
|
this.accessToken = param.accessToken;
|
||||||
|
this.basePath = param.basePath;
|
||||||
|
this.serverIndex = param.serverIndex;
|
||||||
|
this.baseOptions = param.baseOptions;
|
||||||
|
this.formDataCtor = param.formDataCtor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given MIME is a JSON MIME.
|
||||||
|
* JSON MIME examples:
|
||||||
|
* application/json
|
||||||
|
* application/json; charset=UTF8
|
||||||
|
* APPLICATION/JSON
|
||||||
|
* application/vnd.company+json
|
||||||
|
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||||
|
* @return True if the given MIME is JSON, false otherwise.
|
||||||
|
*/
|
||||||
|
public isJsonMime(mime: string): boolean {
|
||||||
|
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
||||||
|
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
git_host=$4
|
||||||
|
|
||||||
|
if [ "$git_host" = "" ]; then
|
||||||
|
git_host="github.com"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id="GIT_USER_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="GIT_REPO_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="Minor update"
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=$(git remote)
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
|
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
export * from "./api";
|
||||||
|
export * from "./configuration";
|
||||||
|
export * from "./models";
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface AddOperation
|
||||||
|
*/
|
||||||
|
export interface AddOperation {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AddOperation
|
||||||
|
*/
|
||||||
|
'op': AddOperationOpEnum;
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AddOperation
|
||||||
|
*/
|
||||||
|
'path': string;
|
||||||
|
/**
|
||||||
|
* Value can be any JSON value
|
||||||
|
* @type {any}
|
||||||
|
* @memberof AddOperation
|
||||||
|
*/
|
||||||
|
'value': any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const AddOperationOpEnum = {
|
||||||
|
Add: 'add'
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type AddOperationOpEnum = typeof AddOperationOpEnum[keyof typeof AddOperationOpEnum];
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CopyOperation
|
||||||
|
*/
|
||||||
|
export interface CopyOperation {
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CopyOperation
|
||||||
|
*/
|
||||||
|
'from': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CopyOperation
|
||||||
|
*/
|
||||||
|
'op': CopyOperationOpEnum;
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CopyOperation
|
||||||
|
*/
|
||||||
|
'path': string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CopyOperationOpEnum = {
|
||||||
|
Copy: 'copy'
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type CopyOperationOpEnum = typeof CopyOperationOpEnum[keyof typeof CopyOperationOpEnum];
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { CronDouban } from './cron-douban';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CronDoubanList
|
||||||
|
*/
|
||||||
|
export interface CronDoubanList {
|
||||||
|
/**
|
||||||
|
* Indicates whether current page is the first page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'first': boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether current page has previous page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'hasNext': boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether current page has previous page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'hasPrevious': boolean;
|
||||||
|
/**
|
||||||
|
* A chunk of items.
|
||||||
|
* @type {Array<CronDouban>}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'items': Array<CronDouban>;
|
||||||
|
/**
|
||||||
|
* Indicates whether current page is the last page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'last': boolean;
|
||||||
|
/**
|
||||||
|
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'page': number;
|
||||||
|
/**
|
||||||
|
* Size of each page. If not set or equal to 0, it means no pagination.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'size': number;
|
||||||
|
/**
|
||||||
|
* Total elements.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'total': number;
|
||||||
|
/**
|
||||||
|
* Indicates total pages.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CronDoubanList
|
||||||
|
*/
|
||||||
|
'totalPages': number;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { Metadata } from './metadata';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { Spec } from './spec';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { Status } from './status';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CronDouban
|
||||||
|
*/
|
||||||
|
export interface CronDouban {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CronDouban
|
||||||
|
*/
|
||||||
|
'apiVersion': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CronDouban
|
||||||
|
*/
|
||||||
|
'kind': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Metadata}
|
||||||
|
* @memberof CronDouban
|
||||||
|
*/
|
||||||
|
'metadata': Metadata;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Spec}
|
||||||
|
* @memberof CronDouban
|
||||||
|
*/
|
||||||
|
'spec'?: Spec;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Status}
|
||||||
|
* @memberof CronDouban
|
||||||
|
*/
|
||||||
|
'status'?: Status;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieFaves
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieFaves {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieFaves
|
||||||
|
*/
|
||||||
|
'createTime'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieFaves
|
||||||
|
*/
|
||||||
|
'remark'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieFaves
|
||||||
|
*/
|
||||||
|
'score'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieFaves
|
||||||
|
*/
|
||||||
|
'status'?: string;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovie } from './douban-movie';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieList
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieList {
|
||||||
|
/**
|
||||||
|
* Indicates whether current page is the first page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'first': boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether current page has previous page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'hasNext': boolean;
|
||||||
|
/**
|
||||||
|
* Indicates whether current page has previous page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'hasPrevious': boolean;
|
||||||
|
/**
|
||||||
|
* A chunk of items.
|
||||||
|
* @type {Array<DoubanMovie>}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'items': Array<DoubanMovie>;
|
||||||
|
/**
|
||||||
|
* Indicates whether current page is the last page.
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'last': boolean;
|
||||||
|
/**
|
||||||
|
* Page number, starts from 1. If not set or equal to 0, it means no pagination.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'page': number;
|
||||||
|
/**
|
||||||
|
* Size of each page. If not set or equal to 0, it means no pagination.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'size': number;
|
||||||
|
/**
|
||||||
|
* Total elements.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'total': number;
|
||||||
|
/**
|
||||||
|
* Indicates total pages.
|
||||||
|
* @type {number}
|
||||||
|
* @memberof DoubanMovieList
|
||||||
|
*/
|
||||||
|
'totalPages': number;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieSpec {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'cardSubtitle'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'dataType'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'genres'?: Array<string>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'id'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'link'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'name'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'poster'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'pubdate'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'score'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'type'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovieSpec
|
||||||
|
*/
|
||||||
|
'year'?: string;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieFaves } from './douban-movie-faves';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieSpec } from './douban-movie-spec';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { Metadata } from './metadata';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovieVo
|
||||||
|
*/
|
||||||
|
export interface DoubanMovieVo {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {DoubanMovieFaves}
|
||||||
|
* @memberof DoubanMovieVo
|
||||||
|
*/
|
||||||
|
'faves'?: DoubanMovieFaves;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Metadata}
|
||||||
|
* @memberof DoubanMovieVo
|
||||||
|
*/
|
||||||
|
'metadata'?: Metadata;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {DoubanMovieSpec}
|
||||||
|
* @memberof DoubanMovieVo
|
||||||
|
*/
|
||||||
|
'spec'?: DoubanMovieSpec;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieFaves } from './douban-movie-faves';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { DoubanMovieSpec } from './douban-movie-spec';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { Metadata } from './metadata';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface DoubanMovie
|
||||||
|
*/
|
||||||
|
export interface DoubanMovie {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovie
|
||||||
|
*/
|
||||||
|
'apiVersion': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {DoubanMovieFaves}
|
||||||
|
* @memberof DoubanMovie
|
||||||
|
*/
|
||||||
|
'faves': DoubanMovieFaves;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DoubanMovie
|
||||||
|
*/
|
||||||
|
'kind': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Metadata}
|
||||||
|
* @memberof DoubanMovie
|
||||||
|
*/
|
||||||
|
'metadata': Metadata;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {DoubanMovieSpec}
|
||||||
|
* @memberof DoubanMovie
|
||||||
|
*/
|
||||||
|
'spec': DoubanMovieSpec;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
export * from './add-operation';
|
||||||
|
export * from './copy-operation';
|
||||||
|
export * from './cron-douban';
|
||||||
|
export * from './cron-douban-list';
|
||||||
|
export * from './douban-movie';
|
||||||
|
export * from './douban-movie-faves';
|
||||||
|
export * from './douban-movie-list';
|
||||||
|
export * from './douban-movie-spec';
|
||||||
|
export * from './douban-movie-vo';
|
||||||
|
export * from './json-patch-inner';
|
||||||
|
export * from './metadata';
|
||||||
|
export * from './move-operation';
|
||||||
|
export * from './remove-operation';
|
||||||
|
export * from './replace-operation';
|
||||||
|
export * from './spec';
|
||||||
|
export * from './status';
|
||||||
|
export * from './test-operation';
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { AddOperation } from './add-operation';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { CopyOperation } from './copy-operation';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { MoveOperation } from './move-operation';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { RemoveOperation } from './remove-operation';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { ReplaceOperation } from './replace-operation';
|
||||||
|
// May contain unused imports in some cases
|
||||||
|
// @ts-ignore
|
||||||
|
import type { TestOperation } from './test-operation';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type JsonPatchInner
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export type JsonPatchInner = AddOperation | CopyOperation | MoveOperation | RemoveOperation | ReplaceOperation | TestOperation;
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Metadata
|
||||||
|
*/
|
||||||
|
export interface Metadata {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: string; }}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'annotations'?: { [key: string]: string; };
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'creationTimestamp'?: string | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'deletionTimestamp'?: string | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'finalizers'?: Array<string> | null;
|
||||||
|
/**
|
||||||
|
* The name field will be generated automatically according to the given generateName field
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'generateName'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: string; }}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'labels'?: { [key: string]: string; };
|
||||||
|
/**
|
||||||
|
* Metadata name
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'name': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Metadata
|
||||||
|
*/
|
||||||
|
'version'?: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface MoveOperation
|
||||||
|
*/
|
||||||
|
export interface MoveOperation {
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MoveOperation
|
||||||
|
*/
|
||||||
|
'from': string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MoveOperation
|
||||||
|
*/
|
||||||
|
'op': MoveOperationOpEnum;
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MoveOperation
|
||||||
|
*/
|
||||||
|
'path': string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MoveOperationOpEnum = {
|
||||||
|
Move: 'move'
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type MoveOperationOpEnum = typeof MoveOperationOpEnum[keyof typeof MoveOperationOpEnum];
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface RemoveOperation
|
||||||
|
*/
|
||||||
|
export interface RemoveOperation {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RemoveOperation
|
||||||
|
*/
|
||||||
|
'op': RemoveOperationOpEnum;
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof RemoveOperation
|
||||||
|
*/
|
||||||
|
'path': string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RemoveOperationOpEnum = {
|
||||||
|
Remove: 'remove'
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type RemoveOperationOpEnum = typeof RemoveOperationOpEnum[keyof typeof RemoveOperationOpEnum];
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ReplaceOperation
|
||||||
|
*/
|
||||||
|
export interface ReplaceOperation {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ReplaceOperation
|
||||||
|
*/
|
||||||
|
'op': ReplaceOperationOpEnum;
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ReplaceOperation
|
||||||
|
*/
|
||||||
|
'path': string;
|
||||||
|
/**
|
||||||
|
* Value can be any JSON value
|
||||||
|
* @type {any}
|
||||||
|
* @memberof ReplaceOperation
|
||||||
|
*/
|
||||||
|
'value': any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ReplaceOperationOpEnum = {
|
||||||
|
Replace: 'replace'
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type ReplaceOperationOpEnum = typeof ReplaceOperationOpEnum[keyof typeof ReplaceOperationOpEnum];
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Spec
|
||||||
|
*/
|
||||||
|
export interface Spec {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Spec
|
||||||
|
*/
|
||||||
|
'cron'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof Spec
|
||||||
|
*/
|
||||||
|
'suspend'?: boolean;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Spec
|
||||||
|
*/
|
||||||
|
'timezone'?: string;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Status
|
||||||
|
*/
|
||||||
|
export interface Status {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Status
|
||||||
|
*/
|
||||||
|
'lastScheduledTimestamp'?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Status
|
||||||
|
*/
|
||||||
|
'nextSchedulingTimestamp'?: string;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Halo
|
||||||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 2.20.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface TestOperation
|
||||||
|
*/
|
||||||
|
export interface TestOperation {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof TestOperation
|
||||||
|
*/
|
||||||
|
'op': TestOperationOpEnum;
|
||||||
|
/**
|
||||||
|
* A JSON Pointer path pointing to the location to move/copy from.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof TestOperation
|
||||||
|
*/
|
||||||
|
'path': string;
|
||||||
|
/**
|
||||||
|
* Value can be any JSON value
|
||||||
|
* @type {any}
|
||||||
|
* @memberof TestOperation
|
||||||
|
*/
|
||||||
|
'value': any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const TestOperationOpEnum = {
|
||||||
|
Test: 'test'
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export type TestOperationOpEnum = typeof TestOperationOpEnum[keyof typeof TestOperationOpEnum];
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { axiosInstance } from "@halo-dev/api-client";
|
||||||
|
import { ApiDoubanMoonyLaV1alpha1DoubanMovieApi, DoubanMovieV1alpha1Api, CronDoubanV1alpha1Api } from "./generated";
|
||||||
|
|
||||||
|
const doubanCoreApiClient = {
|
||||||
|
doubanMovie: new DoubanMovieV1alpha1Api(undefined, "", axiosInstance),
|
||||||
|
cronDouban: new CronDoubanV1alpha1Api(undefined, "", axiosInstance),
|
||||||
|
};
|
||||||
|
|
||||||
|
const doubanApiClient = {
|
||||||
|
doubanMovie: new ApiDoubanMoonyLaV1alpha1DoubanMovieApi(undefined, "", axiosInstance),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export { doubanCoreApiClient, doubanApiClient };
|
||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 5.5 KiB |
@@ -0,0 +1,335 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { Toast, VButton, VModal, VSpace } from "@halo-dev/components";
|
||||||
|
import { ref, computed, nextTick, watch} from "vue";
|
||||||
|
import cloneDeep from "lodash.clonedeep";
|
||||||
|
import {doubanCoreApiClient} from "@/api";
|
||||||
|
import type { DoubanMovie } from "@/api/generated";
|
||||||
|
import {toDatetimeLocal, toISOString} from "@/utils/date";
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
doubanMovie?: DoubanMovie;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
visible: false,
|
||||||
|
doubanMovie: undefined,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(event: "update:visible", value: boolean): void;
|
||||||
|
(event: "close"): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const initialFormState: DoubanMovie = {
|
||||||
|
metadata: {
|
||||||
|
name: "",
|
||||||
|
generateName: "douban-movie-",
|
||||||
|
},
|
||||||
|
faves:{
|
||||||
|
remark :"",
|
||||||
|
createTime: undefined,
|
||||||
|
score: "",
|
||||||
|
status: "done"
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
name: "",
|
||||||
|
poster: "",
|
||||||
|
link: "",
|
||||||
|
id: "",
|
||||||
|
score: "",
|
||||||
|
year: "",
|
||||||
|
type: "",
|
||||||
|
pubdate: "",
|
||||||
|
cardSubtitle: "",
|
||||||
|
dataType: "halo",
|
||||||
|
genres: []
|
||||||
|
},
|
||||||
|
kind: "DoubanMovie",
|
||||||
|
apiVersion: "douban.moony.la/v1alpha1",
|
||||||
|
};
|
||||||
|
|
||||||
|
const formState = ref<DoubanMovie>(cloneDeep(initialFormState));
|
||||||
|
const saving = ref<boolean>(false);
|
||||||
|
const formVisible = ref(false);
|
||||||
|
const createTime = ref<string | undefined>(undefined);
|
||||||
|
|
||||||
|
|
||||||
|
const isUpdateMode = computed(() => {
|
||||||
|
return !!formState.value.metadata.creationTimestamp;
|
||||||
|
});
|
||||||
|
|
||||||
|
const modalTitle = computed(() => {
|
||||||
|
return isUpdateMode.value ? "编辑条目" : "新建条目";
|
||||||
|
});
|
||||||
|
|
||||||
|
const onVisibleChange = (visible: boolean) => {
|
||||||
|
emit("update:visible", visible);
|
||||||
|
if (!visible) {
|
||||||
|
emit("close");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResetForm = () => {
|
||||||
|
formState.value = cloneDeep(initialFormState);
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
formVisible.value = true;
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
formVisible.value = false;
|
||||||
|
handleResetForm();
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.doubanMovie,
|
||||||
|
(doubanMovie) => {
|
||||||
|
if (doubanMovie) {
|
||||||
|
formState.value = cloneDeep(doubanMovie);
|
||||||
|
createTime.value = toDatetimeLocal(formState.value.faves.createTime);
|
||||||
|
}else {
|
||||||
|
createTime.value = undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => createTime.value,
|
||||||
|
(value) => {
|
||||||
|
formState.value.faves.createTime = value ? toISOString(value) : undefined;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const annotationsFormRef = ref();
|
||||||
|
|
||||||
|
const handleSaveFriend = async () => {
|
||||||
|
annotationsFormRef.value?.handleSubmit();
|
||||||
|
await nextTick();
|
||||||
|
|
||||||
|
const { customAnnotations, annotations, customFormInvalid, specFormInvalid } =
|
||||||
|
annotationsFormRef.value || {};
|
||||||
|
if (customFormInvalid || specFormInvalid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
formState.value.metadata.annotations = {
|
||||||
|
...annotations,
|
||||||
|
...customAnnotations,
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
saving.value = true;
|
||||||
|
if (isUpdateMode.value) {
|
||||||
|
await doubanCoreApiClient.doubanMovie.updateDoubanMovie({
|
||||||
|
name: formState.value.metadata.name,
|
||||||
|
doubanMovie: formState.value
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await doubanCoreApiClient.doubanMovie.createDoubanMovie(
|
||||||
|
{
|
||||||
|
doubanMovie: formState.value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.success("保存成功");
|
||||||
|
|
||||||
|
onVisibleChange(false);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
} finally {
|
||||||
|
saving.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VModal
|
||||||
|
:title="modalTitle"
|
||||||
|
:visible="visible"
|
||||||
|
:width="650"
|
||||||
|
@update:visible="onVisibleChange"
|
||||||
|
>
|
||||||
|
<template #actions>
|
||||||
|
<slot name="append-actions" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<FormKit
|
||||||
|
v-if="formVisible"
|
||||||
|
id="doubanMovie-form"
|
||||||
|
name="doubanMovie-form"
|
||||||
|
type="form"
|
||||||
|
:config="{ validationVisibility: 'submit' }"
|
||||||
|
@submit="handleSaveFriend"
|
||||||
|
>
|
||||||
|
<div class="md:grid md:grid-cols-4 md:gap-6">
|
||||||
|
<div class="md:col-span-1">
|
||||||
|
<div class="sticky top-0">
|
||||||
|
<span class="text-base font-medium text-gray-900"> 常规 </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt-5 divide-y divide-gray-100 md:col-span-3 md:mt-0">
|
||||||
|
<td v-if="isUpdateMode">
|
||||||
|
<p><img :src="formState.spec.poster" width="100"></p>
|
||||||
|
<p>{{formState.spec.name}} <span class="db--titletag">{{formState.spec.dataType == 'db' ? '豆瓣' : formState.spec.dataType == 'tmdb' ? 'TMDB' : '手动添加'}}</span>
|
||||||
|
</p>
|
||||||
|
<p>{{formState.spec.cardSubtitle}}</p>
|
||||||
|
</td>
|
||||||
|
<FormKit
|
||||||
|
v-if="formState.spec.dataType=='halo'"
|
||||||
|
type="attachment"
|
||||||
|
v-model="formState.spec.poster"
|
||||||
|
name="poster"
|
||||||
|
validation="required"
|
||||||
|
label="封面"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
v-if="formState.spec.dataType=='halo'"
|
||||||
|
type="text"
|
||||||
|
v-model="formState.spec.name"
|
||||||
|
name="name"
|
||||||
|
validation="required"
|
||||||
|
label="标题"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
type="text"
|
||||||
|
v-model="formState.spec.link"
|
||||||
|
name="link"
|
||||||
|
validation="required"
|
||||||
|
label="链接"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
v-if="formState.spec.dataType=='halo'"
|
||||||
|
type="number"
|
||||||
|
v-model="formState.spec.score"
|
||||||
|
name="score"
|
||||||
|
validation="required"
|
||||||
|
label="评分"
|
||||||
|
max="10"
|
||||||
|
min="0"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
v-if="formState.spec.dataType=='halo'"
|
||||||
|
:options="[
|
||||||
|
{
|
||||||
|
label: '电影',
|
||||||
|
value: 'movie',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '图书',
|
||||||
|
value: 'book',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '音乐',
|
||||||
|
value: 'music',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '游戏',
|
||||||
|
value: 'game',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '舞台剧',
|
||||||
|
value: 'drama',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
label="类型"
|
||||||
|
v-model="formState.spec.type"
|
||||||
|
name="type"
|
||||||
|
type="select"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
v-if="formState.spec.dataType=='halo'"
|
||||||
|
type="textarea"
|
||||||
|
v-model="formState.spec.cardSubtitle"
|
||||||
|
name="cardSubtitle"
|
||||||
|
label="描述"
|
||||||
|
:rows="4"
|
||||||
|
validation="required|length:0,300"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
type="datetime-local"
|
||||||
|
min="0000-01-01T00:00"
|
||||||
|
max="9999-12-31T23:59"
|
||||||
|
v-model="createTime"
|
||||||
|
name="createTime"
|
||||||
|
validation="required"
|
||||||
|
label="观看时间"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
:options="[
|
||||||
|
{ label: '已看', value: 'done' },
|
||||||
|
{ label: '想看', value: 'mark' },
|
||||||
|
{ label: '在看', value: 'doing' },
|
||||||
|
]"
|
||||||
|
label="状态"
|
||||||
|
v-model="formState.faves.status"
|
||||||
|
name="status"
|
||||||
|
type="select"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
type="textarea"
|
||||||
|
v-model="formState.faves.remark"
|
||||||
|
name="remark"
|
||||||
|
label="我的短评"
|
||||||
|
:rows="4"
|
||||||
|
validation="length:0,300"
|
||||||
|
></FormKit>
|
||||||
|
<FormKit
|
||||||
|
type="number"
|
||||||
|
v-model="formState.faves.score"
|
||||||
|
name="score"
|
||||||
|
label="我的评分"
|
||||||
|
max="5"
|
||||||
|
min="0"
|
||||||
|
></FormKit>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</FormKit>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<VSpace>
|
||||||
|
<VButton
|
||||||
|
:loading="saving"
|
||||||
|
type="secondary"
|
||||||
|
@click="$formkit.submit('doubanMovie-form')"
|
||||||
|
>
|
||||||
|
提交
|
||||||
|
</VButton>
|
||||||
|
<VButton @click="onVisibleChange(false)">取消</VButton>
|
||||||
|
</VSpace>
|
||||||
|
</template>
|
||||||
|
</VModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
.db--titletag {
|
||||||
|
font-size: 13px;
|
||||||
|
display: inline-block;
|
||||||
|
color: #fff;
|
||||||
|
background-color: green;
|
||||||
|
border-radius: 2px;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 2px 3px;
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
divide-y td {
|
||||||
|
margin-bottom: 9px;
|
||||||
|
line-height: 1.3;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divide-y td p {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<template>
|
||||||
|
<div class="editor-block__actions-separator"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.editor-block__actions-separator {
|
||||||
|
@apply h-5 bg-slate-200 mx-1.5;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import type { Editor } from "@halo-dev/richtext-editor";
|
||||||
|
import { computed, type Component } from "vue";
|
||||||
|
import Douban from "./douban-edited";
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
editor: Editor;
|
||||||
|
isActive: ({ editor }: { editor: Editor }) => boolean;
|
||||||
|
visible?: ({ editor }: { editor: Editor }) => boolean;
|
||||||
|
icon?: Component;
|
||||||
|
title?: string;
|
||||||
|
action?: ({ editor }: { editor: Editor }) => void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const src = computed({
|
||||||
|
get: () => {
|
||||||
|
return props.editor.getAttributes(Douban.name)?.src;
|
||||||
|
},
|
||||||
|
set: (src: string) => {
|
||||||
|
props.editor
|
||||||
|
.chain()
|
||||||
|
.updateAttributes(Douban.name, { src: src })
|
||||||
|
.setNodeSelection(props.editor.state.selection.from)
|
||||||
|
.focus()
|
||||||
|
.run();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<input
|
||||||
|
v-model.lazy="src"
|
||||||
|
placeholder="输入链接,按回车确定"
|
||||||
|
class="bg-gray-50 rounded-md hover:bg-gray-100 block px-2 w-full py-1.5 text-sm text-gray-900 border border-gray-300 focus:ring-blue-500 focus:border-blue-500"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,267 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import type { PMNode } from "@halo-dev/richtext-editor";
|
||||||
|
import type { Editor, Node } from "@halo-dev/richtext-editor";
|
||||||
|
import { NodeViewWrapper } from "@halo-dev/richtext-editor";
|
||||||
|
import { computed, onMounted, ref } from "vue";
|
||||||
|
import {formatDatetime} from "@/utils/date";
|
||||||
|
import { VButton,VSpace,VDropdown} from "@halo-dev/components";
|
||||||
|
import {doubanApiClient} from "@/api";
|
||||||
|
import type { DoubanMovie } from "@/api/generated";
|
||||||
|
|
||||||
|
const selecteDoubanMovie = ref<DoubanMovie | undefined>();
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
editor: Editor;
|
||||||
|
node: PMNode;
|
||||||
|
selected: boolean;
|
||||||
|
extension: Node<any, any>;
|
||||||
|
getPos: () => number;
|
||||||
|
updateAttributes: (attributes: Record<string, any>) => void;
|
||||||
|
deleteNode: () => void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const src = computed({
|
||||||
|
get: () => {
|
||||||
|
return props.node?.attrs.src;
|
||||||
|
},
|
||||||
|
set: (src: string) => {
|
||||||
|
props.updateAttributes({ src: src });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleSetFocus() {
|
||||||
|
props.editor.commands.setNodeSelection(props.getPos());
|
||||||
|
}
|
||||||
|
|
||||||
|
const editorLinkObtain = ref();
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (!src.value) {
|
||||||
|
}else {
|
||||||
|
handleCheckAllChange();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleCheckAllChange = async () => {
|
||||||
|
const { data: data } = await doubanApiClient.doubanMovie.getDoubanDetail({
|
||||||
|
url: src.value
|
||||||
|
});
|
||||||
|
selecteDoubanMovie.value = data
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEnterSetExternalLink = () => {
|
||||||
|
if (!editorLinkObtain.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
props.updateAttributes({
|
||||||
|
src: editorLinkObtain.value,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResetInit = () => {
|
||||||
|
props.updateAttributes({src: ""});
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<node-view-wrapper as="div" class="inline-block-box inline-block">
|
||||||
|
<div
|
||||||
|
class="inline-block overflow-hidden transition-all text-center relative h-full w-full rounded-md"
|
||||||
|
:class="{
|
||||||
|
'rounded ring-2': selected,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<div v-if="!src || selecteDoubanMovie?.spec==undefined" class="relative">
|
||||||
|
<div class="flex h-64 w-full items-center justify-center" style="height: 180px;">
|
||||||
|
<div
|
||||||
|
class="flex h-full w-full cursor-pointer flex-col items-center justify-center border-2 border-dashed border-gray-300 bg-gray-50"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex flex-col items-center justify-center space-y-7 pb-6 pt-5 editor-link-obtain"
|
||||||
|
>
|
||||||
|
<VSpace>
|
||||||
|
<VDropdown>
|
||||||
|
<div class="flex h-14 w-14 items-center justify-center rounded-full bg-primary/20" style="margin: 0.8em 1.5em;">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" style="font-size: 1.6rem;">
|
||||||
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 20h16M5 4h14M8 8h8a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2m8 6l-2 6m-6-3l1 3">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<VButton>输入链接</VButton>
|
||||||
|
<template #popper>
|
||||||
|
<input
|
||||||
|
v-model="editorLinkObtain"
|
||||||
|
class="block w-full rounded-md border border-gray-300 bg-gray-50 px-2 py-1.5 text-sm text-gray-900 hover:bg-gray-100"
|
||||||
|
placeholder="输入链接,按回车确定"
|
||||||
|
@keydown.enter="handleEnterSetExternalLink"
|
||||||
|
@change="handleCheckAllChange"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VDropdown>
|
||||||
|
</VSpace>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="group relative">
|
||||||
|
<div class="doulist-item">
|
||||||
|
<div class="doulist-subject">
|
||||||
|
<div class="doulist-post"><img decoding="async" referrerpolicy="no-referrer"
|
||||||
|
:src="selecteDoubanMovie?.spec.poster" class="fade-before fade-after"></div>
|
||||||
|
<div class="db--viewTime JiEun">Marked {{formatDatetime(selecteDoubanMovie?.faves.createTime)}}</div>
|
||||||
|
<div class="doulist-content">
|
||||||
|
<div class="doulist-title"><a :href="selecteDoubanMovie?.spec.link" class="cute" target="_blank"
|
||||||
|
rel="external nofollow">{{selecteDoubanMovie?.spec.name}}</a></div>
|
||||||
|
<div class="rating"><span class="allstardark"><span class="allstarlight" :style="'width:'+selecteDoubanMovie?.spec.score * 10+'%'"></span></span><span
|
||||||
|
class="rating_nums"> {{selecteDoubanMovie?.spec.score}} </span></div>
|
||||||
|
<div class="abstract">
|
||||||
|
{{selecteDoubanMovie?.faves.remark !=null && selecteDoubanMovie?.faves.remark !='' ? selecteDoubanMovie?.faves.remark : selecteDoubanMovie?.spec.cardSubtitle}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="src"
|
||||||
|
class="absolute left-0 top-0 hidden h-1/4 w-full cursor-pointer justify-end bg-gradient-to-b from-gray-300 to-transparent p-2 ease-in-out group-hover:flex"
|
||||||
|
>
|
||||||
|
<VButton size="sm" type="secondary" @click="handleResetInit">
|
||||||
|
替换
|
||||||
|
</VButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</node-view-wrapper>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--db--text-color-light: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.inline-block-box {
|
||||||
|
width: calc(100% - 1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item {
|
||||||
|
margin: 5px 0;
|
||||||
|
color: var(--db--text-color-light);
|
||||||
|
border: 1px solid #eee;
|
||||||
|
border-radius: 4px
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item:hover {
|
||||||
|
box-shadow: 0 3px 12px rgba(0,0,0,.05)
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
line-height: 1.6;
|
||||||
|
padding: 12px;
|
||||||
|
position: relative
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .db--viewTime {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
background: #f5c518;
|
||||||
|
color: #000;
|
||||||
|
border-radius: 4px 4px 0 4px;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 3px 5px 3px 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
font-weight: 900
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .db--viewTime:after {
|
||||||
|
content: "";
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
margin-left: -.2rem;
|
||||||
|
border-radius: 0 4px 4px 4px;
|
||||||
|
background: inherit;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
width: .75rem;
|
||||||
|
transform: skewX(20deg)
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .doulist-content {
|
||||||
|
flex: 1 1 auto
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .doulist-post {
|
||||||
|
width: 96px;
|
||||||
|
margin-right: 15px;
|
||||||
|
display: flex;
|
||||||
|
flex: 0 0 auto
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .doulist-title {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-size: 18px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .doulist-title a {
|
||||||
|
text-decoration: none!important
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .rating {
|
||||||
|
margin: 0 0 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .rating .allstardark {
|
||||||
|
position: relative;
|
||||||
|
color: #f99b01;
|
||||||
|
height: 16px;
|
||||||
|
width: 80px;
|
||||||
|
background-repeat: repeat;
|
||||||
|
background-image: url(/plugins/plugin-douban/assets/static/img/star.svg);
|
||||||
|
background-size: auto 100%;
|
||||||
|
margin-right: 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .rating .allstarlight {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
color: #f99b01;
|
||||||
|
height: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-repeat: repeat;
|
||||||
|
background-image: url(/plugins/plugin-douban/assets/static/img/star-fill.svg);
|
||||||
|
background-size: auto 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject .abstract {
|
||||||
|
font-size: 14px;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
line-height: 1.6;
|
||||||
|
max-height: 3.2em;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doulist-item .doulist-subject img {
|
||||||
|
width: 96px!important;
|
||||||
|
height: 96px!important;
|
||||||
|
border-radius: 4px;
|
||||||
|
object-fit: cover
|
||||||
|
}
|
||||||
|
.editor-link-obtain .v-popper--theme-dropdown {
|
||||||
|
margin-top: -10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
import {
|
||||||
|
type Editor,
|
||||||
|
isActive,
|
||||||
|
mergeAttributes,
|
||||||
|
Node,
|
||||||
|
nodeInputRule,
|
||||||
|
type Range,
|
||||||
|
VueNodeViewRenderer,
|
||||||
|
type EditorState,
|
||||||
|
} from "@halo-dev/richtext-editor";
|
||||||
|
import DoubanView from "./DoubanView.vue";
|
||||||
|
import { markRaw } from "vue";
|
||||||
|
import { ToolboxItem } from "@halo-dev/richtext-editor";
|
||||||
|
import MdiShare from "~icons/mdi/share";
|
||||||
|
import BlockActionSeparator from "./BlockActionSeparator.vue";
|
||||||
|
import MdiDeleteForeverOutline from "~icons/mdi/delete-forever-outline?color=red";
|
||||||
|
import TablerBrandDouban from '~icons/tabler/brand-douban';
|
||||||
|
import { deleteNode } from "../utils/delete-node";
|
||||||
|
declare module "@halo-dev/richtext-editor" {
|
||||||
|
interface Commands<ReturnType> {
|
||||||
|
douban: {
|
||||||
|
setDouban: (options: { src: string }) => ReturnType;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const Douban = Node.create({
|
||||||
|
name: "douban",
|
||||||
|
|
||||||
|
inline() {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
group() {
|
||||||
|
return "inline";
|
||||||
|
},
|
||||||
|
|
||||||
|
addAttributes() {
|
||||||
|
return {
|
||||||
|
...this.parent?.(),
|
||||||
|
src: {
|
||||||
|
default: null,
|
||||||
|
parseHTML: (element) => {
|
||||||
|
return element.getAttribute("src");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
parseHTML() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
tag: "douban",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
|
||||||
|
renderHTML({ HTMLAttributes }) {
|
||||||
|
return ["douban", mergeAttributes(HTMLAttributes)];
|
||||||
|
},
|
||||||
|
|
||||||
|
addCommands() {
|
||||||
|
return {
|
||||||
|
setDouban:
|
||||||
|
(options) =>
|
||||||
|
({ commands }) => {
|
||||||
|
return commands.insertContent({
|
||||||
|
type: this.name,
|
||||||
|
attrs: options,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
addInputRules() {
|
||||||
|
return [
|
||||||
|
nodeInputRule({
|
||||||
|
find: /^\$douban\$$/,
|
||||||
|
type: this.type,
|
||||||
|
getAttributes: () => {
|
||||||
|
return { width: "100%" };
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
|
||||||
|
addNodeView() {
|
||||||
|
return VueNodeViewRenderer(DoubanView);
|
||||||
|
},
|
||||||
|
|
||||||
|
addOptions() {
|
||||||
|
return {
|
||||||
|
getCommandMenuItems() {
|
||||||
|
return {
|
||||||
|
priority: 2e2,
|
||||||
|
icon: markRaw(TablerBrandDouban),
|
||||||
|
title: "豆瓣展示",
|
||||||
|
keywords: ["douban", "豆瓣展示"],
|
||||||
|
command: ({ editor, range }: { editor: Editor; range: Range }) => {
|
||||||
|
editor
|
||||||
|
.chain()
|
||||||
|
.focus()
|
||||||
|
.deleteRange(range)
|
||||||
|
.insertContent([
|
||||||
|
{ type: "douban", attrs: { src: "" } },
|
||||||
|
{ type: "paragraph", content: "" },
|
||||||
|
])
|
||||||
|
.run();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getToolboxItems({ editor }: { editor: Editor }) {
|
||||||
|
return {
|
||||||
|
priority: 59,
|
||||||
|
component: markRaw(ToolboxItem),
|
||||||
|
props: {
|
||||||
|
editor,
|
||||||
|
icon: markRaw(TablerBrandDouban),
|
||||||
|
title: "豆瓣展示",
|
||||||
|
action: () => {
|
||||||
|
editor
|
||||||
|
.chain()
|
||||||
|
.focus()
|
||||||
|
.insertContent([{ type: "douban", attrs: { src: "" } }])
|
||||||
|
.run();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getBubbleMenu({ editor }: { editor: Editor }) {
|
||||||
|
return {
|
||||||
|
pluginKey: "doubanBubbleMenu",
|
||||||
|
shouldShow: ({ state }: { state: EditorState }) => {
|
||||||
|
return isActive(state, Douban.name);
|
||||||
|
},
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
priority: 50,
|
||||||
|
props: {
|
||||||
|
icon: markRaw(MdiShare),
|
||||||
|
title: "打开链接",
|
||||||
|
action: () => {
|
||||||
|
window.open(editor.getAttributes(Douban.name).src, "_blank");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority: 60,
|
||||||
|
component: markRaw(BlockActionSeparator),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
priority: 70,
|
||||||
|
props: {
|
||||||
|
icon: markRaw(MdiDeleteForeverOutline),
|
||||||
|
title: "删除",
|
||||||
|
action: ({ editor }: { editor: Editor }) => {
|
||||||
|
deleteNode(Douban.name, editor);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getDraggable() {
|
||||||
|
return {
|
||||||
|
getRenderContainer({ dom }: { dom: HTMLElement }) {
|
||||||
|
let container = dom;
|
||||||
|
while (
|
||||||
|
container &&
|
||||||
|
!container.hasAttribute("data-node-view-wrapper")
|
||||||
|
) {
|
||||||
|
container = container.parentElement as HTMLElement;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
el: container,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
allowPropagationDownward: true,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
export default Douban;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default as DoubanExtension } from "./douban-edited";
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { definePlugin } from "@halo-dev/console-shared";
|
||||||
|
import Douban from "./views/Douban.vue";
|
||||||
|
import Cron from "./views/Cron.vue";
|
||||||
|
import TablerBrandDouban from '~icons/tabler/brand-douban';
|
||||||
|
import { markRaw } from "vue";
|
||||||
|
import { DoubanExtension } from "./editor";
|
||||||
|
|
||||||
|
export default definePlugin({
|
||||||
|
name: "plugin-douban",
|
||||||
|
components: {},
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
parentName: "Root",
|
||||||
|
route: {
|
||||||
|
path: "/douban",
|
||||||
|
name: "DoubanRoot",
|
||||||
|
meta: {
|
||||||
|
title: "豆瓣",
|
||||||
|
searchable: true,
|
||||||
|
permissions: ["plugin:douban:view"],
|
||||||
|
menu: {
|
||||||
|
name: "豆瓣",
|
||||||
|
group: "content",
|
||||||
|
icon: markRaw(TablerBrandDouban),
|
||||||
|
priority: 20,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "",
|
||||||
|
name: "Douban",
|
||||||
|
component: Douban,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "cron",
|
||||||
|
name: "DoubanCron",
|
||||||
|
component: Cron,
|
||||||
|
meta: {
|
||||||
|
title: "豆瓣任务",
|
||||||
|
searchable: true,
|
||||||
|
permissions: ["plugin:douban:view"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
extensionPoints: {
|
||||||
|
"default:editor:extension:create": () => {
|
||||||
|
return [DoubanExtension];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import dayjs from "dayjs";
|
||||||
|
import "dayjs/locale/zh-cn";
|
||||||
|
import timezone from "dayjs/plugin/timezone";
|
||||||
|
import TimeAgo from "javascript-time-ago";
|
||||||
|
import utc from "dayjs/plugin/utc";
|
||||||
|
import zh from "javascript-time-ago/locale/zh";
|
||||||
|
|
||||||
|
dayjs.extend(timezone);
|
||||||
|
dayjs.extend(utc);
|
||||||
|
dayjs.locale("zh-cn");
|
||||||
|
|
||||||
|
TimeAgo.addDefaultLocale(zh);
|
||||||
|
|
||||||
|
export function formatDatetime(date: string | Date | undefined | null): string {
|
||||||
|
if (!date) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return dayjs(date).format("YYYY-MM-DD HH:mm");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function timeAgo(
|
||||||
|
date: string | Date | number | undefined | null
|
||||||
|
): string {
|
||||||
|
if (!date) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentDate = new Date();
|
||||||
|
const inputDate = new Date(date);
|
||||||
|
|
||||||
|
// 365天 * 24小时 * 60分钟 * 60秒 * 1000毫秒
|
||||||
|
const oneYearInMilliseconds = 365 * 24 * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
if (currentDate.getTime() - inputDate.getTime() > oneYearInMilliseconds) {
|
||||||
|
return dayjs(date).format("YYYY-MM-DD");
|
||||||
|
}
|
||||||
|
|
||||||
|
const timeAgo = new TimeAgo("zh");
|
||||||
|
|
||||||
|
return timeAgo.format(new Date(date));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toDatetimeLocal(date: string | Date | undefined | null): string {
|
||||||
|
if (!date) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return dayjs(date).format("YYYY-MM-DDTHH:mm");
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toISOString(date: string | Date | undefined | null): string {
|
||||||
|
if (!date) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return dayjs(date).utc(false).toISOString();
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import type { Editor } from "@halo-dev/richtext-editor";
|
||||||
|
|
||||||
|
export const deleteNode = (nodeType: string, editor: Editor) => {
|
||||||
|
const { state } = editor;
|
||||||
|
const $pos = state.selection.$anchor;
|
||||||
|
let done = false;
|
||||||
|
|
||||||
|
if ($pos.depth) {
|
||||||
|
for (let d = $pos.depth; d > 0; d--) {
|
||||||
|
const node = $pos.node(d);
|
||||||
|
if (node.type.name === nodeType) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (editor.dispatchTransaction)
|
||||||
|
// @ts-ignore
|
||||||
|
editor.dispatchTransaction(
|
||||||
|
state.tr.delete($pos.before(d), $pos.after(d)).scrollIntoView()
|
||||||
|
);
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// @ts-ignore
|
||||||
|
const node = state.selection.node;
|
||||||
|
if (node && node.type.name === nodeType) {
|
||||||
|
editor.chain().deleteSelection().run();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!done) {
|
||||||
|
const pos = $pos.pos;
|
||||||
|
|
||||||
|
if (pos) {
|
||||||
|
const node = state.tr.doc.nodeAt(pos);
|
||||||
|
|
||||||
|
if (node && node.type.name === nodeType) {
|
||||||
|
// @ts-ignore
|
||||||
|
if (editor.dispatchTransaction)
|
||||||
|
// @ts-ignore
|
||||||
|
editor.dispatchTransaction(state.tr.delete(pos, pos + node.nodeSize));
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return done;
|
||||||
|
};
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import {Toast, VButton, VCard, VPageHeader} from "@halo-dev/components";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import type { CronDouban } from "@/api/generated";
|
||||||
|
import cloneDeep from "lodash.clonedeep";
|
||||||
|
import {doubanCoreApiClient} from "@/api";
|
||||||
|
import {useMutation, useQuery} from "@tanstack/vue-query";
|
||||||
|
|
||||||
|
const Se = "cron-douban-default"
|
||||||
|
|
||||||
|
const initialFormState: CronDouban = {
|
||||||
|
metadata: {
|
||||||
|
name: Se,
|
||||||
|
creationTimestamp: ""
|
||||||
|
},
|
||||||
|
spec: {
|
||||||
|
cron: "@daily",
|
||||||
|
timezone:"Asia/Shanghai",
|
||||||
|
suspend: false,
|
||||||
|
},
|
||||||
|
kind: "CronDouban",
|
||||||
|
apiVersion: "douban.moony.la/v1alpha1",
|
||||||
|
};
|
||||||
|
|
||||||
|
const formState = ref<CronDouban>(cloneDeep(initialFormState));
|
||||||
|
|
||||||
|
const {isLoading: cronIsLoading, isFetching: cronIsFetching} = useQuery({
|
||||||
|
queryKey: ["cron-douban"],
|
||||||
|
queryFn: async () => {
|
||||||
|
const {data} = await doubanCoreApiClient.cronDouban.getCronDouban({
|
||||||
|
name: Se
|
||||||
|
},{
|
||||||
|
mute: true
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
onSuccess(data) {
|
||||||
|
formState.value = data
|
||||||
|
},
|
||||||
|
retry: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const { mutate:save, isLoading:saveIsLoading } = useMutation({
|
||||||
|
mutationKey: ["cron-douban-save"],
|
||||||
|
mutationFn: async () => {
|
||||||
|
if (formState.value.metadata.creationTimestamp) {
|
||||||
|
const { data: data } = await doubanCoreApiClient.cronDouban.getCronDouban({
|
||||||
|
name: Se
|
||||||
|
});
|
||||||
|
formState.value = {
|
||||||
|
...formState.value,
|
||||||
|
status: data.status,
|
||||||
|
metadata: data.metadata
|
||||||
|
};
|
||||||
|
return await doubanCoreApiClient.cronDouban.updateCronDouban({
|
||||||
|
name: Se,
|
||||||
|
cronDouban: formState.value
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
return await doubanCoreApiClient.cronDouban.createCronDouban({
|
||||||
|
cronDouban: formState.value
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSuccess(data) {
|
||||||
|
formState.value = data.data
|
||||||
|
Toast.success("保存成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const cronOptions = [{
|
||||||
|
label: "每月(每月 1 号 0 点)",
|
||||||
|
value: "@monthly"
|
||||||
|
}, {
|
||||||
|
label: "每周(每周第一天 的 0 点)",
|
||||||
|
value: "@weekly"
|
||||||
|
}, {
|
||||||
|
label: "每天(每天的 0 点)",
|
||||||
|
value: "@daily"
|
||||||
|
}, {
|
||||||
|
label: "每小时",
|
||||||
|
value: "@hourly"
|
||||||
|
}]
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VPageHeader title="豆瓣任务">
|
||||||
|
<template #actions>
|
||||||
|
<VSpace>
|
||||||
|
<VButton :route="{ name: 'Douban' }" size="sm">
|
||||||
|
返回
|
||||||
|
</VButton>
|
||||||
|
</VSpace>
|
||||||
|
</template>
|
||||||
|
</VPageHeader>
|
||||||
|
<div class="m-0 md:m-4">
|
||||||
|
<VCard :body-class="['!p-0']">
|
||||||
|
<Transition mode="out-in" name="fade">
|
||||||
|
<div class="bg-white p-4">
|
||||||
|
<div>
|
||||||
|
<FormKit
|
||||||
|
id="cron-setting"
|
||||||
|
v-model="formState.spec"
|
||||||
|
name="cron-setting"
|
||||||
|
:preserve="true"
|
||||||
|
type="form"
|
||||||
|
:disabled="cronIsFetching"
|
||||||
|
@submit="save"
|
||||||
|
>
|
||||||
|
<FormKit
|
||||||
|
type="checkbox"
|
||||||
|
name="suspend"
|
||||||
|
label="是否启用"
|
||||||
|
value="false"
|
||||||
|
/>
|
||||||
|
<FormKit
|
||||||
|
type="select"
|
||||||
|
name="cron"
|
||||||
|
label="定时表达式"
|
||||||
|
allow-create
|
||||||
|
searchable
|
||||||
|
validatio="required"
|
||||||
|
:options="cronOptions"
|
||||||
|
help="定时表达式规则请参考:https://docs.spring.io/spring-framework/reference/integration/scheduling.html#scheduling-cron-expression"
|
||||||
|
/>
|
||||||
|
<FormKit
|
||||||
|
type="select"
|
||||||
|
name="timezone"
|
||||||
|
label="时区"
|
||||||
|
:options="[
|
||||||
|
{
|
||||||
|
value: 'Asia/Shanghai',
|
||||||
|
label: 'Asia/Shanghai (GMT+08:00)'
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</FormKit>
|
||||||
|
</div>
|
||||||
|
<div v-permission="['plugin:douban:manage']" class="pt-5">
|
||||||
|
<div class="flex justify-start">
|
||||||
|
<VButton
|
||||||
|
:loading="saveIsLoading"
|
||||||
|
:cronIsLoading="cronIsLoading"
|
||||||
|
type="secondary"
|
||||||
|
@click="$formkit.submit('cron-setting')"
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</VButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
</VCard>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,501 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import {
|
||||||
|
VCard,
|
||||||
|
IconRefreshLine,
|
||||||
|
Dialog,
|
||||||
|
VButton,
|
||||||
|
VEmpty,
|
||||||
|
VLoading,
|
||||||
|
VPagination,
|
||||||
|
VPageHeader,
|
||||||
|
VDropdownItem,
|
||||||
|
Toast,
|
||||||
|
VSpace,
|
||||||
|
IconAddCircle,
|
||||||
|
IconCloseCircle} from "@halo-dev/components";
|
||||||
|
import {useQuery, useQueryClient} from "@tanstack/vue-query";
|
||||||
|
import {computed, ref, watch} from "vue";
|
||||||
|
import { axiosInstance } from "@halo-dev/api-client";
|
||||||
|
import {formatDatetime} from "@/utils/date";
|
||||||
|
|
||||||
|
import {useRouteQuery} from "@vueuse/router";
|
||||||
|
import DoubanMovieEditingModal from "../components/DoubanMovieEditingModal.vue";
|
||||||
|
import { doubanApiClient, doubanCoreApiClient } from "@/api";
|
||||||
|
import type { DoubanMovie } from "@/api/generated";
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
|
const selecteDoubanMovie = ref<DoubanMovie | undefined>();
|
||||||
|
const selecteDoubanMovies = ref<string[]>([]);
|
||||||
|
const checkedAll = ref(false);
|
||||||
|
const selectedSort = useRouteQuery<string | undefined>("sort");
|
||||||
|
const selectedStatus = useRouteQuery<string | undefined>("status");
|
||||||
|
const selectedDataType = useRouteQuery<string | undefined>("dataType");
|
||||||
|
const selectedType = useRouteQuery<string | undefined>("type");
|
||||||
|
|
||||||
|
|
||||||
|
const page = ref(1);
|
||||||
|
const size = ref(20);
|
||||||
|
const keyword = ref("");
|
||||||
|
const searchText = ref("");
|
||||||
|
const total = ref(0);
|
||||||
|
const editingModal = ref(false);
|
||||||
|
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => [
|
||||||
|
selectedSort.value,
|
||||||
|
selectedStatus.value,
|
||||||
|
selectedDataType.value,
|
||||||
|
selectedType.value,
|
||||||
|
keyword.value,
|
||||||
|
],
|
||||||
|
() => {
|
||||||
|
page.value = 1;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
function handleClearFilters() {
|
||||||
|
selectedSort.value = undefined;
|
||||||
|
selectedStatus.value = undefined;
|
||||||
|
selectedType.value = undefined;
|
||||||
|
selectedDataType.value = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasFilters = computed(() => {
|
||||||
|
return (
|
||||||
|
selectedSort.value ||
|
||||||
|
selectedStatus.value ||
|
||||||
|
selectedType.value ||
|
||||||
|
selectedDataType.value
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: doubanMovies,
|
||||||
|
isLoading,
|
||||||
|
isFetching,
|
||||||
|
refetch,
|
||||||
|
} = useQuery({
|
||||||
|
queryKey: ["doubanMovies", page, size,selectedSort,selectedDataType,selectedStatus,selectedType,keyword],
|
||||||
|
queryFn: async () => {
|
||||||
|
|
||||||
|
const { data } = await doubanApiClient.doubanMovie.listDoubanMovie(
|
||||||
|
{
|
||||||
|
page: page.value,
|
||||||
|
size: size.value,
|
||||||
|
sort: [selectedSort.value].filter(Boolean) as string[],
|
||||||
|
dataType: selectedDataType.value,
|
||||||
|
status: selectedStatus.value,
|
||||||
|
type : selectedType.value,
|
||||||
|
keyword: keyword?.value
|
||||||
|
}
|
||||||
|
);
|
||||||
|
total.value = data.total;
|
||||||
|
return data.items;
|
||||||
|
},
|
||||||
|
refetchInterval: (data) => {
|
||||||
|
const deletingFriend = data?.filter( (douban) => {
|
||||||
|
return douban.metadata.deletionTimestamp;
|
||||||
|
});
|
||||||
|
return deletingFriend?.length ? 500 : false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const handleCheckAllChange = (e: Event) => {
|
||||||
|
const { checked } = e.target as HTMLInputElement;
|
||||||
|
checkedAll.value = checked;
|
||||||
|
if (checkedAll.value) {
|
||||||
|
selecteDoubanMovies.value =
|
||||||
|
doubanMovies.value?.map((doubanMovie) => {
|
||||||
|
return doubanMovie.metadata.name;
|
||||||
|
}) || [];
|
||||||
|
} else {
|
||||||
|
selecteDoubanMovies.value.length = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteInBatch = () => {
|
||||||
|
Dialog.warning({
|
||||||
|
title: "是否确认删除所选的条目?",
|
||||||
|
description: "删除之后将无法恢复。",
|
||||||
|
confirmType: "danger",
|
||||||
|
onConfirm: async () => {
|
||||||
|
try {
|
||||||
|
const promises = selecteDoubanMovies.value.map((doubanMovie) => {
|
||||||
|
return doubanCoreApiClient.doubanMovie.deleteDoubanMovie(
|
||||||
|
{
|
||||||
|
name: doubanMovie
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
if (promises) {
|
||||||
|
await Promise.all(promises);
|
||||||
|
}
|
||||||
|
selecteDoubanMovies.value.length = 0;
|
||||||
|
checkedAll.value = false;
|
||||||
|
|
||||||
|
Toast.success("删除成功");
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
} finally {
|
||||||
|
await refetch();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
function handleReset() {
|
||||||
|
keyword.value = "";
|
||||||
|
searchText.value = "";
|
||||||
|
}
|
||||||
|
function onKeywordChange() {
|
||||||
|
keyword.value = searchText.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const synchronization = () => {
|
||||||
|
Dialog.warning({
|
||||||
|
title: "同步豆瓣数据",
|
||||||
|
description: "确定要同步豆瓣数据吗,此操作可能会持续较长时间。 ",
|
||||||
|
confirmType: "danger",
|
||||||
|
confirmText: "确定",
|
||||||
|
cancelText: "取消",
|
||||||
|
onConfirm: async () => {
|
||||||
|
try {
|
||||||
|
await axiosInstance.post("/apis/api.plugin.halo.run/v1alpha1/plugins/plugin-douban/douban/synchronizationDouban")
|
||||||
|
.then((res: any) => {
|
||||||
|
Toast.success("已请求同步豆瓣数据");
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error("", e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const getStatusText = (status: String) => {
|
||||||
|
if (status == 'done'){
|
||||||
|
return '已看';
|
||||||
|
}else if (status == 'mark'){
|
||||||
|
return '想看';
|
||||||
|
}else if (status == 'doing'){
|
||||||
|
return '在看';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function handleClear() {
|
||||||
|
Dialog.warning({
|
||||||
|
title: "清空记录",
|
||||||
|
description: "确定要清空所有推送记录吗?此操作不可恢复。",
|
||||||
|
async onConfirm() {
|
||||||
|
try {
|
||||||
|
await axiosInstance.delete("/apis/api.plugin.halo.run/v1alpha1/plugins/plugin-douban/douban/clear")
|
||||||
|
.then((res: any) => {
|
||||||
|
Toast.success("清空成功");
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error("", e);
|
||||||
|
}
|
||||||
|
refetch();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleOpenCreateModal = (doubanMovie: DoubanMovie) => {
|
||||||
|
selecteDoubanMovie.value = doubanMovie;
|
||||||
|
editingModal.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onEditingModalClose = async () => {
|
||||||
|
selecteDoubanMovie.value = undefined;
|
||||||
|
refetch();
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<DoubanMovieEditingModal
|
||||||
|
v-model:visible="editingModal"
|
||||||
|
:douban-movie="selecteDoubanMovie"
|
||||||
|
@close="onEditingModalClose"
|
||||||
|
>
|
||||||
|
</DoubanMovieEditingModal>
|
||||||
|
<VPageHeader title="豆瓣">
|
||||||
|
<template #actions>
|
||||||
|
<VSpace v-permission="['plugin:douban:manage']">
|
||||||
|
<VButton :route="{ name: 'DoubanCron' }" size="sm">
|
||||||
|
任务
|
||||||
|
</VButton>
|
||||||
|
<VButton
|
||||||
|
type="secondary"
|
||||||
|
@click="editingModal = true"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<IconAddCircle class="h-full w-full" />
|
||||||
|
</template>
|
||||||
|
新建
|
||||||
|
</VButton>
|
||||||
|
<VButton type="secondary" @click="synchronization">
|
||||||
|
同步数据
|
||||||
|
</VButton>
|
||||||
|
<VButton type="danger" @click="handleClear()"> 清空 </VButton>
|
||||||
|
</VSpace>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</VPageHeader>
|
||||||
|
<div class="m-0 md:m-4">
|
||||||
|
<VCard :body-class="['!p-0']">
|
||||||
|
<template #header>
|
||||||
|
<div class="block w-full bg-gray-50 px-4 py-3">
|
||||||
|
<div class="relative flex flex-col flex-wrap items-start gap-4 sm:flex-row sm:items-center" >
|
||||||
|
<div
|
||||||
|
v-permission="['plugin:douban:manage']"
|
||||||
|
class="hidden items-center sm:flex" >
|
||||||
|
<input
|
||||||
|
v-model="checkedAll"
|
||||||
|
type="checkbox"
|
||||||
|
@change="handleCheckAllChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex w-full flex-1 items-center sm:w-auto" >
|
||||||
|
<FormKit
|
||||||
|
v-if="!selecteDoubanMovies.length"
|
||||||
|
v-model="searchText"
|
||||||
|
placeholder="输入关键词搜索"
|
||||||
|
type="text"
|
||||||
|
outer-class="!moments-p-0 moments-mr-2"
|
||||||
|
@keyup.enter="onKeywordChange"
|
||||||
|
>
|
||||||
|
<template v-if="keyword" #suffix>
|
||||||
|
<div
|
||||||
|
class="group flex h-full cursor-pointer items-center bg-white px-2 transition-all hover:bg-gray-50"
|
||||||
|
@click="handleReset"
|
||||||
|
>
|
||||||
|
<IconCloseCircle
|
||||||
|
class="h-4 w-4 text-gray-500 group-hover:text-gray-700"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</FormKit>
|
||||||
|
<VSpace v-else v-permission="['plugin:douban:manage']">
|
||||||
|
<VButton type="danger" @click="handleDeleteInBatch">
|
||||||
|
删除
|
||||||
|
</VButton>
|
||||||
|
</VSpace>
|
||||||
|
</div>
|
||||||
|
<VSpace spacing="lg" class="flex-wrap">
|
||||||
|
<FilterCleanButton
|
||||||
|
v-if="hasFilters"
|
||||||
|
@click="handleClearFilters"
|
||||||
|
/>
|
||||||
|
<FilterDropdown
|
||||||
|
v-model="selectedDataType"
|
||||||
|
label="数据类型"
|
||||||
|
:items="[
|
||||||
|
{
|
||||||
|
label: '全部',
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '豆瓣',
|
||||||
|
value: 'db',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'TMDB',
|
||||||
|
value: 'tmdb',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '手动添加',
|
||||||
|
value: 'halo',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<FilterDropdown
|
||||||
|
v-model="selectedStatus"
|
||||||
|
label="状态"
|
||||||
|
:items="[
|
||||||
|
{
|
||||||
|
label: '全部',
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '已看',
|
||||||
|
value: 'done',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '想看',
|
||||||
|
value: 'mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '在看',
|
||||||
|
value: 'doing',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<FilterDropdown
|
||||||
|
v-model="selectedType"
|
||||||
|
label="类型"
|
||||||
|
:items="[
|
||||||
|
{
|
||||||
|
label: '全部',
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '电影',
|
||||||
|
value: 'movie',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '图书',
|
||||||
|
value: 'book',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '音乐',
|
||||||
|
value: 'music',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '游戏',
|
||||||
|
value: 'game',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '舞台剧',
|
||||||
|
value: 'drama',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<FilterDropdown
|
||||||
|
v-model="selectedSort"
|
||||||
|
label="排序"
|
||||||
|
:items="[
|
||||||
|
{
|
||||||
|
label: '默认',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '较近创建',
|
||||||
|
value: 'faves.createTime,desc',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '较早创建',
|
||||||
|
value: 'faves.createTime,asc',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<div
|
||||||
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
|
@click="refetch()"
|
||||||
|
>
|
||||||
|
<IconRefreshLine
|
||||||
|
v-tooltip="'刷新'"
|
||||||
|
:class="{ 'animate-spin text-gray-900': isFetching }"
|
||||||
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</VSpace>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<VLoading v-if="isLoading" />
|
||||||
|
|
||||||
|
<Transition v-else-if="!doubanMovies?.length" appear name="fade">
|
||||||
|
<VEmpty
|
||||||
|
message="暂无订阅文章记录"
|
||||||
|
title="暂无订阅文章记录"
|
||||||
|
>
|
||||||
|
<template #actions>
|
||||||
|
<VSpace>
|
||||||
|
<VButton @click="refetch()"> 刷新 </VButton>
|
||||||
|
</VSpace>
|
||||||
|
</template>
|
||||||
|
</VEmpty>
|
||||||
|
</Transition>
|
||||||
|
|
||||||
|
<Transition v-else appear name="fade">
|
||||||
|
<div class="w-full relative overflow-x-auto">
|
||||||
|
<table class="w-full text-sm text-left text-gray-500 widefat ">
|
||||||
|
<thead class="text-xs text-gray-700 uppercase bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th v-permission="['plugin:douban:manage']"
|
||||||
|
scope="col" class="px-4 py-3"><div class="w-max flex items-center"> </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">标题 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">封面 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">来源 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">评分 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">描述 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">时间 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">状态 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">我的短评 </div></th>
|
||||||
|
<th scope="col" class="px-4 py-3"><div class="w-max flex items-center">我的评分 </div></th>
|
||||||
|
<th v-permission="['plugin:douban:manage']"
|
||||||
|
scope="col" class="px-4 py-3"><div class="w-max flex items-center"> </div></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="doubanMovie in doubanMovies" class="border-b last:border-none hover:bg-gray-100">
|
||||||
|
<td class="px-4 py-4 " v-permission="['plugin:douban:manage']">
|
||||||
|
<input
|
||||||
|
v-model="selecteDoubanMovies"
|
||||||
|
:value="doubanMovie.metadata.name"
|
||||||
|
class="h-4 w-4 rounded border-gray-300 text-indigo-600"
|
||||||
|
name="post-checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-4">{{doubanMovie.spec.name}}</td>
|
||||||
|
<td class="px-4 py-4 poster">
|
||||||
|
<img :src="doubanMovie.spec.poster" referrerpolicy="no-referrer">
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-4 table-td">{{doubanMovie.spec.dataType == 'db' ? '豆瓣' : doubanMovie.spec.dataType == 'tmdb' ? 'TMDB' : '手动添加'}}</td>
|
||||||
|
<td class="px-4 py-4 table-td">{{doubanMovie.spec.score}}</td>
|
||||||
|
<td class="px-4 py-4">{{doubanMovie.spec.cardSubtitle}}</td>
|
||||||
|
<td class="px-4 py-4 table-td">{{formatDatetime(doubanMovie.faves.createTime)}}</td>
|
||||||
|
<td class="px-4 py-4 table-td">{{getStatusText(doubanMovie.faves.status)}}</td>
|
||||||
|
<td class="px-4 py-4">{{doubanMovie.faves.remark}}</td>
|
||||||
|
<td class="px-4 py-4">{{doubanMovie.faves.score}}</td>
|
||||||
|
<td class="px-4 py-4 table-td" v-permission="['plugin:douban:manage']">
|
||||||
|
<VDropdownItem @click="handleOpenCreateModal(doubanMovie)">
|
||||||
|
编辑
|
||||||
|
</VDropdownItem>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<VPagination
|
||||||
|
v-model:page="page"
|
||||||
|
v-model:size="size"
|
||||||
|
:total="total"
|
||||||
|
:size-options="[20, 30, 50, 100]"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VCard>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
.widefat * {
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
.widefat td {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widefat .poster{
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-td {
|
||||||
|
text-align: left !important;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "@vue/tsconfig/tsconfig.web.json",
|
||||||
|
"include": ["./env.d.ts", "./src/**/*", "./src/**/*.vue"],
|
||||||
|
"exclude": ["./src/**/__tests__/*"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
},
|
||||||
|
"types": ["unplugin-icons/types/vue"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "@vue/tsconfig/tsconfig.node.json",
|
||||||
|
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"types": ["node"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"files": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.config.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.app.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.vitest.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.app.json",
|
||||||
|
"exclude": [],
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"lib": [],
|
||||||
|
"types": ["node", "jsdom"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import { fileURLToPath, URL } from "url";
|
||||||
|
|
||||||
|
import { defineConfig } from "vite";
|
||||||
|
import Vue from "@vitejs/plugin-vue";
|
||||||
|
import Icons from "unplugin-icons/vite";
|
||||||
|
import { HaloUIPluginBundlerKit } from "@halo-dev/ui-plugin-bundler-kit";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
Vue(),
|
||||||
|
Icons({ compiler: "vue3" }),
|
||||||
|
HaloUIPluginBundlerKit(),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user