mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
init project
This commit is contained in:
10
app/controllers/admins/import_users_controller.rb
Normal file
10
app/controllers/admins/import_users_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class Admins::ImportUsersController < Admins::BaseController
|
||||
def create
|
||||
return render_error('请上传正确的文件') if params[:file].blank? || !params[:file].is_a?(ActionDispatch::Http::UploadedFile)
|
||||
|
||||
result = Admins::ImportUserService.call(params[:file].to_io)
|
||||
render_ok(result)
|
||||
rescue Admins::ImportUserService::Error => ex
|
||||
render_error(ex)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user