Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2022-01-07 18:41:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e7e12d6d6ac9f00c8b8d6530b7828cf1dc24d8c6
e7e12d6d
1 parent
1995b6d3
init
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
130 additions
and
9 deletions
app/Admin/Controllers/PickPoetryVerseController.php
app/Console/Commands/ImportPoemDataToMysql.php
app/Models/PickPoetryVerse.php
database/migrations/2021_12_29_050326_create_poetry_table.php
database/migrations/2021_12_29_074410_create_verse_table.php
database/migrations/2021_12_29_080638_create_poetry_tag_table.php
database/migrations/2021_12_30_080410_create_pick_poetry_table.php
database/migrations/2021_12_30_080411_create_pick_poetry_verse_table.php
database/migrations/2021_12_30_082824_create_user_show_table.php
dcat_admin_ide_helper.php
app/Admin/Controllers/PickPoetryVerseController.php
0 → 100755
View file @
e7e12d6
<?php
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\PickPoetryVerse
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Show
;
use
Dcat\Admin\Http\Controllers\AdminController
;
class
PickPoetryVerseController
extends
AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected
function
grid
()
{
return
Grid
::
make
(
new
PickPoetryVerse
(),
function
(
Grid
$grid
)
{
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'pick_id'
);
$grid
->
column
(
'verse_id'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
equal
(
'id'
);
});
});
}
/**
* Make a show builder.
*
* @param mixed $id
*
* @return Show
*/
protected
function
detail
(
$id
)
{
return
Show
::
make
(
$id
,
new
PickPoetryVerse
(),
function
(
Show
$show
)
{
$show
->
field
(
'id'
);
$show
->
field
(
'pick_id'
);
$show
->
field
(
'verse_id'
);
$show
->
field
(
'created_at'
);
$show
->
field
(
'updated_at'
);
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected
function
form
()
{
return
Form
::
make
(
new
PickPoetryVerse
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
);
$form
->
text
(
'pick_id'
);
$form
->
text
(
'verse_id'
);
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
});
}
}
app/Console/Commands/ImportPoemDataToMysql.php
0 → 100644
View file @
e7e12d6
This diff is collapsed. Click to expand it.
app/Models/PickPoetryVerse.php
0 → 100755
View file @
e7e12d6
<?php
namespace
App\Models
;
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
class
PickPoetryVerse
extends
Model
{
use
HasDateTimeFormatter
;
protected
$table
=
'pick_poetry_verse'
;
}
database/migrations/2021_12_29_050326_create_poetry_table.php
View file @
e7e12d6
...
...
@@ -15,7 +15,7 @@ class CreatePoetryTable extends Migration
{
Schema
::
create
(
'poetry'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
foreignId
(
'author_id'
)
->
constrained
(
'author'
,
'
id'
);
$table
->
unsignedBigInteger
(
'author_id'
)
->
index
()
->
comment
(
'作者
id'
);
$table
->
string
(
'name'
)
->
default
(
''
)
->
comment
(
'题目'
);
$table
->
string
(
'subname'
)
->
default
(
''
)
->
comment
(
'小标题'
);
$table
->
string
(
'alias'
)
->
default
(
''
)
->
comment
(
'别名'
);
...
...
database/migrations/2021_12_29_074410_create_verse_table.php
View file @
e7e12d6
...
...
@@ -15,7 +15,7 @@ class CreateVerseTable extends Migration
{
Schema
::
create
(
'verse'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
foreignId
(
'poetry_id'
)
->
constrained
(
'poetry'
,
'
id'
);
$table
->
unsignedBigInteger
(
'poetry_id'
)
->
index
()
->
comment
(
'诗词
id'
);
$table
->
string
(
'stanza'
)
->
default
(
''
)
->
comment
(
'诗节'
);
$table
->
text
(
'annotate'
)
->
comment
(
'注解'
);
$table
->
string
(
'spelling'
)
->
default
(
''
)
->
comment
(
'拼音'
);
...
...
database/migrations/2021_12_29_080638_create_poetry_tag_table.php
View file @
e7e12d6
...
...
@@ -15,8 +15,8 @@ class CreatePoetryTagTable extends Migration
{
Schema
::
create
(
'poetry_tag'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
foreignId
(
'poetry_id'
)
->
constrained
(
'poetry'
,
'
id'
);
$table
->
foreignId
(
'tag_id'
)
->
constrained
(
'tags'
,
'
id'
);
$table
->
unsignedBigInteger
(
'poetry_id'
)
->
index
()
->
comment
(
'诗词
id'
);
$table
->
unsignedBigInteger
(
'tag_id'
)
->
index
()
->
comment
(
'标签
id'
);
});
}
...
...
database/migrations/2021_12_30_080410_create_pick_poetry_table.php
View file @
e7e12d6
...
...
@@ -17,9 +17,9 @@ class CreatePickPoetryTable extends Migration
$table
->
increments
(
'id'
);
$table
->
string
(
'title'
)
->
default
(
''
)
->
comment
(
'标题'
);
$table
->
string
(
'subtitle'
)
->
default
(
''
)
->
comment
(
'副标题'
);
$table
->
string
(
'left_t
ag_id
'
)
->
default
(
''
)
->
comment
(
'左侧文本'
);
$table
->
string
(
'right_t
ag_id
'
)
->
default
(
''
)
->
comment
(
'右侧文本'
);
$table
->
foreignId
(
'poetry_id'
)
->
constrained
(
'poetry'
,
'
id'
);
$table
->
string
(
'left_t
ext
'
)
->
default
(
''
)
->
comment
(
'左侧文本'
);
$table
->
string
(
'right_t
ext
'
)
->
default
(
''
)
->
comment
(
'右侧文本'
);
$table
->
unsignedBigInteger
(
'poetry_id'
)
->
index
()
->
comment
(
'诗词
id'
);
$table
->
unsignedBigInteger
(
'use_num'
)
->
comment
(
'使用次数'
);
$table
->
unsignedTinyInteger
(
'state'
)
->
comment
(
'状态'
);
$table
->
timestamps
();
...
...
database/migrations/2021_12_30_080411_create_pick_poetry_verse_table.php
0 → 100755
View file @
e7e12d6
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
CreatePickPoetryVerseTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'pick_poetry_verse'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
unsignedBigInteger
(
'pick_id'
)
->
index
()
->
comment
(
'官方秀id'
);
$table
->
unsignedBigInteger
(
'verse_id'
)
->
index
()
->
comment
(
'诗句(节)id'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'pick_poetry_verse'
);
}
}
database/migrations/2021_12_30_082824_create_user_show_table.php
View file @
e7e12d6
...
...
@@ -18,8 +18,7 @@ class CreateUserShowTable extends Migration
$table
->
unsignedBigInteger
(
'user_id'
)
->
comment
(
'用户id'
);
$table
->
text
(
'content'
)
->
comment
(
'内容描述'
);
$table
->
unsignedTinyInteger
(
'type'
)
->
comment
(
'1=图文,2=视频'
);
// $table->unsignedBigInteger('pick_id')->comment('引用的官方秀id');
$table
->
foreignId
(
'poetry_id'
)
->
constrained
(
'pick_poetry'
,
'id'
);
$table
->
unsignedBigInteger
(
'pick_id'
)
->
index
()
->
comment
(
'引用的秀id'
);
$table
->
integer
(
'fav_num'
)
->
comment
(
'收藏数'
);
$table
->
integer
(
'view_num'
)
->
comment
(
'观看数'
);
$table
->
integer
(
'praise_num'
)
->
comment
(
'点赞数'
);
...
...
dcat_admin_ide_helper.php
View file @
e7e12d6
...
...
@@ -48,6 +48,8 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection tokenable_id
* @property Grid\Column|Collection abilities
* @property Grid\Column|Collection last_used_at
* @property Grid\Column|Collection poetry_id
* @property Grid\Column|Collection tag_id
* @property Grid\Column|Collection email_verified_at
*
* @method Grid\Column|Collection id(string $label = null)
...
...
@@ -87,6 +89,8 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection tokenable_id(string $label = null)
* @method Grid\Column|Collection abilities(string $label = null)
* @method Grid\Column|Collection last_used_at(string $label = null)
* @method Grid\Column|Collection poetry_id(string $label = null)
* @method Grid\Column|Collection tag_id(string $label = null)
* @method Grid\Column|Collection email_verified_at(string $label = null)
*/
class
Grid
{}
...
...
@@ -131,6 +135,8 @@ namespace Dcat\Admin {
* @property Show\Field|Collection tokenable_id
* @property Show\Field|Collection abilities
* @property Show\Field|Collection last_used_at
* @property Show\Field|Collection poetry_id
* @property Show\Field|Collection tag_id
* @property Show\Field|Collection email_verified_at
*
* @method Show\Field|Collection id(string $label = null)
...
...
@@ -170,6 +176,8 @@ namespace Dcat\Admin {
* @method Show\Field|Collection tokenable_id(string $label = null)
* @method Show\Field|Collection abilities(string $label = null)
* @method Show\Field|Collection last_used_at(string $label = null)
* @method Show\Field|Collection poetry_id(string $label = null)
* @method Show\Field|Collection tag_id(string $label = null)
* @method Show\Field|Collection email_verified_at(string $label = null)
*/
class
Show
{}
...
...
Please
register
or
login
to post a comment