You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/config/routes.rb

1086 lines
29 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Rails.application.routes.draw do
require 'sidekiq/web'
require 'admin_constraint'
mount Sidekiq::Web => '/sidekiq', :constraints => AdminConstraint.new
get 'attachments/download/:id', to: 'attachments#show'
get 'attachments/download/:id/:filename', to: 'attachments#show'
get 'auth/qq/callback', to: 'oauth/qq#create'
get 'auth/failure', to: 'oauth/base#auth_failure'
resources :edu_settings
scope '/api' do
resources :composes do
resources :compose_projects, only: [:create, :destroy]
end
get 'home/index'
get 'home/search'
get 'search', to: 'searchs#index'
put 'commons/hidden', to: 'commons#hidden'
put 'commons/unhidden', to: 'commons#unhidden'
delete 'commons/delete', to: 'commons#delete'
resources :issues, except: [:index, :new,:create, :update, :edit, :destroy] do
resources :journals, only: [:index, :create, :destroy, :edit, :update]
resources :issue_times, only: [:create] do
collection do
post :end_work
end
end
resources :issue_depends, only: [:create, :destroy]
end
resources :project_categories, only: [:index, :show] do
get :group_list, on: :collection
end
resources :project_languages, only: [:index, :show]
resources :ignores, only: [:index, :show]
resources :licenses, only: [:index, :show]
resources :projects do
resources :pull_requests, except: [:destroy] do
member do
post :pr_merge
post :check_merge
end
collection do
post :check_can_merge
end
end
resources :version_releases, only: [:index,:new, :create, :edit, :update, :destroy]
resources :project_trends, only: [:index, :create]
resources :issues do
collection do
get :commit_issues
get :index_chosen
end
member do
post :copy
post :close_issue
post :lock_issue
end
end
resources :issue_tags, only: [:create, :edit, :update, :destroy, :index]
resources :versions do
member do
post :update_status
end
end
resources :watchers, only: [:index] do
collection do
post :follow
delete :unfollow
get :check_watch
end
end
resources :praise_tread, only: [:index] do
collection do
post :like
delete :unlike
get :check_like
end
end
resources :members, only: [:index, :create] do
collection do
delete :remove
put :change_role
end
end
resources :forks, only: [:create]
collection do
post :migrate
get :group_type_list
post :watch
end
member do
get :branches
post :watch
end
end
resources :accounts do
collection do
post :login
post :register
post :reset_password
get :logout
get :get_verification_code
get :valid_email_and_phone
post :remote_register
end
end
resources :users do
member do
get :homepage_info
end
resources :repositories do
end
collection do
post :following
post :unfollow
get :get_user_info
get :attachment_show
get :html_show
get :get_navigation_info
post :reply_message
get :search_user_projects
post :brief_introduction
post :attendance
get :system_update
get :me
get :list
resource :trial_apply, only: [:create]
resources :projects, module: :users, only: [] do
get :search, on: :collection
end
resources :tidings, only: [:index]
scope module: :users do
resource :interest, only: [:create]
resources :accounts, only: [:show, :update] do
resource :phone_bind, only: [:create]
resource :email_bind, only: [:create]
resource :password, only: [:update]
resource :avatar, only: [:update]
resource :auth_attachment, only: [:create]
resource :authentication_apply, only: [:create, :destroy]
resource :professional_auth_apply, only: [:create, :destroy]
resources :open_users, only: [:destroy]
end
end
end
end
get '/:login/:repo_identifier', to: 'repositories#show'
get '/:login/:repo_identifier/edit', to: 'repositories#edit'
resources :repositories, path: '/:login/:repo_identifier', only: [:index] do
collection do
get :entries
match :sub_entries, :via => [:get, :put]
get :commits
get :single_commit
post :files
get :tags
end
end
resources :contents, path: '/:login/:repo_identifier/contents', only: [:create] do
collection do
put 'files/update', :action => 'update_file'
delete 'files/delete', :action => 'delete_file'
end
end
resources :users_for_private_messages, only: [:index]
resources :myshixuns, param: :identifier, shallow: true do
member do
post :repository
post :commits
post :file_content
post :update_file
get :reset_my_game
post :html_content
get :open_webssh
get :challenges
post :sync_code
end
collection do
get :sigle_mul_test
match :training_task_status, :via => [:get, :post]
match :code_runinng_message, :via => [:get, :post]
end
resources :games
end
resources :games, path: :tasks, param: :identifier do
member do
get :star
get :git_entries
get :answer
get :answer_grade
get :rep_content
get :reset_original_code
get :reset_passed_code
post :file_update
post :choose_build
get :game_build
get :game_status
post :plus_or_cancel_praise
get :cost_time
get :system_update
get :sync_modify_time
get :picture_display
get :sync_codes
get :close_webssh
get :reset_vnc_link
get :get_answer_info
get :unlock_answer
get :check_test_sets
get :unlock_choose_answer
get :get_choose_answer
get :jupyter
end
collection do
get :challenges
end
end
resources :subject_lists
resources :shixun_lists
resources :shixuns, param: :identifier do
collection do
get :menus
get :get_recommend_shixuns
get :departments
get :get_mirror_script
post :apply_shixun_mirror
get :download_file
get :shixun_lists
post :batch_send_to_course
end
member do
post :copy
get :propaedeutics
get :show_right
get :operation
get :ranking_list
get :discusses
get :tasks
get :collaborators
get :settings
get :get_script_contents
get :get_custom_script
post :repository
post :secret_repository
post :set_secret_dir
post :commits
post :file_content
post :update_file
post :close
post :add_file
get :fork_list
post :update_propaedeutics
get :add_collaborators
post :shixun_members_added
match :change_manager, :via => [:get, :post]
get :search_user_courses
post :send_to_course
delete :collaborators_delete
get :cancel_publish
get :cancel_apply_public
get :publish
get :apply_public
get :shixun_exec
post :review_shixun
get :review_newest_record
post :update_permission_setting
post :update_learn_setting
get :get_data_sets
get :jupyter_exec
post :upload_data_sets
delete :destroy_data_sets
end
resources :challenges do
member do
get 'index_up'
get 'index_down'
post 'create_choose_question'
get 'show_choose_question'
match 'choose_type_show', :via => [:get, :post]
match 'edit_choose_question', :via => [:get, :post]
match 'update_choose_question', :via => [:get, :post]
delete 'destroy_challenge_choose'
post :crud_answer
get :answer
end
end
resources :repositories do
collection do
post :add_project
post :fork_project
post :file_tree # 目录树
post :update_file # 文件更新
post :file_content # 文件内容
post :commits # 提交记录
end
end
end
resources :discusses do
collection do
get :new_message
get :forum_discusses
end
member do
post :reply
post :hidden
post :reward_code
post :plus
end
end
resources :subjects, path: :paths do
member do
get 'choose_subject_shixun'
get 'publish'
get 'cancel_publish'
get 'cancel_has_publish'
get 'statistics'
get 'shixun_report'
get 'school_report'
post 'update_attr'
post :search_members
post 'add_subject_members'
delete 'delete_member'
get :choose_course
post 'send_to_course'
delete :delete_member
post :up_member_position
post :down_member_position
get :right_banner
post :appointment
post :update_team_title
end
collection do
get 'create_subject'
get 'new_subject'
post 'append_to_stage'
post :add_shixun_to_stage
get 'search'
end
end
resources :stages do
member do
get 'down_position'
get 'up_position'
end
end
resources :files, only: [:index, :show, :update] do
collection do
delete :bulk_delete
put :bulk_move
post :bulk_send
put :bulk_public
get :public_with_course_and_project
get :mine_with_course_and_project
post :import
post :upload
put :bulk_publish
end
member do
get :histories
end
end
resources :polls,except:[:index,:new,:create] do
member do
get :poll_setting
post :commit_setting
get :start_answer
post :commit_poll
get :commit_result
get :poll_lists # 问卷的答题列表
post :cancel_publish #撤销发布
get :cancel_publish_modal #撤销发布的弹窗
get :common_header
get :publish_groups
end
resources :poll_questions,only:[:new,:create]
end
resources :poll_questions,except:[:new,:create,:index] do
member do
post :delete_answer
post :up_down
post :commit_answer
end
resource :poll_votes,only:[:create,:destroy]
end
resources :exercises do
member do
get :choose_shixun
get :commit_shixun
get :exercise_setting
post :commit_setting
get :start_answer
post :commit_exercise
get :redo_modal #打回重做弹窗内容
post :redo_exercise
get :review_exercise
get :exercise_lists
# get :blank_exercise #摒弃仅作为测试html页面才会使用
get :export_exercise
get :common_header
get :exercise_result
post :cancel_exercise
get :begin_commit #提交前的弹窗
get :publish_groups
post :adjust_score
end
resources :exercise_questions,only:[:new,:create,:index]
end
resources :exercise_questions,except:[:new,:create,:index] do
member do
post :up_down
post :delete_answer
post :adjust_score
post :update_scores
end
resource :exercise_answers,only:[:create,:destroy]
end
resources :course_modules, shallow: true do
member do
get 'sticky_module'
get 'hidden_module'
post 'rename_module'
post 'add_second_category'
end
collection do
post 'unhidden_modules'
end
end
resources :course_second_categories, shallow: true do
member do
post 'rename_category'
post 'move_category'
end
collection do
end
end
resources :question_banks do
collection do
get :bank_list
post :save_banks
get :my_courses
post :send_to_course
delete :multi_delete
post :multi_public
end
end
resources :homework_banks do
member do
post :set_public
end
end
resources :gtopic_banks
resources :task_banks
resources :exercise_banks do
collection do
get :choose_shixun
end
member do
get :commit_shixun
end
end
resources :exercise_bank_questions do
member do
post :up_down
get :choose_shixun
end
end
resources :poll_bank_questions
resources :attachments do
collection do
delete :destroy_files
end
end
resources :schools do
member do
resources :departments, only: [] do
get :for_option, on: :collection
end
end
collection do
get :school_list
get :for_option
get :search
end
scope module: :ecs do
get :detail, to: 'homes#index'
resources :ec_majors, only: [:index]
resources :ec_major_schools, only: [:index, :create, :destroy]
end
end
resources :add_school_applies, only: [:create]
resources :add_department_applies, only: [:create]
# 为避免url过长以及层级过深路由定义和controller继承都做了处理
scope module: :ecs do
resources :ec_major_schools, only: [:show] do
resources :users, only: [:index]
resources :major_managers, only: [:create, :destroy]
resources :ec_years, only: [:index, :show, :create, :destroy]
end
resources :ec_years, only: [] do
resource :ec_training_objectives, only: [:show, :create]
resources :ec_graduation_requirements, only: [:index, :create, :update, :destroy]
resource :requirement_support_objectives, only: [:show, :create, :destroy]
resource :subitem_support_standards, only: [:show, :create, :destroy]
resource :students, only: [:show, :destroy] do
post :import, on: :collection
end
resources :ec_courses, only: [:index, :create, :destroy] do
post :link_course, on: :member
collection do
post :import
get :search
end
end
resource :graduation_course_supports, only: [:show, :create]
resource :reach_evaluation, only: [:show, :create]
resource :reach_criteria, only: [:create]
resources :graduation_subitems, only: [:index]
end
resources :ec_courses, only: [] do
resource :evaluation, only: [:show, :create]
resources :course_managers, only: [:create, :destroy]
resources :course_targets, only: [:index, :create] do
get :with_achievement_methods, on: :collection
resource :course_achievement_methods, only: [:create]
end
resources :course_evaluations, only: [:index, :create, :update, :destroy] do
member do
get :average_score_import_template
get :detail_score_import_template
get :import_student_achievement
end
get :slimmer, on: :collection
end
resource :score_levels, only: [:show, :create]
end
end
resource :zip, only: [] do
collection do
get :shixun_report
get :export_exercises
end
end
resources :repertoires, only: [:index]
scope module: :competitions do
resources :competitions, only: [:index, :show, :update] do
resources :competition_modules, only: [:index, :show, :update]
resource :competition_staff
resources :competition_teams, only: [:index, :show, :create, :update] do
post :join, on: :collection
post :leave, on: :member
get :course_detail, on: :member
get :shixun_detail, on: :member
end
resources :teachers, only: [:index]
resources :students, only: [:index]
member do
get :common_header
get :informs
post :update_inform
get :md_content
post :update_md_content
get :charts
get :export_extra_course_statistics
get :chart_rules
post :update_chart_rules
end
resource :prize_leader_account, only: [:update]
resource :prize, only: [:show]
resources :certificates, only: [] do
member do
get :personal
get :team
end
end
end
end
resources :project_package_categories, only: [:index]
resources :project_packages, only: [:index, :show, :create, :update, :destroy] do
resources :bidding_users, only: [:create] do
post :win, on: :collection
end
end
resources :libraries, only: [:index, :show, :create, :update, :destroy]
resources :library_tags, only: [:index]
scope module: :projects do
resources :project_applies, only: [:create]
end
post 'callbacks/aliyun_vod', to: 'callbacks/aliyun_vods#create'
namespace :wechats do
resource :js_sdk_signature, only: [:create]
end
resources :helps, only: [] do
collection do
get :about
get :contact
get :cooperatives
get :agreement
get :help_center
post :feedback
end
end
resource :template, only: [:show]
resource :setting, only: [:show]
get '/auth/qq/callback', to: 'oauth/qq#create'
get '/auth/wechat/callback', to: 'oauth/wechat#create'
resource :bind_user, only: [:create]
resources :hot_keywords, only: [:index]
namespace :weapps do
resource :home, only: [:show]
resource :session, only: [:create]
resource :register, only: [:create]
resource :verification_code, only: [:create]
resource :code_session, only: [:create]
resource :verify, only: [:create]
resource :check_account, only: [:create]
resources :searchs, only: [:index]
resources :course_stickies, only: [:create] do
post :cancel_sticky, on: :collection
end
resources :courses, only: [:create, :update, :edit, :show] do
member do
get :shixun_homework_category
get :teachers
delete :delete_course_teachers
post :change_member_roles
get :students
delete :delete_course_students
get :course_groups
end
end
resources :homework_commons do
post :update_settings, on: :member
end
end
resources :users_for_partners, only: [:index]
resources :trustie_hacks, path: :osshackathon do
collection do
get :edit_hackathon
post :update_hackathon
end
member do
post :entry
end
end
resources :colleges, only: [] do
member do
get :statistics
get :course_statistics
get :student_shixun
get :shixun_time
get :shixun_report_count
get :teachers
get :shixun_chart_data
get :student_hot_evaluations
end
end
end
namespace :admins do
get '/', to: 'dashboards#index'
resources :project_statistics, only: [:index] do
collection do
get :visits_static
end
end
resources :major_informations, only: [:index]
resources :ec_templates, only: [:index, :destroy] do
collection do
post :create_template
end
end
resources :graduation_standards, only: [:index, :destroy] do
collection do
post :create_standard
end
end
resources :auth_schools, only: [:index, :destroy] do
collection do
get :search_school
post :add_school
get :search_manager
post :add_manager
post :remove_manager
end
end
resources :dashboards, only: [:index] do
collection do
get :month_active_user
get :evaluate
end
end
resources :files, only: [:create]
resources :daily_school_statistics, only: [:index] do
get :export, on: :collection
end
resources :school_statistics, only: [:index] do
get :contrast, on: :collection
end
resources :users, only: [:index, :edit, :update, :destroy] do
member do
post :reward_grade
post :lock
post :unlock
post :active
post :reset_login_times
end
end
resource :import_users, only: [:create]
resource :import_course_members, only: [:create]
resources :user_statistics, only: [:index] do
get :export, on: :collection
end
resources :library_applies, only: [:index] do
member do
post :agree
post :refuse
end
end
resources :video_applies, only: [:index] do
member do
post :agree
post :refuse
end
end
resources :identity_authentications, only: [:index] do
member do
post :agree
post :refuse
post :revoke
end
collection do
post :batch_agree
end
end
resources :professional_authentications, only: [:index] do
member do
post :agree
post :refuse
post :revoke
end
collection do
post :batch_agree
end
end
resources :shixun_authorizations, only: [:index] do
member do
post :agree
post :refuse
end
end
resources :subject_authorizations, only: [:index] do
member do
post :agree
post :refuse
end
end
resources :project_package_applies, only: [:index] do
member do
post :agree
post :refuse
end
end
resources :shixuns, only: [:index,:destroy]
resources :shixun_settings, only: [:index,:update]
resources :shixun_feedback_messages, only: [:index]
resources :shixun_recycles, only: [:index, :destroy] do
post :resume, on: :member
end
resources :shixun_modify_records, only: [:index]
resources :department_applies,only: [:index,:destroy] do
collection do
post :merge
end
member do
post :agree
end
end
resources :unit_applies,only: [:index,:destroy,:edit,:update] do
member do
post :agree
end
end
resources :mirror_repositories, only: [:index, :new, :create, :edit, :update, :destroy] do
collection do
post :merge
get :for_select
end
resources :mirror_scripts, only: [:index, :new, :create, :edit, :update, :destroy]
end
resources :choose_mirror_repositories, only: [:new, :create]
resources :schools, only: [:index, :destroy]
resources :departments, only: [:index, :create, :edit, :update, :destroy] do
resource :department_member, only: [:create, :destroy]
post :merge, on: :collection
end
resources :myshixuns, only: [:index]
resource :about, only: [:edit, :update]
resource :agreement, only: [:edit, :update]
resource :help_center, only: [:edit, :update]
resource :contact_us, only: [:edit, :update] do
patch :update_address, on: :collection
end
resources :cooperatives, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
post :replace_image_url, on: :member
end
resources :laboratories, only: [:index, :create, :destroy, :update] do
member do
get :shixuns_for_select
get :subjects_for_select
get :synchronize_user
post :update_sync_course
end
resource :laboratory_setting, only: [:show, :update]
resource :laboratory_user, only: [:create, :destroy]
resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :laboratory_shixuns, only: [:index, :create, :destroy] do
member do
post :homepage
post :cancel_homepage
end
end
resources :laboratory_subjects, only: [:index, :create, :destroy] do
member do
post :homepage
post :cancel_homepage
end
end
end
resource :import_competition_scores, only: [:create]
resources :competitions, only: [:index, :destroy, :create] do
member do
post :publish
post :unpublish
post :online_switch
end
collection do
post :hot_setting
end
resources :competition_settings, only: [:index] do
post :basic_setting, on: :collection
post :nav_setting, on: :collection
end
resources :enroll_lists, only: [:index] do
get :export, on: :collection
end
resources :competition_stages, only: [:create, :update, :destroy] do
member do
post :send_message
post :calculate_stage_score
end
end
resources :competition_prizes, only: [:index, :new, :create, :edit, :update, :destroy]
resources :competition_prize_users, only: [:index, :create] do
member do
post :approve
post :unapprove
end
end
end
resources :weapp_carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :weapp_adverts, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :subjects, only: [:index, :edit, :update, :destroy] do
member do
post :hide
post :cancel_hide
post :homepage_show
post :cancel_homepage_show
post :excellent
post :cancel_excellent
end
end
resources :partners, only: [:index, :create, :destroy] do
resources :customers, only: [:index, :create, :destroy]
end
resources :course_lists, only: [:index, :destroy] do
post :merge, on: :collection
end
resources :courses, only: [:index, :destroy, :update]
resources :projects, only: [:index, :destroy]
end
namespace :cooperative do
# get '/', to: 'dashboards#show'
get '/', to: 'laboratory_settings#edit'
resources :files, only: [:create]
resources :users, only: [:index] do
get :for_select, on: :collection
end
resources :laboratory_users, only: [:index, :create, :destroy]
resource :laboratory_setting, only: [:edit, :update]
resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection
end
resources :laboratory_shixuns, only: [:index, :edit, :update, :destroy] do
member do
post :homepage
post :cancel_homepage
end
end
resources :laboratory_subjects, only: [:index, :edit, :update, :destroy] do
member do
post :homepage
post :cancel_homepage
end
end
resource :import_competition_scores, only: [:create]
resources :competitions, only: [:index, :destroy, :create] do
member do
post :publish
post :unpublish
post :online_switch
end
collection do
post :hot_setting
end
resources :competition_settings, only: [:index] do
post :basic_setting, on: :collection
post :nav_setting, on: :collection
end
resources :enroll_lists, only: [:index] do
get :export, on: :collection
end
resources :competition_stages, only: [:create, :update, :destroy] do
member do
post :send_message
post :calculate_stage_score
end
end
resources :competition_prizes, only: [:index, :new, :create, :edit, :update, :destroy]
resources :competition_prize_users, only: [:index, :create] do
member do
post :approve
post :unapprove
end
end
end
end
resources :partners, only: [] do
member do
get :customers
get :partner_manager_groups
post :customer_manager_group
post :manager_group
delete :remove_manager_group
post :partner_managers
delete :remove_partner_manager
end
end
#git 认证回调
match 'gitauth/*url', to: 'gits#auth', via: :all
get 'oauth/get_code', to: 'oauth#get_code'
get 'oauth/get_token_callback', to: 'oauth#get_token_callback'
root 'main#index'
## react用
get '*path', to: 'main#index', constraints: ReactConstraint.new
end