Commit da63a307 by Phạm Văn Đoan

tạo api lấy ds bài hát để đồng bộ sang elastic

parent 2ecd76a0
<?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();
}
}
......@@ -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');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment