|
|
@@ -71,7 +71,7 @@ class RepositoriesController < ApplicationController |
|
|
logger.info "######### sub_entries: #{@sub_entries}"
|
|
|
logger.info "######### sub_entries: #{@sub_entries}"
|
|
|
return render_error('该文件暂未开放,敬请期待.') if @sub_entries['status'].to_i === -1
|
|
|
return render_error('该文件暂未开放,敬请期待.') if @sub_entries['status'].to_i === -1
|
|
|
|
|
|
|
|
|
tmp_entries = [{
|
|
|
|
|
|
|
|
|
tmp_entries = {
|
|
|
"content" => @sub_entries['data']['content'],
|
|
|
"content" => @sub_entries['data']['content'],
|
|
|
"type" => "blob"
|
|
|
"type" => "blob"
|
|
|
}]
|
|
|
}]
|
|
|
@@ -82,13 +82,13 @@ class RepositoriesController < ApplicationController |
|
|
else
|
|
|
else
|
|
|
begin
|
|
|
begin
|
|
|
@sub_entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder&.repo_name, {path: file_path_uri})
|
|
|
@sub_entries = Educoder::Repository::Entries::ListService.call(@project&.project_educoder&.repo_name, {path: file_path_uri})
|
|
|
if @sub_entries.blank?
|
|
|
|
|
|
|
|
|
if @sub_entries.blank? || @sub_entries['status'].to_i === -1
|
|
|
@sub_entries = Educoder::Repository::Entries::GetService.call(@project&.project_educoder&.repo_name, file_path_uri)
|
|
|
@sub_entries = Educoder::Repository::Entries::GetService.call(@project&.project_educoder&.repo_name, file_path_uri)
|
|
|
return render_error('该文件暂未开放,敬请期待.') if @sub_entries['status'].to_i === -1
|
|
|
return render_error('该文件暂未开放,敬请期待.') if @sub_entries['status'].to_i === -1
|
|
|
tmp_entries = [{
|
|
|
tmp_entries = [{
|
|
|
"content" => @sub_entries['data']['content'],
|
|
|
"content" => @sub_entries['data']['content'],
|
|
|
"type" => "blob"
|
|
|
"type" => "blob"
|
|
|
}]
|
|
|
|
|
|
|
|
|
}
|
|
|
@sub_entries = {
|
|
|
@sub_entries = {
|
|
|
"trees"=>tmp_entries,
|
|
|
"trees"=>tmp_entries,
|
|
|
"commits" => [{}]
|
|
|
"commits" => [{}]
|
|
|
|