Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crawler.vmusicchart.vn
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Văn Đoan
crawler.vmusicchart.vn
Commits
da63a307
Commit
da63a307
authored
May 28, 2020
by
Phạm Văn Đoan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tạo api lấy ds bài hát để đồng bộ sang elastic
parent
2ecd76a0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
TrackController.php
app/Http/Controllers/Api/TrackController.php
+31
-0
api.php
routes/api.php
+1
-0
No files found.
app/Http/Controllers/Api/TrackController.php
0 → 100644
View file @
da63a307
<?php
namespace
App\Http\Controllers\Api
;
use
App\Models\Track
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
class
TrackController
extends
Controller
{
public
function
__construct
()
{
}
/**
* API lấy tất cả các bài hát để đồng bộ sang elastic
* URL: http://localhost:8000/api/get-track-list
* URL: http://crawler.vmusicchart.vn/api/get-track-list
* @param Request $request
* @return array
*/
public
function
getTrackList
(
Request
$request
)
{
$query
=
Track
::
select
([
'id'
,
'title'
,
'id_zing'
,
'id_nct'
,
'id_nct_str'
,
'id_keeng'
])
->
orderBy
(
'title'
,
'asc'
);
return
$query
->
get
()
->
toArray
();
}
}
routes/api.php
View file @
da63a307
...
...
@@ -20,3 +20,4 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
Route
::
get
(
'/get-nct-top100'
,
'Api\NctController@getNctTop100'
);
Route
::
get
(
'/get-zing-top100'
,
'Api\NctController@getZingTop100'
);
Route
::
get
(
'/get-listen-history-by-date'
,
'Api\ListenHistoryController@getListenHistoryByDate'
);
Route
::
get
(
'/get-track-list'
,
'Api\TrackController@getTrackList'
);
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