Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
41670a08
Commit
41670a08
authored
Dec 12, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增了文件服务基本控制器
parent
d4b86e79
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
112 additions
and
1 deletion
+112
-1
FileServiceContract.php
app/Contracts/FileServiceContract.php
+18
-0
FileController.php
app/Http/Controllers/FileController.php
+22
-0
FileServiceProvider.php
app/Providers/FileServiceProvider.php
+33
-0
FileService.php
app/Services/FileService.php
+31
-0
app.php
config/app.php
+1
-0
2017_11_28_142018_entrust_setup_tables.php
...ase/migrations/2017_11_28_142018_entrust_setup_tables.php
+1
-1
web.php
routes/web.php
+6
-0
No files found.
app/Contracts/FileServiceContract.php
0 → 100644
View file @
41670a08
<?php
/**
* Created by PhpStorm.
* User: Aladin
* Date: 2017/12/12
* Time: 13:10
*/
namespace
App\Contracts
;
interface
FileServiceContract
{
public
function
getAll
();
public
function
get
(
$id
);
public
function
delete
();
}
\ No newline at end of file
app/Http/Controllers/FileController.php
0 → 100644
View file @
41670a08
<?php
namespace
App\Http\Controllers
;
use
App\Contracts\FileServiceContract
;
use
Illuminate\Http\Request
;
class
FileController
extends
Controller
{
public
function
__construct
(
FileServiceContract
$fileHandel
)
{
$this
->
mFile
=
$fileHandel
;
}
// 查询所有文件
public
function
getAll
()
{
$this
->
mFile
->
getAll
();
}
}
app/Providers/FileServiceProvider.php
0 → 100644
View file @
41670a08
<?php
namespace
App\Providers
;
use
App\Services\FileService
;
use
Illuminate\Support\ServiceProvider
;
class
FileServiceProvider
extends
ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public
function
boot
()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public
function
register
()
{
//绑定服务与接口关系
$this
->
app
->
singleton
(
"App\Contracts\FileServiceContract"
,
function
(){
return
new
FileService
();
});
}
}
app/Services/FileService.php
0 → 100644
View file @
41670a08
<?php
/**
* Created by PhpStorm.
* User: Aladin
* Date: 2017/12/12
* Time: 13:14
*/
namespace
App\Services
;
use
App\Contracts\FileServiceContract
;
class
FileService
implements
FileServiceContract
{
public
function
getAll
()
{
dd
(
1
);
}
public
function
get
(
$id
)
{
// TODO: Implement get() method.
}
public
function
delete
()
{
// TODO: Implement delete() method.
}
}
\ No newline at end of file
config/app.php
View file @
41670a08
...
@@ -189,6 +189,7 @@ return [
...
@@ -189,6 +189,7 @@ return [
App\Providers\PermissionServiceProvider
::
class
,
App\Providers\PermissionServiceProvider
::
class
,
App\Providers\TaskServiceProvider
::
class
,
App\Providers\TaskServiceProvider
::
class
,
App\Providers\ScheduleServiceProvider
::
class
,
App\Providers\ScheduleServiceProvider
::
class
,
App\Providers\FileServiceProvider
::
class
,
Zizaco\Entrust\EntrustServiceProvider
::
class
,
Zizaco\Entrust\EntrustServiceProvider
::
class
,
Orangehill\Iseed\IseedServiceProvider
::
class
,
Orangehill\Iseed\IseedServiceProvider
::
class
,
...
...
database/migrations/2017_11_28_142018_entrust_setup_tables.php
View file @
41670a08
...
@@ -30,7 +30,7 @@ class EntrustSetupTables extends Migration
...
@@ -30,7 +30,7 @@ class EntrustSetupTables extends Migration
$table
->
foreign
(
'role_id'
)
->
references
(
'id'
)
->
on
(
'roles'
)
$table
->
foreign
(
'role_id'
)
->
references
(
'id'
)
->
on
(
'roles'
)
->
onUpdate
(
'cascade'
)
->
onDelete
(
'cascade'
);
->
onUpdate
(
'cascade'
)
->
onDelete
(
'cascade'
);
$table
->
increments
(
"id"
);
$table
->
increments
(
"id"
);
$table
->
primary
([
'admin_id'
,
'role_id'
]);
$table
->
unsignedBigInteger
([
'admin_id'
,
'role_id'
]);
});
});
// Create table for storing permissions
// Create table for storing permissions
...
...
routes/web.php
View file @
41670a08
...
@@ -112,6 +112,12 @@ Route::get('/',function (){return view('login');})->name('admin.login');
...
@@ -112,6 +112,12 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route
::
get
(
'get_all'
,
'PermissionController@getAll'
)
->
name
(
'permission.getAll'
);
Route
::
get
(
'get_all'
,
'PermissionController@getAll'
)
->
name
(
'permission.getAll'
);
});
});
Route
::
group
([
'prefix'
=>
'file'
],
function
(){
Route
::
get
(
'get_all'
,
'FileController@getAll'
)
->
name
(
'file.getAll'
);
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment