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
96273125
Commit
96273125
authored
Dec 12, 2017
by
mengyixi
Browse files
Options
Browse Files
Download
Plain Diff
entrust_setup-tables
parents
78576625
adb160a9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
117 additions
and
3 deletions
+117
-3
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_09_06_072230_create_files_table.php
database/migrations/2017_09_06_072230_create_files_table.php
+2
-0
2017_09_07_032619_create_folders_table.php
...ase/migrations/2017_09_07_032619_create_folders_table.php
+2
-1
2017_11_28_142018_entrust_setup_tables.php
...ase/migrations/2017_11_28_142018_entrust_setup_tables.php
+2
-2
web.php
routes/web.php
+6
-0
No files found.
app/Contracts/FileServiceContract.php
0 → 100644
View file @
96273125
<?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 @
96273125
<?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 @
96273125
<?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 @
96273125
<?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 @
96273125
...
@@ -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_09_06_072230_create_files_table.php
View file @
96273125
...
@@ -22,6 +22,8 @@ class CreateFilesTable extends Migration
...
@@ -22,6 +22,8 @@ class CreateFilesTable extends Migration
$table
->
unsignedInteger
(
'group_id'
)
->
nullable
();
$table
->
unsignedInteger
(
'group_id'
)
->
nullable
();
$table
->
unsignedInteger
(
'owner_id'
);
$table
->
unsignedInteger
(
'owner_id'
);
$table
->
unsignedInteger
(
'creator_id'
);
$table
->
unsignedInteger
(
'creator_id'
);
$table
->
string
(
'Bucket'
,
191
);
$table
->
string
(
'pointer'
,
191
);
$table
->
softDeletes
();
$table
->
softDeletes
();
$table
->
timestamps
();
$table
->
timestamps
();
});
});
...
...
database/migrations/2017_09_07_032619_create_folders_table.php
View file @
96273125
...
@@ -18,7 +18,8 @@ class CreateFoldersTable extends Migration
...
@@ -18,7 +18,8 @@ class CreateFoldersTable extends Migration
$table
->
string
(
'name'
);
$table
->
string
(
'name'
);
$table
->
unsignedInteger
(
'parent_id'
);
$table
->
unsignedInteger
(
'parent_id'
);
$table
->
unsignedInteger
(
'creator_id'
);
$table
->
unsignedInteger
(
'creator_id'
);
$table
->
unsignedInteger
(
'owner_id'
);
$table
->
unsignedInteger
(
'group_id'
);
$table
->
unsignedInteger
(
'project_id'
);
$table
->
softDeletes
();
$table
->
softDeletes
();
$table
->
timestamps
();
$table
->
timestamps
();
});
});
...
...
database/migrations/2017_11_28_142018_entrust_setup_tables.php
View file @
96273125
...
@@ -29,8 +29,8 @@ class EntrustSetupTables extends Migration
...
@@ -29,8 +29,8 @@ class EntrustSetupTables extends Migration
->
onUpdate
(
'cascade'
)
->
onDelete
(
'cascade'
);
->
onUpdate
(
'cascade'
)
->
onDelete
(
'cascade'
);
$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 @
96273125
...
@@ -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