本地数据初始化

dev_local
jingquan huang 6 years ago
parent f6fc52b09d
commit 59ff646a4f

@ -30,6 +30,17 @@ class WelcomeController < ApplicationController
require 'simple_xlsx_reader' require 'simple_xlsx_reader'
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
def local_init
LocalShixun.delete_all
LocalMirrorRepository.delete_all
LocalShixunTagRepertoire.delete_all
LocalChallenge.delete_all
LocalTestSet.delete_all
LocalChallengeTag.delete_all
render :json => {status: 0, message: "success"}
end
def shixun_to_local def shixun_to_local
identifiers = params[:identifiers].split(",") identifiers = params[:identifiers].split(",")
shixuns = Shixun.where(identifier: identifiers) shixuns = Shixun.where(identifier: identifiers)

@ -283,6 +283,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'welcome/ccf' => 'welcome#ccf' get 'welcome/ccf' => 'welcome#ccf'
get 'welcome/shixun_to_local' => 'welcome#shixun_to_local' get 'welcome/shixun_to_local' => 'welcome#shixun_to_local'
get 'welcome/local_to_shixun' => 'welcome#local_to_shixun' get 'welcome/local_to_shixun' => 'welcome#local_to_shixun'
get 'welcome/local_init' => 'welcome#local_init'
# get 'competitions/home' => 'competitions#home' # get 'competitions/home' => 'competitions#home'
# get 'competitions/hn' => 'competitions#index' # get 'competitions/hn' => 'competitions#index'

Loading…
Cancel
Save