Merge branches 'dev_aliyun' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysm1
commit
857c6bf587
File diff suppressed because one or more lines are too long
@ -0,0 +1,25 @@
|
||||
require 'uri'
|
||||
require 'net/http'
|
||||
|
||||
class SyncTrustieJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(type, count)
|
||||
Rails.logger.info("#######_________response__sync__start__#########")
|
||||
configs_content = Rails.application.config_for(:configuration)
|
||||
|
||||
token = configs_content["sync_token"]
|
||||
token_url = configs_content["sync_url"]
|
||||
url = "#{token_url}/api/v1/homes/sync_count"
|
||||
sync_json = {
|
||||
"token": token,
|
||||
"type": type,
|
||||
"number": count
|
||||
}
|
||||
uri = URI.parse(url)
|
||||
|
||||
http = Net::HTTP.new(uri.hostname, uri.port)
|
||||
http.send_request('PUT', uri.path, sync_json.to_json, {'Content-Type' => 'application/json'})
|
||||
Rails.logger.info("#######_________response__sync__end_____#########")
|
||||
end
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
json.count @users.total_count
|
||||
json.users do
|
||||
json.array! @users.each do |user|
|
||||
json.extract! user, :id, :login, :real_name, :identity, :school_name
|
||||
json.extract! user, :id, :login, :real_name, :identity, :school_name, :hidden_phone
|
||||
end
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
json.count @users.total_count
|
||||
json.users do
|
||||
json.array! @users.each do |user|
|
||||
json.extract! user, :id, :login, :real_name, :identity, :school_name
|
||||
json.extract! user, :id, :login, :real_name, :identity, :school_name, :hidden_phone
|
||||
end
|
||||
end
|
@ -0,0 +1,26 @@
|
||||
class MigrateComModuleResource < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
Competition.all.each do |competition|
|
||||
competition.competition_modules.each do |com_module|
|
||||
mod_type = ""
|
||||
case com_module.name.strip
|
||||
when '首页'
|
||||
mod_type = "home"
|
||||
when '报名'
|
||||
mod_type = "enroll"
|
||||
when '通知公告'
|
||||
mod_type = "inform"
|
||||
when '参赛手册'
|
||||
mod_type = "manual"
|
||||
when '排行榜'
|
||||
mod_type = "chart"
|
||||
when '资料下载'
|
||||
mod_type = "resource"
|
||||
else
|
||||
mod_type = "md"
|
||||
end
|
||||
com_module.update_attributes!(module_type: mod_type)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue