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
李帅
2023-03-15 15:03:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
42fb12f92b272c81a4fecbe5c900f6b4947bd17a
42fb12f9
1 parent
2a7bb900
优化接口,修改bug
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
app/Http/Controllers/V1/AuthController.php
app/Http/Controllers/V1/ImmerseController.php
app/Http/Controllers/V1/UserController.php
database/migrations/2023_03_02_213237_alter_user_profiles.php
app/Http/Controllers/V1/AuthController.php
View file @
42fb12f
...
...
@@ -157,11 +157,12 @@ class AuthController extends Controller
$validator
=
Validator
::
make
(
$request
->
all
(),
[
'email'
=>
'required|email|unique:users|max:255'
,
'password'
=>
'required|min:6'
,
'verify_code'
=>
'required'
'verify_code'
=>
'required'
,
'nickname'
=>
'required'
,
]);
if
(
$validator
->
fails
())
{
return
Response
::
fail
(
''
,
500
,
$validator
->
errors
());
return
Response
::
fail
(
'
参数错误
'
,
500
,
$validator
->
errors
());
}
try
{
...
...
app/Http/Controllers/V1/ImmerseController.php
View file @
42fb12f
...
...
@@ -162,8 +162,10 @@ class ImmerseController extends Controller
if
(
$collects
->
count
()){
foreach
(
$collects
as
$collect
){
if
(
$collect
->
immerse
){
// 避免删除过临境的还存在收藏列表里
$data
[
'id'
]
=
$collect
->
id
;
$data
[
'user_id'
]
=
$collect
->
user_id
;
$data
[
'immerse_id'
]
=
$collect
->
immerse_id
;
$data
[
'poem_id'
]
=
$collect
->
immerse
->
poem_id
;
$data
[
'content'
]
=
$collect
->
immerse
->
content
;
$data
[
'thumbnail'
]
=
$collect
->
immerse
->
thumbnail
;
$data
[
'url'
]
=
$collect
->
immerse
->
url
;
...
...
@@ -209,8 +211,10 @@ class ImmerseController extends Controller
if
(
$collects
->
count
()){
foreach
(
$collects
as
$collect
){
if
(
$collect
->
immerse
){
// 避免删除过临境的还存在收藏列表里
$data
[
'id'
]
=
$collect
->
id
;
$data
[
'user_id'
]
=
$collect
->
user_id
;
$data
[
'immerse_id'
]
=
$collect
->
immerse_id
;
$data
[
'poem_id'
]
=
$collect
->
immerse
->
poem_id
;
$data
[
'content'
]
=
$collect
->
immerse
->
content
;
$data
[
'thumbnail'
]
=
$collect
->
immerse
->
thumbnail
;
$data
[
'url'
]
=
$collect
->
immerse
->
url
;
...
...
app/Http/Controllers/V1/UserController.php
View file @
42fb12f
...
...
@@ -51,7 +51,7 @@ class UserController extends Controller
public
function
videos
(
Request
$request
)
{
$type
=
$request
->
get
(
'type'
);
$type
=
$request
->
get
(
'type'
,
'all'
);
$page
=
$request
->
get
(
'page'
,
1
);
$page_size
=
$request
->
get
(
'page_size'
,
20
);
...
...
database/migrations/2023_03_02_213237_alter_user_profiles.php
View file @
42fb12f
...
...
@@ -18,9 +18,12 @@ class AlterUserProfiles extends Migration
$table
->
string
(
'intro'
)
->
after
(
'user_id'
)
->
default
(
""
)
->
comment
(
'简介'
);
$table
->
date
(
'birthday'
)
->
after
(
'intro'
)
->
default
(
"2023-01-01"
)
->
comment
(
'生日'
);
$table
->
unsignedInteger
(
'follow_count'
)
->
after
(
'video_count'
)
->
default
(
0
)
->
comment
(
'关注数量'
);
$table
->
unsignedInteger
(
'fans_count'
)
->
after
(
'follow_count'
)
->
default
(
0
)
->
comment
(
'粉丝数量'
);
$table
->
unsignedInteger
(
'popular_count'
)
->
after
(
'fans_count'
)
->
default
(
0
)
->
comment
(
'人气数量'
);
// $table->unsignedInteger('follow_count')->after('video_count')->default(0)->comment('关注数');
// $table->unsignedInteger('fans_count')->after('follow_count')->default(0)->comment('粉丝数');
// $table->unsignedInteger('popular_count')->after('fans_count')->default(0)->comment('人气数');
$table
->
unsignedInteger
(
'praised_count'
)
->
after
(
'video_count'
)
->
default
(
0
)
->
comment
(
'被点赞数'
);
$table
->
unsignedInteger
(
'collected_count'
)
->
after
(
'praised_count'
)
->
default
(
0
)
->
comment
(
'被收藏数'
);
});
}
...
...
@@ -34,5 +37,6 @@ class AlterUserProfiles extends Migration
{
//
Schema
::
dropColumns
(
'user_profiles'
,
[
'intro'
,
'birthday'
,
'follow_count'
,
'fans_count'
,
'popular_count'
]);
// Schema::dropColumns('user_profiles', ['intro','birthday','praised_count','collected_count']);
}
}
...
...
Please
register
or
login
to post a comment